Changeset 50314 in vbox
- Timestamp:
- Feb 3, 2014 7:29:26 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
include/VBox/HostServices/VBoxCrOpenGLSvc.h (modified) (2 diffs)
-
src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp (modified) (2 diffs)
-
src/VBox/Main/include/DisplayImpl.h (modified) (2 diffs)
-
src/VBox/Main/src-client/DisplayImpl.cpp (modified) (5 diffs)
-
src/VBox/Main/src-client/VideoRec.cpp (modified) (1 diff)
-
src/VBox/Main/src-client/VideoRec.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/HostServices/VBoxCrOpenGLSvc.h
r50313 r50314 386 386 uint8_t *pu8BufferAddress, uint64_t u64TimeStamp); 387 387 388 typedef DECLCALLBACKPTR(bool, PFNCRSCREENSHOTBEGIN)(void *pvCtx, uint32_t uScreen, uint64_t u64TimeStamp); 389 typedef DECLCALLBACKPTR(void, PFNCRSCREENSHOTEND)(void *pvCtx, uint32_t uScreen, uint64_t u64TimeStamp); 390 388 391 #define CRSCREEN_ALL (0xffffffff) 389 392 … … 393 396 uint32_t u32Screen; 394 397 void *pvContext; 395 PFNCRSCREENSHOTREPORT pfnScreenshot; 398 PFNCRSCREENSHOTBEGIN pfnScreenshotBegin; 399 PFNCRSCREENSHOTREPORT pfnScreenshotPerform; 400 PFNCRSCREENSHOTEND pfnScreenshotEnd; 396 401 } CRVBOXHGCMTAKESCREENSHOT; 397 402 -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r50313 r50314 933 933 } 934 934 935 static void crScreenshotHandle(CRVBOXHGCMTAKESCREENSHOT *pScreenshot, uint32_t idScreen, uint64_t u64Now) 936 { 937 if (!pScreenshot->pfnScreenshotBegin || pScreenshot->pfnScreenshotBegin(pScreenshot->pvContext, idScreen, u64Now)) 938 { 939 CR_SCREENSHOT Screenshot; 940 941 int rc = crServerVBoxScreenshotGet(idScreen, &Screenshot); 942 if (RT_SUCCESS(rc)) 943 { 944 pScreenshot->pfnScreenshotPerform(pScreenshot->pvContext, idScreen, 945 0, 0, 32, 946 Screenshot.Img.pitch, Screenshot.Img.width, Screenshot.Img.height, 947 (uint8_t*)Screenshot.Img.pvData, u64Now); 948 crServerVBoxScreenshotRelease(&Screenshot); 949 } 950 else 951 { 952 Assert(rc == VERR_INVALID_STATE); 953 } 954 955 if (pScreenshot->pfnScreenshotEnd) 956 pScreenshot->pfnScreenshotEnd(pScreenshot->pvContext, idScreen, u64Now); 957 } 958 } 959 935 960 /* 936 961 * We differentiate between a function handler for the guest and one for the host. … … 1225 1250 for (uint32_t i = 0; i < g_u32ScreenCount; ++i) 1226 1251 { 1227 CR_SCREENSHOT Screenshot; 1228 1229 int rc = crServerVBoxScreenshotGet(i, &Screenshot); 1230 if (RT_SUCCESS(rc)) 1231 { 1232 pScreenshot->pfnScreenshot(pScreenshot->pvContext, i, 1233 0, 0, 32, 1234 Screenshot.Img.pitch, Screenshot.Img.width, Screenshot.Img.height, 1235 (uint8_t*)Screenshot.Img.pvData, u64Now); 1236 crServerVBoxScreenshotRelease(&Screenshot); 1237 } 1238 else 1239 { 1240 Assert(rc == VERR_INVALID_STATE); 1241 } 1252 crScreenshotHandle(pScreenshot, i, u64Now); 1242 1253 } 1243 1254 } 1244 1255 else if (pScreenshot->u32Screen < g_u32ScreenCount) 1245 1256 { 1246 CR_SCREENSHOT Screenshot; 1247 1248 int rc = crServerVBoxScreenshotGet(pScreenshot->u32Screen, &Screenshot); 1249 if (RT_SUCCESS(rc)) 1250 { 1251 pScreenshot->pfnScreenshot(pScreenshot->pvContext, pScreenshot->u32Screen, 1252 0, 0, 32, 1253 Screenshot.Img.pitch, Screenshot.Img.width, Screenshot.Img.height, 1254 (uint8_t*)Screenshot.Img.pvData, u64Now); 1255 crServerVBoxScreenshotRelease(&Screenshot); 1256 } 1257 else 1258 { 1259 Assert(rc == VERR_INVALID_STATE); 1260 } 1257 crScreenshotHandle(pScreenshot, pScreenshot->u32Screen, u64Now); 1261 1258 } 1262 1259 else -
trunk/src/VBox/Main/include/DisplayImpl.h
r50313 r50314 178 178 #if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL) 179 179 void handleCrAsyncCmdCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam); 180 void handleCrVRecScreenshot (uint32_t uScreen,180 void handleCrVRecScreenshotPerform(uint32_t uScreen, 181 181 uint32_t x, uint32_t y, uint32_t uPixelFormat, uint32_t uBitsPerPixel, 182 182 uint32_t uBytesPerLine, uint32_t uGuestWidth, uint32_t uGuestHeight, 183 183 uint8_t *pu8BufferAddress, uint64_t u64TimeStamp); 184 bool handleCrVRecScreenshotBegin(uint32_t uScreen, uint64_t u64TimeStamp); 185 void handleCrVRecScreenshotEnd(uint32_t uScreen, uint64_t u64TimeStamp); 184 186 void handleVRecCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext); 185 187 #endif … … 283 285 284 286 #if defined(VBOX_WITH_HGCM) && defined(VBOX_WITH_CROGL) 285 static DECLCALLBACK(void) displayCrVRecScreenshot (void *pvCtx, uint32_t uScreen,287 static DECLCALLBACK(void) displayCrVRecScreenshotPerform(void *pvCtx, uint32_t uScreen, 286 288 uint32_t x, uint32_t y, uint32_t uBitsPerPixel, 287 289 uint32_t uBytesPerLine, uint32_t uGuestWidth, uint32_t uGuestHeight, 288 290 uint8_t *pu8BufferAddress, uint64_t u64TimeStamp); 291 static DECLCALLBACK(bool) displayCrVRecScreenshotBegin(void *pvCtx, uint32_t uScreen, uint64_t u64TimeStamp); 292 static DECLCALLBACK(void) displayCrVRecScreenshotEnd(void *pvCtx, uint32_t uScreen, uint64_t u64TimeStamp); 293 289 294 static DECLCALLBACK(void) displayVRecCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext); 290 295 static DECLCALLBACK(void) displayCrAsyncCmdCompletion(int32_t result, uint32_t u32Function, PVBOXHGCMSVCPARM pParam, void *pvContext); -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r50313 r50314 155 155 mCrOglScreenshotData.u32Screen = CRSCREEN_ALL; 156 156 mCrOglScreenshotData.pvContext = this; 157 mCrOglScreenshotData.pfnScreenshot = displayCrVRecScreenshot; 157 mCrOglScreenshotData.pfnScreenshotBegin = displayCrVRecScreenshotBegin; 158 mCrOglScreenshotData.pfnScreenshotPerform = displayCrVRecScreenshotPerform; 159 mCrOglScreenshotData.pfnScreenshotEnd = displayCrVRecScreenshotEnd; 158 160 #endif 159 161 … … 4205 4207 } 4206 4208 4207 4208 void Display::handleCrVRecScreenshot(uint32_t uScreen, 4209 bool Display::handleCrVRecScreenshotBegin(uint32_t uScreen, uint64_t u64TimeStamp) 4210 { 4211 return VideoRecIsReady(mpVideoRecCtx, uScreen, u64TimeStamp); 4212 } 4213 4214 void Display::handleCrVRecScreenshotEnd(uint32_t uScreen, uint64_t u64TimeStamp) 4215 { 4216 } 4217 4218 void Display::handleCrVRecScreenshotPerform(uint32_t uScreen, 4209 4219 uint32_t x, uint32_t y, uint32_t uPixelFormat, uint32_t uBitsPerPixel, 4210 4220 uint32_t uBytesPerLine, uint32_t uGuestWidth, uint32_t uGuestHeight, … … 4217 4227 uGuestWidth, uGuestHeight, 4218 4228 pu8BufferAddress, u64TimeStamp); 4219 Assert(rc == VINF_SUCCESS || rc == VERR_TRY_AGAIN || rc == VINF_TRY_AGAIN);4229 Assert(rc == VINF_SUCCESS/* || rc == VERR_TRY_AGAIN || rc == VINF_TRY_AGAIN*/); 4220 4230 } 4221 4231 … … 4226 4236 } 4227 4237 4228 DECLCALLBACK(void) Display::displayCrVRecScreenshot (void *pvCtx, uint32_t uScreen,4238 DECLCALLBACK(void) Display::displayCrVRecScreenshotPerform(void *pvCtx, uint32_t uScreen, 4229 4239 uint32_t x, uint32_t y, uint32_t uBitsPerPixel, 4230 4240 uint32_t uBytesPerLine, uint32_t uGuestWidth, uint32_t uGuestHeight, … … 4232 4242 { 4233 4243 Display *pDisplay = (Display *)pvCtx; 4234 pDisplay->handleCrVRecScreenshot (uScreen,4244 pDisplay->handleCrVRecScreenshotPerform(uScreen, 4235 4245 x, y, FramebufferPixelFormat_FOURCC_RGB, uBitsPerPixel, 4236 4246 uBytesPerLine, uGuestWidth, uGuestHeight, 4237 4247 pu8BufferAddress, u64TimeStamp); 4248 } 4249 4250 DECLCALLBACK(bool) Display::displayCrVRecScreenshotBegin(void *pvCtx, uint32_t uScreen, uint64_t u64TimeStamp) 4251 { 4252 Display *pDisplay = (Display *)pvCtx; 4253 return pDisplay->handleCrVRecScreenshotBegin(uScreen, u64TimeStamp); 4254 } 4255 4256 DECLCALLBACK(void) Display::displayCrVRecScreenshotEnd(void *pvCtx, uint32_t uScreen, uint64_t u64TimeStamp) 4257 { 4258 Display *pDisplay = (Display *)pvCtx; 4259 pDisplay->handleCrVRecScreenshotEnd(uScreen, u64TimeStamp); 4238 4260 } 4239 4261 -
trunk/src/VBox/Main/src-client/VideoRec.cpp
r50041 r50314 603 603 604 604 /** 605 * VideoRec utility function to check if recording engine is ready to accept a new frame 606 * for the given screen. 607 * 608 * @returns true if recording engine is ready 609 * @param pCtx Pointer to video recording context. 610 * @param uScreen screen id. 611 * @param u64TimeStamp current time stamp 612 */ 613 bool VideoRecIsReady(PVIDEORECCONTEXT pCtx, uint32_t uScreen, uint64_t u64TimeStamp) 614 { 615 uint32_t enmState = ASMAtomicReadU32(&g_enmState); 616 if (enmState != VIDREC_IDLE) 617 return false; 618 619 PVIDEORECSTREAM pStrm = &pCtx->Strm[uScreen]; 620 if (!pStrm->fEnabled) 621 return false; 622 623 if (u64TimeStamp < pStrm->u64LastTimeStamp + pStrm->uDelay) 624 return false; 625 626 if (ASMAtomicReadBool(&pStrm->fRgbFilled)) 627 return false; 628 629 return true; 630 } 631 632 /** 605 633 * VideoRec utility function to encode the source image and write the encoded 606 634 * image to target file. -
trunk/src/VBox/Main/src-client/VideoRec.h
r50313 r50314 34 34 uint32_t uBytesPerLine, uint32_t uGuestWidth, uint32_t uGuestHeight, 35 35 uint8_t *pu8BufferAddress, uint64_t u64TimeStamp); 36 bool VideoRecIsReady(PVIDEORECCONTEXT pCtx, uint32_t uScreen, uint64_t u64TimeStamp); 36 37 37 38 #endif /* !____H_VIDEOREC */
Note:
See TracChangeset
for help on using the changeset viewer.

