From 32c0a769e38711f707ca760652f44b14dea36620 Mon Sep 17 00:00:00 2001 From: "alexeypa@chromium.org" Date: Thu, 6 Jun 2013 02:53:07 +0000 Subject: Disable audio in an RDP session. Capturing audio using IAudioCaptureClient in an RDP session garbles the sound. This seems to be caused by a bug in the OS. This CL disables audio in an RDP session until we find a better way of capturing audio. BUG=242312 Review URL: https://chromiumcodereview.appspot.com/16359013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204397 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/host/win/rdp_client_window.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'remoting/host') diff --git a/remoting/host/win/rdp_client_window.cc b/remoting/host/win/rdp_client_window.cc index e9bcdac..787f8d2 100644 --- a/remoting/host/win/rdp_client_window.cc +++ b/remoting/host/win/rdp_client_window.cc @@ -39,6 +39,18 @@ const int kKeyboardStateLength = 256; // The RDP control creates 'IHWindowClass' window to handle keyboard input. const wchar_t kRdpInputWindowClass[] = L"IHWindowClass"; +enum RdpAudioMode { + // Redirect sounds to the client. This is the default value. + kRdpAudioModeRedirect = 0, + + // Play sounds at the remote computer. Equivalent to |kRdpAudioModeNone| if + // the remote computer is running a server SKU. + kRdpAudioModePlayOnServer = 1, + + // Disable sound redirection; do not play sounds at the remote computer. + kRdpAudioModeNone = 2 +}; + // Points to a per-thread instance of the window activation hook handle. base::LazyInstance > g_window_hook = LAZY_INSTANCE_INITIALIZER; @@ -224,6 +236,7 @@ LRESULT RdpClientWindow::OnCreate(CREATESTRUCT* create_struct) { CAxWindow2 activex_window; base::win::ScopedComPtr control; HRESULT result = E_FAIL; + base::win::ScopedComPtr secured_settings; base::win::ScopedBstr server_name( UTF8ToUTF16(server_endpoint_.ToStringWithoutPort()).c_str()); @@ -323,6 +336,16 @@ LRESULT RdpClientWindow::OnCreate(CREATESTRUCT* create_struct) { if (FAILED(result)) goto done; + // Disable audio in the session. + // TODO(alexeypa): re-enable audio redirection when http://crbug.com/242312 is + // fixed. + result = client_->get_SecuredSettings2(secured_settings.Receive()); + if (SUCCEEDED(result)) { + result = secured_settings->put_AudioRedirectionMode(kRdpAudioModeNone); + if (FAILED(result)) + goto done; + } + result = client_->Connect(); if (FAILED(result)) goto done; -- cgit v1.1