VirtualBox

Changeset 75313 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Nov 7, 2018 5:13:56 PM (6 years ago)
Author:
vboxsync
Message:

Recording: More bugfixes for Main and FE/Qt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/CaptureScreenSettingsImpl.cpp

    r75307 r75313  
    292292HRESULT CaptureScreenSettings::setFeatures(ULONG aFeatures)
    293293{
    294     if (!i_canChangeSettings())
     294    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     295
     296    if (m->bd->fEnabled)
    295297        return setError(E_INVALIDARG, tr("Cannot change features while capturing is enabled"));
    296 
    297     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    298298
    299299    m->bd.backup();
     
    325325HRESULT CaptureScreenSettings::setDestination(CaptureDestination_T aDestination)
    326326{
    327     if (!i_canChangeSettings())
     327    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     328
     329    if (m->bd->fEnabled)
    328330        return setError(E_INVALIDARG, tr("Cannot change destination type while capturing is enabled"));
    329331
    330     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    331 
    332332    m->bd.backup();
    333333    m->bd->enmDest = aDestination;
     
    353353HRESULT CaptureScreenSettings::setFileName(const com::Utf8Str &aFileName)
    354354{
    355     if (!i_canChangeSettings())
     355    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     356
     357    if (m->bd->fEnabled)
    356358        return setError(E_INVALIDARG, tr("Cannot change file name while capturing is enabled"));
    357 
    358     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    359359
    360360    Utf8Str strFile(aFileName);
     
    388388    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    389389
    390     if (!i_canChangeSettings())
     390    if (m->bd->fEnabled)
    391391        return setError(E_INVALIDARG, tr("Cannot change maximum time while capturing is enabled"));
    392392
     
    414414    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    415415
    416     if (!i_canChangeSettings())
     416    if (m->bd->fEnabled)
    417417        return setError(E_INVALIDARG, tr("Cannot change maximum file size while capturing is enabled"));
    418418
     
    440440    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    441441
    442     if (!i_canChangeSettings())
    443         return setError(E_INVALIDARG, tr("Cannot change options string while capturing is enabled"));
     442    if (m->bd->fEnabled)
     443        return setError(E_INVALIDARG, tr("Cannot change options while capturing is enabled"));
    444444
    445445    m->bd.backup();
    446446    m->bd->strOptions = aOptions;
    447447
    448     AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    449     m->pMachine->i_setModified(Machine::IsModified_Capture);
    450     mlock.release();
     448    alock.release();
     449    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
     450    m->pMachine->i_setModified(Machine::IsModified_Capture);
    451451
    452452    return S_OK;
     
    466466    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    467467
    468     if (!i_canChangeSettings())
     468    if (m->bd->fEnabled)
    469469        return setError(E_INVALIDARG, tr("Cannot change audio codec while capturing is enabled"));
    470470
     
    492492    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    493493
    494     if (!i_canChangeSettings())
     494    if (m->bd->fEnabled)
    495495        return setError(E_INVALIDARG, tr("Cannot change audio Hertz rate while capturing is enabled"));
    496496
     
    518518    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    519519
    520     if (!i_canChangeSettings())
     520    if (m->bd->fEnabled)
    521521        return setError(E_INVALIDARG, tr("Cannot change audio bits while capturing is enabled"));
    522522
     
    544544    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    545545
    546     if (!i_canChangeSettings())
     546    if (m->bd->fEnabled)
    547547        return setError(E_INVALIDARG, tr("Cannot change audio channels while capturing is enabled"));
    548548
     
    570570    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    571571
    572     if (!i_canChangeSettings())
     572    if (m->bd->fEnabled)
    573573        return setError(E_INVALIDARG, tr("Cannot change video codec while capturing is enabled"));
    574574
     
    596596    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    597597
    598     if (!i_canChangeSettings())
     598    if (m->bd->fEnabled)
    599599        return setError(E_INVALIDARG, tr("Cannot change video width while capturing is enabled"));
    600600
     
    622622    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    623623
    624     if (!i_canChangeSettings())
     624    if (m->bd->fEnabled)
    625625        return setError(E_INVALIDARG, tr("Cannot change video height while capturing is enabled"));
    626626
     
    648648    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    649649
    650     if (!i_canChangeSettings())
     650    if (m->bd->fEnabled)
    651651        return setError(E_INVALIDARG, tr("Cannot change video rate while capturing is enabled"));
    652652
     
    674674    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    675675
    676     if (!i_canChangeSettings())
     676    if (m->bd->fEnabled)
    677677        return setError(E_INVALIDARG, tr("Cannot change video rate control mode while capturing is enabled"));
    678678
     
    696696    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    697697
    698     if (!i_canChangeSettings())
     698    if (m->bd->fEnabled)
    699699        return setError(E_INVALIDARG, tr("Cannot change video FPS while capturing is enabled"));
    700700
     
    722722    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    723723
    724     if (!i_canChangeSettings())
     724    if (m->bd->fEnabled)
    725725        return setError(E_INVALIDARG, tr("Cannot change video rate scaling method while capturing is enabled"));
    726726
     
    729729
    730730    return E_NOTIMPL;
    731 }
    732 
    733 bool CaptureScreenSettings::i_canChangeSettings(void)
    734 {
    735     AutoAnyStateDependency adep(m->pMachine);
    736     AssertComRCReturn(adep.rc(), false);
    737 
    738     if (   Global::IsOnline(adep.machineState())
    739         && m->bd->fEnabled)
    740         return false;
    741 
    742     return true;
    743731}
    744732
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