Changeset 51436 in vbox for trunk/src/VBox/Frontends/VBoxHeadless
- Timestamp:
- May 28, 2014 9:12:15 AM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 93991
- Location:
- trunk/src/VBox/Frontends/VBoxHeadless
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/Framebuffer.cpp
r49980 r51436 42 42 43 43 RTCritSectInit (&m_CritSect); 44 45 // start with a standard size46 RequestResize(0, FramebufferPixelFormat_Opaque,47 NULL, 0, 0, 640, 480, NULL);48 44 } 49 45 … … 241 237 242 238 return S_OK; 239 } 240 241 extern ComPtr<IDisplay> display; 242 243 STDMETHODIMP VRDPFramebuffer::NotifyChange(ULONG aScreenId, 244 ULONG aXOrigin, 245 ULONG aYOrigin, 246 ULONG aWidth, 247 ULONG aHeight) 248 { 249 LogRelFlow(("NotifyChange: %d %d,%d %dx%d\n", 250 aScreenId, aXOrigin, aYOrigin, aWidth, aHeight)); 251 252 HRESULT hr = S_OK; 253 254 hr = display->QuerySourceBitmap(aScreenId, mpSourceBitmap.asOutParam()); 255 if (SUCCEEDED(hr)) 256 { 257 BYTE *pAddress = NULL; 258 ULONG ulWidth = 0; 259 ULONG ulHeight = 0; 260 ULONG ulBitsPerPixel = 0; 261 ULONG ulBytesPerLine = 0; 262 ULONG ulPixelFormat = 0; 263 264 hr = mpSourceBitmap->QueryBitmapInfo(&pAddress, 265 &ulWidth, 266 &ulHeight, 267 &ulBitsPerPixel, 268 &ulBytesPerLine, 269 &ulPixelFormat); 270 271 if (SUCCEEDED(hr)) 272 { 273 mScreen = pAddress; 274 mWidth = ulWidth; 275 mHeight = ulHeight; 276 mBitsPerPixel = ulBitsPerPixel; 277 mBytesPerLine = ulBytesPerLine; 278 mPixelFormat = FramebufferPixelFormat_FOURCC_RGB; 279 mUsesGuestVRAM = TRUE; 280 281 Log(("Using screen bitmap, %d BPP\n", mBitsPerPixel)); 282 } 283 } 284 285 if (FAILED(hr)) 286 { 287 /* Just reset everything. */ 288 mScreen = NULL; 289 mWidth = 0; 290 mHeight = 0; 291 mBitsPerPixel = 0; 292 mBytesPerLine = 0; 293 mPixelFormat = FramebufferPixelFormat_Opaque; 294 mUsesGuestVRAM = FALSE; 295 296 Log(("No screen w = %d, h = %d!!!\n", aWidth, aHeight)); 297 } 298 299 return hr; 243 300 } 244 301 -
trunk/src/VBox/Frontends/VBoxHeadless/Framebuffer.h
r45940 r51436 63 63 ULONG bitsPerPixel, ULONG bytesPerLine, ULONG w, ULONG h, 64 64 BOOL *finished); 65 STDMETHOD(NotifyChange)(ULONG aScreenId, 66 ULONG aXOrigin, 67 ULONG aYOrigin, 68 ULONG aWidth, 69 ULONG aHeight); 65 70 STDMETHOD(VideoModeSupported)(ULONG width, ULONG height, ULONG bpp, BOOL *supported); 66 71 … … 92 97 long refcnt; 93 98 #endif 99 100 ComPtr<IDisplaySourceBitmap> mpSourceBitmap; 94 101 }; 95 102 -
trunk/src/VBox/Frontends/VBoxHeadless/NullFramebuffer.h
r45940 r51436 180 180 return S_OK; 181 181 } 182 STDMETHOD(NotifyChange)(ULONG aScreenId, 183 ULONG aXOrigin, 184 ULONG aYOrigin, 185 ULONG aWidth, 186 ULONG aHeight) 187 { 188 /* Do nothing. */ 189 return S_OK; 190 } 182 191 STDMETHOD(VideoModeSupported)(ULONG width, ULONG height, ULONG bpp, BOOL *supported) 183 192 { -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r50406 r51436 639 639 static CComModule _Module; 640 640 #endif 641 642 ComPtr<IDisplay> display; 641 643 642 644 /** … … 968 970 CHECK_ERROR_BREAK(console, COMGETTER(Machine)(machine.asOutParam())); 969 971 970 ComPtr<IDisplay> display;971 972 CHECK_ERROR_BREAK(console, COMGETTER(Display)(display.asOutParam())); 972 973 … … 1009 1010 Log2(("VBoxHeadless: Registering framebuffer\n")); 1010 1011 pFramebuffer->AddRef(); 1011 display-> SetFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, pFramebuffer);1012 display->AttachFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, pFramebuffer); 1012 1013 } 1013 1014 if (!RT_SUCCESS(rrc) || rcc != S_OK) … … 1039 1040 } 1040 1041 pVRDPFramebuffer->AddRef(); 1041 display-> SetFramebuffer(uScreenId, pVRDPFramebuffer);1042 display->AttachFramebuffer(uScreenId, pVRDPFramebuffer); 1042 1043 } 1043 1044 if (uScreenId < cMonitors) … … 1050 1051 { 1051 1052 ComPtr<IFramebuffer> fb; 1052 LONG xOrigin, yOrigin; 1053 HRESULT hrc2 = display->GetFramebuffer(uScreenId, 1054 fb.asOutParam(), 1055 &xOrigin, &yOrigin); 1053 HRESULT hrc2 = display->QueryFramebuffer(uScreenId, 1054 fb.asOutParam()); 1056 1055 if (hrc2 == S_OK && fb.isNull()) 1057 1056 { … … 1059 1058 pNullFB->AddRef(); 1060 1059 pNullFB->init(); 1061 display-> SetFramebuffer(uScreenId, pNullFB);1060 display->AttachFramebuffer(uScreenId, pNullFB); 1062 1061 } 1063 1062 } … … 1330 1329 while (0); 1331 1330 1331 display.setNull(); 1332 1332 1333 /* 1333 1334 * Get the machine state.
Note:
See TracChangeset
for help on using the changeset viewer.