VirtualBox

Changeset 75352 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Nov 9, 2018 10:56:10 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126483
Message:

Recording: More renaming for IConsole and IDisplay internals.

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

Legend:

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

    r75345 r75352  
    587587#endif
    588588#ifdef VBOX_WITH_AUDIO_RECORDING
    589         unconst(Capture.mAudioVideoRec) = new AudioVideoRec(this);
    590         AssertReturn(Capture.mAudioVideoRec, E_FAIL);
     589        unconst(Recording.mAudioRec) = new AudioVideoRec(this);
     590        AssertReturn(Recording.mAudioRec, E_FAIL);
    591591#endif
    592592        FirmwareType_T enmFirmwareType;
     
    735735
    736736#ifdef VBOX_WITH_AUDIO_RECORDING
    737     if (Capture.mAudioVideoRec)
    738     {
    739         delete Capture.mAudioVideoRec;
    740         unconst(Capture.mAudioVideoRec) = NULL;
     737    if (Recording.mAudioRec)
     738    {
     739        delete Recording.mAudioRec;
     740        unconst(Recording.mAudioRec) = NULL;
    741741    }
    742742#endif
     
    56015601#ifdef VBOX_WITH_RECORDING
    56025602/**
    5603  * Enables or disables video (audio) capturing of a VM.
    5604  *
    5605  * @returns IPRT status code. Will return VERR_NO_CHANGE if the capturing state has not been changed.
    5606  * @param   fEnable             Whether to enable or disable the capturing.
     5603 * Enables or disables recording of a VM.
     5604 *
     5605 * @returns IPRT status code. Will return VERR_NO_CHANGE if the recording state has not been changed.
     5606 * @param   fEnable             Whether to enable or disable the recording.
    56075607 * @param   pAutoLock           Pointer to auto write lock to use for attaching/detaching required driver(s) at runtime.
    56085608 */
    5609 int Console::i_videoRecEnable(BOOL fEnable, util::AutoWriteLock *pAutoLock)
     5609int Console::i_recordingEnable(BOOL fEnable, util::AutoWriteLock *pAutoLock)
    56105610{
    56115611    AssertPtrReturn(pAutoLock, VERR_INVALID_POINTER);
     
    56165616    if (pDisplay)
    56175617    {
    5618         const bool fIsEnabled =    Capture.mpVideoRecCtx
    5619                                 && Capture.mpVideoRecCtx->IsStarted();
     5618        const bool fIsEnabled =    Recording.mpRecordCtx
     5619                                && Recording.mpRecordCtx->IsStarted();
    56205620
    56215621        if (RT_BOOL(fEnable) != fIsEnabled)
     
    56235623            LogRel(("Recording: %s\n", fEnable ? "Enabling" : "Disabling"));
    56245624
    5625             pDisplay->i_videoRecInvalidate();
     5625            pDisplay->i_recordingInvalidate();
    56265626
    56275627            if (fEnable)
    56285628            {
    5629                 vrc = i_videoRecCreate();
     5629                vrc = i_recordingCreate();
    56305630                if (RT_SUCCESS(vrc))
    56315631                {
    56325632# ifdef VBOX_WITH_AUDIO_RECORDING
    56335633                    /* Attach the video recording audio driver if required. */
    5634                     if (   Capture.mpVideoRecCtx->IsFeatureEnabled(RecordFeature_Audio)
    5635                         && Capture.mAudioVideoRec)
     5634                    if (   Recording.mpRecordCtx->IsFeatureEnabled(RecordFeature_Audio)
     5635                        && Recording.mAudioRec)
    56365636                    {
    5637                         vrc = Capture.mAudioVideoRec->applyConfiguration(Capture.mpVideoRecCtx->GetConfig());
     5637                        vrc = Recording.mAudioRec->applyConfiguration(Recording.mpRecordCtx->GetConfig());
    56385638                        if (RT_SUCCESS(vrc))
    5639                             vrc = Capture.mAudioVideoRec->doAttachDriverViaEmt(mpUVM, pAutoLock);
     5639                            vrc = Recording.mAudioRec->doAttachDriverViaEmt(mpUVM, pAutoLock);
    56405640                    }
    56415641# endif
    56425642                    if (   RT_SUCCESS(vrc)
    5643                         && Capture.mpVideoRecCtx->IsReady()) /* Any video recording (audio and/or video) feature enabled? */
     5643                        && Recording.mpRecordCtx->IsReady()) /* Any video recording (audio and/or video) feature enabled? */
    56445644                    {
    5645                         vrc = i_videoRecStart();
     5645                        vrc = i_recordingStart();
    56465646                    }
    56475647                }
     
    56495649            else
    56505650            {
    5651                 i_videoRecStop();
     5651                i_recordingStop();
    56525652# ifdef VBOX_WITH_AUDIO_RECORDING
    5653                 Capture.mAudioVideoRec->doDetachDriverViaEmt(mpUVM, pAutoLock);
     5653                Recording.mAudioRec->doDetachDriverViaEmt(mpUVM, pAutoLock);
    56545654# endif
    5655                 i_videoRecDestroy();
     5655                i_recordingDestroy();
    56565656            }
    56575657
     
    56765676    HRESULT rc = S_OK;
    56775677#ifdef VBOX_WITH_RECORDING
    5678     /* Don't trigger video capture changes if the VM isn't running. */
     5678    /* Don't trigger recording changes if the VM isn't running. */
    56795679    SafeVMPtrQuiet ptrVM(this);
    56805680    if (ptrVM.isOk())
     
    56885688        AssertComRCReturnRC(rc);
    56895689
    5690         int vrc = i_videoRecEnable(fEnabled, &alock);
     5690        int vrc = i_recordingEnable(fEnabled, &alock);
    56915691        if (RT_SUCCESS(vrc))
    56925692        {
     
    68766876 * @param   uTimestampMs        Timestamp (in ms) of audio data.
    68776877 */
    6878 HRESULT Console::i_videoRecSendAudio(const void *pvData, size_t cbData, uint64_t uTimestampMs)
    6879 {
    6880     if (!Capture.mpVideoRecCtx)
     6878HRESULT Console::i_recordingSendAudio(const void *pvData, size_t cbData, uint64_t uTimestampMs)
     6879{
     6880    if (!Recording.mpRecordCtx)
    68816881        return S_OK;
    68826882
    6883     if (   Capture.mpVideoRecCtx->IsStarted()
    6884         && Capture.mpVideoRecCtx->IsFeatureEnabled(RecordFeature_Audio))
    6885     {
    6886         return Capture.mpVideoRecCtx->SendAudioFrame(pvData, cbData, uTimestampMs);
     6883    if (   Recording.mpRecordCtx->IsStarted()
     6884        && Recording.mpRecordCtx->IsFeatureEnabled(RecordFeature_Audio))
     6885    {
     6886        return Recording.mpRecordCtx->SendAudioFrame(pvData, cbData, uTimestampMs);
    68876887    }
    68886888
     
    68926892
    68936893#ifdef VBOX_WITH_RECORDING
    6894 int Console::i_videoRecGetSettings(settings::RecordSettings &Settings)
     6894int Console::i_recordingGetSettings(settings::RecordSettings &Settings)
    68956895{
    68966896    Assert(mMachine.isNotNull());
     
    69526952 * @returns IPRT status code.
    69536953 */
    6954 int Console::i_videoRecCreate(void)
    6955 {
    6956     AssertReturn(Capture.mpVideoRecCtx == NULL, VERR_WRONG_ORDER);
     6954int Console::i_recordingCreate(void)
     6955{
     6956    AssertReturn(Recording.mpRecordCtx == NULL, VERR_WRONG_ORDER);
    69576957
    69586958    int rc = VINF_SUCCESS;
     
    69606960    try
    69616961    {
    6962         Capture.mpVideoRecCtx = new CaptureContext(this);
     6962        Recording.mpRecordCtx = new CaptureContext(this);
    69636963    }
    69646964    catch (std::bad_alloc &)
     
    69726972
    69736973    settings::RecordSettings Settings;
    6974     rc = i_videoRecGetSettings(Settings);
     6974    rc = i_recordingGetSettings(Settings);
    69756975    if (RT_SUCCESS(rc))
    69766976    {
    6977         AssertPtr(Capture.mpVideoRecCtx);
    6978         rc = Capture.mpVideoRecCtx->Create(Settings);
     6977        AssertPtr(Recording.mpRecordCtx);
     6978        rc = Recording.mpRecordCtx->Create(Settings);
    69796979    }
    69806980
     
    69866986 * Destroys the recording context.
    69876987 */
    6988 void Console::i_videoRecDestroy(void)
    6989 {
    6990     if (Capture.mpVideoRecCtx)
    6991     {
    6992         delete Capture.mpVideoRecCtx;
    6993         Capture.mpVideoRecCtx = NULL;
     6988void Console::i_recordingDestroy(void)
     6989{
     6990    if (Recording.mpRecordCtx)
     6991    {
     6992        delete Recording.mpRecordCtx;
     6993        Recording.mpRecordCtx = NULL;
    69946994    }
    69956995
     
    70027002 * @returns IPRT status code.
    70037003 */
    7004 int Console::i_videoRecStart(void)
    7005 {
    7006     AssertPtrReturn(Capture.mpVideoRecCtx, VERR_WRONG_ORDER);
    7007 
    7008     if (Capture.mpVideoRecCtx->IsStarted())
     7004int Console::i_recordingStart(void)
     7005{
     7006    AssertPtrReturn(Recording.mpRecordCtx, VERR_WRONG_ORDER);
     7007
     7008    if (Recording.mpRecordCtx->IsStarted())
    70097009        return VINF_SUCCESS;
    70107010
    70117011    LogRel(("Recording: Starting ...\n"));
    70127012
    7013     int rc = Capture.mpVideoRecCtx->Start();
     7013    int rc = Recording.mpRecordCtx->Start();
    70147014    if (RT_SUCCESS(rc))
    70157015    {
    7016         for (unsigned uScreen = 0; uScreen < Capture.mpVideoRecCtx->GetStreamCount(); uScreen++)
    7017             mDisplay->i_videoRecScreenChanged(uScreen);
     7016        for (unsigned uScreen = 0; uScreen < Recording.mpRecordCtx->GetStreamCount(); uScreen++)
     7017            mDisplay->i_recordingScreenChanged(uScreen);
    70187018    }
    70197019
     
    70287028 * Stops capturing. Does nothing if capturing is not active.
    70297029 */
    7030 int Console::i_videoRecStop(void)
    7031 {
    7032     if (   !Capture.mpVideoRecCtx
    7033         || !Capture.mpVideoRecCtx->IsStarted())
     7030int Console::i_recordingStop(void)
     7031{
     7032    if (   !Recording.mpRecordCtx
     7033        || !Recording.mpRecordCtx->IsStarted())
    70347034        return VINF_SUCCESS;
    70357035
    70367036    LogRel(("Recording: Stopping ...\n"));
    70377037
    7038     int rc = Capture.mpVideoRecCtx->Stop();
     7038    int rc = Recording.mpRecordCtx->Stop();
    70397039    if (RT_SUCCESS(rc))
    70407040    {
    7041         const size_t cStreams = Capture.mpVideoRecCtx->GetStreamCount();
     7041        const size_t cStreams = Recording.mpRecordCtx->GetStreamCount();
    70427042        for (unsigned uScreen = 0; uScreen < cStreams; ++uScreen)
    7043             mDisplay->i_videoRecScreenChanged(uScreen);
     7043            mDisplay->i_recordingScreenChanged(uScreen);
    70447044
    70457045        ComPtr<IRecordSettings> pRecordSettings;
     
    1015610156        if (fCaptureEnabled)
    1015710157        {
    10158             int vrc2 = pConsole->i_videoRecEnable(fCaptureEnabled, &alock);
     10158            int vrc2 = pConsole->i_recordingEnable(fCaptureEnabled, &alock);
    1015910159            if (RT_SUCCESS(vrc2))
    1016010160            {
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r75346 r75352  
    29982998                InsertConfigString(pLunL0, "Driver", "AUDIO");
    29992999            AudioDriverCfg DrvCfgVideoRec(strAudioDevice, 0 /* Instance */, uAudioLUN, "AudioVideoRec");
    3000             rc = Capture.mAudioVideoRec->InitializeConfig(&DrvCfgVideoRec);
     3000            rc = Recording.mAudioRec->InitializeConfig(&DrvCfgVideoRec);
    30013001            if (RT_SUCCESS(rc))
    30023002                uAudioLUN++;
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r75345 r75352  
    150150    AssertRC(rc);
    151151
    152     for (unsigned i = 0; i < RT_ELEMENTS(maVideoRecEnabled); i++)
    153         maVideoRecEnabled[i] = true;
     152    for (unsigned i = 0; i < RT_ELEMENTS(maRecordingEnabled); i++)
     153        maRecordingEnabled[i] = true;
    154154#endif
    155155
     
    730730        maFramebuffers[uScreenId].pFramebuffer.setNull();
    731731#ifdef VBOX_WITH_RECORDING
    732         maFramebuffers[uScreenId].videoRec.pSourceBitmap.setNull();
     732        maFramebuffers[uScreenId].Recording.pSourceBitmap.setNull();
    733733#endif
    734734    }
     
    10581058
    10591059#ifdef VBOX_WITH_RECORDING
    1060     i_videoRecScreenChanged(uScreenId);
     1060    i_recordingScreenChanged(uScreenId);
    10611061#endif
    10621062
     
    24072407#ifdef VBOX_WITH_RECORDING
    24082408/**
    2409  * Invalidates the capturing configuration.
     2409 * Invalidates the recording configuration.
    24102410 *
    24112411 * @returns IPRT status code.
    24122412 */
    2413 int Display::i_videoRecInvalidate(void)
    2414 {
    2415     CaptureContext *pCtx = mParent->i_videoRecGetContext();
     2413int Display::i_recordingInvalidate(void)
     2414{
     2415    CaptureContext *pCtx = mParent->i_recordingGetContext();
    24162416    if (!pCtx || !pCtx->IsStarted())
    24172417        return VINF_SUCCESS;
     
    24222422    for (unsigned uScreen = 0; uScreen < mcMonitors; uScreen++)
    24232423    {
    2424         CaptureStream *pCaptureStream = pCtx->GetStream(uScreen);
    2425 
    2426         const bool fStreamEnabled = pCaptureStream->IsReady();
    2427               bool fChanged       = maVideoRecEnabled[uScreen] != fStreamEnabled;
    2428 
    2429         maVideoRecEnabled[uScreen] = fStreamEnabled;
     2424        CaptureStream *pRecordingStream = pCtx->GetStream(uScreen);
     2425
     2426        const bool fStreamEnabled = pRecordingStream->IsReady();
     2427              bool fChanged       = maRecordingEnabled[uScreen] != fStreamEnabled;
     2428
     2429        maRecordingEnabled[uScreen] = fStreamEnabled;
    24302430
    24312431        if (fChanged && uScreen < mcMonitors)
    2432             i_videoRecScreenChanged(uScreen);
     2432            i_recordingScreenChanged(uScreen);
    24332433    }
    24342434
     
    24362436}
    24372437
    2438 void Display::i_videoRecScreenChanged(unsigned uScreenId)
    2439 {
    2440     CaptureContext *pCtx = mParent->i_videoRecGetContext();
    2441 
    2442     if (   RT_LIKELY(!maVideoRecEnabled[uScreenId])
     2438void Display::i_recordingScreenChanged(unsigned uScreenId)
     2439{
     2440    CaptureContext *pCtx = mParent->i_recordingGetContext();
     2441
     2442    if (   RT_LIKELY(!maRecordingEnabled[uScreenId])
    24432443        || !pCtx || !pCtx->IsStarted())
    24442444    {
     
    24542454    if (RT_SUCCESS(rc2))
    24552455    {
    2456         maFramebuffers[uScreenId].videoRec.pSourceBitmap = pSourceBitmap;
     2456        maFramebuffers[uScreenId].Recording.pSourceBitmap = pSourceBitmap;
    24572457
    24582458        rc2 = RTCritSectLeave(&mVideoRecLock);
     
    33893389#ifdef VBOX_WITH_RECORDING
    33903390    AssertPtr(pDisplay->mParent);
    3391     CaptureContext *pCtx = pDisplay->mParent->i_videoRecGetContext();
     3391    CaptureContext *pCtx = pDisplay->mParent->i_recordingGetContext();
    33923392
    33933393    if (   pCtx
     
    34343434            for (uScreenId = 0; uScreenId < pDisplay->mcMonitors; uScreenId++)
    34353435            {
    3436                 if (!pDisplay->maVideoRecEnabled[uScreenId])
     3436                if (!pDisplay->maRecordingEnabled[uScreenId])
    34373437                    continue;
    34383438
    34393439                if (pCtx->IsLimitReached(uScreenId, tsNowMs))
    34403440                {
    3441                     pDisplay->mParent->i_videoRecStop();
     3441                    pDisplay->mParent->i_recordingStop();
    34423442                    break;
    34433443                }
     
    34503450                    if (RT_SUCCESS(rc2))
    34513451                    {
    3452                         pSourceBitmap = pFBInfo->videoRec.pSourceBitmap;
     3452                        pSourceBitmap = pFBInfo->Recording.pSourceBitmap;
    34533453                        RTCritSectLeave(&pDisplay->mVideoRecLock);
    34543454                    }
     
    38333833{
    38343834# ifdef VBOX_WITH_RECORDING
    3835     CaptureContext *pCtx = mParent->i_videoRecGetContext();
     3835    CaptureContext *pCtx = mParent->i_recordingGetContext();
    38363836    return (      pCtx
    38373837               && pCtx->IsReady(uScreen, uTimestampMs));
     
    38553855    Assert(mfCrOglVideoRecState == CRVREC_STATE_SUBMITTED);
    38563856# ifdef VBOX_WITH_RECORDING
    3857     CaptureContext *pCtx = mParent->i_videoRecGetContext();
     3857    CaptureContext *pCtx = mParent->i_recordingGetContext();
    38583858
    38593859    if (   pCtx
     
    44994499        AutoWriteLock displayLock(pThis->pDisplay COMMA_LOCKVAL_SRC_POS);
    45004500#ifdef VBOX_WITH_RECORDING
    4501         pThis->pDisplay->mParent->i_videoRecStop();
     4501        pThis->pDisplay->mParent->i_recordingStop();
    45024502#endif
    45034503#ifdef VBOX_WITH_CRHGSMI
  • trunk/src/VBox/Main/src-client/DrvAudioRec.cpp

    r75344 r75352  
    828828                case AVRECCONTAINERTYPE_MAIN_CONSOLE:
    829829                {
    830                     HRESULT hr = pSink->Con.Main.pConsole->i_videoRecSendAudio(pStreamAV->pvDstBuf, cbDst, uPTSMs);
     830                    HRESULT hr = pSink->Con.Main.pConsole->i_recordingSendAudio(pStreamAV->pvDstBuf, cbDst, uPTSMs);
    831831                    Assert(hr == S_OK);
    832832                    RT_NOREF(hr);
     
    11011101int AudioVideoRec::configureDriver(PCFGMNODE pLunCfg)
    11021102{
    1103     int rc = CFGMR3InsertInteger(pLunCfg, "Object",    (uintptr_t)mpConsole->i_videoRecGetAudioDrv());
     1103    int rc = CFGMR3InsertInteger(pLunCfg, "Object",    (uintptr_t)mpConsole->i_recordingGetAudioDrv());
    11041104    AssertRCReturn(rc, rc);
    11051105    rc = CFGMR3InsertInteger(pLunCfg, "ObjectConsole", (uintptr_t)mpConsole);
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