VirtualBox

Ignore:
Timestamp:
Nov 9, 2018 8:37:28 AM (6 years ago)
Author:
vboxsync
Message:

Recording: Renaming APIs ICapture* -> IRecord* and other terminology to better distinguish from features like mouse capturing and stuff.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/xml/Settings.cpp

    r75324 r75341  
    23712371}
    23722372
    2373 CaptureScreenSettings::CaptureScreenSettings(void)
     2373RecordScreenSettings::RecordScreenSettings(void)
    23742374{
    23752375    applyDefaults();
    23762376}
    23772377
    2378 CaptureScreenSettings::~CaptureScreenSettings()
    2379 {
    2380 
    2381 }
    2382 
    2383 void CaptureScreenSettings::applyDefaults(void)
     2378RecordScreenSettings::~RecordScreenSettings()
     2379{
     2380
     2381}
     2382
     2383void RecordScreenSettings::applyDefaults(void)
    23842384{
    23852385    /*
     
    23882388
    23892389    fEnabled            = false;
    2390     enmDest             = CaptureDestination_File;
     2390    enmDest             = RecordDestination_File;
    23912391    ulMaxTimeS          = 0;
    23922392    strOptions          = "";
    23932393    File.ulMaxSizeMB    = 0;
    23942394    File.strName        = "";
    2395     Video.enmCodec      = CaptureVideoCodec_VP8;
     2395    Video.enmCodec      = RecordVideoCodec_VP8;
    23962396    Video.ulWidth       = 1024;
    23972397    Video.ulHeight      = 768;
    23982398    Video.ulRate        = 512;
    23992399    Video.ulFPS         = 25;
    2400     Audio.enmAudioCodec = CaptureAudioCodec_Opus;
     2400    Audio.enmAudioCodec = RecordAudioCodec_Opus;
    24012401    Audio.cBits         = 16;
    24022402    Audio.cChannels     = 2;
    24032403    Audio.uHz           = 22050;
    24042404
    2405     featureMap[CaptureFeature_Video] = true;
    2406     featureMap[CaptureFeature_Audio] = false;
     2405    featureMap[RecordFeature_Video] = true;
     2406    featureMap[RecordFeature_Audio] = false;
    24072407}
    24082408
     
    24102410 * Check if all settings have default values.
    24112411 */
    2412 bool CaptureScreenSettings::areDefaultSettings(void) const
     2412bool RecordScreenSettings::areDefaultSettings(void) const
    24132413{
    24142414    return    fEnabled            == false
    2415            && enmDest             == CaptureDestination_File
     2415           && enmDest             == RecordDestination_File
    24162416           && ulMaxTimeS          == 0
    24172417           && strOptions          == ""
    24182418           && File.ulMaxSizeMB    == 0
    24192419           && File.strName        == ""
    2420            && Video.enmCodec      == CaptureVideoCodec_VP8
     2420           && Video.enmCodec      == RecordVideoCodec_VP8
    24212421           && Video.ulWidth       == 1024
    24222422           && Video.ulHeight      == 768
    24232423           && Video.ulRate        == 512
    24242424           && Video.ulFPS         == 25
    2425            && Audio.enmAudioCodec == CaptureAudioCodec_Opus
     2425           && Audio.enmAudioCodec == RecordAudioCodec_Opus
    24262426           && Audio.cBits         == 16
    24272427           && Audio.cChannels     == 2
     
    24292429}
    24302430
    2431 bool CaptureScreenSettings::isFeatureEnabled(CaptureFeature_T enmFeature) const
    2432 {
    2433     CaptureFeatureMap::const_iterator itFeature = featureMap.find(enmFeature);
     2431bool RecordScreenSettings::isFeatureEnabled(RecordFeature_T enmFeature) const
     2432{
     2433    RecordFeatureMap::const_iterator itFeature = featureMap.find(enmFeature);
    24342434    if (itFeature != featureMap.end())
    24352435        return itFeature->second;
     
    24432443 * machine settings have really changed and thus need to be written out to disk.
    24442444 */
    2445 bool CaptureScreenSettings::operator==(const CaptureScreenSettings &d) const
     2445bool RecordScreenSettings::operator==(const RecordScreenSettings &d) const
    24462446{
    24472447    return    fEnabled            == d.fEnabled
     
    24652465 * Constructor. Needs to set sane defaults which stand the test of time.
    24662466 */
    2467 CaptureSettings::CaptureSettings()
     2467RecordSettings::RecordSettings()
    24682468{
    24692469    applyDefaults();
     
    24732473 * Applies the default settings.
    24742474 */
    2475 void CaptureSettings::applyDefaults(void)
     2475void RecordSettings::applyDefaults(void)
    24762476{
    24772477    fEnabled = false;
     
    24822482    {
    24832483        /* Always add screen 0 to the default configuration. */
    2484         CaptureScreenSettings screenSettings; /* Apply default settings for screen 0. */
     2484        RecordScreenSettings screenSettings; /* Apply default settings for screen 0. */
    24852485        screenSettings.fEnabled = true;       /* Enabled by default. */
    24862486        mapScreens[0] = screenSettings;
     
    24952495 * Check if all settings have default values.
    24962496 */
    2497 bool CaptureSettings::areDefaultSettings() const
     2497bool RecordSettings::areDefaultSettings() const
    24982498{
    24992499    const bool fDefault =    fEnabled          == false
     
    25022502        return false;
    25032503
    2504     CaptureScreenMap::const_iterator itScreen = mapScreens.begin();
     2504    RecordScreenMap::const_iterator itScreen = mapScreens.begin();
    25052505    return    itScreen->first == 0
    25062506           && itScreen->second.areDefaultSettings();
     
    25122512 * machine settings have really changed and thus need to be written out to disk.
    25132513 */
    2514 bool CaptureSettings::operator==(const CaptureSettings &d) const
     2514bool RecordSettings::operator==(const RecordSettings &d) const
    25152515{
    25162516    if (this == &d)
     
    25212521        return false;
    25222522
    2523     CaptureScreenMap::const_iterator itScreen = mapScreens.begin();
     2523    RecordScreenMap::const_iterator itScreen = mapScreens.begin();
    25242524    uint32_t i = 0;
    25252525    while (itScreen != mapScreens.end())
    25262526    {
    2527         CaptureScreenMap::const_iterator itScreenThat = d.mapScreens.find(i);
     2527        RecordScreenMap::const_iterator itScreenThat = d.mapScreens.find(i);
    25282528        if (itScreen->second == itScreenThat->second)
    25292529        {
     
    44094409        else if (pelmHwChild->nameEquals("VideoCapture"))
    44104410        {
    4411             pelmHwChild->getAttributeValue("enabled",   hw.captureSettings.fEnabled);
     4411            pelmHwChild->getAttributeValue("enabled",   hw.recordSettings.fEnabled);
    44124412
    44134413            /* Right now I don't want to bump the settings version, so just convert the enabled
     
    44184418            /* At the moment we only support one capturing configuration, that is, all screens
    44194419             * have the same configuration. So load/save to/from screen 0. */
    4420             Assert(hw.captureSettings.mapScreens.size()); /* At least screen must be present. */
    4421             CaptureScreenSettings &screen0Settings = hw.captureSettings.mapScreens[0];
     4420            Assert(hw.recordSettings.mapScreens.size()); /* At least screen must be present. */
     4421            RecordScreenSettings &screen0Settings = hw.recordSettings.mapScreens[0];
    44224422
    44234423            pelmHwChild->getAttributeValue("maxTime",   screen0Settings.ulMaxTimeS);
     
    44334433            {
    44344434                /* Add screen i to config in any case. */
    4435                 hw.captureSettings.mapScreens[i] = screen0Settings;
     4435                hw.recordSettings.mapScreens[i] = screen0Settings;
    44364436
    44374437                if (u64VideoCaptureScreens & RT_BIT_64(i)) /* Screen i enabled? */
    4438                     hw.captureSettings.mapScreens[i].fEnabled = true;
     4438                    hw.recordSettings.mapScreens[i].fEnabled = true;
    44394439            }
    44404440        }
     
    58205820    }
    58215821
    5822     if (m->sv >= SettingsVersion_v1_14 && !hw.captureSettings.areDefaultSettings())
     5822    if (m->sv >= SettingsVersion_v1_14 && !hw.recordSettings.areDefaultSettings())
    58235823    {
    58245824        xml::ElementNode *pelmVideoCapture = pelmHardware->createChild("VideoCapture");
    58255825
    5826         if (hw.captureSettings.fEnabled)
    5827             pelmVideoCapture->setAttribute("enabled", hw.captureSettings.fEnabled);
     5826        if (hw.recordSettings.fEnabled)
     5827            pelmVideoCapture->setAttribute("enabled", hw.recordSettings.fEnabled);
    58285828
    58295829        /* Right now I don't want to bump the settings version, so just convert the enabled
    58305830         * screens to the former uint64t_t bit array and vice versa. */
    58315831        uint64_t u64VideoCaptureScreens = 0;
    5832         CaptureScreenMap::const_iterator itScreen = hw.captureSettings.mapScreens.begin();
    5833         while (itScreen != hw.captureSettings.mapScreens.end())
     5832        RecordScreenMap::const_iterator itScreen = hw.recordSettings.mapScreens.begin();
     5833        while (itScreen != hw.recordSettings.mapScreens.end())
    58345834        {
    58355835            if (itScreen->second.fEnabled)
     
    58435843        /* At the moment we only support one capturing configuration, that is, all screens
    58445844         * have the same configuration. So load/save to/from screen 0. */
    5845         Assert(hw.captureSettings.mapScreens.size());
    5846         const CaptureScreenMap::const_iterator itScreen0Settings = hw.captureSettings.mapScreens.find(0);
    5847         Assert(itScreen0Settings != hw.captureSettings.mapScreens.end());
     5845        Assert(hw.recordSettings.mapScreens.size());
     5846        const RecordScreenMap::const_iterator itScreen0Settings = hw.recordSettings.mapScreens.find(0);
     5847        Assert(itScreen0Settings != hw.recordSettings.mapScreens.end());
    58485848
    58495849        if (itScreen0Settings->second.ulMaxTimeS)
     
    74427442            || hardwareMachine.enmLongMode != Hardware::LongMode_Legacy
    74437443            || machineUserData.ovIcon.size() > 0
    7444             || hardwareMachine.captureSettings.fEnabled)
     7444            || hardwareMachine.recordSettings.fEnabled)
    74457445        {
    74467446            m->sv = SettingsVersion_v1_14;
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