VirtualBox

Ignore:
Timestamp:
Nov 7, 2018 5:13:56 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126424
Message:

Recording: More bugfixes for Main and FE/Qt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/VideoRecStream.cpp

    r75307 r75313  
    4242
    4343
    44 CaptureStream::CaptureStream(void)
    45     : tsStartMs(0)
     44CaptureStream::CaptureStream(CaptureContext *a_pCtx)
     45    : pCtx(a_pCtx)
     46    , enmState(RECORDINGSTREAMSTATE_UNINITIALIZED)
     47    , tsStartMs(0)
    4648{
    4749    File.pWEBM = NULL;
     
    4951}
    5052
    51 CaptureStream::CaptureStream(uint32_t uScreen, const settings::CaptureScreenSettings &Settings)
    52     : tsStartMs(0)
     53CaptureStream::CaptureStream(CaptureContext *a_pCtx, uint32_t uScreen, const settings::CaptureScreenSettings &Settings)
     54    : enmState(RECORDINGSTREAMSTATE_UNINITIALIZED)
     55    , tsStartMs(0)
    5356{
    5457    File.pWEBM = NULL;
    5558    File.hFile = NIL_RTFILE;
    5659
    57     int rc2 = initInternal(uScreen, Settings);
     60    int rc2 = initInternal(a_pCtx, uScreen, Settings);
    5861    if (RT_FAILURE(rc2))
    5962        throw rc2;
     
    645648        VideoRecVideoFrameFree(pFrame);
    646649
    647     lock();
     650    unlock();
    648651
    649652    return rc;
    650653}
    651654
    652 int CaptureStream::Init(uint32_t uScreen, const settings::CaptureScreenSettings &Settings)
    653 {
    654     return initInternal(uScreen, Settings);
    655 }
    656 
    657655/**
    658656 * Initializes a recording stream.
    659657 *
    660658 * @returns IPRT status code.
     659 * @param   a_pCtx              Pointer to recording context.
    661660 * @param   uScreen             Screen number to use for this recording stream.
    662661 * @param   Settings            Capturing configuration to use for initialization.
    663662 */
    664 int CaptureStream::initInternal(uint32_t uScreen, const settings::CaptureScreenSettings &Settings)
     663int 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 */
     676int CaptureStream::initInternal(CaptureContext *a_pCtx, uint32_t uScreen, const settings::CaptureScreenSettings &Settings)
    665677{
    666678    int rc = parseOptionsString(Settings.strOptions);
     
    770782    if (RT_SUCCESS(rc))
    771783    {
     784        this->pCtx           = a_pCtx;
     785        this->enmState       = RECORDINGSTREAMSTATE_INITIALIZED;
    772786        this->fEnabled       = true;
    773787        this->uScreenID      = uScreen;
     
    870884int CaptureStream::uninitInternal(void)
    871885{
     886    if (this->enmState != RECORDINGSTREAMSTATE_INITIALIZED)
     887        return VINF_SUCCESS;
     888
    872889    int rc = close();
    873890    if (RT_FAILURE(rc))
     
    883900    RTCritSectDelete(&this->CritSect);
    884901
     902    this->enmState = RECORDINGSTREAMSTATE_UNINITIALIZED;
    885903    this->fEnabled = false;
    886904
     
    911929int CaptureStream::uninitVideoVPX(void)
    912930{
    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
    914935    vpx_codec_err_t rcv = vpx_codec_destroy(&this->Video.Codec.VPX.Ctx);
    915936    Assert(rcv == VPX_CODEC_OK); RT_NOREF(rcv);
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette