Changeset 75341 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Nov 9, 2018 8:37:28 AM (6 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r75313 r75341 5632 5632 # ifdef VBOX_WITH_AUDIO_VIDEOREC 5633 5633 /* Attach the video recording audio driver if required. */ 5634 if ( Capture.mpVideoRecCtx->IsFeatureEnabled( CaptureFeature_Audio)5634 if ( Capture.mpVideoRecCtx->IsFeatureEnabled(RecordFeature_Audio) 5635 5635 && Capture.mAudioVideoRec) 5636 5636 { … … 5667 5667 #endif /* VBOX_WITH_VIDEOREC */ 5668 5668 5669 HRESULT Console::i_on CaptureChange()5669 HRESULT Console::i_onRecordChange() 5670 5670 { 5671 5671 AutoCaller autoCaller(this); … … 5680 5680 if (ptrVM.isOk()) 5681 5681 { 5682 ComPtr<I CaptureSettings> CaptureSettings;5683 rc = mMachine->COMGETTER( CaptureSettings)(CaptureSettings.asOutParam());5682 ComPtr<IRecordSettings> RecordSettings; 5683 rc = mMachine->COMGETTER(RecordSettings)(RecordSettings.asOutParam()); 5684 5684 AssertComRCReturnRC(rc); 5685 5685 5686 5686 BOOL fEnabled; 5687 rc = CaptureSettings->COMGETTER(Enabled)(&fEnabled);5687 rc = RecordSettings->COMGETTER(Enabled)(&fEnabled); 5688 5688 AssertComRCReturnRC(rc); 5689 5689 … … 5692 5692 { 5693 5693 alock.release(); 5694 fire CaptureChangedEvent(mEventSource);5694 fireRecordChangedEvent(mEventSource); 5695 5695 } 5696 5696 … … 6882 6882 6883 6883 if ( Capture.mpVideoRecCtx->IsStarted() 6884 && Capture.mpVideoRecCtx->IsFeatureEnabled( CaptureFeature_Audio))6884 && Capture.mpVideoRecCtx->IsFeatureEnabled(RecordFeature_Audio)) 6885 6885 { 6886 6886 return Capture.mpVideoRecCtx->SendAudioFrame(pvData, cbData, uTimestampMs); … … 6892 6892 6893 6893 #ifdef VBOX_WITH_VIDEOREC 6894 int Console::i_videoRecGetSettings(settings:: CaptureSettings &Settings)6894 int Console::i_videoRecGetSettings(settings::RecordSettings &Settings) 6895 6895 { 6896 6896 Assert(mMachine.isNotNull()); … … 6898 6898 Settings.applyDefaults(); 6899 6899 6900 ComPtr<I CaptureSettings> pCaptureSettings;6901 HRESULT hrc = mMachine->COMGETTER( CaptureSettings)(pCaptureSettings.asOutParam());6900 ComPtr<IRecordSettings> pRecordSettings; 6901 HRESULT hrc = mMachine->COMGETTER(RecordSettings)(pRecordSettings.asOutParam()); 6902 6902 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6903 6903 6904 6904 BOOL fTemp; 6905 hrc = p CaptureSettings->COMGETTER(Enabled)(&fTemp);6905 hrc = pRecordSettings->COMGETTER(Enabled)(&fTemp); 6906 6906 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6907 6907 Settings.fEnabled = RT_BOOL(fTemp); 6908 6908 6909 SafeIfaceArray<I CaptureScreenSettings> paCaptureScreens;6910 hrc = p CaptureSettings->COMGETTER(Screens)(ComSafeArrayAsOutParam(paCaptureScreens));6909 SafeIfaceArray<IRecordScreenSettings> paCaptureScreens; 6910 hrc = pRecordSettings->COMGETTER(Screens)(ComSafeArrayAsOutParam(paCaptureScreens)); 6911 6911 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6912 6912 6913 6913 for (unsigned long i = 0; i < (unsigned long)paCaptureScreens.size(); ++i) 6914 6914 { 6915 settings:: CaptureScreenSettings CaptureScreenSettings;6916 ComPtr<I CaptureScreenSettings> pCaptureScreenSettings = paCaptureScreens[i];6917 6918 hrc = p CaptureScreenSettings->COMGETTER(Enabled)(&fTemp);6915 settings::RecordScreenSettings RecordScreenSettings; 6916 ComPtr<IRecordScreenSettings> pRecordScreenSettings = paCaptureScreens[i]; 6917 6918 hrc = pRecordScreenSettings->COMGETTER(Enabled)(&fTemp); 6919 6919 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6920 CaptureScreenSettings.fEnabled = RT_BOOL(fTemp);6921 hrc = p CaptureScreenSettings->COMGETTER(MaxTime)((ULONG *)&CaptureScreenSettings.ulMaxTimeS);6920 RecordScreenSettings.fEnabled = RT_BOOL(fTemp); 6921 hrc = pRecordScreenSettings->COMGETTER(MaxTime)((ULONG *)&RecordScreenSettings.ulMaxTimeS); 6922 6922 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6923 hrc = p CaptureScreenSettings->COMGETTER(MaxFileSize)((ULONG *)&CaptureScreenSettings.File.ulMaxSizeMB);6923 hrc = pRecordScreenSettings->COMGETTER(MaxFileSize)((ULONG *)&RecordScreenSettings.File.ulMaxSizeMB); 6924 6924 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6925 6925 Bstr bstrTemp; 6926 hrc = p CaptureScreenSettings->COMGETTER(FileName)(bstrTemp.asOutParam());6926 hrc = pRecordScreenSettings->COMGETTER(FileName)(bstrTemp.asOutParam()); 6927 6927 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6928 CaptureScreenSettings.File.strName = bstrTemp;6929 hrc = p CaptureScreenSettings->COMGETTER(Options)(bstrTemp.asOutParam());6928 RecordScreenSettings.File.strName = bstrTemp; 6929 hrc = pRecordScreenSettings->COMGETTER(Options)(bstrTemp.asOutParam()); 6930 6930 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6931 CaptureScreenSettings.strOptions = bstrTemp;6932 hrc = p CaptureScreenSettings->COMGETTER(VideoWidth)((ULONG *)&CaptureScreenSettings.Video.ulWidth);6931 RecordScreenSettings.strOptions = bstrTemp; 6932 hrc = pRecordScreenSettings->COMGETTER(VideoWidth)((ULONG *)&RecordScreenSettings.Video.ulWidth); 6933 6933 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6934 hrc = p CaptureScreenSettings->COMGETTER(VideoHeight)((ULONG *)&CaptureScreenSettings.Video.ulHeight);6934 hrc = pRecordScreenSettings->COMGETTER(VideoHeight)((ULONG *)&RecordScreenSettings.Video.ulHeight); 6935 6935 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6936 hrc = p CaptureScreenSettings->COMGETTER(VideoRate)((ULONG *)&CaptureScreenSettings.Video.ulRate);6936 hrc = pRecordScreenSettings->COMGETTER(VideoRate)((ULONG *)&RecordScreenSettings.Video.ulRate); 6937 6937 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6938 hrc = p CaptureScreenSettings->COMGETTER(VideoFPS)((ULONG *)&CaptureScreenSettings.Video.ulFPS);6938 hrc = pRecordScreenSettings->COMGETTER(VideoFPS)((ULONG *)&RecordScreenSettings.Video.ulFPS); 6939 6939 AssertComRCReturn(hrc, VERR_INVALID_PARAMETER); 6940 6940 6941 Settings.mapScreens[i] = CaptureScreenSettings;6941 Settings.mapScreens[i] = RecordScreenSettings; 6942 6942 } 6943 6943 … … 6971 6971 } 6972 6972 6973 settings:: CaptureSettings Settings;6973 settings::RecordSettings Settings; 6974 6974 rc = i_videoRecGetSettings(Settings); 6975 6975 if (RT_SUCCESS(rc)) … … 7043 7043 mDisplay->i_videoRecScreenChanged(uScreen); 7044 7044 7045 ComPtr<I CaptureSettings> pCaptureSettings;7046 HRESULT hrc = mMachine->COMGETTER( CaptureSettings)(pCaptureSettings.asOutParam());7045 ComPtr<IRecordSettings> pRecordSettings; 7046 HRESULT hrc = mMachine->COMGETTER(RecordSettings)(pRecordSettings.asOutParam()); 7047 7047 ComAssertComRC(hrc); 7048 hrc = p CaptureSettings->COMSETTER(Enabled)(false);7048 hrc = pRecordSettings->COMSETTER(Enabled)(false); 7049 7049 ComAssertComRC(hrc); 7050 7050 … … 10146 10146 10147 10147 #ifdef VBOX_WITH_VIDEOREC 10148 ComPtr<I CaptureSettings> CaptureSettings;10149 rc = pConsole->mMachine->COMGETTER( CaptureSettings)(CaptureSettings.asOutParam());10148 ComPtr<IRecordSettings> RecordSettings; 10149 rc = pConsole->mMachine->COMGETTER(RecordSettings)(RecordSettings.asOutParam()); 10150 10150 AssertComRCReturnVoid(rc); 10151 10151 10152 10152 BOOL fCaptureEnabled; 10153 rc = CaptureSettings->COMGETTER(Enabled)(&fCaptureEnabled);10153 rc = RecordSettings->COMGETTER(Enabled)(&fCaptureEnabled); 10154 10154 AssertComRCReturnVoid(rc); 10155 10155 … … 10159 10159 if (RT_SUCCESS(vrc2)) 10160 10160 { 10161 fire CaptureChangedEvent(pConsole->mEventSource);10161 fireRecordChangedEvent(pConsole->mEventSource); 10162 10162 } 10163 10163 else -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r75251 r75341 3393 3393 if ( pCtx 3394 3394 && pCtx->IsStarted() 3395 && pCtx->IsFeatureEnabled( CaptureFeature_Video))3395 && pCtx->IsFeatureEnabled(RecordFeature_Video)) 3396 3396 { 3397 3397 do { … … 3859 3859 if ( pCtx 3860 3860 && pCtx->IsStarted() 3861 && pCtx->IsFeatureEnabled( CaptureFeature_Video))3861 && pCtx->IsFeatureEnabled(RecordFeature_Video)) 3862 3862 { 3863 3863 int rc2 = pCtx->SendVideoFrame(uScreen, x, y, -
trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp
r75254 r75341 1088 1088 * @param Settings Capturing configuration to apply. 1089 1089 */ 1090 int AudioVideoRec::applyConfiguration(const settings:: CaptureSettings &Settings)1090 int AudioVideoRec::applyConfiguration(const settings::RecordSettings &Settings) 1091 1091 { 1092 1092 /** @todo Do some validation here. */ … … 1108 1108 /** @todo For now we're using the configuration of the first screen here audio-wise. */ 1109 1109 Assert(mVideoRecCfg.mapScreens.size() >= 1); 1110 const settings:: CaptureScreenSettings &Screen0Settings = mVideoRecCfg.mapScreens[0];1110 const settings::RecordScreenSettings &Screen0Settings = mVideoRecCfg.mapScreens[0]; 1111 1111 1112 1112 rc = CFGMR3InsertInteger(pLunCfg, "ContainerType", (uint64_t)Screen0Settings.enmDest); 1113 1113 AssertRCReturn(rc, rc); 1114 if (Screen0Settings.enmDest == CaptureDestination_File)1114 if (Screen0Settings.enmDest == RecordDestination_File) 1115 1115 { 1116 1116 rc = CFGMR3InsertString(pLunCfg, "ContainerFileName", Utf8Str(Screen0Settings.File.strName).c_str()); -
trunk/src/VBox/Main/src-client/SessionImpl.cpp
r75251 r75341 725 725 } 726 726 727 HRESULT Session::on CaptureChange()728 { 729 LogFlowThisFunc(("\n")); 730 731 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 732 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 733 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 734 #ifndef VBOX_COM_INPROC_API_CLIENT 735 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 736 737 return mConsole->i_on CaptureChange();727 HRESULT Session::onRecordChange() 728 { 729 LogFlowThisFunc(("\n")); 730 731 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 732 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 733 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 734 #ifndef VBOX_COM_INPROC_API_CLIENT 735 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 736 737 return mConsole->i_onRecordChange(); 738 738 #else 739 739 return S_OK; -
trunk/src/VBox/Main/src-client/VideoRec.cpp
r75313 r75341 94 94 , enmState(VIDEORECSTS_UNINITIALIZED) { } 95 95 96 CaptureContext::CaptureContext(Console *a_pConsole, const settings:: CaptureSettings &a_Settings)96 CaptureContext::CaptureContext(Console *a_pConsole, const settings::RecordSettings &a_Settings) 97 97 : pConsole(a_pConsole) 98 98 , enmState(VIDEORECSTS_UNINITIALIZED) … … 177 177 * @param a_Settings Capture settings to use for context creation. 178 178 */ 179 int CaptureContext::createInternal(const settings:: CaptureSettings &a_Settings)179 int CaptureContext::createInternal(const settings::RecordSettings &a_Settings) 180 180 { 181 181 int rc = RTCritSectInit(&this->CritSect); … … 183 183 return rc; 184 184 185 settings:: CaptureScreenMap::const_iterator itScreen = a_Settings.mapScreens.begin();185 settings::RecordScreenMap::const_iterator itScreen = a_Settings.mapScreens.begin(); 186 186 while (itScreen != a_Settings.mapScreens.end()) 187 187 { … … 318 318 } 319 319 320 const settings:: CaptureSettings &CaptureContext::GetConfig(void) const320 const settings::RecordSettings &CaptureContext::GetConfig(void) const 321 321 { 322 322 return this->Settings; … … 355 355 } 356 356 357 int CaptureContext::Create(const settings:: CaptureSettings &a_Settings)357 int CaptureContext::Create(const settings::RecordSettings &a_Settings) 358 358 { 359 359 return createInternal(a_Settings); … … 375 375 } 376 376 377 bool CaptureContext::IsFeatureEnabled( CaptureFeature_T enmFeature) const377 bool CaptureContext::IsFeatureEnabled(RecordFeature_T enmFeature) const 378 378 { 379 379 VideoRecStreams::const_iterator itStream = this->vecStreams.begin(); -
trunk/src/VBox/Main/src-client/VideoRecStream.cpp
r75313 r75341 51 51 } 52 52 53 CaptureStream::CaptureStream(CaptureContext *a_pCtx, uint32_t uScreen, const settings:: CaptureScreenSettings &Settings)53 CaptureStream::CaptureStream(CaptureContext *a_pCtx, uint32_t uScreen, const settings::RecordScreenSettings &Settings) 54 54 : enmState(RECORDINGSTREAMSTATE_UNINITIALIZED) 55 55 , tsStartMs(0) … … 74 74 * @returns IPRT status code. 75 75 */ 76 int CaptureStream::open(const settings:: CaptureScreenSettings &Settings)76 int CaptureStream::open(const settings::RecordScreenSettings &Settings) 77 77 { 78 78 /* Sanity. */ 79 Assert(Settings.enmDest != CaptureDestination_None);79 Assert(Settings.enmDest != RecordDestination_None); 80 80 81 81 int rc; … … 83 83 switch (Settings.enmDest) 84 84 { 85 case CaptureDestination_File:85 case RecordDestination_File: 86 86 { 87 87 Assert(Settings.File.strName.isNotEmpty()); … … 209 209 if (value.compare("false", Utf8Str::CaseInsensitive) == 0) 210 210 { 211 this->ScreenSettings.featureMap[ CaptureFeature_Video] = false;211 this->ScreenSettings.featureMap[RecordFeature_Video] = false; 212 212 #ifdef VBOX_WITH_AUDIO_VIDEOREC 213 213 LogRel(("VideoRec: Only audio will be recorded\n")); … … 220 220 if (value.compare("true", Utf8Str::CaseInsensitive) == 0) 221 221 { 222 this->ScreenSettings.featureMap[ CaptureFeature_Audio] = true;222 this->ScreenSettings.featureMap[RecordFeature_Audio] = true; 223 223 } 224 224 else … … 255 255 } 256 256 257 const settings:: CaptureScreenSettings &CaptureStream::GetConfig(void) const257 const settings::RecordScreenSettings &CaptureStream::GetConfig(void) const 258 258 { 259 259 return this->ScreenSettings; … … 277 277 } 278 278 279 if (this->ScreenSettings.enmDest == CaptureDestination_File)279 if (this->ScreenSettings.enmDest == RecordDestination_File) 280 280 { 281 281 … … 661 661 * @param Settings Capturing configuration to use for initialization. 662 662 */ 663 int CaptureStream::Init(CaptureContext *a_pCtx, uint32_t uScreen, const settings:: CaptureScreenSettings &Settings)663 int CaptureStream::Init(CaptureContext *a_pCtx, uint32_t uScreen, const settings::RecordScreenSettings &Settings) 664 664 { 665 665 return initInternal(a_pCtx, uScreen, Settings); … … 674 674 * @param Settings Capturing configuration to use for initialization. 675 675 */ 676 int CaptureStream::initInternal(CaptureContext *a_pCtx, uint32_t uScreen, const settings:: CaptureScreenSettings &Settings)676 int CaptureStream::initInternal(CaptureContext *a_pCtx, uint32_t uScreen, const settings::RecordScreenSettings &Settings) 677 677 { 678 678 int rc = parseOptionsString(Settings.strOptions); … … 688 688 return rc; 689 689 690 const bool fVideoEnabled = Settings.isFeatureEnabled( CaptureFeature_Video);691 const bool fAudioEnabled = Settings.isFeatureEnabled( CaptureFeature_Audio);690 const bool fVideoEnabled = Settings.isFeatureEnabled(RecordFeature_Video); 691 const bool fAudioEnabled = Settings.isFeatureEnabled(RecordFeature_Audio); 692 692 693 693 if (fVideoEnabled) … … 699 699 switch (this->ScreenSettings.enmDest) 700 700 { 701 case CaptureDestination_File:701 case RecordDestination_File: 702 702 { 703 703 const char *pszFile = this->ScreenSettings.File.strName.c_str(); … … 706 706 rc = File.pWEBM->OpenEx(pszFile, &this->File.hFile, 707 707 #ifdef VBOX_WITH_AUDIO_VIDEOREC 708 Settings.isFeatureEnabled( CaptureFeature_Audio)708 Settings.isFeatureEnabled(RecordFeature_Audio) 709 709 ? WebMWriter::AudioCodec_Opus : WebMWriter::AudioCodec_None, 710 710 #else 711 711 WebMWriter::AudioCodec_None, 712 712 #endif 713 Settings.isFeatureEnabled( CaptureFeature_Video)713 Settings.isFeatureEnabled(RecordFeature_Video) 714 714 ? WebMWriter::VideoCodec_VP8 : WebMWriter::VideoCodec_None); 715 715 if (RT_FAILURE(rc)) … … 814 814 switch (this->ScreenSettings.enmDest) 815 815 { 816 case CaptureDestination_File:816 case RecordDestination_File: 817 817 { 818 818 if (this->File.pWEBM) … … 839 839 switch (this->ScreenSettings.enmDest) 840 840 { 841 case CaptureDestination_File:841 case RecordDestination_File: 842 842 { 843 843 if (RTFileIsValid(this->File.hFile)) … … 891 891 return rc; 892 892 893 if (this->ScreenSettings.isFeatureEnabled( CaptureFeature_Video))893 if (this->ScreenSettings.isFeatureEnabled(RecordFeature_Video)) 894 894 { 895 895 int rc2 = unitVideo(); … … 1025 1025 { 1026 1026 #ifdef VBOX_WITH_AUDIO_VIDEOREC 1027 if (this->ScreenSettings.isFeatureEnabled( CaptureFeature_Audio))1027 if (this->ScreenSettings.isFeatureEnabled(RecordFeature_Audio)) 1028 1028 { 1029 1029 /* Sanity. */
Note:
See TracChangeset
for help on using the changeset viewer.