Changeset 35146 in vbox
- Timestamp:
- Dec 15, 2010 4:31:56 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
-
include/VBox/settings.h (modified) (2 diffs)
-
src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp (modified) (1 diff)
-
src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp (modified) (3 diffs)
-
src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp (modified) (4 diffs)
-
src/VBox/Main/ConsoleVRDPServer.cpp (modified) (2 diffs)
-
src/VBox/Main/VRDEServerImpl.cpp (modified) (4 diffs)
-
src/VBox/Main/idl/VirtualBox.xidl (modified) (2 diffs)
-
src/VBox/Main/include/VRDEServerImpl.h (modified) (2 diffs)
-
src/VBox/Main/xml/Settings.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r34837 r35146 283 283 ulAuthTimeout(5000), 284 284 fAllowMultiConnection(false), 285 fReuseSingleConnection(false), 286 fVideoChannel(false), 287 ulVideoChannelQuality(75) 285 fReuseSingleConnection(false) 288 286 {} 289 287 … … 295 293 com::Utf8Str strAuthLibrary; 296 294 bool fAllowMultiConnection, 297 fReuseSingleConnection, 298 fVideoChannel; 299 uint32_t ulVideoChannelQuality; 295 fReuseSingleConnection; 300 296 com::Utf8Str strVrdeExtPack; 301 297 StringsMap mapProperties; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp
r35105 r35146 653 653 if (vrdeServer) 654 654 { 655 unsigned n = parseNum(a->argv[2], 100, "VRDE video redirection quality in percent");656 657 CHECK_ERROR(vrdeServer, COMSETTER(VideoChannelQuality)(n));655 Bstr value = a->argv[2]; 656 657 CHECK_ERROR(vrdeServer, SetVRDEProperty(Bstr("VideoChannel/Quality").raw(), value.raw())); 658 658 } 659 659 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r35105 r35146 1406 1406 BOOL fReuseCon; 1407 1407 vrdeServer->COMGETTER(ReuseSingleConnection)(&fReuseCon); 1408 BOOL fVideoChannel; 1409 vrdeServer->COMGETTER(VideoChannel)(&fVideoChannel); 1410 ULONG ulVideoChannelQuality; 1411 vrdeServer->COMGETTER(VideoChannelQuality)(&ulVideoChannelQuality); 1408 Bstr videoChannel; 1409 vrdeServer->GetVRDEProperty(Bstr("VideoChannel/Enabled").raw(), videoChannel.asOutParam()); 1410 BOOL fVideoChannel = (videoChannel.compare(Bstr("true"), Bstr::CaseInsensitive)== 0) 1411 || (videoChannel == "1"); 1412 Bstr videoChannelQuality; 1413 vrdeServer->GetVRDEProperty(Bstr("VideoChannel/Quality").raw(), videoChannelQuality.asOutParam()); 1412 1414 AuthType_T authType; 1413 1415 const char *strAuthType; … … 1455 1457 RTPrintf("vrdevideochannel=\"%s\"\n", fVideoChannel ? "on" : "off"); 1456 1458 if (fVideoChannel) 1457 RTPrintf("vrdevideochannelquality=\"% d\"\n", ulVideoChannelQuality);1459 RTPrintf("vrdevideochannelquality=\"%lS\"\n", videoChannelQuality.raw()); 1458 1460 } 1459 1461 else … … 1465 1467 RTPrintf("VRDE port: %d\n", currentPort); 1466 1468 if (fVideoChannel) 1467 RTPrintf("Video redirection: enabled (Quality % d)\n", ulVideoChannelQuality);1469 RTPrintf("Video redirection: enabled (Quality %lS)\n", videoChannelQuality.raw()); 1468 1470 else 1469 1471 RTPrintf("Video redirection: disabled\n"); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r35105 r35146 264 264 { "--vrdpreusecon", MODIFYVM_VRDPREUSECON, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */ 265 265 { "--vrdpvideochannel", MODIFYVM_VRDPVIDEOCHANNEL, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */ 266 { "--vrdpvideochannelquality", MODIFYVM_VRDPVIDEOCHANNELQUALITY, RTGETOPT_REQ_ UINT32}, /* deprecated */266 { "--vrdpvideochannelquality", MODIFYVM_VRDPVIDEOCHANNELQUALITY, RTGETOPT_REQ_STRING }, /* deprecated */ 267 267 { "--vrdp", MODIFYVM_VRDP, RTGETOPT_REQ_BOOL_ONOFF }, /* deprecated */ 268 268 { "--vrdeproperty", MODIFYVM_VRDEPROPERTY, RTGETOPT_REQ_STRING }, … … 274 274 { "--vrdereusecon", MODIFYVM_VRDEREUSECON, RTGETOPT_REQ_BOOL_ONOFF }, 275 275 { "--vrdevideochannel", MODIFYVM_VRDEVIDEOCHANNEL, RTGETOPT_REQ_BOOL_ONOFF }, 276 { "--vrdevideochannelquality", MODIFYVM_VRDEVIDEOCHANNELQUALITY, RTGETOPT_REQ_ UINT32},276 { "--vrdevideochannelquality", MODIFYVM_VRDEVIDEOCHANNELQUALITY, RTGETOPT_REQ_STRING }, 277 277 { "--vrdeextpack", MODIFYVM_VRDE_EXTPACK, RTGETOPT_REQ_STRING }, 278 278 { "--vrde", MODIFYVM_VRDE, RTGETOPT_REQ_BOOL_ONOFF }, … … 1988 1988 ASSERT(vrdeServer); 1989 1989 1990 CHECK_ERROR(vrdeServer, COMSETTER(VideoChannel)(ValueUnion.f)); 1990 CHECK_ERROR(vrdeServer, SetVRDEProperty(Bstr("VideoChannel/Enabled").raw(), 1991 ValueUnion.f? Bstr("true").raw(): Bstr("false").raw())); 1991 1992 break; 1992 1993 } … … 2000 2001 ASSERT(vrdeServer); 2001 2002 2002 CHECK_ERROR(vrdeServer, COMSETTER(VideoChannelQuality)(ValueUnion.u32)); 2003 CHECK_ERROR(vrdeServer, SetVRDEProperty(Bstr("VideoChannel/Quality").raw(), 2004 Bstr(ValueUnion.psz).raw())); 2003 2005 break; 2004 2006 } -
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r34969 r35146 650 650 case VRDE_QP_VIDEO_CHANNEL: 651 651 { 652 BOOL fVideoEnabled = FALSE; 653 654 server->mConsole->getVRDEServer()->COMGETTER(VideoChannel)(&fVideoEnabled); 652 com::Bstr bstr; 653 HRESULT hrc = server->mConsole->getVRDEServer()->GetVRDEProperty(Bstr("VideoChannel/Enabled").raw(), bstr.asOutParam()); 654 655 if (hrc != S_OK) 656 { 657 bstr = ""; 658 } 659 660 com::Utf8Str value = bstr; 661 662 BOOL fVideoEnabled = RTStrICmp(value.c_str(), "true") == 0 663 || RTStrICmp(value.c_str(), "1") == 0; 655 664 656 665 if (cbBuffer >= sizeof(uint32_t)) … … 669 678 case VRDE_QP_VIDEO_CHANNEL_QUALITY: 670 679 { 671 ULONG ulQuality = 0; 672 673 server->mConsole->getVRDEServer()->COMGETTER(VideoChannelQuality)(&ulQuality); 680 com::Bstr bstr; 681 HRESULT hrc = server->mConsole->getVRDEServer()->GetVRDEProperty(Bstr("VideoChannel/Quality").raw(), bstr.asOutParam()); 682 683 if (hrc != S_OK) 684 { 685 bstr = ""; 686 } 687 688 com::Utf8Str value = bstr; 689 690 ULONG ulQuality = RTStrToUInt32(value.c_str()); /* This returns 0 on invalid string which is ok. */ 674 691 675 692 if (cbBuffer >= sizeof(uint32_t)) -
trunk/src/VBox/Main/VRDEServerImpl.cpp
r35105 r35146 93 93 mData->mAllowMultiConnection = FALSE; 94 94 mData->mReuseSingleConnection = FALSE; 95 mData->mVideoChannel = FALSE;96 mData->mVideoChannelQuality = 75;97 95 mData->mVrdeExtPack.setNull(); 98 96 … … 212 210 mData->mAllowMultiConnection = data.fAllowMultiConnection; 213 211 mData->mReuseSingleConnection = data.fReuseSingleConnection; 214 mData->mVideoChannel = data.fVideoChannel;215 mData->mVideoChannelQuality = data.ulVideoChannelQuality;216 212 mData->mVrdeExtPack = data.strVrdeExtPack; 217 213 mData->mProperties = data.mapProperties; … … 240 236 data.fAllowMultiConnection = !!mData->mAllowMultiConnection; 241 237 data.fReuseSingleConnection = !!mData->mReuseSingleConnection; 242 data.fVideoChannel = !!mData->mVideoChannel;243 data.ulVideoChannelQuality = mData->mVideoChannelQuality;244 238 data.strVrdeExtPack = mData->mVrdeExtPack; 245 239 data.mapProperties = mData->mProperties; … … 870 864 871 865 mParent->onVRDEServerChange(/* aRestart */ TRUE); // @todo needs a restart? 872 }873 874 return S_OK;875 }876 877 STDMETHODIMP VRDEServer::COMGETTER(VideoChannel) (878 BOOL *aVideoChannel)879 {880 CheckComArgOutPointerValid(aVideoChannel);881 882 AutoCaller autoCaller(this);883 if (FAILED(autoCaller.rc())) return autoCaller.rc();884 885 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);886 887 *aVideoChannel = mData->mVideoChannel;888 889 return S_OK;890 }891 892 STDMETHODIMP VRDEServer::COMSETTER(VideoChannel) (893 BOOL aVideoChannel)894 {895 AutoCaller autoCaller(this);896 if (FAILED(autoCaller.rc())) return autoCaller.rc();897 898 /* the machine needs to be mutable */899 AutoMutableStateDependency adep(mParent);900 if (FAILED(adep.rc())) return adep.rc();901 902 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);903 904 if (mData->mVideoChannel != aVideoChannel)905 {906 mData.backup();907 mData->mVideoChannel = aVideoChannel;908 909 /* leave the lock before informing callbacks */910 alock.release();911 912 AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS); // mParent is const, needs no locking913 mParent->setModified(Machine::IsModified_VRDEServer);914 mlock.release();915 916 mParent->onVRDEServerChange(/* aRestart */ TRUE);917 }918 919 return S_OK;920 }921 922 STDMETHODIMP VRDEServer::COMGETTER(VideoChannelQuality) (923 ULONG *aVideoChannelQuality)924 {925 CheckComArgOutPointerValid(aVideoChannelQuality);926 927 AutoCaller autoCaller(this);928 if (FAILED(autoCaller.rc())) return autoCaller.rc();929 930 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);931 932 *aVideoChannelQuality = mData->mVideoChannelQuality;933 934 return S_OK;935 }936 937 STDMETHODIMP VRDEServer::COMSETTER(VideoChannelQuality) (938 ULONG aVideoChannelQuality)939 {940 AutoCaller autoCaller(this);941 if (FAILED(autoCaller.rc())) return autoCaller.rc();942 943 /* the machine needs to be mutable */944 AutoMutableStateDependency adep(mParent);945 if (FAILED(adep.rc())) return adep.rc();946 947 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);948 949 aVideoChannelQuality = RT_CLAMP(aVideoChannelQuality, 10, 100);950 951 if (mData->mVideoChannelQuality != aVideoChannelQuality)952 {953 mData.backup();954 mData->mVideoChannelQuality = aVideoChannelQuality;955 956 /* leave the lock before informing callbacks */957 alock.release();958 959 AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS); // mParent is const, needs no locking960 mParent->setModified(Machine::IsModified_VRDEServer);961 mlock.release();962 963 mParent->onVRDEServerChange(/* aRestart */ FALSE);964 866 } 965 867 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r35134 r35146 12702 12702 <interface 12703 12703 name="IVRDEServer" extends="$unknown" 12704 uuid="b 5bd49dc-26ef-42b4-ae7a-0c4b734a7653"12704 uuid="be24e0db-e1d6-4d58-b85b-21053d1511b4" 12705 12705 wsmap="managed" 12706 12706 > … … 12729 12729 must be established by the VRDE server, when a new client connects in single 12730 12730 connection mode. 12731 </desc>12732 </attribute>12733 12734 <attribute name="videoChannel" type="boolean">12735 <desc>12736 Flag whether video redirectiron channel is enabled.12737 </desc>12738 </attribute>12739 12740 <attribute name="videoChannelQuality" type="unsigned long">12741 <desc>12742 Image quality in percents.12743 12731 </desc> 12744 12732 </attribute> -
trunk/src/VBox/Main/include/VRDEServerImpl.h
r35105 r35146 40 40 BOOL mAllowMultiConnection; 41 41 BOOL mReuseSingleConnection; 42 BOOL mVideoChannel;43 ULONG mVideoChannelQuality;44 42 Utf8Str mVrdeExtPack; 45 43 settings::StringsMap mProperties; … … 80 78 STDMETHOD(COMGETTER(ReuseSingleConnection)) (BOOL *aReuseSingleConnection); 81 79 STDMETHOD(COMSETTER(ReuseSingleConnection)) (BOOL aReuseSingleConnection); 82 STDMETHOD(COMGETTER(VideoChannel)) (BOOL *aVideoChannel);83 STDMETHOD(COMSETTER(VideoChannel)) (BOOL aVideoChannel);84 STDMETHOD(COMGETTER(VideoChannelQuality)) (ULONG *aVideoChannelQuality);85 STDMETHOD(COMSETTER(VideoChannelQuality)) (ULONG aVideoChannelQuality);86 80 STDMETHOD(COMGETTER(VRDEExtPack))(BSTR *aExtPack); 87 81 STDMETHOD(COMSETTER(VRDEExtPack))(IN_BSTR aExtPack); -
trunk/src/VBox/Main/xml/Settings.cpp
r35128 r35146 1401 1401 && (fAllowMultiConnection == v.fAllowMultiConnection) 1402 1402 && (fReuseSingleConnection == v.fReuseSingleConnection) 1403 && (fVideoChannel == v.fVideoChannel)1404 && (ulVideoChannelQuality == v.ulVideoChannelQuality)1405 1403 && (strVrdeExtPack == v.strVrdeExtPack) 1406 1404 && (mapProperties == v.mapProperties) … … 2493 2491 pelmHwChild->getAttributeValue("reuseSingleConnection", hw.vrdeSettings.fReuseSingleConnection); 2494 2492 2493 /* 3.2 and 4.0 betas, 4.0 has this information in VRDEProperties. */ 2495 2494 const xml::ElementNode *pelmVideoChannel; 2496 2495 if ((pelmVideoChannel = pelmHwChild->findChildElement("VideoChannel"))) 2497 2496 { 2498 pelmVideoChannel->getAttributeValue("enabled", hw.vrdeSettings.fVideoChannel); 2499 pelmVideoChannel->getAttributeValue("quality", hw.vrdeSettings.ulVideoChannelQuality); 2500 hw.vrdeSettings.ulVideoChannelQuality = RT_CLAMP(hw.vrdeSettings.ulVideoChannelQuality, 10, 100); 2497 bool fVideoChannel = false; 2498 pelmVideoChannel->getAttributeValue("enabled", fVideoChannel); 2499 hw.vrdeSettings.mapProperties["VideoChannel/Enabled"] = fVideoChannel? "true": "false"; 2500 2501 uint32_t ulVideoChannelQuality = 75; 2502 pelmVideoChannel->getAttributeValue("quality", ulVideoChannelQuality); 2503 ulVideoChannelQuality = RT_CLAMP(ulVideoChannelQuality, 10, 100); 2504 char *pszBuffer = NULL; 2505 if (RTStrAPrintf(&pszBuffer, "%d", ulVideoChannelQuality) >= 0) 2506 { 2507 hw.vrdeSettings.mapProperties["VideoChannel/Quality"] = pszBuffer; 2508 RTStrFree(pszBuffer); 2509 } 2510 else 2511 hw.vrdeSettings.mapProperties["VideoChannel/Quality"] = "75"; 2501 2512 } 2502 2513 pelmHwChild->getAttributeValue("VRDEExtPack", hw.vrdeSettings.strVrdeExtPack); … … 3480 3491 pelmVRDE->setAttribute("reuseSingleConnection", hw.vrdeSettings.fReuseSingleConnection); 3481 3492 3482 if (m->sv >= SettingsVersion_v1_10)3493 if (m->sv == SettingsVersion_v1_10) 3483 3494 { 3484 3495 xml::ElementNode *pelmVideoChannel = pelmVRDE->createChild("VideoChannel"); 3485 pelmVideoChannel->setAttribute("enabled", hw.vrdeSettings.fVideoChannel); 3486 pelmVideoChannel->setAttribute("quality", hw.vrdeSettings.ulVideoChannelQuality); 3496 3497 /* In 4.0 videochannel settings were replaced with properties, so look at properties. */ 3498 Utf8Str str; 3499 StringsMap::const_iterator it = hw.vrdeSettings.mapProperties.find("VideoChannel/Enabled"); 3500 if (it != hw.vrdeSettings.mapProperties.end()) 3501 str = it->second; 3502 bool fVideoChannel = RTStrICmp(str.c_str(), "true") == 0 3503 || RTStrCmp(str.c_str(), "1") == 0; 3504 pelmVideoChannel->setAttribute("enabled", fVideoChannel); 3505 3506 it = hw.vrdeSettings.mapProperties.find("VideoChannel/Quality"); 3507 if (it != hw.vrdeSettings.mapProperties.end()) 3508 str = it->second; 3509 uint32_t ulVideoChannelQuality = RTStrToUInt32(str.c_str()); /* This returns 0 on invalid string which is ok. */ 3510 if (ulVideoChannelQuality == 0) 3511 ulVideoChannelQuality = 75; 3512 else 3513 ulVideoChannelQuality = RT_CLAMP(ulVideoChannelQuality, 10, 100); 3514 pelmVideoChannel->setAttribute("quality", ulVideoChannelQuality); 3487 3515 } 3488 3516 if (m->sv >= SettingsVersion_v1_11) … … 4408 4436 } 4409 4437 4410 if (m->sv < SettingsVersion_v1_1 1)4438 if (m->sv < SettingsVersion_v1_10) 4411 4439 { 4412 4440 /* If the properties contain elements other than "TCP/Ports" and "TCP/Address", 4413 * then increase the version to VBox 4.0.4441 * then increase the version to at least VBox 3.2, which can have video channel properties. 4414 4442 */ 4415 4443 unsigned cOldProperties = 0; … … 4419 4447 cOldProperties++; 4420 4448 it = hardwareMachine.vrdeSettings.mapProperties.find("TCP/Address"); 4449 if (it != hardwareMachine.vrdeSettings.mapProperties.end()) 4450 cOldProperties++; 4451 4452 if (hardwareMachine.vrdeSettings.mapProperties.size() != cOldProperties) 4453 m->sv = SettingsVersion_v1_10; 4454 } 4455 4456 if (m->sv < SettingsVersion_v1_11) 4457 { 4458 /* If the properties contain elements other than "TCP/Ports", "TCP/Address", 4459 * "VideoChannel/Enabled" and "VideoChannel/Quality" then increase the version to VBox 4.0. 4460 */ 4461 unsigned cOldProperties = 0; 4462 4463 StringsMap::const_iterator it = hardwareMachine.vrdeSettings.mapProperties.find("TCP/Ports"); 4464 if (it != hardwareMachine.vrdeSettings.mapProperties.end()) 4465 cOldProperties++; 4466 it = hardwareMachine.vrdeSettings.mapProperties.find("TCP/Address"); 4467 if (it != hardwareMachine.vrdeSettings.mapProperties.end()) 4468 cOldProperties++; 4469 it = hardwareMachine.vrdeSettings.mapProperties.find("VideoChannel/Enabled"); 4470 if (it != hardwareMachine.vrdeSettings.mapProperties.end()) 4471 cOldProperties++; 4472 it = hardwareMachine.vrdeSettings.mapProperties.find("VideoChannel/Quality"); 4421 4473 if (it != hardwareMachine.vrdeSettings.mapProperties.end()) 4422 4474 cOldProperties++; … … 4557 4609 if ( (hardwareMachine.ioSettings.fIoCacheEnabled != true) 4558 4610 || (hardwareMachine.ioSettings.ulIoCacheSize != 5) 4559 // and remote desktop video redirection channel4560 || (hardwareMachine.vrdeSettings.fVideoChannel)4561 4611 // and page fusion 4562 4612 || (hardwareMachine.fPageFusionEnabled)
Note:
See TracChangeset
for help on using the changeset viewer.

