Changeset 45941 in vbox
- Timestamp:
- May 8, 2013 8:47:02 AM (12 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r45926 r45941 479 479 } 480 480 481 #ifdef VBOX_WITH_VPX482 if (VideoRecContextCreate(&mpVideoRecCtx))483 {484 LogFlow(("Failed to create Video Recording Context\n"));485 return E_FAIL;486 }487 488 BOOL fEnabled = false;489 mParent->machine()->COMGETTER(VideoCaptureEnabled)(&fEnabled);490 if (fEnabled)491 {492 ULONG ulWidth;493 mParent->machine()->COMGETTER(VideoCaptureWidth)(&ulWidth);494 ULONG ulHeight;495 mParent->machine()->COMGETTER(VideoCaptureHeight)(&ulHeight);496 ULONG ulRate;497 mParent->machine()->COMGETTER(VideoCaptureRate)(&ulRate);498 ULONG ulFps;499 mParent->machine()->COMGETTER(VideoCaptureFps)(&ulFps);500 BSTR strFile;501 mParent->machine()->COMGETTER(VideoCaptureFile)(&strFile);502 if (VideoRecContextInit(mpVideoRecCtx, strFile, ulWidth, ulHeight, ulRate, ulFps))503 {504 LogFlow(("Failed to initialize video recording context!\n"));505 return E_FAIL;506 }507 LogFlow(("Video recording as VPX with %lux%lu @ %lukbps to '%ls' enabled!\n",508 ulWidth, ulHeight, ulRate, strFile));509 }510 #endif511 512 481 { 513 482 // register listener for state change events … … 662 631 if (!finished) 663 632 { 664 LogRelFlowFunc 633 LogRelFlowFunc(("External framebuffer wants us to wait!\n")); 665 634 return VINF_VGA_RESIZE_IN_PROGRESS; 666 635 } … … 684 653 uint32_t cbLine, int w, int h, uint16_t flags) 685 654 { 686 LogRel 687 688 655 LogRel(("Display::handleDisplayResize(): uScreenId = %d, pvVRAM=%p " 656 "w=%d h=%d bpp=%d cbLine=0x%X, flags=0x%X\n", 657 uScreenId, pvVRAM, w, h, bpp, cbLine, flags)); 689 658 690 659 /* If there is no framebuffer, this call is not interesting. */ … … 732 701 * Note: the resize information is only accessed on EMT so no serialization is required. 733 702 */ 734 LogRel 703 LogRel(("Display::handleDisplayResize(): Warning: resize postponed.\n")); 735 704 736 705 maFramebuffers[uScreenId].pendingResize.fPending = true; … … 866 835 867 836 /* Inform VRDP server about the change of display parameters. */ 868 LogRelFlowFunc 837 LogRelFlowFunc(("Calling VRDP\n")); 869 838 mParent->consoleVRDPServer()->SendResize(); 870 839 … … 927 896 DISPLAYFBINFO *pInfo = pInfos; 928 897 unsigned uScreenId; 929 LogSunlover 898 LogSunlover(("mapCoordsToScreen: %d,%d %dx%d\n", *px, *py, *pw, *ph)); 930 899 for (uScreenId = 0; uScreenId < cInfos; uScreenId++, pInfo++) 931 900 { 932 LogSunlover 901 LogSunlover((" [%d] %d,%d %dx%d\n", uScreenId, pInfo->xOrigin, pInfo->yOrigin, pInfo->w, pInfo->h)); 933 902 if ( (pInfo->xOrigin <= *px && *px < pInfo->xOrigin + (int)pInfo->w) 934 903 && (pInfo->yOrigin <= *py && *py < pInfo->yOrigin + (int)pInfo->h)) … … 937 906 *px -= pInfo->xOrigin; 938 907 *py -= pInfo->yOrigin; 939 LogSunlover 908 LogSunlover((" -> %d,%d", *px, *py)); 940 909 break; 941 910 } … … 946 915 uScreenId = 0; 947 916 } 948 LogSunlover 917 LogSunlover((" scr %d\n", uScreenId)); 949 918 return uScreenId; 950 919 } … … 966 935 967 936 #ifdef DEBUG_sunlover 968 LogFlowFunc 937 LogFlowFunc(("%d,%d %dx%d (checked)\n", x, y, w, h)); 969 938 #endif /* DEBUG_sunlover */ 970 939 … … 980 949 981 950 #ifdef DEBUG_sunlover 982 LogFlowFunc 983 951 LogFlowFunc(("[%d] %d,%d %dx%d (%d,%d)\n", 952 uScreenId, x, y, w, h, mpDrv->IConnector.cx, mpDrv->IConnector.cy)); 984 953 #endif /* DEBUG_sunlover */ 985 954 … … 1219 1188 static void vbvaRgnDirtyRect (VBVADIRTYREGION *prgn, unsigned uScreenId, VBVACMDHDR *phdr) 1220 1189 { 1221 LogSunlover 1222 1190 LogSunlover(("x = %d, y = %d, w = %d, h = %d\n", 1191 phdr->x, phdr->y, phdr->w, phdr->h)); 1223 1192 1224 1193 /* … … 1420 1389 * acceleration after a mode change. 1421 1390 */ 1422 LogRelFlowFunc 1391 LogRelFlowFunc(("mfVideoAccelEnabled = %d, fEnable = %d, pVbvaMemory = %p\n", 1423 1392 mfVideoAccelEnabled, fEnable, pVbvaMemory)); 1424 1393 … … 1437 1406 Assert (!mfVideoAccelEnabled); 1438 1407 1439 LogRelFlowFunc 1408 LogRelFlowFunc(("Machine is not yet running.\n")); 1440 1409 1441 1410 if (fEnable) … … 1505 1474 } 1506 1475 1507 LogRelFlowFunc 1476 LogRelFlowFunc(("VideoAccelEnable: rc = %Rrc.\n", rc)); 1508 1477 1509 1478 return rc; … … 1660 1629 1661 1630 #ifdef DEBUG_sunlover 1662 LogFlowFunc 1663 1631 LogFlowFunc(("first = %d, free = %d\n", 1632 indexRecordFirst, indexRecordFree)); 1664 1633 #endif /* DEBUG_sunlover */ 1665 1634 … … 1678 1647 1679 1648 #ifdef DEBUG_sunlover 1680 LogFlowFunc 1649 LogFlowFunc(("cbRecord = 0x%08X\n", pRecord->cbRecord)); 1681 1650 #endif /* DEBUG_sunlover */ 1682 1651 … … 1689 1658 Assert (mpu8VbvaPartial); 1690 1659 1691 LogFlowFunc 1660 LogFlowFunc(("continue partial record mcbVbvaPartial = %d cbRecord 0x%08X, first = %d, free = %d\n", 1692 1661 mcbVbvaPartial, pRecord->cbRecord, indexRecordFirst, indexRecordFree)); 1693 1662 … … 1714 1683 1715 1684 #ifdef DEBUG_sunlover 1716 LogFlowFunc 1685 LogFlowFunc(("partial done ok, data = %d, free = %d\n", 1717 1686 mpVbvaMemory->off32Data, mpVbvaMemory->off32Free)); 1718 1687 #endif /* DEBUG_sunlover */ … … 1734 1703 } 1735 1704 1736 LogFlowFunc 1705 LogFlowFunc(("started partial record mcbVbvaPartial = 0x%08X cbRecord 0x%08X, first = %d, free = %d\n", 1737 1706 mcbVbvaPartial, pRecord->cbRecord, indexRecordFirst, indexRecordFree)); 1738 1707 } … … 1769 1738 if (!dst) 1770 1739 { 1771 LogRelFlowFunc 1740 LogRelFlowFunc(("could not allocate %d bytes from heap!!!\n", cbRecord)); 1772 1741 mpVbvaMemory->off32Data = (mpVbvaMemory->off32Data + cbRecord) % VBVA_RING_BUFFER_SIZE; 1773 1742 return false; … … 1779 1748 1780 1749 #ifdef DEBUG_sunlover 1781 LogFlowFunc 1750 LogFlowFunc(("Allocated from heap %p\n", dst)); 1782 1751 #endif /* DEBUG_sunlover */ 1783 1752 } … … 1790 1759 1791 1760 #ifdef DEBUG_sunlover 1792 LogFlowFunc 1793 1761 LogFlowFunc(("done ok, data = %d, free = %d\n", 1762 mpVbvaMemory->off32Data, mpVbvaMemory->off32Free)); 1794 1763 #endif /* DEBUG_sunlover */ 1795 1764 … … 1816 1785 1817 1786 #ifdef DEBUG_sunlover 1818 LogFlowFunc 1787 LogFlowFunc(("Free heap %p\n", pHdr)); 1819 1788 #endif /* DEBUG_sunlover */ 1820 1789 … … 1853 1822 { 1854 1823 #ifdef DEBUG_sunlover_2 1855 LogFlowFunc 1824 LogFlowFunc(("mfVideoAccelEnabled = %d\n", mfVideoAccelEnabled)); 1856 1825 #endif /* DEBUG_sunlover_2 */ 1857 1826 … … 1866 1835 1867 1836 #ifdef DEBUG_sunlover_2 1868 LogFlowFunc 1837 LogFlowFunc(("indexRecordFirst = %d, indexRecordFree = %d, off32Data = %d, off32Free = %d\n", 1869 1838 mpVbvaMemory->indexRecordFirst, mpVbvaMemory->indexRecordFree, mpVbvaMemory->off32Data, mpVbvaMemory->off32Free)); 1870 1839 #endif /* DEBUG_sunlover_2 */ … … 1909 1878 { 1910 1879 #ifdef DEBUG_sunlover 1911 LogFlowFunc 1912 1880 LogFlowFunc(("hdr: cbCmd = %d, x=%d, y=%d, w=%d, h=%d\n", 1881 cbCmd, phdr->x, phdr->y, phdr->w, phdr->h)); 1913 1882 #endif /* DEBUG_sunlover */ 1914 1883 … … 2024 1993 ULONG *aWidth, ULONG *aHeight, ULONG *aBitsPerPixel) 2025 1994 { 2026 LogRelFlowFunc 1995 LogRelFlowFunc(("aScreenId = %d\n", aScreenId)); 2027 1996 2028 1997 AutoCaller autoCaller(this); … … 2068 2037 STDMETHODIMP Display::SetFramebuffer(ULONG aScreenId, IFramebuffer *aFramebuffer) 2069 2038 { 2070 LogRelFlowFunc 2039 LogRelFlowFunc(("\n")); 2071 2040 2072 2041 if (aFramebuffer != NULL) … … 2129 2098 } 2130 2099 2131 STDMETHODIMP Display::GetFramebuffer 2132 IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin)2133 { 2134 LogRelFlowFunc 2100 STDMETHODIMP Display::GetFramebuffer(ULONG aScreenId, 2101 IFramebuffer **aFramebuffer, LONG *aXOrigin, LONG *aYOrigin) 2102 { 2103 LogRelFlowFunc(("aScreenId = %d\n", aScreenId)); 2135 2104 2136 2105 CheckComArgOutPointerValid(aFramebuffer); … … 2305 2274 2306 2275 rc = pDisplay->mpDrv->pUpPort->pfnCopyRect(pDisplay->mpDrv->pUpPort, 2307 width, height,2308 pu8Src,2309 xSrc, ySrc,2310 u32SrcWidth, u32SrcHeight,2311 u32SrcLineSize, u32SrcBitsPerPixel,2312 pu8Dst,2313 xDst, yDst,2314 u32DstWidth, u32DstHeight,2315 u32DstLineSize, u32DstBitsPerPixel);2276 width, height, 2277 pu8Src, 2278 xSrc, ySrc, 2279 u32SrcWidth, u32SrcHeight, 2280 u32SrcLineSize, u32SrcBitsPerPixel, 2281 pu8Dst, 2282 xDst, yDst, 2283 u32DstWidth, u32DstHeight, 2284 u32DstLineSize, u32DstBitsPerPixel); 2316 2285 if (RT_SUCCESS(rc)) 2317 2286 { … … 2747 2716 // within the Console lock to make it atomic). 2748 2717 2749 LogRelFlowFunc 2718 LogRelFlowFunc(("address=%p, x=%d, y=%d, width=%d, height=%d\n", 2750 2719 (void *)address, x, y, width, height)); 2751 2720 … … 2795 2764 // } 2796 2765 2797 LogRelFlowFunc 2766 LogRelFlowFunc(("rc=%08X\n", rc)); 2798 2767 return rc; 2799 2768 } … … 2903 2872 HRESULT rc = S_OK; 2904 2873 2905 LogRelFlowFunc 2874 LogRelFlowFunc(("Sending DPYUPDATE request\n")); 2906 2875 2907 2876 /* Have to release the lock when calling EMT. */ … … 2917 2886 tr("Could not invalidate and update the screen (%Rrc)"), rcVBox); 2918 2887 2919 LogRelFlowFunc 2888 LogRelFlowFunc(("rc=%08X\n", rc)); 2920 2889 return rc; 2921 2890 } … … 2929 2898 STDMETHODIMP Display::ResizeCompleted(ULONG aScreenId) 2930 2899 { 2931 LogRelFlowFunc 2900 LogRelFlowFunc(("\n")); 2932 2901 2933 2902 /// @todo (dmik) can we AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); here? … … 3010 2979 void Display::updateDisplayData(void) 3011 2980 { 3012 LogRelFlowFunc 2981 LogRelFlowFunc(("\n")); 3013 2982 3014 2983 /* the driver might not have been constructed yet */ … … 3070 3039 mpDrv->IConnector.cy = 0; 3071 3040 } 3072 LogRelFlowFunc 3041 LogRelFlowFunc(("leave\n")); 3073 3042 } 3074 3043 … … 3124 3093 unsigned uScreenId) 3125 3094 { 3126 LogRelFlowFunc 3095 LogRelFlowFunc(("uScreenId = %d\n", uScreenId)); 3127 3096 3128 3097 AssertReturn(that, VERR_INVALID_PARAMETER); … … 3182 3151 } 3183 3152 3184 LogRelFlowFunc 3153 LogRelFlowFunc(("leave\n")); 3185 3154 return VINF_SUCCESS; 3186 3155 } … … 3196 3165 PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface); 3197 3166 3198 LogRelFlowFunc 3167 LogRelFlowFunc(("bpp %d, pvVRAM %p, cbLine %d, cx %d, cy %d\n", 3199 3168 bpp, pvVRAM, cbLine, cx, cy)); 3200 3169 … … 3213 3182 3214 3183 #ifdef DEBUG_sunlover 3215 LogFlowFunc 3216 3184 LogFlowFunc(("mfVideoAccelEnabled = %d, %d,%d %dx%d\n", 3185 pDrv->pDisplay->mfVideoAccelEnabled, x, y, cx, cy)); 3217 3186 #endif /* DEBUG_sunlover */ 3218 3187 … … 3239 3208 3240 3209 #ifdef DEBUG_sunlover_2 3241 LogFlowFunc 3242 3210 LogFlowFunc(("pDrv->pDisplay->mfVideoAccelEnabled = %d\n", 3211 pDrv->pDisplay->mfVideoAccelEnabled)); 3243 3212 #endif /* DEBUG_sunlover_2 */ 3244 3213 … … 3259 3228 if (u32ResizeStatus == ResizeStatus_UpdateDisplayData) 3260 3229 { 3261 LogRelFlowFunc 3230 LogRelFlowFunc(("ResizeStatus_UpdateDisplayData %d\n", uScreenId)); 3262 3231 fNoUpdate = true; /* Always set it here, because pfnUpdateDisplayAll can cause a new resize. */ 3263 3232 /* The framebuffer was resized and display data need to be updated. */ … … 3276 3245 { 3277 3246 /* The framebuffer is being resized. Do not call the VGA device back. Immediately return. */ 3278 LogRelFlowFunc 3247 LogRelFlowFunc(("ResizeStatus_InProcess\n")); 3279 3248 fNoUpdate = true; 3280 3249 continue; … … 3320 3289 3321 3290 #ifdef VBOX_WITH_VPX 3322 if ( pDisplay->mpVideoRecCtx 3323 && VideoRecIsEnabled(pDisplay->mpVideoRecCtx)) 3291 if (VideoRecIsEnabled(pDisplay->mpVideoRecCtx)) 3324 3292 { 3325 3293 DISPLAYFBINFO *pFBInfo = &pDisplay->maFramebuffers[VBOX_VIDEO_PRIMARY_SCREEN]; … … 3356 3324 #endif /* DEBUG_sunlover */ 3357 3325 #ifdef DEBUG_sunlover_2 3358 LogFlowFunc 3326 LogFlowFunc(("leave\n")); 3359 3327 #endif /* DEBUG_sunlover_2 */ 3360 3328 } … … 3369 3337 PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface); 3370 3338 3371 LogRelFlowFunc 3339 LogRelFlowFunc(("\n")); 3372 3340 3373 3341 /* Disable VBVA mode. */ … … 3384 3352 PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface); 3385 3353 3386 LogRelFlowFunc 3354 LogRelFlowFunc(("fEnabled=%d\n", fEnabled)); 3387 3355 3388 3356 NOREF(fEnabled); … … 4193 4161 { 4194 4162 /* VRDP server still need this notification. */ 4195 LogRelFlowFunc 4163 LogRelFlowFunc(("Calling VRDP\n")); 4196 4164 pThis->mParent->consoleVRDPServer()->SendResize(); 4197 4165 } … … 4306 4274 * Init Interfaces. 4307 4275 */ 4308 pDrvIns->IBase.pfnQueryInterface = Display::drvQueryInterface;4309 4310 pThis->IConnector.pfnResize = Display::displayResizeCallback;4311 pThis->IConnector.pfnUpdateRect = Display::displayUpdateCallback;4312 pThis->IConnector.pfnRefresh = Display::displayRefreshCallback;4313 pThis->IConnector.pfnReset = Display::displayResetCallback;4314 pThis->IConnector.pfnLFBModeChange = Display::displayLFBModeChangeCallback;4315 pThis->IConnector.pfnProcessAdapterData = Display::displayProcessAdapterDataCallback;4316 pThis->IConnector.pfnProcessDisplayData = Display::displayProcessDisplayDataCallback;4276 pDrvIns->IBase.pfnQueryInterface = Display::drvQueryInterface; 4277 4278 pThis->IConnector.pfnResize = Display::displayResizeCallback; 4279 pThis->IConnector.pfnUpdateRect = Display::displayUpdateCallback; 4280 pThis->IConnector.pfnRefresh = Display::displayRefreshCallback; 4281 pThis->IConnector.pfnReset = Display::displayResetCallback; 4282 pThis->IConnector.pfnLFBModeChange = Display::displayLFBModeChangeCallback; 4283 pThis->IConnector.pfnProcessAdapterData = Display::displayProcessAdapterDataCallback; 4284 pThis->IConnector.pfnProcessDisplayData = Display::displayProcessDisplayDataCallback; 4317 4285 #ifdef VBOX_WITH_VIDEOHWACCEL 4318 pThis->IConnector.pfnVHWACommandProcess = Display::displayVHWACommandProcess;4286 pThis->IConnector.pfnVHWACommandProcess = Display::displayVHWACommandProcess; 4319 4287 #endif 4320 4288 #ifdef VBOX_WITH_CRHGSMI … … 4323 4291 #endif 4324 4292 #ifdef VBOX_WITH_HGSMI 4325 pThis->IConnector.pfnVBVAEnable = Display::displayVBVAEnable;4326 pThis->IConnector.pfnVBVADisable = Display::displayVBVADisable;4327 pThis->IConnector.pfnVBVAUpdateBegin = Display::displayVBVAUpdateBegin;4328 pThis->IConnector.pfnVBVAUpdateProcess = Display::displayVBVAUpdateProcess;4329 pThis->IConnector.pfnVBVAUpdateEnd = Display::displayVBVAUpdateEnd;4330 pThis->IConnector.pfnVBVAResize = Display::displayVBVAResize;4293 pThis->IConnector.pfnVBVAEnable = Display::displayVBVAEnable; 4294 pThis->IConnector.pfnVBVADisable = Display::displayVBVADisable; 4295 pThis->IConnector.pfnVBVAUpdateBegin = Display::displayVBVAUpdateBegin; 4296 pThis->IConnector.pfnVBVAUpdateProcess = Display::displayVBVAUpdateProcess; 4297 pThis->IConnector.pfnVBVAUpdateEnd = Display::displayVBVAUpdateEnd; 4298 pThis->IConnector.pfnVBVAResize = Display::displayVBVAResize; 4331 4299 pThis->IConnector.pfnVBVAMousePointerShape = Display::displayVBVAMousePointerShape; 4332 4300 #endif … … 4359 4327 return rc; 4360 4328 } 4361 pThis->pDisplay = (Display *)pv; /** @todo Check this cast! */ 4329 Display *pDisplay = (Display *)pv; /** @todo Check this cast! */ 4330 pThis->pDisplay = pDisplay; 4362 4331 pThis->pDisplay->mpDrv = pThis; 4363 4364 4332 /* 4365 4333 * Update our display information according to the framebuffer 4366 4334 */ 4367 p This->pDisplay->updateDisplayData();4335 pDisplay->updateDisplayData(); 4368 4336 4369 4337 /* … … 4373 4341 4374 4342 #ifdef VBOX_WITH_CRHGSMI 4375 pThis->pDisplay->setupCrHgsmiData(); 4343 pDisplay->setupCrHgsmiData(); 4344 #endif 4345 4346 #ifdef VBOX_WITH_VPX 4347 rc = VideoRecContextCreate(&pDisplay->mpVideoRecCtx); 4348 if (RT_FAILURE(rc)) 4349 { 4350 LogFlow(("Failed to create video recording context (%Rrc)!\n", rc)); 4351 return E_FAIL; 4352 } 4353 4354 ComPtr<IMachine> pMachine = pDisplay->mParent->machine(); 4355 BOOL fEnabled = false; 4356 pMachine->COMGETTER(VideoCaptureEnabled)(&fEnabled); 4357 if (fEnabled) 4358 { 4359 ULONG ulWidth; 4360 int hrc = pMachine->COMGETTER(VideoCaptureWidth)(&ulWidth); 4361 AssertComRCReturnRC(hrc); 4362 ULONG ulHeight; 4363 hrc = pMachine->COMGETTER(VideoCaptureHeight)(&ulHeight); 4364 AssertComRCReturnRC(hrc); 4365 ULONG ulRate; 4366 hrc = pMachine->COMGETTER(VideoCaptureRate)(&ulRate); 4367 AssertComRCReturnRC(hrc); 4368 ULONG ulFps; 4369 hrc = pMachine->COMGETTER(VideoCaptureFps)(&ulFps); 4370 AssertComRCReturnRC(hrc); 4371 BSTR strFile; 4372 hrc = pMachine->COMGETTER(VideoCaptureFile)(&strFile); 4373 AssertComRCReturnRC(hrc); 4374 rc = VideoRecContextInit(pDisplay->mpVideoRecCtx, com::Utf8Str(strFile).c_str(), 4375 ulWidth, ulHeight, ulRate, ulFps); 4376 if (RT_SUCCESS(rc)) 4377 LogRel(("WebM/VP8 video recording with %ux%u @ %u kbps, %u fps to '%s' enabled!\n", 4378 ulWidth, ulHeight, ulRate, ulFps, com::Utf8Str(strFile).c_str())); 4379 else 4380 LogRel(("Failed to initialize video recording context (%Rrc)!\n", rc)); 4381 } 4376 4382 #endif 4377 4383 -
trunk/src/VBox/Main/src-client/VideoRec.cpp
r45926 r45941 39 39 static int videoRecEncodeAndWrite(PVIDEORECCONTEXT pVideoRecCtx); 40 40 static int videoRecRGBToYUV(PVIDEORECCONTEXT pVideoRecCtx); 41 42 /* RGB buffer */43 enum44 {45 /* RGB buffer empty */46 VIDREC_RGB_EMPTY = 0,47 /* RGB buffer filled */48 VIDREC_RGB_FILLED49 };50 41 51 42 /* encoding */ … … 97 88 /* pixel format of the current frame */ 98 89 uint32_t u32PixelFormat; 99 /* m aximum number of frames per second*/90 /* minimal delay between two frames */ 100 91 uint32_t uDelay; 92 /* time stamp of the last frame we encoded */ 101 93 uint64_t u64LastTimeStamp; 102 94 /* time stamp of the current frame */ … … 428 420 * @param uTargetHeight Height of the target image in video recording file. 429 421 */ 430 int VideoRecContextInit(PVIDEORECCONTEXT pVideoRecCtx, co m::Bstr strFile,422 int VideoRecContextInit(PVIDEORECCONTEXT pVideoRecCtx, const char *pszFile, 431 423 uint32_t uWidth, uint32_t uHeight, uint32_t uRate, uint32_t uFps) 432 424 { … … 436 428 AssertReturn(pVideoRecCtx->pu8RgbBuf, VERR_NO_MEMORY); 437 429 438 int rc = RTFileOpen(&pVideoRecCtx->ebml.file, 439 com::Utf8Str(strFile).c_str(), 430 int rc = RTFileOpen(&pVideoRecCtx->ebml.file, pszFile, 440 431 RTFILE_O_CREATE_REPLACE | RTFILE_O_WRITE | RTFILE_O_DENY_NONE); 441 432 if (RT_FAILURE(rc)) 442 433 { 443 LogFlow(("Failed to open the output File 444 return VERR_GENERAL_FAILURE;434 LogFlow(("Failed to open the output File\n")); 435 return rc; 445 436 } 446 437 … … 448 439 if (rcv != VPX_CODEC_OK) 449 440 { 450 LogFlow(("Failed to configure codec 451 return VERR_GENERAL_FAILURE;441 LogFlow(("Failed to configure codec\n", vpx_codec_err_to_string(rcv))); 442 return rc; 452 443 } 453 444 … … 487 478 pVideoRecCtx->pu8YuvBuf = pVideoRecCtx->VpxRawImage.planes[0]; 488 479 489 int vrc = RTSemEventCreate(&pVideoRecCtx->WaitEvent);490 AssertRCReturn( vrc, vrc);491 492 vrc = RTThreadCreate(&pVideoRecCtx->Thread, VideoRecThread,493 494 495 AssertRCReturn( vrc, vrc);480 rc = RTSemEventCreate(&pVideoRecCtx->WaitEvent); 481 AssertRCReturn(rc, rc); 482 483 rc = RTThreadCreate(&pVideoRecCtx->Thread, VideoRecThread, 484 (void*)pVideoRecCtx, 0, 485 RTTHREADTYPE_MAIN_WORKER, 0, "VideoRec"); 486 AssertRCReturn(rc, rc); 496 487 497 488 pVideoRecCtx->fEnabled = true; … … 542 533 bool VideoRecIsEnabled(PVIDEORECCONTEXT pVideoRecCtx) 543 534 { 544 AssertPtr(pVideoRecCtx); 535 if (!pVideoRecCtx) 536 return false; 537 545 538 return pVideoRecCtx->fEnabled; 546 539 } -
trunk/src/VBox/Main/src-client/VideoRec.h
r45926 r45941 23 23 24 24 int VideoRecContextCreate(PVIDEORECCONTEXT *ppVideoRecContext); 25 int VideoRecContextInit(PVIDEORECCONTEXT pVideoRecContext, co m::Bstr mFileName,25 int VideoRecContextInit(PVIDEORECCONTEXT pVideoRecContext, const char *pszFile, 26 26 uint32_t uWidth, uint32_t uHeight, uint32_t uRate, uint32_t uFps); 27 27 void VideoRecContextClose(PVIDEORECCONTEXT pVideoRecContext);
Note:
See TracChangeset
for help on using the changeset viewer.