vbox的更動 45941 路徑 trunk/src/VBox/Main/src-client/VideoRec.cpp
- 時間撮記:
- 2013-5-8 上午08:47:02 (12 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
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 }
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器