VirtualBox

Changeset 68975 in vbox


Ignore:
Timestamp:
Oct 4, 2017 11:51:39 AM (7 years ago)
Author:
vboxsync
Message:

VideoRec: Renaming (be more consistent): video capture vs. video recording.

Location:
trunk/src/VBox/Main
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r68971 r68975  
    105105    {
    106106        ComPtr<IDisplaySourceBitmap> pSourceBitmap;
    107     } videoCapture;
     107    } videoRec;
    108108#endif /* VBOX_WITH_VIDEOREC */
    109109} DISPLAYFBINFO;
     
    209209
    210210#ifdef VBOX_WITH_VIDEOREC
    211     PVIDEORECCFG             i_videoCaptureGetConfig(void) { return &mVideoRecCfg; }
    212     VIDEORECFEATURES         i_videoCaptureGetEnabled(void);
    213     bool                     i_videoCaptureStarted(void);
     211    PVIDEORECCFG             i_videoRecGetConfig(void) { return &mVideoRecCfg; }
     212    VIDEORECFEATURES         i_videoRecGetEnabled(void);
     213    bool                     i_videoRecStarted(void);
    214214# ifdef VBOX_WITH_AUDIO_VIDEOREC
    215     int                      i_videoCaptureConfigureAudioDriver(const Utf8Str& strAdapter, unsigned uInstance, unsigned uLun, bool fAttach);
     215    int                      i_videoRecConfigureAudioDriver(const Utf8Str& strAdapter, unsigned uInstance, unsigned uLun, bool fAttach);
    216216# endif
    217     static DECLCALLBACK(int) i_videoCaptureConfigure(Display *pThis, PVIDEORECCFG pCfg, bool fAttachDetach);
    218     int                      i_videoCaptureSendAudio(const void *pvData, size_t cbData, uint64_t uDurationMs);
    219     int                      i_videoCaptureStart(void);
    220     void                     i_videoCaptureStop(void);
    221     void                     i_videoCaptureScreenChanged(unsigned uScreenId);
     217    static DECLCALLBACK(int) i_videoRecConfigure(Display *pThis, PVIDEORECCFG pCfg, bool fAttachDetach);
     218    int                      i_videoRecSendAudio(const void *pvData, size_t cbData, uint64_t uDurationMs);
     219    int                      i_videoRecStart(void);
     220    void                     i_videoRecStop(void);
     221    void                     i_videoRecScreenChanged(unsigned uScreenId);
    222222#endif
    223223
     
    475475
    476476#ifdef VBOX_WITH_VIDEOREC
    477     /* Serializes access to video capture source bitmaps. */
    478     RTCRITSECT           mVideoCaptureLock;
     477    /* Serializes access to video recording source bitmaps. */
     478    RTCRITSECT           mVideoRecLock;
    479479    /** The current video recording configuration being used. */
    480480    VIDEORECCFG          mVideoRecCfg;
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r68971 r68975  
    55175517
    55185518            int vrc = VMR3ReqCallWaitU(ptrVM.rawUVM(), VMCPUID_ANY /*idDstCpu*/,
    5519                                        (PFNRT)Display::i_videoCaptureConfigure, 3,
    5520                                        pDisplay, pDisplay->i_videoCaptureGetConfig(), true /* fAttachDetach */);
     5519                                       (PFNRT)Display::i_videoRecConfigure, 3,
     5520                                       pDisplay, pDisplay->i_videoRecGetConfig(), true /* fAttachDetach */);
    55215521            if (RT_SUCCESS(vrc))
    55225522            {
     
    55245524                alock.acquire();
    55255525
    5526                 if (!mDisplay->i_videoCaptureStarted())
     5526                if (!mDisplay->i_videoRecStarted())
    55275527                {
    5528                     vrc = mDisplay->i_videoCaptureStart();
     5528                    vrc = mDisplay->i_videoRecStart();
    55295529                    if (RT_FAILURE(vrc))
    55305530                        rc = setError(E_FAIL, tr("Unable to start video capturing (%Rrc)"), vrc);
    55315531                }
    55325532                else
    5533                     mDisplay->i_videoCaptureStop();
     5533                    mDisplay->i_videoRecStop();
    55345534            }
    55355535            else
     
    67366736    if (mDisplay)
    67376737    {
    6738         int rc2 = mDisplay->i_videoCaptureSendAudio(pvData, cbData, uDurationMs);
     6738        int rc2 = mDisplay->i_videoRecSendAudio(pvData, cbData, uDurationMs);
    67396739        AssertRC(rc2);
    67406740    }
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r68944 r68975  
    30063006                /* Note: Don't do any driver attaching (fAttachDetach) here, as this will
    30073007                 *       be done automatically as part of the VM startup process. */
    3008                 pDisplay->i_videoCaptureConfigure(pDisplay, pDisplay->i_videoCaptureGetConfig(), false /* fAttachDetach */);
     3008                pDisplay->i_videoRecConfigure(pDisplay, pDisplay->i_videoRecGetConfig(), false /* fAttachDetach */);
    30093009            }
    30103010#endif /* VBOX_WITH_AUDIO_VIDEOREC */
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r68972 r68975  
    147147
    148148#ifdef VBOX_WITH_VIDEOREC
    149     rc = RTCritSectInit(&mVideoCaptureLock);
     149    rc = RTCritSectInit(&mVideoRecLock);
    150150    AssertRC(rc);
    151151
     
    180180
    181181#ifdef VBOX_WITH_VIDEOREC
    182     if (RTCritSectIsInitialized(&mVideoCaptureLock))
    183     {
    184         RTCritSectDelete(&mVideoCaptureLock);
    185         RT_ZERO(mVideoCaptureLock);
     182    if (RTCritSectIsInitialized(&mVideoRecLock))
     183    {
     184        RTCritSectDelete(&mVideoRecLock);
     185        RT_ZERO(mVideoRecLock);
    186186    }
    187187#endif
     
    731731        maFramebuffers[uScreenId].pFramebuffer.setNull();
    732732#ifdef VBOX_WITH_VIDEOREC
    733         maFramebuffers[uScreenId].videoCapture.pSourceBitmap.setNull();
     733        maFramebuffers[uScreenId].videoRec.pSourceBitmap.setNull();
    734734#endif
    735735    }
     
    10591059
    10601060#ifdef VBOX_WITH_VIDEOREC
    1061     i_videoCaptureScreenChanged(uScreenId);
     1061    i_videoRecScreenChanged(uScreenId);
    10621062#endif
    10631063
     
    24022402 * @returns Enables video capturing features.
    24032403 */
    2404 VIDEORECFEATURES Display::i_videoCaptureGetEnabled(void)
     2404VIDEORECFEATURES Display::i_videoRecGetEnabled(void)
    24052405{
    24062406    return VideoRecGetEnabled(&mVideoRecCfg);
     
    24122412 * @returns True if video capturing is active, false if not.
    24132413 */
    2414 bool Display::i_videoCaptureStarted(void)
     2414bool Display::i_videoRecStarted(void)
    24152415{
    24162416    return VideoRecIsActive(mpVideoRecCtx);
     
    24292429 * @thread EMT
    24302430 */
    2431 int Display::i_videoCaptureConfigureAudioDriver(const Utf8Str& strDevice,
     2431int Display::i_videoRecConfigureAudioDriver(const Utf8Str& strDevice,
    24322432                                                unsigned       uInstance,
    24332433                                                unsigned       uLun,
     
    25022502 */
    25032503/* static */
    2504 DECLCALLBACK(int) Display::i_videoCaptureConfigure(Display *pThis, PVIDEORECCFG pCfg, bool fAttachDetach)
     2504DECLCALLBACK(int) Display::i_videoRecConfigure(Display *pThis, PVIDEORECCFG pCfg, bool fAttachDetach)
    25052505{
    25062506    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
     
    26642664        if (pCfg->Audio.fEnabled) /* Enable */
    26652665        {
    2666             vrc2 = pThis->i_videoCaptureConfigureAudioDriver(strAudioDev, uInstance, uLun, true /* fAttach */);
     2666            vrc2 = pThis->i_videoRecConfigureAudioDriver(strAudioDev, uInstance, uLun, true /* fAttach */);
    26672667            if (   RT_SUCCESS(vrc2)
    26682668                && fAttachDetach)
     
    26822682            if (RT_SUCCESS(vrc2))
    26832683            {
    2684                 vrc2 = pThis->i_videoCaptureConfigureAudioDriver(strAudioDev, uInstance, uLun, false /* fAttach */);
     2684                vrc2 = pThis->i_videoRecConfigureAudioDriver(strAudioDev, uInstance, uLun, false /* fAttach */);
    26852685            }
    26862686
     
    27072707
    27082708        if (fChanged && i < pThis->mcMonitors)
    2709             pThis->i_videoCaptureScreenChanged(i);
     2709            pThis->i_videoRecScreenChanged(i);
    27102710
    27112711    }
     
    27232723 * @param   uTimestampMs        Timestamp (in ms) of the audio data.
    27242724 */
    2725 int Display::i_videoCaptureSendAudio(const void *pvData, size_t cbData, uint64_t uTimestampMs)
     2725int Display::i_videoRecSendAudio(const void *pvData, size_t cbData, uint64_t uTimestampMs)
    27262726{
    27272727    if (   VideoRecIsActive(mpVideoRecCtx)
     
    27402740 * @returns IPRT status code.
    27412741 */
    2742 int Display::i_videoCaptureStart(void)
     2742int Display::i_videoRecStart(void)
    27432743{
    27442744    if (VideoRecIsActive(mpVideoRecCtx))
     
    27572757        if (RT_SUCCESS(rc2))
    27582758        {
    2759             i_videoCaptureScreenChanged(uScreen);
     2759            i_videoRecScreenChanged(uScreen);
    27602760        }
    27612761        else
    2762             LogRel(("Display::VideoCaptureStart: Failed to initialize video recording context #%u (%Rrc)\n", uScreen, rc2));
     2762            LogRel(("VideoRec: Failed to initialize video recording context #%u (%Rrc)\n", uScreen, rc2));
    27632763
    27642764        if (RT_SUCCESS(rc))
     
    27712771 * Stops video capturing. Does nothing if video capturing is not active.
    27722772 */
    2773 void Display::i_videoCaptureStop(void)
     2773void Display::i_videoRecStop(void)
    27742774{
    27752775    if (!VideoRecIsActive(mpVideoRecCtx))
     
    27812781    unsigned uScreenId;
    27822782    for (uScreenId = 0; uScreenId < mcMonitors; ++uScreenId)
    2783         i_videoCaptureScreenChanged(uScreenId);
    2784 }
    2785 
    2786 void Display::i_videoCaptureScreenChanged(unsigned uScreenId)
     2783        i_videoRecScreenChanged(uScreenId);
     2784}
     2785
     2786void Display::i_videoRecScreenChanged(unsigned uScreenId)
    27872787{
    27882788    if (   !VideoRecIsActive(mpVideoRecCtx)
     
    27932793    }
    27942794
    2795     /* Get a new source bitmap which will be used by video capture code. */
     2795    /* Get a new source bitmap which will be used by video recording code. */
    27962796    ComPtr<IDisplaySourceBitmap> pSourceBitmap;
    27972797    QuerySourceBitmap(uScreenId, pSourceBitmap.asOutParam());
    27982798
    2799     int rc2 = RTCritSectEnter(&mVideoCaptureLock);
     2799    int rc2 = RTCritSectEnter(&mVideoRecLock);
    28002800    if (RT_SUCCESS(rc2))
    28012801    {
    2802         maFramebuffers[uScreenId].videoCapture.pSourceBitmap = pSourceBitmap;
    2803 
    2804         rc2 = RTCritSectLeave(&mVideoCaptureLock);
     2802        maFramebuffers[uScreenId].videoRec.pSourceBitmap = pSourceBitmap;
     2803
     2804        rc2 = RTCritSectLeave(&mVideoRecLock);
    28052805        AssertRC(rc2);
    28062806    }
     
    35553555                if (VideoRecIsLimitReached(pDisplay->mpVideoRecCtx, uScreenId, u64Now))
    35563556                {
    3557                     pDisplay->i_videoCaptureStop();
     3557                    pDisplay->i_videoRecStop();
    35583558                    pDisplay->mParent->i_machine()->COMSETTER(VideoCaptureEnabled)(false);
    35593559                    break;
     
    35643564                {
    35653565                    ComPtr<IDisplaySourceBitmap> pSourceBitmap;
    3566                     int rc2 = RTCritSectEnter(&pDisplay->mVideoCaptureLock);
     3566                    int rc2 = RTCritSectEnter(&pDisplay->mVideoRecLock);
    35673567                    if (RT_SUCCESS(rc2))
    35683568                    {
    3569                         pSourceBitmap = pFBInfo->videoCapture.pSourceBitmap;
    3570                         RTCritSectLeave(&pDisplay->mVideoCaptureLock);
     3569                        pSourceBitmap = pFBInfo->videoRec.pSourceBitmap;
     3570                        RTCritSectLeave(&pDisplay->mVideoRecLock);
    35713571                    }
    35723572
     
    45914591        AutoWriteLock displayLock(pThis->pDisplay COMMA_LOCKVAL_SRC_POS);
    45924592#ifdef VBOX_WITH_VIDEOREC
    4593         pThis->pDisplay->i_videoCaptureStop();
     4593        pThis->pDisplay->i_videoRecStop();
    45944594#endif
    45954595#ifdef VBOX_WITH_CRHGSMI
     
    47044704
    47054705#ifdef VBOX_WITH_VIDEOREC
    4706 LogRel(("Display: Debug: Calling i_videoCaptureGetEnabled\n"));
    4707     if (pDisplay->i_videoCaptureGetEnabled())
    4708     {
    4709 LogRel(("Display: Debug: Calling i_videoCaptureStart\n"));
    4710         int rc2 = pDisplay->i_videoCaptureStart();
     4706LogRel(("Display: Debug: Calling i_videoRecGetEnabled\n"));
     4707    if (pDisplay->i_videoRecGetEnabled())
     4708    {
     4709LogRel(("Display: Debug: Calling i_videoRecStart\n"));
     4710        int rc2 = pDisplay->i_videoRecStart();
    47114711        if (RT_SUCCESS(rc2))
    47124712            fireVideoCaptureChangedEvent(pDisplay->mParent->i_getEventSource());
    47134713
    4714         /* If video capturing fails for whatever reason here, this is
     4714        /* If video recording fails for whatever reason here, this is
    47154715         * non-critical and should not be returned at this point -- otherwise
    47164716         * the display driver construction fails completely. */
Note: See TracChangeset for help on using the changeset viewer.

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