Changeset 75313 in vbox for trunk/src/VBox/Main/src-client/VideoRecStream.cpp
- Timestamp:
- Nov 7, 2018 5:13:56 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 126424
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/VideoRecStream.cpp
r75307 r75313 42 42 43 43 44 CaptureStream::CaptureStream(void) 45 : tsStartMs(0) 44 CaptureStream::CaptureStream(CaptureContext *a_pCtx) 45 : pCtx(a_pCtx) 46 , enmState(RECORDINGSTREAMSTATE_UNINITIALIZED) 47 , tsStartMs(0) 46 48 { 47 49 File.pWEBM = NULL; … … 49 51 } 50 52 51 CaptureStream::CaptureStream(uint32_t uScreen, const settings::CaptureScreenSettings &Settings) 52 : tsStartMs(0) 53 CaptureStream::CaptureStream(CaptureContext *a_pCtx, uint32_t uScreen, const settings::CaptureScreenSettings &Settings) 54 : enmState(RECORDINGSTREAMSTATE_UNINITIALIZED) 55 , tsStartMs(0) 53 56 { 54 57 File.pWEBM = NULL; 55 58 File.hFile = NIL_RTFILE; 56 59 57 int rc2 = initInternal( uScreen, Settings);60 int rc2 = initInternal(a_pCtx, uScreen, Settings); 58 61 if (RT_FAILURE(rc2)) 59 62 throw rc2; … … 645 648 VideoRecVideoFrameFree(pFrame); 646 649 647 lock();650 unlock(); 648 651 649 652 return rc; 650 653 } 651 654 652 int CaptureStream::Init(uint32_t uScreen, const settings::CaptureScreenSettings &Settings)653 {654 return initInternal(uScreen, Settings);655 }656 657 655 /** 658 656 * Initializes a recording stream. 659 657 * 660 658 * @returns IPRT status code. 659 * @param a_pCtx Pointer to recording context. 661 660 * @param uScreen Screen number to use for this recording stream. 662 661 * @param Settings Capturing configuration to use for initialization. 663 662 */ 664 int CaptureStream::initInternal(uint32_t uScreen, const settings::CaptureScreenSettings &Settings) 663 int CaptureStream::Init(CaptureContext *a_pCtx, uint32_t uScreen, const settings::CaptureScreenSettings &Settings) 664 { 665 return initInternal(a_pCtx, uScreen, Settings); 666 } 667 668 /** 669 * Initializes a recording stream, internal version. 670 * 671 * @returns IPRT status code. 672 * @param a_pCtx Pointer to recording context. 673 * @param uScreen Screen number to use for this recording stream. 674 * @param Settings Capturing configuration to use for initialization. 675 */ 676 int CaptureStream::initInternal(CaptureContext *a_pCtx, uint32_t uScreen, const settings::CaptureScreenSettings &Settings) 665 677 { 666 678 int rc = parseOptionsString(Settings.strOptions); … … 770 782 if (RT_SUCCESS(rc)) 771 783 { 784 this->pCtx = a_pCtx; 785 this->enmState = RECORDINGSTREAMSTATE_INITIALIZED; 772 786 this->fEnabled = true; 773 787 this->uScreenID = uScreen; … … 870 884 int CaptureStream::uninitInternal(void) 871 885 { 886 if (this->enmState != RECORDINGSTREAMSTATE_INITIALIZED) 887 return VINF_SUCCESS; 888 872 889 int rc = close(); 873 890 if (RT_FAILURE(rc)) … … 883 900 RTCritSectDelete(&this->CritSect); 884 901 902 this->enmState = RECORDINGSTREAMSTATE_UNINITIALIZED; 885 903 this->fEnabled = false; 886 904 … … 911 929 int CaptureStream::uninitVideoVPX(void) 912 930 { 913 vpx_img_free(&this->Video.Codec.VPX.RawImage); 931 PVIDEORECVIDEOCODEC pCodec = &this->Video.Codec; 932 vpx_img_free(&pCodec->VPX.RawImage); 933 pCodec->VPX.pu8YuvBuf = NULL; /* Was pointing to VPX.RawImage. */ 934 914 935 vpx_codec_err_t rcv = vpx_codec_destroy(&this->Video.Codec.VPX.Ctx); 915 936 Assert(rcv == VPX_CODEC_OK); RT_NOREF(rcv);
Note:
See TracChangeset
for help on using the changeset viewer.