VirtualBox

Changeset 95918 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Jul 28, 2022 2:56:13 PM (2 years ago)
Author:
vboxsync
Message:

Recording/Main: Integrated r152624 from 6.1 into trunk (More code for per-screen settings. ​As we always want to have screen 0 enabled by default (if not explicitly set otherwise), the per-screen settings need to know which screen ID it's assigned to, to treat the defaults right). bugref:9286

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/RecordingStream.cpp

    r95750 r95918  
    3737    , enmState(RECORDINGSTREAMSTATE_UNINITIALIZED)
    3838    , tsStartMs(0)
     39    , ScreenSettings(UINT32_MAX)
    3940{
    4041    File.pWEBM = NULL;
     
    4546    : enmState(RECORDINGSTREAMSTATE_UNINITIALIZED)
    4647    , tsStartMs(0)
     48    , ScreenSettings(uScreen)
    4749{
    4850    File.pWEBM = NULL;
  • trunk/src/VBox/Main/src-server/RecordingSettingsImpl.cpp

    r95714 r95918  
    773773        if (m->mapScreenObj.find(i) == m->mapScreenObj.end())
    774774        {
    775             settings::RecordingScreenSettings defaultScreenSettings; /* Apply default settings. */
     775            settings::RecordingScreenSettings defaultScreenSettings(i /* Screen ID */); /* Apply default settings. */
    776776
    777777            int vrc2 = i_createScreenObj(m->mapScreenObj, i /* Screen ID */, defaultScreenSettings);
  • trunk/src/VBox/Main/xml/Settings.cpp

    r95839 r95918  
    27692769}
    27702770
    2771 RecordingScreenSettings::RecordingScreenSettings(void)
     2771RecordingScreenSettings::RecordingScreenSettings(uint32_t a_idScreen /* = UINT32_MAX */)
     2772    : idScreen(a_idScreen)
    27722773{
    27732774    applyDefaults();
     
    27812782/**
    27822783 * Returns the default options string for screen recording settings.
     2784 *
     2785 * @returns Default options string for a given screen.
    27832786 */
    27842787/* static */
     
    28462849     */
    28472850
    2848     fEnabled             = false;
     2851    /*
     2852     * Enable screen 0 by default.
     2853     * Otherwise enabling recording without any screen enabled at all makes no sense.
     2854     *
     2855     * Note: When tweaking this, make sure to also alter RecordingScreenSettings::areDefaultSettings().
     2856     */
     2857    fEnabled             = idScreen == 0 ? true : false;;
    28492858    enmDest              = RecordingDestination_File;
    28502859    ulMaxTimeS           = 0;
     
    28722881 *
    28732882 * @returns \c true if default, \c false if not.
    2874  * @param   idScreen            Screen ID of screen settings to check.
    2875  *                              Set to UINT32_MAX if not specified / optional.
    2876  */
    2877 bool RecordingScreenSettings::areDefaultSettings(uint32_t idScreen /* = UINT32_MAX */) const
     2883 */
     2884bool RecordingScreenSettings::areDefaultSettings(void) const
    28782885{
    28792886    return    (   fEnabled                                    == false
     
    30023009    {
    30033010        /* Always add screen 0 to the default configuration. */
    3004         RecordingScreenSettings screenSettings;
    3005 
    3006         /* Make sure to enable this per default.
    3007          * Otherwise enabling recording without any screen enabled at all makes no sense.
    3008          *
    3009          * Note: When tweaking this, make sure to also alter RecordingScreenSettings::areDefaultSettings(). */
    3010         screenSettings.fEnabled = true;
    3011 
    3012         mapScreens[0] = screenSettings;
     3011        RecordingScreenSettings screenSettings(0 /* Screen ID */);
     3012
     3013        mapScreens[0 /* Screen ID */] = screenSettings;
    30133014    }
    30143015    catch (std::bad_alloc &)
     
    30313032    while (itScreen != mapScreens.end())
    30323033    {
    3033         if (!itScreen->second.areDefaultSettings(itScreen->first /* Screen ID */))
     3034        if (!itScreen->second.areDefaultSettings())
    30343035            return false;
    30353036        ++itScreen;
     
    61476148            recording.mapScreens[i] = screen0;
    61486149
    6149             if (uScreensBitmap & RT_BIT_64(i)) /* Screen i enabled? */
    6150                 recording.mapScreens[i].fEnabled = true;
     6150            /* Screen i enabled? */
     6151            recording.mapScreens[i].idScreen = i;
     6152            recording.mapScreens[i].fEnabled = RT_BOOL(uScreensBitmap & RT_BIT_64(i));
    61516153        }
    61526154    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette