Changeset 75307 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Nov 7, 2018 1:56:14 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 126417
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r75283 r75307 2387 2387 */ 2388 2388 2389 fEnabled = true;2389 fEnabled = false; 2390 2390 enmDest = CaptureDestination_File; 2391 2391 ulMaxTimeS = 0; 2392 2392 strOptions = ""; 2393 2393 File.ulMaxSizeMB = 0; 2394 File.strName = ""; 2394 2395 Video.enmCodec = CaptureVideoCodec_VP8; 2395 2396 Video.ulWidth = 1024; … … 2404 2405 featureMap[CaptureFeature_Video] = true; 2405 2406 featureMap[CaptureFeature_Audio] = false; 2406 2407 //i_calculateFullPath2408 2407 } 2409 2408 … … 2413 2412 bool CaptureScreenSettings::areDefaultSettings(void) const 2414 2413 { 2415 const bool fDefault = fEnabled == true 2416 && enmDest == CaptureDestination_File 2417 && ulMaxTimeS == 0 2418 && strOptions == "" 2419 && File.ulMaxSizeMB == 0 2420 && Video.enmCodec == CaptureVideoCodec_VP8 2421 && Video.ulWidth == 1024 2422 && Video.ulHeight == 768 2423 && Video.ulRate == 512 2424 && Video.ulFPS == 25 2425 && Audio.enmAudioCodec == CaptureAudioCodec_Opus 2426 && Audio.cBits == 16 2427 && Audio.cChannels == 2 2428 && Audio.uHz == 22050; 2429 2430 return fDefault; 2414 return fEnabled == false 2415 && enmDest == CaptureDestination_File 2416 && ulMaxTimeS == 0 2417 && strOptions == "" 2418 && File.ulMaxSizeMB == 0 2419 && File.strName == "" 2420 && Video.enmCodec == CaptureVideoCodec_VP8 2421 && Video.ulWidth == 1024 2422 && Video.ulHeight == 768 2423 && Video.ulRate == 512 2424 && Video.ulFPS == 25 2425 && Audio.enmAudioCodec == CaptureAudioCodec_Opus 2426 && Audio.cBits == 16 2427 && Audio.cChannels == 2 2428 && Audio.uHz == 22050; 2431 2429 } 2432 2430 … … 2472 2470 } 2473 2471 2472 /** 2473 * Applies the default settings. 2474 */ 2474 2475 void CaptureSettings::applyDefaults(void) 2475 2476 { … … 2478 2479 mapScreens.clear(); 2479 2480 2480 CaptureScreenSettings screenSettings; /* Apply default settings. */ 2481 for (uint32_t l = 0; l < SchemaDefs::MaxGuestMonitors; l++) 2482 { 2483 mapScreens[l] = screenSettings; 2481 try 2482 { 2483 /* Always add screen 0 to the default configuration. */ 2484 CaptureScreenSettings screenSettings; /* Apply default settings for screen 0. */ 2485 mapScreens[0] = screenSettings; 2486 } 2487 catch (std::bad_alloc &) 2488 { 2489 AssertFailed(); 2484 2490 } 2485 2491 } … … 2490 2496 bool CaptureSettings::areDefaultSettings() const 2491 2497 { 2498 const bool fDefault = fEnabled == false 2499 && mapScreens.size() == 1; 2500 if (!fDefault) 2501 return false; 2502 2492 2503 CaptureScreenMap::const_iterator itScreen = mapScreens.begin(); 2493 while (itScreen != mapScreens.end()) 2494 { 2495 if (!itScreen->second.areDefaultSettings()) 2496 return false; 2497 2498 ++itScreen; 2499 } 2500 2501 return true; 2504 return itScreen->first == 0 2505 && itScreen->second.areDefaultSettings(); 2502 2506 } 2503 2507 … … 4413 4417 /* At the moment we only support one capturing configuration, that is, all screens 4414 4418 * have the same configuration. So load/save to/from screen 0. */ 4419 Assert(hw.captureSettings.mapScreens.size()); /* At least screen must be present. */ 4415 4420 CaptureScreenSettings &screen0Settings = hw.captureSettings.mapScreens[0]; 4416 4421 … … 4424 4429 pelmHwChild->getAttributeValue("fps", screen0Settings.Video.ulFPS); 4425 4430 4426 for (unsigned i = 0; i < 64; i++)4431 for (unsigned i = 0; i < hw.cMonitors; i++) /* Don't add more settings than we have monitors configured. */ 4427 4432 { 4428 4433 if (u64VideoCaptureScreens & RT_BIT_64(i)) /* Screen i enabled? */ … … 5839 5844 Assert(hw.captureSettings.mapScreens.size()); 5840 5845 const CaptureScreenMap::const_iterator itScreen0Settings = hw.captureSettings.mapScreens.find(0); 5846 Assert(itScreen0Settings != hw.captureSettings.mapScreens.end()); 5841 5847 5842 5848 if (itScreen0Settings->second.ulMaxTimeS)
Note:
See TracChangeset
for help on using the changeset viewer.