Changeset 95839 in vbox for trunk/src/VBox
- Timestamp:
- Jul 26, 2022 8:24:11 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r95835 r95839 6062 6062 * or \<Recording\> under \<Machine\>, 6063 6063 */ 6064 void MachineConfigFile::readRecordingSettings(const xml::ElementNode &elmRecording, RecordingSettings &recording) 6065 { 6064 void MachineConfigFile::readRecordingSettings(const xml::ElementNode &elmRecording, uint32_t cMonitors, RecordingSettings &recording) 6065 { 6066 if (cMonitors > 64) 6067 throw ConfigFileError(this, &elmRecording, N_("Invalid monitor count given")); 6068 6066 6069 elmRecording.getAttributeValue("enabled", recording.common.fEnabled); 6067 6070 … … 6078 6081 if (cScreens != plstScreens.size()) 6079 6082 throw ConfigFileError(this, &elmRecording, N_("Recording/@screens attribute does not match stored screen objects")); 6083 if (cScreens > 64) 6084 throw ConfigFileError(this, &elmRecording, N_("Recording/@screens attribute is invalid")); 6080 6085 6081 6086 for (xml::ElementNodesList::iterator itScreen = plstScreens.begin(); … … 6132 6137 6133 6138 /* Convert the enabled screens to the former uint64_t bit array and vice versa. */ 6134 uint64_t cScreens= 0;6135 elmRecording.getAttributeValue("screens", cScreens);6139 uint64_t uScreensBitmap = 0; 6140 elmRecording.getAttributeValue("screens", uScreensBitmap); 6136 6141 6137 6142 /* Note: For settings < 1.19 the "screens" attribute is a bit field for all screens 6138 6143 * which are ENABLED for recording. The settings for recording are for all the same though. */ 6139 for (unsigned i = 0; i < cScreens; i++)6144 for (unsigned i = 0; i < cMonitors; i++) 6140 6145 { 6141 6146 /* Apply settings of screen 0 to screen i and enable it. */ 6142 6147 recording.mapScreens[i] = screen0; 6143 6148 6144 if ( cScreens& RT_BIT_64(i)) /* Screen i enabled? */6149 if (uScreensBitmap & RT_BIT_64(i)) /* Screen i enabled? */ 6145 6150 recording.mapScreens[i].fEnabled = true; 6146 6151 } … … 6275 6280 const xml::ElementNode *pelmVideoCapture = pelmHardware->findChildElement("VideoCapture"); 6276 6281 if (pelmVideoCapture) 6277 readRecordingSettings(*pelmVideoCapture, pSnap-> recordingSettings);6282 readRecordingSettings(*pelmVideoCapture, pSnap->hardware.graphicsAdapter.cMonitors, pSnap->recordingSettings); 6278 6283 } 6279 6284 else /* >= VBox 7.0 */ … … 6281 6286 const xml::ElementNode *pelmRecording = pElement->findChildElement("Recording"); 6282 6287 if (pelmRecording) 6283 readRecordingSettings(*pelmRecording, pSnap-> recordingSettings);6288 readRecordingSettings(*pelmRecording, pSnap->hardware.graphicsAdapter.cMonitors, pSnap->recordingSettings); 6284 6289 } 6285 6290 // note: Groups exist only for Machine, not for Snapshot … … 6476 6481 && m->sv < SettingsVersion_v1_19 6477 6482 && pelmMachineChild->nameEquals("VideoCapture")) /* For settings >= 1.14 (< VBox 7.0). */ 6478 readRecordingSettings(*pelmMachineChild, recordingSettings);6483 readRecordingSettings(*pelmMachineChild, hardwareMachine.graphicsAdapter.cMonitors, recordingSettings); 6479 6484 else if ( m->sv >= SettingsVersion_v1_19 6480 6485 && pelmMachineChild->nameEquals("Recording")) /* Only exists for settings >= 1.19 (VBox 7.0). */ 6481 readRecordingSettings(*pelmMachineChild, recordingSettings);6486 readRecordingSettings(*pelmMachineChild, hardwareMachine.graphicsAdapter.cMonitors, recordingSettings); 6482 6487 } 6483 6488 … … 8116 8121 return; 8117 8122 8123 AssertReturnVoid(recording.mapScreens.size() <= 64); /* Make sure we never exceed the bitmap of 64 monitors. */ 8124 8118 8125 /* Note: Since settings 1.19 the recording settings have a dedicated XML branch outside of Hardware. */ 8119 8126 if (m->sv >= SettingsVersion_v1_19 /* VBox >= 7.0 */) … … 8196 8203 8197 8204 /* Convert the enabled screens to the former uint64_t bit array and vice versa. */ 8198 uint64_t u 64VideoCaptureScreens= 0;8205 uint64_t uScreensBitmap = 0; 8199 8206 RecordingScreenSettingsMap::const_iterator itScreen = recording.mapScreens.begin(); 8200 8207 while (itScreen != recording.mapScreens.end()) 8201 8208 { 8202 8209 if (itScreen->second.fEnabled) 8203 u64VideoCaptureScreens|= RT_BIT_64(itScreen->first);8210 uScreensBitmap |= RT_BIT_64(itScreen->first); 8204 8211 ++itScreen; 8205 8212 } 8206 8213 8207 if (u 64VideoCaptureScreens)8208 pelmVideoCapture->setAttribute("screens", u 64VideoCaptureScreens);8214 if (uScreensBitmap) 8215 pelmVideoCapture->setAttribute("screens", uScreensBitmap); 8209 8216 8210 8217 Assert(recording.mapScreens.size());
Note:
See TracChangeset
for help on using the changeset viewer.