Changeset 19817 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- May 19, 2009 12:16:28 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.cpp
r19300 r19817 93 93 mcbVbvaPartial = 0; 94 94 95 RTSemEventMultiCreate(&mUpdateSem);96 97 // reset the event sems98 RTSemEventMultiReset(mUpdateSem);99 100 95 // by default, we have an internal Framebuffer which is 101 96 // NULL, i.e. a black hole for no display output 97 mFramebuffer = NULL; 98 mFramebufferOpened = false; 99 100 mu32ResizeStatus = ResizeStatus_Void; 101 } 102 103 VMDisplay::~VMDisplay() 104 { 102 105 mFramebuffer = 0; 103 mInternalFramebuffer = true;104 mFramebufferOpened = false;105 106 mu32ResizeStatus = ResizeStatus_Void;107 }108 109 VMDisplay::~VMDisplay()110 {111 mFramebuffer = 0;112 RTSemEventMultiDestroy(mUpdateSem);113 106 } 114 107 … … 201 194 202 195 // this is only valid for external framebuffers 203 if ( mInternalFramebuffer)196 if (!mFramebuffer) 204 197 return E_FAIL; 205 198 … … 259 252 } 260 253 261 // special processing for the internal Framebuffer 262 if (mInternalFramebuffer) 263 { 264 mFramebuffer->Unlock(); 265 } 266 else 267 { 268 // callback into the Framebuffer to notify it 269 BOOL finished; 270 271 RTSemEventMultiReset(mUpdateSem); 272 273 mFramebuffer->NotifyUpdate(x, y, w, h, &finished); 274 mFramebuffer->Unlock(); 275 276 if (!finished) 277 { 278 // the Framebuffer needs more time to process 279 // the event so we have to halt the VM until it's done 280 RTSemEventMultiWait(mUpdateSem, RT_INDEFINITE_WAIT); 281 } 282 } 254 mFramebuffer->NotifyUpdate(x, y, w, h); 255 mFramebuffer->Unlock(); 283 256 } 284 257 … … 336 309 * @param Framebuffer external Framebuffer object 337 310 */ 338 STDMETHODIMP VMDisplay:: RegisterExternalFramebuffer(Framebuffer *Framebuffer)311 STDMETHODIMP VMDisplay::SetFramebuffer(unsigned iScreenID, Framebuffer *Framebuffer) 339 312 { 340 313 if (!Framebuffer) … … 343 316 // free current Framebuffer (if there is any) 344 317 mFramebuffer = 0; 345 mInternalFramebuffer = false;346 318 mFramebuffer = Framebuffer; 347 319 updateDisplayData(); -
trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.h
r8155 r19817 55 55 uint32_t getBitsPerPixel(); 56 56 57 STDMETHODIMP RegisterExternalFramebuffer(Framebuffer *Framebuffer);57 STDMETHODIMP SetFramebuffer(unsigned iScreenID, Framebuffer *Framebuffer); 58 58 STDMETHODIMP InvalidateAndUpdate(); 59 59 STDMETHODIMP ResizeCompleted(); … … 84 84 85 85 Framebuffer *mFramebuffer; 86 bool m InternalFramebuffer, mFramebufferOpened;86 bool mFramebufferOpened; 87 87 88 88 ULONG mSupportedAccelOps; 89 RTSEMEVENTMULTI mUpdateSem;90 89 91 90 struct _VBVAMEMORY *mpVbvaMemory; -
trunk/src/VBox/Frontends/VBoxBFE/Framebuffer.h
r19798 r19817 44 44 virtual HRESULT getBitsPerPixel(ULONG *bitsPerPixel) = 0; 45 45 virtual HRESULT getLineSize(ULONG *lineSize) = 0; 46 virtual HRESULT NotifyUpdate(ULONG x, ULONG y, 47 ULONG w, ULONG h, BOOL *finished) = 0; 46 virtual HRESULT NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h) = 0; 48 47 virtual HRESULT RequestResize(ULONG w, ULONG h, BOOL *finished) = 0; 49 48 -
trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.cpp
r19798 r19817 228 228 */ 229 229 HRESULT SDLFramebuffer::NotifyUpdate(ULONG x, ULONG y, 230 ULONG w, ULONG h , BOOL *finished)230 ULONG w, ULONG h) 231 231 { 232 232 LogFlow(("SDLFramebuffer::NotifyUpdate: x = %d, y = %d, w = %d, h = %d\n", … … 258 258 #endif /* !VBOXBFE_WITH_X11 */ 259 259 260 /*261 * The Display thread can continue as we will lock the framebuffer262 * from the SDL thread when we get to actually doing the update.263 */264 if (finished)265 *finished = TRUE;266 260 return S_OK; 267 261 } -
trunk/src/VBox/Frontends/VBoxBFE/SDLFramebuffer.h
r19798 r19817 50 50 virtual HRESULT getBitsPerPixel(ULONG *bitsPerPixel); 51 51 virtual HRESULT getLineSize(ULONG *lineSize); 52 virtual HRESULT NotifyUpdate(ULONG x, ULONG y, 53 ULONG w, ULONG h, BOOL *finished); 52 virtual HRESULT NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h); 54 53 virtual HRESULT RequestResize(ULONG w, ULONG h, BOOL *finished); 55 54 virtual HRESULT GetVisibleRegion(BYTE *aRectangles, ULONG aCount, ULONG *aCountCopied); -
trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
r19300 r19817 803 803 if (!gConsole->initialized()) 804 804 goto leave; 805 gDisplay-> RegisterExternalFramebuffer(gFramebuffer);805 gDisplay->SetFramebuffer(0, gFramebuffer); 806 806 807 807 /* start with something in the titlebar */ -
trunk/src/VBox/Frontends/VBoxFB/Framebuffer.cpp
r8155 r19817 187 187 188 188 NS_IMETHODIMP VBoxDirectFB::NotifyUpdate(uint32_t x, uint32_t y, 189 uint32_t w, uint32_t h , PRBool *finished)189 uint32_t w, uint32_t h) 190 190 { 191 191 // we only need to take action if we have a memory framebuffer … … 209 209 DFBCHECK(surface->StretchBlit(surface, fbInternalSurface, 210 210 &blitRectangle, &hostRectangle)); 211 } else 211 } 212 else 212 213 { 213 214 DFBCHECK(surface->Blit(surface, fbInternalSurface, &blitRectangle, … … 216 217 } 217 218 } 218 if (finished)219 *finished = true;220 219 return NS_OK; 221 220 } -
trunk/src/VBox/Frontends/VBoxFB/Framebuffer.h
r8155 r19817 44 44 NS_IMETHOD GetUsesGuestVRAM(BOOL *usesGuestVRAM); 45 45 NS_IMETHOD NotifyUpdate(uint32_t x, uint32_t y, 46 uint32_t w, uint32_t h, PRBool *finished);46 uint32_t w, uint32_t h); 47 47 NS_IMETHOD RequestResize(ULONG aScreenId, ULONG pixelFormat, uint32_t vram, 48 48 uint32_t bitsPerPixel, uint32_t bytesPerLine, -
trunk/src/VBox/Frontends/VBoxFB/VBoxFB.cpp
r13835 r19817 342 342 // register our framebuffer 343 343 frameBuffer = new VBoxDirectFB(dfb, surface); 344 display-> RegisterExternalFramebuffer(frameBuffer);344 display->SetFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, frameBuffer); 345 345 346 346 /** -
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r19239 r19817 46 46 #include <iprt/env.h> 47 47 #include <VBox/err.h> 48 #include <VBox/VBoxVideo.h> 48 49 49 50 #ifdef VBOX_FFMPEG … … 744 745 Log2(("VBoxHeadless: Registering framebuffer\n")); 745 746 pFramebuffer->AddRef(); 746 display-> RegisterExternalFramebuffer(pFramebuffer);747 display->SetFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, pFramebuffer); 747 748 } 748 749 if (!RT_SUCCESS(rrc) || (rcc != S_OK)) -
trunk/src/VBox/Frontends/VBoxHeadless/VideoCapture/FFmpegFB.cpp
r19798 r19817 142 142 { 143 143 /* Dummy update to make sure we get all the frame (timing). */ 144 BOOL dummy; 145 NotifyUpdate(0, 0, 0, 0, &dummy); 144 NotifyUpdate(0, 0, 0, 0); 146 145 /* Write the last pending frame before exiting */ 147 146 int rc = do_rgb_to_yuv_conversion(); … … 431 430 * @param w width of the area which has been updated 432 431 * @param h height of the area which has been updated 433 * @param finished 434 */ 435 STDMETHODIMP FFmpegFB::NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h, 436 BOOL *finished) 432 */ 433 STDMETHODIMP FFmpegFB::NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h) 437 434 { 438 435 int rc; … … 442 439 (unsigned long) x, (unsigned long) y, (unsigned long) w, 443 440 (unsigned long) h)); 444 if (!finished) 445 return E_POINTER; 446 /* For now we will do things synchronously */ 447 *finished = true; 441 448 442 /* We always leave at least one frame update pending, which we 449 443 process when the time until the next frame has elapsed. */ -
trunk/src/VBox/Frontends/VBoxHeadless/VideoCapture/FFmpegFB.h
r19798 r19817 100 100 STDMETHOD(COMGETTER(WinId)) (ULONG64 *winId); 101 101 102 STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, 103 ULONG w, ULONG h, BOOL *finished); 102 STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, ULONG w, ULONG h); 104 103 STDMETHOD(RequestResize)(ULONG aScreenId, ULONG pixelFormat, BYTE *vram, 105 104 ULONG bitsPerPixel, ULONG bytesPerLine, -
trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.cpp
r19798 r19817 408 408 */ 409 409 STDMETHODIMP VBoxSDLFB::NotifyUpdate(ULONG x, ULONG y, 410 ULONG w, ULONG h , BOOL *finished)410 ULONG w, ULONG h) 411 411 { 412 412 /* … … 434 434 #endif /* !VBOXSDL_WITH_X11 */ 435 435 436 /*437 * The Display thread can continue as we will lock the framebuffer438 * from the SDL thread when we get to actually doing the update.439 */440 if (finished)441 *finished = TRUE;442 436 return S_OK; 443 437 } … … 1454 1448 */ 1455 1449 STDMETHODIMP VBoxSDLFBOverlay::NotifyUpdate(ULONG x, ULONG y, 1456 ULONG w, ULONG h , BOOL *finished)1457 { 1458 return mParent->NotifyUpdate(x + mOverlayX, y + mOverlayY, w, h , finished);1450 ULONG w, ULONG h) 1451 { 1452 return mParent->NotifyUpdate(x + mOverlayX, y + mOverlayY, w, h); 1459 1453 } 1460 1454 -
trunk/src/VBox/Frontends/VBoxSDL/Framebuffer.h
r19798 r19817 101 101 STDMETHOD(COMGETTER(WinId)) (uint64_t *winId); 102 102 103 STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, 104 ULONG w, ULONG h, BOOL *finished); 103 STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, ULONG w, ULONG h); 105 104 STDMETHOD(RequestResize)(ULONG aScreenId, ULONG pixelFormat, BYTE *vram, 106 105 ULONG bitsPerPixel, ULONG bytesPerLine, … … 268 267 STDMETHOD(Unlock)(); 269 268 STDMETHOD(Move)(ULONG x, ULONG y); 270 STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, 271 ULONG w, ULONG h, BOOL *finished); 269 STDMETHOD(NotifyUpdate)(ULONG x, ULONG y, ULONG w, ULONG h); 272 270 STDMETHOD(RequestResize)(ULONG aScreenId, ULONG pixelFormat, ULONG vram, 273 271 ULONG bitsPerPixel, ULONG bytesPerLine, -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r19579 r19817 59 59 #include <VBox/log.h> 60 60 #include <VBox/version.h> 61 #include <VBox/VBoxVideo.h> 61 62 62 63 #include <iprt/alloca.h> … … 2037 2038 2038 2039 // register our framebuffer 2039 rc = gDisplay-> RegisterExternalFramebuffer(gpFrameBuffer);2040 rc = gDisplay->SetFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, gpFrameBuffer); 2040 2041 if (rc != S_OK) 2041 2042 { … … 2885 2886 LogFlow(("Releasing mouse, keyboard, vrdpserver, display, console...\n")); 2886 2887 if (gDisplay) 2887 gDisplay->Set upInternalFramebuffer(0);2888 gDisplay->SetFramebuffer(VBOX_VIDEO_PRIMARY_SCREEN, NULL); 2888 2889 gMouse = NULL; 2889 2890 gKeyboard = NULL; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r19798 r19817 273 273 274 274 STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY, 275 ULONG aW, ULONG aH, 276 BOOL *aFinished); 275 ULONG aW, ULONG aH); 277 276 278 277 ulong pixelFormat() { return mPixelFormat; } … … 308 307 309 308 STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY, 310 ULONG aW, ULONG aH, 311 BOOL *aFinished); 309 ULONG aW, ULONG aH); 312 310 313 311 uchar *address() … … 364 362 365 363 STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY, 366 ULONG aW, ULONG aH, 367 BOOL *aFinished); 364 ULONG aW, ULONG aH); 368 365 369 366 uchar *address() { return (uchar *) mSurfaceDesc.lpSurface; } … … 422 419 423 420 STDMETHOD (NotifyUpdate) (ULONG aX, ULONG aY, 424 ULONG aW, ULONG aH, 425 BOOL *aFinished); 421 ULONG aW, ULONG aH); 426 422 STDMETHOD (SetVisibleRegion) (BYTE *aRectangles, ULONG aCount); 427 423 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r19684 r19817 20 20 * additional information or have any questions. 21 21 */ 22 23 #include <VBox/VBoxVideo.h> 22 24 23 25 #include "VBoxConsoleView.h" … … 876 878 { 877 879 mFrameBuf->AddRef(); 878 display. RegisterExternalFramebuffer (CFramebuffer (mFrameBuf));880 display.SetFramebuffer (VBOX_VIDEO_PRIMARY_SCREEN, CFramebuffer (mFrameBuf)); 879 881 } 880 882 … … 950 952 CDisplay display = mConsole.GetDisplay(); 951 953 Assert (!display.isNull()); 952 display.Set upInternalFramebuffer (0);954 display.SetFramebuffer (VBOX_VIDEO_PRIMARY_SCREEN, CFramebuffer(NULL)); 953 955 /* release the reference */ 954 956 mFrameBuf->Release(); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBDDRAW.cpp
r10149 r19817 229 229 /** @note This method is called on EMT from under this object's lock */ 230 230 STDMETHODIMP VBoxDDRAWFrameBuffer::NotifyUpdate (ULONG aX, ULONG aY, 231 ULONG aW, ULONG aH, 232 BOOL *aFinished) 231 ULONG aW, ULONG aH) 233 232 { 234 233 LOGDDRAW(("DDRAW: NotifyUpdate %d,%d %dx%d\n", aX, aY, aW, aH)); … … 243 242 drawRect (aX, aY, aW, aH); 244 243 } 245 246 *aFinished = TRUE;247 244 248 245 return S_OK; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQuartz2D.cpp
r17201 r19817 64 64 /** @note This method is called on EMT from under this object's lock */ 65 65 STDMETHODIMP VBoxQuartz2DFrameBuffer::NotifyUpdate (ULONG aX, ULONG aY, 66 ULONG aW, ULONG aH, 67 BOOL *aFinished) 66 ULONG aW, ULONG aH) 68 67 { 69 68 /* Log (("Quartz2D: NotifyUpdate %d,%d %dx%d\n", aX, aY, aW, aH));*/ … … 71 70 QApplication::postEvent (mView, 72 71 new VBoxRepaintEvent (aX, aY, aW, aH)); 73 /* the update has been finished, return TRUE */74 *aFinished = TRUE;75 76 72 return S_OK; 77 73 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFrameBuffer.cpp
r19798 r19817 282 282 /** @note This method is called on EMT from under this object's lock */ 283 283 STDMETHODIMP VBoxQImageFrameBuffer::NotifyUpdate (ULONG aX, ULONG aY, 284 ULONG aW, ULONG aH, 285 BOOL *aFinished) 284 ULONG aW, ULONG aH) 286 285 { 287 286 /* We're not on the GUI thread and update() isn't thread safe in … … 292 291 new VBoxRepaintEvent (aX, aY, aW, aH)); 293 292 294 /* The update has been finished, return TRUE */295 *aFinished = TRUE;296 293 return S_OK; 297 294 } … … 465 462 /** @note This method is called on EMT from under this object's lock */ 466 463 STDMETHODIMP VBoxSDLFrameBuffer::NotifyUpdate (ULONG aX, ULONG aY, 467 ULONG aW, ULONG aH, 468 BOOL *aFinished) 464 ULONG aW, ULONG aH) 469 465 { 470 466 #if !defined (Q_WS_WIN) && !defined (Q_WS_PM) … … 480 476 aW, aH); 481 477 #endif 482 /* the update has been finished, return TRUE */483 *aFinished = TRUE;484 478 return S_OK; 485 479 }
Note:
See TracChangeset
for help on using the changeset viewer.