Changeset 75352 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Nov 9, 2018 10:56:10 AM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 126483
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r75345 r75352 587 587 #endif 588 588 #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); 591 591 #endif 592 592 FirmwareType_T enmFirmwareType; … … 735 735 736 736 #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; 741 741 } 742 742 #endif … … 5601 5601 #ifdef VBOX_WITH_RECORDING 5602 5602 /** 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. 5607 5607 * @param pAutoLock Pointer to auto write lock to use for attaching/detaching required driver(s) at runtime. 5608 5608 */ 5609 int Console::i_ videoRecEnable(BOOL fEnable, util::AutoWriteLock *pAutoLock)5609 int Console::i_recordingEnable(BOOL fEnable, util::AutoWriteLock *pAutoLock) 5610 5610 { 5611 5611 AssertPtrReturn(pAutoLock, VERR_INVALID_POINTER); … … 5616 5616 if (pDisplay) 5617 5617 { 5618 const bool fIsEnabled = Capture.mpVideoRecCtx5619 && Capture.mpVideoRecCtx->IsStarted();5618 const bool fIsEnabled = Recording.mpRecordCtx 5619 && Recording.mpRecordCtx->IsStarted(); 5620 5620 5621 5621 if (RT_BOOL(fEnable) != fIsEnabled) … … 5623 5623 LogRel(("Recording: %s\n", fEnable ? "Enabling" : "Disabling")); 5624 5624 5625 pDisplay->i_ videoRecInvalidate();5625 pDisplay->i_recordingInvalidate(); 5626 5626 5627 5627 if (fEnable) 5628 5628 { 5629 vrc = i_ videoRecCreate();5629 vrc = i_recordingCreate(); 5630 5630 if (RT_SUCCESS(vrc)) 5631 5631 { 5632 5632 # ifdef VBOX_WITH_AUDIO_RECORDING 5633 5633 /* 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) 5636 5636 { 5637 vrc = Capture.mAudioVideoRec->applyConfiguration(Capture.mpVideoRecCtx->GetConfig());5637 vrc = Recording.mAudioRec->applyConfiguration(Recording.mpRecordCtx->GetConfig()); 5638 5638 if (RT_SUCCESS(vrc)) 5639 vrc = Capture.mAudioVideoRec->doAttachDriverViaEmt(mpUVM, pAutoLock);5639 vrc = Recording.mAudioRec->doAttachDriverViaEmt(mpUVM, pAutoLock); 5640 5640 } 5641 5641 # endif 5642 5642 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? */ 5644 5644 { 5645 vrc = i_ videoRecStart();5645 vrc = i_recordingStart(); 5646 5646 } 5647 5647 } … … 5649 5649 else 5650 5650 { 5651 i_ videoRecStop();5651 i_recordingStop(); 5652 5652 # ifdef VBOX_WITH_AUDIO_RECORDING 5653 Capture.mAudioVideoRec->doDetachDriverViaEmt(mpUVM, pAutoLock);5653 Recording.mAudioRec->doDetachDriverViaEmt(mpUVM, pAutoLock); 5654 5654 # endif 5655 i_ videoRecDestroy();5655 i_recordingDestroy(); 5656 5656 } 5657 5657 … … 5676 5676 HRESULT rc = S_OK; 5677 5677 #ifdef VBOX_WITH_RECORDING 5678 /* Don't trigger video capturechanges if the VM isn't running. */5678 /* Don't trigger recording changes if the VM isn't running. */ 5679 5679 SafeVMPtrQuiet ptrVM(this); 5680 5680 if (ptrVM.isOk()) … … 5688 5688 AssertComRCReturnRC(rc); 5689 5689 5690 int vrc = i_ videoRecEnable(fEnabled, &alock);5690 int vrc = i_recordingEnable(fEnabled, &alock); 5691 5691 if (RT_SUCCESS(vrc)) 5692 5692 { … … 6876 6876 * @param uTimestampMs Timestamp (in ms) of audio data. 6877 6877 */ 6878 HRESULT Console::i_ videoRecSendAudio(const void *pvData, size_t cbData, uint64_t uTimestampMs)6879 { 6880 if (! Capture.mpVideoRecCtx)6878 HRESULT Console::i_recordingSendAudio(const void *pvData, size_t cbData, uint64_t uTimestampMs) 6879 { 6880 if (!Recording.mpRecordCtx) 6881 6881 return S_OK; 6882 6882 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); 6887 6887 } 6888 6888 … … 6892 6892 6893 6893 #ifdef VBOX_WITH_RECORDING 6894 int Console::i_ videoRecGetSettings(settings::RecordSettings &Settings)6894 int Console::i_recordingGetSettings(settings::RecordSettings &Settings) 6895 6895 { 6896 6896 Assert(mMachine.isNotNull()); … … 6952 6952 * @returns IPRT status code. 6953 6953 */ 6954 int Console::i_ videoRecCreate(void)6955 { 6956 AssertReturn( Capture.mpVideoRecCtx == NULL, VERR_WRONG_ORDER);6954 int Console::i_recordingCreate(void) 6955 { 6956 AssertReturn(Recording.mpRecordCtx == NULL, VERR_WRONG_ORDER); 6957 6957 6958 6958 int rc = VINF_SUCCESS; … … 6960 6960 try 6961 6961 { 6962 Capture.mpVideoRecCtx = new CaptureContext(this);6962 Recording.mpRecordCtx = new CaptureContext(this); 6963 6963 } 6964 6964 catch (std::bad_alloc &) … … 6972 6972 6973 6973 settings::RecordSettings Settings; 6974 rc = i_ videoRecGetSettings(Settings);6974 rc = i_recordingGetSettings(Settings); 6975 6975 if (RT_SUCCESS(rc)) 6976 6976 { 6977 AssertPtr( Capture.mpVideoRecCtx);6978 rc = Capture.mpVideoRecCtx->Create(Settings);6977 AssertPtr(Recording.mpRecordCtx); 6978 rc = Recording.mpRecordCtx->Create(Settings); 6979 6979 } 6980 6980 … … 6986 6986 * Destroys the recording context. 6987 6987 */ 6988 void Console::i_ videoRecDestroy(void)6989 { 6990 if ( Capture.mpVideoRecCtx)6991 { 6992 delete Capture.mpVideoRecCtx;6993 Capture.mpVideoRecCtx = NULL;6988 void Console::i_recordingDestroy(void) 6989 { 6990 if (Recording.mpRecordCtx) 6991 { 6992 delete Recording.mpRecordCtx; 6993 Recording.mpRecordCtx = NULL; 6994 6994 } 6995 6995 … … 7002 7002 * @returns IPRT status code. 7003 7003 */ 7004 int Console::i_ videoRecStart(void)7005 { 7006 AssertPtrReturn( Capture.mpVideoRecCtx, VERR_WRONG_ORDER);7007 7008 if ( Capture.mpVideoRecCtx->IsStarted())7004 int Console::i_recordingStart(void) 7005 { 7006 AssertPtrReturn(Recording.mpRecordCtx, VERR_WRONG_ORDER); 7007 7008 if (Recording.mpRecordCtx->IsStarted()) 7009 7009 return VINF_SUCCESS; 7010 7010 7011 7011 LogRel(("Recording: Starting ...\n")); 7012 7012 7013 int rc = Capture.mpVideoRecCtx->Start();7013 int rc = Recording.mpRecordCtx->Start(); 7014 7014 if (RT_SUCCESS(rc)) 7015 7015 { 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); 7018 7018 } 7019 7019 … … 7028 7028 * Stops capturing. Does nothing if capturing is not active. 7029 7029 */ 7030 int Console::i_ videoRecStop(void)7031 { 7032 if ( ! Capture.mpVideoRecCtx7033 || ! Capture.mpVideoRecCtx->IsStarted())7030 int Console::i_recordingStop(void) 7031 { 7032 if ( !Recording.mpRecordCtx 7033 || !Recording.mpRecordCtx->IsStarted()) 7034 7034 return VINF_SUCCESS; 7035 7035 7036 7036 LogRel(("Recording: Stopping ...\n")); 7037 7037 7038 int rc = Capture.mpVideoRecCtx->Stop();7038 int rc = Recording.mpRecordCtx->Stop(); 7039 7039 if (RT_SUCCESS(rc)) 7040 7040 { 7041 const size_t cStreams = Capture.mpVideoRecCtx->GetStreamCount();7041 const size_t cStreams = Recording.mpRecordCtx->GetStreamCount(); 7042 7042 for (unsigned uScreen = 0; uScreen < cStreams; ++uScreen) 7043 mDisplay->i_ videoRecScreenChanged(uScreen);7043 mDisplay->i_recordingScreenChanged(uScreen); 7044 7044 7045 7045 ComPtr<IRecordSettings> pRecordSettings; … … 10156 10156 if (fCaptureEnabled) 10157 10157 { 10158 int vrc2 = pConsole->i_ videoRecEnable(fCaptureEnabled, &alock);10158 int vrc2 = pConsole->i_recordingEnable(fCaptureEnabled, &alock); 10159 10159 if (RT_SUCCESS(vrc2)) 10160 10160 { -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r75346 r75352 2998 2998 InsertConfigString(pLunL0, "Driver", "AUDIO"); 2999 2999 AudioDriverCfg DrvCfgVideoRec(strAudioDevice, 0 /* Instance */, uAudioLUN, "AudioVideoRec"); 3000 rc = Capture.mAudioVideoRec->InitializeConfig(&DrvCfgVideoRec);3000 rc = Recording.mAudioRec->InitializeConfig(&DrvCfgVideoRec); 3001 3001 if (RT_SUCCESS(rc)) 3002 3002 uAudioLUN++; -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r75345 r75352 150 150 AssertRC(rc); 151 151 152 for (unsigned i = 0; i < RT_ELEMENTS(ma VideoRecEnabled); i++)153 ma VideoRecEnabled[i] = true;152 for (unsigned i = 0; i < RT_ELEMENTS(maRecordingEnabled); i++) 153 maRecordingEnabled[i] = true; 154 154 #endif 155 155 … … 730 730 maFramebuffers[uScreenId].pFramebuffer.setNull(); 731 731 #ifdef VBOX_WITH_RECORDING 732 maFramebuffers[uScreenId]. videoRec.pSourceBitmap.setNull();732 maFramebuffers[uScreenId].Recording.pSourceBitmap.setNull(); 733 733 #endif 734 734 } … … 1058 1058 1059 1059 #ifdef VBOX_WITH_RECORDING 1060 i_ videoRecScreenChanged(uScreenId);1060 i_recordingScreenChanged(uScreenId); 1061 1061 #endif 1062 1062 … … 2407 2407 #ifdef VBOX_WITH_RECORDING 2408 2408 /** 2409 * Invalidates the capturing configuration.2409 * Invalidates the recording configuration. 2410 2410 * 2411 2411 * @returns IPRT status code. 2412 2412 */ 2413 int Display::i_ videoRecInvalidate(void)2414 { 2415 CaptureContext *pCtx = mParent->i_ videoRecGetContext();2413 int Display::i_recordingInvalidate(void) 2414 { 2415 CaptureContext *pCtx = mParent->i_recordingGetContext(); 2416 2416 if (!pCtx || !pCtx->IsStarted()) 2417 2417 return VINF_SUCCESS; … … 2422 2422 for (unsigned uScreen = 0; uScreen < mcMonitors; uScreen++) 2423 2423 { 2424 CaptureStream *p CaptureStream = pCtx->GetStream(uScreen);2425 2426 const bool fStreamEnabled = p CaptureStream->IsReady();2427 bool fChanged = ma VideoRecEnabled[uScreen] != fStreamEnabled;2428 2429 ma VideoRecEnabled[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; 2430 2430 2431 2431 if (fChanged && uScreen < mcMonitors) 2432 i_ videoRecScreenChanged(uScreen);2432 i_recordingScreenChanged(uScreen); 2433 2433 } 2434 2434 … … 2436 2436 } 2437 2437 2438 void Display::i_ videoRecScreenChanged(unsigned uScreenId)2439 { 2440 CaptureContext *pCtx = mParent->i_ videoRecGetContext();2441 2442 if ( RT_LIKELY(!ma VideoRecEnabled[uScreenId])2438 void Display::i_recordingScreenChanged(unsigned uScreenId) 2439 { 2440 CaptureContext *pCtx = mParent->i_recordingGetContext(); 2441 2442 if ( RT_LIKELY(!maRecordingEnabled[uScreenId]) 2443 2443 || !pCtx || !pCtx->IsStarted()) 2444 2444 { … … 2454 2454 if (RT_SUCCESS(rc2)) 2455 2455 { 2456 maFramebuffers[uScreenId]. videoRec.pSourceBitmap = pSourceBitmap;2456 maFramebuffers[uScreenId].Recording.pSourceBitmap = pSourceBitmap; 2457 2457 2458 2458 rc2 = RTCritSectLeave(&mVideoRecLock); … … 3389 3389 #ifdef VBOX_WITH_RECORDING 3390 3390 AssertPtr(pDisplay->mParent); 3391 CaptureContext *pCtx = pDisplay->mParent->i_ videoRecGetContext();3391 CaptureContext *pCtx = pDisplay->mParent->i_recordingGetContext(); 3392 3392 3393 3393 if ( pCtx … … 3434 3434 for (uScreenId = 0; uScreenId < pDisplay->mcMonitors; uScreenId++) 3435 3435 { 3436 if (!pDisplay->ma VideoRecEnabled[uScreenId])3436 if (!pDisplay->maRecordingEnabled[uScreenId]) 3437 3437 continue; 3438 3438 3439 3439 if (pCtx->IsLimitReached(uScreenId, tsNowMs)) 3440 3440 { 3441 pDisplay->mParent->i_ videoRecStop();3441 pDisplay->mParent->i_recordingStop(); 3442 3442 break; 3443 3443 } … … 3450 3450 if (RT_SUCCESS(rc2)) 3451 3451 { 3452 pSourceBitmap = pFBInfo-> videoRec.pSourceBitmap;3452 pSourceBitmap = pFBInfo->Recording.pSourceBitmap; 3453 3453 RTCritSectLeave(&pDisplay->mVideoRecLock); 3454 3454 } … … 3833 3833 { 3834 3834 # ifdef VBOX_WITH_RECORDING 3835 CaptureContext *pCtx = mParent->i_ videoRecGetContext();3835 CaptureContext *pCtx = mParent->i_recordingGetContext(); 3836 3836 return ( pCtx 3837 3837 && pCtx->IsReady(uScreen, uTimestampMs)); … … 3855 3855 Assert(mfCrOglVideoRecState == CRVREC_STATE_SUBMITTED); 3856 3856 # ifdef VBOX_WITH_RECORDING 3857 CaptureContext *pCtx = mParent->i_ videoRecGetContext();3857 CaptureContext *pCtx = mParent->i_recordingGetContext(); 3858 3858 3859 3859 if ( pCtx … … 4499 4499 AutoWriteLock displayLock(pThis->pDisplay COMMA_LOCKVAL_SRC_POS); 4500 4500 #ifdef VBOX_WITH_RECORDING 4501 pThis->pDisplay->mParent->i_ videoRecStop();4501 pThis->pDisplay->mParent->i_recordingStop(); 4502 4502 #endif 4503 4503 #ifdef VBOX_WITH_CRHGSMI -
trunk/src/VBox/Main/src-client/DrvAudioRec.cpp
r75344 r75352 828 828 case AVRECCONTAINERTYPE_MAIN_CONSOLE: 829 829 { 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); 831 831 Assert(hr == S_OK); 832 832 RT_NOREF(hr); … … 1101 1101 int AudioVideoRec::configureDriver(PCFGMNODE pLunCfg) 1102 1102 { 1103 int rc = CFGMR3InsertInteger(pLunCfg, "Object", (uintptr_t)mpConsole->i_ videoRecGetAudioDrv());1103 int rc = CFGMR3InsertInteger(pLunCfg, "Object", (uintptr_t)mpConsole->i_recordingGetAudioDrv()); 1104 1104 AssertRCReturn(rc, rc); 1105 1105 rc = CFGMR3InsertInteger(pLunCfg, "ObjectConsole", (uintptr_t)mpConsole);
Note:
See TracChangeset
for help on using the changeset viewer.