Changeset 75253 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 5, 2018 6:25:50 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp
r75252 r75253 484 484 * @param ppszFileName may be updated with a desired file name 485 485 */ 486 static void parse_environ(u nsigned long *pulFrameWidth, unsigned long*pulFrameHeight,487 u nsigned long*pulBitRate, const char **ppszFileName)486 static void parse_environ(uint32_t *pulFrameWidth, uint32_t *pulFrameHeight, 487 uint32_t *pulBitRate, const char **ppszFileName) 488 488 { 489 489 const char *pszEnvTemp; … … 627 627 unsigned fPaused = 0; 628 628 #ifdef VBOX_WITH_VIDEOREC 629 bool f VideoRec= false;630 u nsigned long ulFrameWidth = 800;631 u nsigned long ulFrameHeight = 600;632 u nsigned long ulBitRate = 300000; /** @todo r=bird: The COM type ULONG isn't unsigned long, it's 32-bit unsigned int. */633 char sz MpegFile[RTPATH_MAX];634 const char *psz FileNameParam = "VBox-%d.vob";629 bool fCaptureEnabled = false; 630 uint32_t ulCaptureVideoWidth = 800; 631 uint32_t ulCaptureVideoHeight = 600; 632 uint32_t ulCaptureVideoRate = 300000; 633 char szCaptureFileName[RTPATH_MAX]; 634 const char *pszCaptureFileNameTemplate = "VBox-%d.webm"; /* .webm container by default. */ 635 635 #endif /* VBOX_WITH_VIDEOREC */ 636 636 #ifdef RT_OS_WINDOWS … … 645 645 #ifdef VBOX_WITH_VIDEOREC 646 646 /* Parse the environment */ 647 parse_environ(&ul FrameWidth, &ulFrameHeight, &ulBitRate, &pszFileNameParam);647 parse_environ(&ulCaptureVideoWidth, &ulCaptureVideoHeight, &ulCaptureVideoRate, &pszCaptureFileNameTemplate); 648 648 #endif 649 649 … … 782 782 #ifdef VBOX_WITH_VIDEOREC 783 783 case 'c': 784 f VideoRec= true;784 fCaptureEnabled = true; 785 785 break; 786 786 case 'w': 787 ul FrameWidth = ValueUnion.u32;787 ulCaptureVideoWidth = ValueUnion.u32; 788 788 break; 789 789 case 'r': 790 ul BitRate = ValueUnion.u32;790 ulCaptureVideoRate = ValueUnion.u32; 791 791 break; 792 792 case 'f': 793 psz FileNameParam= ValueUnion.psz;793 pszCaptureFileNameTemplate = ValueUnion.psz; 794 794 break; 795 795 #endif /* VBOX_WITH_VIDEOREC defined */ … … 798 798 if ((GetState.pDef->fFlags & RTGETOPT_REQ_MASK) != RTGETOPT_REQ_NOTHING) 799 799 { 800 ul FrameHeight = ValueUnion.u32;800 ulCaptureVideoHeight = ValueUnion.u32; 801 801 break; 802 802 } … … 818 818 819 819 #ifdef VBOX_WITH_VIDEOREC 820 if (ul FrameWidth < 512 || ulFrameWidth > 2048 || ulFrameWidth % 2)820 if (ulCaptureVideoWidth < 512 || ulCaptureVideoWidth > 2048 || ulCaptureVideoWidth % 2) 821 821 { 822 822 LogError("VBoxHeadless: ERROR: please specify an even frame width between 512 and 2048", 0); 823 823 return 1; 824 824 } 825 if (ul FrameHeight < 384 || ulFrameHeight > 1536 || ulFrameHeight % 2)825 if (ulCaptureVideoHeight < 384 || ulCaptureVideoHeight > 1536 || ulCaptureVideoHeight % 2) 826 826 { 827 827 LogError("VBoxHeadless: ERROR: please specify an even frame height between 384 and 1536", 0); 828 828 return 1; 829 829 } 830 if (ul BitRate < 300000 || ulBitRate > 1000000)830 if (ulCaptureVideoRate < 300000 || ulCaptureVideoRate > 1000000) 831 831 { 832 832 LogError("VBoxHeadless: ERROR: please specify an even bitrate between 300000 and 1000000", 0); … … 834 834 } 835 835 /* Make sure we only have %d or %u (or none) in the file name specified */ 836 char *pcPercent = (char*)strchr(psz FileNameParam, '%');836 char *pcPercent = (char*)strchr(pszCaptureFileNameTemplate, '%'); 837 837 if (pcPercent != 0 && *(pcPercent + 1) != 'd' && *(pcPercent + 1) != 'u') 838 838 { … … 846 846 return 1; 847 847 } 848 RTStrPrintf(&sz MpegFile[0], RTPATH_MAX, pszFileNameParam, RTProcSelf());848 RTStrPrintf(&szCaptureFileName[0], RTPATH_MAX, pszCaptureFileNameTemplate, RTProcSelf()); 849 849 #endif /* defined VBOX_WITH_VIDEOREC */ 850 850 … … 959 959 960 960 #ifdef VBOX_WITH_VIDEOREC 961 if (f VideoRec)961 if (fCaptureEnabled) 962 962 { 963 963 ComPtr<ICaptureSettings> captureSettings; … … 972 972 { 973 973 CHECK_ERROR_BREAK(saCaptureScreenScreens[i], COMSETTER(Enabled)(TRUE)); 974 CHECK_ERROR_BREAK(saCaptureScreenScreens[i], COMSETTER(FileName)(Bstr(sz MpegFile).raw()));975 CHECK_ERROR_BREAK(saCaptureScreenScreens[i], COMSETTER(VideoWidth)(ul FrameWidth));976 CHECK_ERROR_BREAK(saCaptureScreenScreens[i], COMSETTER(VideoHeight)(ul FrameHeight));977 CHECK_ERROR_BREAK(saCaptureScreenScreens[i], COMSETTER(VideoRate)(ul BitRate));974 CHECK_ERROR_BREAK(saCaptureScreenScreens[i], COMSETTER(FileName)(Bstr(szCaptureFileName).raw())); 975 CHECK_ERROR_BREAK(saCaptureScreenScreens[i], COMSETTER(VideoWidth)(ulCaptureVideoWidth)); 976 CHECK_ERROR_BREAK(saCaptureScreenScreens[i], COMSETTER(VideoHeight)(ulCaptureVideoHeight)); 977 CHECK_ERROR_BREAK(saCaptureScreenScreens[i], COMSETTER(VideoRate)(ulCaptureVideoRate)); 978 978 } 979 979 } … … 1228 1228 1229 1229 #ifdef VBOX_WITH_VIDEOREC 1230 if (f VideoRec)1230 if (fCaptureEnabled) 1231 1231 { 1232 1232 if (!machine.isNull())
Note:
See TracChangeset
for help on using the changeset viewer.