Changeset 75313 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- Nov 7, 2018 5:13:56 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/CaptureScreenSettingsImpl.cpp
r75307 r75313 292 292 HRESULT CaptureScreenSettings::setFeatures(ULONG aFeatures) 293 293 { 294 if (!i_canChangeSettings()) 294 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 295 296 if (m->bd->fEnabled) 295 297 return setError(E_INVALIDARG, tr("Cannot change features while capturing is enabled")); 296 297 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);298 298 299 299 m->bd.backup(); … … 325 325 HRESULT CaptureScreenSettings::setDestination(CaptureDestination_T aDestination) 326 326 { 327 if (!i_canChangeSettings()) 327 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 328 329 if (m->bd->fEnabled) 328 330 return setError(E_INVALIDARG, tr("Cannot change destination type while capturing is enabled")); 329 331 330 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);331 332 332 m->bd.backup(); 333 333 m->bd->enmDest = aDestination; … … 353 353 HRESULT CaptureScreenSettings::setFileName(const com::Utf8Str &aFileName) 354 354 { 355 if (!i_canChangeSettings()) 355 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 356 357 if (m->bd->fEnabled) 356 358 return setError(E_INVALIDARG, tr("Cannot change file name while capturing is enabled")); 357 358 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);359 359 360 360 Utf8Str strFile(aFileName); … … 388 388 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 389 389 390 if ( !i_canChangeSettings())390 if (m->bd->fEnabled) 391 391 return setError(E_INVALIDARG, tr("Cannot change maximum time while capturing is enabled")); 392 392 … … 414 414 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 415 415 416 if ( !i_canChangeSettings())416 if (m->bd->fEnabled) 417 417 return setError(E_INVALIDARG, tr("Cannot change maximum file size while capturing is enabled")); 418 418 … … 440 440 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 441 441 442 if ( !i_canChangeSettings())443 return setError(E_INVALIDARG, tr("Cannot change options stringwhile capturing is enabled"));442 if (m->bd->fEnabled) 443 return setError(E_INVALIDARG, tr("Cannot change options while capturing is enabled")); 444 444 445 445 m->bd.backup(); 446 446 m->bd->strOptions = aOptions; 447 447 448 AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);449 m->pMachine->i_setModified(Machine::IsModified_Capture);450 m lock.release();448 alock.release(); 449 AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS); 450 m->pMachine->i_setModified(Machine::IsModified_Capture); 451 451 452 452 return S_OK; … … 466 466 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 467 467 468 if ( !i_canChangeSettings())468 if (m->bd->fEnabled) 469 469 return setError(E_INVALIDARG, tr("Cannot change audio codec while capturing is enabled")); 470 470 … … 492 492 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 493 493 494 if ( !i_canChangeSettings())494 if (m->bd->fEnabled) 495 495 return setError(E_INVALIDARG, tr("Cannot change audio Hertz rate while capturing is enabled")); 496 496 … … 518 518 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 519 519 520 if ( !i_canChangeSettings())520 if (m->bd->fEnabled) 521 521 return setError(E_INVALIDARG, tr("Cannot change audio bits while capturing is enabled")); 522 522 … … 544 544 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 545 545 546 if ( !i_canChangeSettings())546 if (m->bd->fEnabled) 547 547 return setError(E_INVALIDARG, tr("Cannot change audio channels while capturing is enabled")); 548 548 … … 570 570 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 571 571 572 if ( !i_canChangeSettings())572 if (m->bd->fEnabled) 573 573 return setError(E_INVALIDARG, tr("Cannot change video codec while capturing is enabled")); 574 574 … … 596 596 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 597 597 598 if ( !i_canChangeSettings())598 if (m->bd->fEnabled) 599 599 return setError(E_INVALIDARG, tr("Cannot change video width while capturing is enabled")); 600 600 … … 622 622 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 623 623 624 if ( !i_canChangeSettings())624 if (m->bd->fEnabled) 625 625 return setError(E_INVALIDARG, tr("Cannot change video height while capturing is enabled")); 626 626 … … 648 648 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 649 649 650 if ( !i_canChangeSettings())650 if (m->bd->fEnabled) 651 651 return setError(E_INVALIDARG, tr("Cannot change video rate while capturing is enabled")); 652 652 … … 674 674 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 675 675 676 if ( !i_canChangeSettings())676 if (m->bd->fEnabled) 677 677 return setError(E_INVALIDARG, tr("Cannot change video rate control mode while capturing is enabled")); 678 678 … … 696 696 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 697 697 698 if ( !i_canChangeSettings())698 if (m->bd->fEnabled) 699 699 return setError(E_INVALIDARG, tr("Cannot change video FPS while capturing is enabled")); 700 700 … … 722 722 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 723 723 724 if ( !i_canChangeSettings())724 if (m->bd->fEnabled) 725 725 return setError(E_INVALIDARG, tr("Cannot change video rate scaling method while capturing is enabled")); 726 726 … … 729 729 730 730 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;743 731 } 744 732
Note:
See TracChangeset
for help on using the changeset viewer.