儲存庫 vbox 的更動 46465
- 時間撮記:
- 2013-6-10 下午02:11:26 (11 年 以前)
- 位置:
- trunk
- 檔案:
-
- 修改 11 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/include/VBox/log.h
r45518 r46465 498 498 /** Main group, IVFSExplorer. */ 499 499 LOG_GROUP_MAIN_VFSEXPLORER, 500 /** Main group, IVideoCaptureChangedEvent. */ 501 LOG_GROUP_MAIN_VIDEOCAPTURECHANGEDEVENT, 500 502 /** Main group, IVirtualBox. */ 501 503 LOG_GROUP_MAIN_VIRTUALBOX, -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r46123 r46465 1345 1345 ULONG cMonitors = 64; 1346 1346 CHECK_ERROR_BREAK(machine, COMGETTER(MonitorCount)(&cMonitors)); 1347 com::SafeArray<BOOL> saScreenIds(cMonitors); 1347 com::SafeArray<BOOL> saScreens(cMonitors); 1348 bool fEnable = !strcmp(a->argv[1], "enablevideocapture"); 1348 1349 if (a->argc < 3) 1349 1350 { 1350 1351 /* default: handle all screens */ 1351 1352 for (unsigned i = 0; i < cMonitors; i++) 1352 saScreen Ids[i] = true;1353 saScreens[i] = true; 1353 1354 } 1354 1355 else 1355 1356 { 1356 1357 /* handle selected screens */ 1357 for (unsigned i = 0; i < cMonitors; i++) 1358 saScreenIds[i] = false; 1358 CHECK_ERROR_BREAK(machine, COMGETTER(VideoCaptureScreens)(ComSafeArrayAsOutParam(saScreens))); 1359 1359 for (int i = 2; SUCCEEDED(rc) && i < a->argc; i++) 1360 1360 { 1361 1361 uint32_t iScreen; 1362 1362 int vrc = RTStrToUInt32Ex(a->argv[i], NULL, 0, &iScreen); 1363 RTPrintf("i = %d => %d => %Rrc\n", i, iScreen, vrc);1364 1363 if (vrc != VINF_SUCCESS) 1365 1364 { … … 1374 1373 break; 1375 1374 } 1376 saScreenIds[iScreen] = true; 1377 } 1378 } 1375 saScreens[iScreen] = fEnable; 1376 } 1377 } 1378 1379 1379 for (unsigned i = 0; i < cMonitors; i++) 1380 RTPrintf(" %d\n", saScreenIds[i]); 1381 ComPtr<IDisplay> pDisplay; 1382 CHECK_ERROR_BREAK(console, COMGETTER(Display)(pDisplay.asOutParam())); 1383 if (!pDisplay) 1384 { 1385 RTMsgError("Guest not running"); 1386 rc = E_FAIL; 1387 break; 1388 } 1389 if (!strcmp(a->argv[1], "enablevideocapture")) 1390 CHECK_ERROR_BREAK(pDisplay, EnableVideoCapture(ComSafeArrayAsInParam(saScreenIds))); 1391 else 1392 CHECK_ERROR_BREAK(pDisplay, DisableVideoCapture(ComSafeArrayAsInParam(saScreenIds))); 1380 RTPrintf(" %d\n", saScreens[i]); 1381 CHECK_ERROR_BREAK(sessionMachine, COMSETTER(VideoCaptureScreens)(ComSafeArrayAsInParam(saScreens))); 1393 1382 } 1394 1383 else -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r46423 r46465 14900 14900 </method> 14901 14901 14902 <method name="enableVideoCapture ">14903 <desc> 14904 Start/ continue video capture.14902 <method name="enableVideoCaptureScreens"> 14903 <desc> 14904 Start/stop video capture on selected screens. 14905 14905 </desc> 14906 14906 <param name="screens" type="boolean" safearray="yes" dir="in"> 14907 14907 <desc> 14908 The screens to start/continue capturing. 14909 </desc> 14910 </param> 14911 </method> 14912 14913 <method name="disableVideoCapture"> 14914 <desc> 14915 Stop video capture. 14916 </desc> 14917 <param name="screens" type="boolean" safearray="yes" dir="in"> 14918 <desc> 14919 The screens to stop capturing. 14908 The screens to start/stop capturing. 14920 14909 </desc> 14921 14910 </param> … … 17103 17092 <desc>Flag whether the server must be restarted</desc> 17104 17093 </param> 17094 </method> 17095 17096 <method name="onVideoCaptureChange"> 17097 <desc> 17098 Triggered when video capture settings have changed. 17099 </desc> 17105 17100 </method> 17106 17101 … … 18791 18786 <enum 18792 18787 name="VBoxEventType" 18793 uuid=" c51645b3-7108-4dce-b5a3-bbf5e4f69ed2"18788 uuid="f019b8c7-22a6-468a-9f7c-3443b7b6c40a" 18794 18789 > 18795 18790 … … 19150 19145 </desc> 19151 19146 </const> 19147 <const name="OnVideoCaptureChanged" value="91"> 19148 <desc> 19149 See <link to="IVideoCaptureChangedEvent">IVideoCapturedChangeEvent</link>. 19150 </desc> 19151 </const> 19152 19152 <!-- Last event marker --> 19153 <const name="Last" value="9 1">19153 <const name="Last" value="92"> 19154 19154 <desc> 19155 19155 Must be last event, used for iterations and structures relying on numerical event values. … … 20353 20353 should use <link to="IConsole::VRDEServerInfo">IVRDEServerInfo</link> 20354 20354 attributes to find out what is the current status. 20355 </desc> 20356 </interface> 20357 20358 <interface 20359 name="IVideoCaptureChangedEvent" extends="IEvent" 20360 uuid="6215d169-25dd-4719-ab34-c908701efb58" 20361 wsmap="managed" autogen="VBoxEvent" id="OnVideoCaptureChanged" 20362 > 20363 <desc> 20364 Notification when video capture settings have changed. 20355 20365 </desc> 20356 20366 </interface> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r45675 r46465 201 201 HRESULT onDragAndDropModeChange(DragAndDropMode_T aDragAndDropMode); 202 202 HRESULT onVRDEServerChange(BOOL aRestart); 203 HRESULT onVideoCaptureChange(); 203 204 HRESULT onUSBControllerChange(); 204 205 HRESULT onSharedFolderChange(BOOL aGlobal); -
trunk/src/VBox/Main/include/DisplayImpl.h
r46123 r46465 170 170 STDMETHOD(TakeScreenShotToArray)(ULONG aScreenId, ULONG width, ULONG height, ComSafeArrayOut(BYTE, aScreenData)); 171 171 STDMETHOD(TakeScreenShotPNGToArray)(ULONG aScreenId, ULONG width, ULONG height, ComSafeArrayOut(BYTE, aScreenData)); 172 STDMETHOD(EnableVideoCapture)(ComSafeArrayIn(BOOL, aScreens)); 173 STDMETHOD(DisableVideoCapture)(ComSafeArrayIn(BOOL, aScreens)); 172 STDMETHOD(EnableVideoCaptureScreens)(ComSafeArrayIn(BOOL, aScreens)); 174 173 STDMETHOD(DrawToScreen)(ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height); 175 174 STDMETHOD(InvalidateAndUpdate)(); -
trunk/src/VBox/Main/include/MachineImpl.h
r46348 r46465 741 741 virtual HRESULT onBandwidthGroupChange(IBandwidthGroup * /* aBandwidthGroup */) { return S_OK; } 742 742 virtual HRESULT onStorageDeviceChange(IMediumAttachment * /* mediumAttachment */, BOOL /* remove */, BOOL /* silent */) { return S_OK; } 743 virtual HRESULT onVideoCaptureChange() { return S_OK; } 743 744 744 745 HRESULT saveRegistryEntry(settings::MachineRegistryEntry &data); … … 1119 1120 HRESULT onParallelPortChange(IParallelPort *parallelPort); 1120 1121 HRESULT onCPUChange(ULONG aCPU, BOOL aRemove); 1121 HRESULT onCPUExecutionCapChange(ULONG aCpuExecutionCap);1122 1122 HRESULT onVRDEServerChange(BOOL aRestart); 1123 HRESULT onVideoCaptureChange(); 1123 1124 HRESULT onUSBControllerChange(); 1124 1125 HRESULT onUSBDeviceAttach(IUSBDevice *aDevice, … … 1132 1133 HRESULT onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup); 1133 1134 HRESULT onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent); 1135 HRESULT onCPUExecutionCapChange(ULONG aCpuExecutionCap); 1134 1136 1135 1137 bool hasMatchingUSBFilter(const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs); -
trunk/src/VBox/Main/include/SessionImpl.h
r45284 r46465 93 93 STDMETHOD(OnCPUExecutionCapChange)(ULONG aExecutionCap); 94 94 STDMETHOD(OnVRDEServerChange)(BOOL aRestart); 95 STDMETHOD(OnVideoCaptureChange)(); 95 96 STDMETHOD(OnUSBControllerChange)(); 96 97 STDMETHOD(OnSharedFolderChange)(BOOL aGlobal); -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r46451 r46465 5101 5101 } 5102 5102 5103 HRESULT Console::onVideoCaptureChange() 5104 { 5105 AutoCaller autoCaller(this); 5106 AssertComRCReturnRC(autoCaller.rc()); 5107 5108 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 5109 5110 SafeArray<BOOL> screens; 5111 HRESULT rc = mMachine->COMGETTER(VideoCaptureScreens)(ComSafeArrayAsOutParam(screens)); 5112 if (mDisplay) 5113 { 5114 if (SUCCEEDED(rc)) 5115 rc = mDisplay->EnableVideoCaptureScreens(ComSafeArrayAsInParam(screens)); 5116 if (SUCCEEDED(rc)) 5117 fireVideoCaptureChangedEvent(mEventSource); 5118 } 5119 5120 return rc; 5121 } 5103 5122 5104 5123 /** -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r46123 r46465 2674 2674 } 2675 2675 2676 STDMETHODIMP Display::EnableVideoCapture (ComSafeArrayIn(BOOL, aScreens))2676 STDMETHODIMP Display::EnableVideoCaptureScreens(ComSafeArrayIn(BOOL, aScreens)) 2677 2677 { 2678 2678 #ifdef VBOX_WITH_VPX 2679 2679 com::SafeArray<LONG> Screens(ComSafeArrayInArg(aScreens)); 2680 2680 for (unsigned i = 0; i < Screens.size(); i++) 2681 if (Screens[i]) 2682 maVideoRecEnabled[i] = true; 2683 return S_OK; 2684 #else 2685 return E_NOTIMPL; 2686 #endif 2687 } 2688 2689 STDMETHODIMP Display::DisableVideoCapture(ComSafeArrayIn(BOOL, aScreens)) 2690 { 2691 #ifdef VBOX_WITH_VPX 2692 com::SafeArray<LONG> Screens(ComSafeArrayInArg(aScreens)); 2693 for (unsigned i = 0; i < Screens.size(); i++) 2694 if (Screens[i]) 2695 maVideoRecEnabled[i] = false; 2681 maVideoRecEnabled[i] = aScreens[i]; 2696 2682 return S_OK; 2697 2683 #else … … 4467 4453 } 4468 4454 com::SafeArray<BOOL> screens; 4469 inthrc = pMachine->COMGETTER(VideoCaptureScreens)(ComSafeArrayAsOutParam(screens));4455 HRESULT hrc = pMachine->COMGETTER(VideoCaptureScreens)(ComSafeArrayAsOutParam(screens)); 4470 4456 AssertComRCReturnRC(hrc); 4471 4457 for (unsigned i = 0; i < RT_ELEMENTS(pDisplay->maVideoRecEnabled); i++) -
trunk/src/VBox/Main/src-client/SessionImpl.cpp
r45814 r46465 642 642 643 643 return mConsole->onVRDEServerChange(aRestart); 644 } 645 646 STDMETHODIMP Session::OnVideoCaptureChange() 647 { 648 LogFlowThisFunc(("\n")); 649 650 AutoCaller autoCaller(this); 651 AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); 652 653 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 654 AssertReturn(mState == SessionState_Locked, VBOX_E_INVALID_VM_STATE); 655 AssertReturn(mType == SessionType_WriteLock, VBOX_E_INVALID_OBJECT_STATE); 656 AssertReturn(mConsole, VBOX_E_INVALID_OBJECT_STATE); 657 658 return mConsole->onVideoCaptureChange(); 644 659 } 645 660 -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r46387 r46465 1721 1721 STDMETHODIMP Machine::COMSETTER(VideoCaptureEnabled)(BOOL fEnabled) 1722 1722 { 1723 AutoCaller autoCaller(this); 1724 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1725 1723 HRESULT rc = S_OK; 1724 1725 AutoCaller autoCaller(this); 1726 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1726 1727 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1728 1729 rc = checkStateDependency(MutableStateDep); 1730 if (FAILED(rc)) return rc; 1731 1732 setModified(IsModified_MachineData); 1733 mHWData.backup(); 1734 1727 1735 mHWData->mVideoCaptureEnabled = fEnabled; 1728 return S_OK; 1736 1737 return rc; 1729 1738 } 1730 1739 … … 1732 1741 { 1733 1742 CheckComArgOutSafeArrayPointerValid(aScreens); 1743 1744 AutoCaller autoCaller(this); 1745 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1746 1747 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1734 1748 1735 1749 SafeArray<BOOL> screens(mHWData->mMonitorCount); … … 1744 1758 SafeArray<BOOL> screens(ComSafeArrayInArg(aScreens)); 1745 1759 AssertReturn(screens.size() <= RT_ELEMENTS(mHWData->maVideoCaptureScreens), E_INVALIDARG); 1760 bool fChanged = false; 1761 1762 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1763 1746 1764 for (unsigned i = 0; i < screens.size(); i++) 1747 mHWData->maVideoCaptureScreens[i] = RT_BOOL(screens[i]); 1765 { 1766 if (mHWData->maVideoCaptureScreens[i] != RT_BOOL(screens[i])) 1767 { 1768 mHWData->maVideoCaptureScreens[i] = RT_BOOL(screens[i]); 1769 fChanged = true; 1770 } 1771 } 1772 if (fChanged) 1773 { 1774 alock.release(); 1775 HRESULT rc = onVideoCaptureChange(); 1776 alock.acquire(); 1777 if (FAILED(rc)) return rc; 1778 setModified(IsModified_MachineData); 1779 if (Global::IsOnline(mData->mMachineState)) 1780 saveSettings(NULL); 1781 } 1782 1748 1783 return S_OK; 1749 1784 } … … 1766 1801 1767 1802 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1803 1804 HRESULT rc = checkStateDependency(MutableStateDep); 1805 if (FAILED(rc)) return rc; 1806 1768 1807 if (strFile.isEmpty()) 1769 1808 strFile = "VideoCap.webm"; 1809 1810 setModified(IsModified_MachineData); 1811 mHWData.backup(); 1770 1812 mHWData->mVideoCaptureFile = strFile; 1813 1771 1814 return S_OK; 1772 1815 } … … 1785 1828 { 1786 1829 AutoCaller autoCaller(this); 1787 if (FAILED(autoCaller.rc())) 1788 { 1789 LogFlow(("Autolocked failed\n")); 1790 return autoCaller.rc(); 1791 } 1830 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1792 1831 1793 1832 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1833 1834 HRESULT rc = checkStateDependency(MutableStateDep); 1835 if (FAILED(rc)) return rc; 1836 1837 setModified(IsModified_MachineData); 1838 mHWData.backup(); 1794 1839 mHWData->mVideoCaptureWidth = aHorzRes; 1840 1795 1841 return S_OK; 1796 1842 } … … 1811 1857 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1812 1858 1813 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1859 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1860 1861 HRESULT rc = checkStateDependency(MutableStateDep); 1862 if (FAILED(rc)) return rc; 1863 1864 setModified(IsModified_MachineData); 1865 mHWData.backup(); 1814 1866 mHWData->mVideoCaptureHeight = aVertRes; 1867 1815 1868 return S_OK; 1816 1869 } … … 1831 1884 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1832 1885 1833 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1886 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1887 1888 HRESULT rc = checkStateDependency(MutableStateDep); 1889 if (FAILED(rc)) return rc; 1890 1891 setModified(IsModified_MachineData); 1892 mHWData.backup(); 1834 1893 mHWData->mVideoCaptureRate = aRate; 1894 1835 1895 return S_OK; 1836 1896 } … … 1851 1911 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1852 1912 1853 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1913 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1914 1915 HRESULT rc = checkStateDependency(MutableStateDep); 1916 if (FAILED(rc)) return rc; 1917 1918 setModified(IsModified_MachineData); 1919 mHWData.backup(); 1854 1920 mHWData->mVideoCaptureFps = aFps; 1921 1855 1922 return S_OK; 1856 1923 } … … 13798 13865 13799 13866 /** 13867 * @note Locks this object for reading. 13868 */ 13869 HRESULT SessionMachine::onVideoCaptureChange() 13870 { 13871 LogFlowThisFunc(("\n")); 13872 13873 AutoCaller autoCaller(this); 13874 AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); 13875 13876 ComPtr<IInternalSessionControl> directControl; 13877 { 13878 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 13879 directControl = mData->mSession.mDirectControl; 13880 } 13881 13882 /* ignore notifications sent after #OnSessionEnd() is called */ 13883 if (!directControl) 13884 return S_OK; 13885 13886 return directControl->OnVideoCaptureChange(); 13887 } 13888 13889 /** 13800 13890 * @note Locks this object for reading. 13801 13891 */
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器