| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/audio_capturer_win.h" | 5 #include "remoting/host/audio_capturer_win.h" |
| 6 | 6 |
| 7 #include <avrt.h> | 7 #include <avrt.h> |
| 8 #include <mmreg.h> | 8 #include <mmreg.h> |
| 9 #include <mmsystem.h> | 9 #include <mmsystem.h> |
| 10 #include <objbase.h> | 10 #include <objbase.h> |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 if (FAILED(hr)) { | 108 if (FAILED(hr)) { |
| 109 LOG(ERROR) << "Failed to create IMMDeviceEnumerator. Error " << hr; | 109 LOG(ERROR) << "Failed to create IMMDeviceEnumerator. Error " << hr; |
| 110 return false; | 110 return false; |
| 111 } | 111 } |
| 112 | 112 |
| 113 default_device_detector_.reset( | 113 default_device_detector_.reset( |
| 114 new DefaultAudioDeviceChangeDetector(mm_device_enumerator)); | 114 new DefaultAudioDeviceChangeDetector(mm_device_enumerator)); |
| 115 | 115 |
| 116 // Get the audio endpoint. | 116 // Get the audio endpoint. |
| 117 hr = mm_device_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, | 117 hr = mm_device_enumerator->GetDefaultAudioEndpoint(eRender, eConsole, |
| 118 mm_device_.Receive()); | 118 mm_device_.GetAddressOf()); |
| 119 if (FAILED(hr)) { | 119 if (FAILED(hr)) { |
| 120 LOG(ERROR) << "Failed to get IMMDevice. Error " << hr; | 120 LOG(ERROR) << "Failed to get IMMDevice. Error " << hr; |
| 121 return false; | 121 return false; |
| 122 } | 122 } |
| 123 | 123 |
| 124 // Get an audio client. | 124 // Get an audio client. |
| 125 hr = mm_device_->Activate(__uuidof(IAudioClient), | 125 hr = mm_device_->Activate(__uuidof(IAudioClient), |
| 126 CLSCTX_ALL, | 126 CLSCTX_ALL, |
| 127 nullptr, | 127 nullptr, |
| 128 &audio_client_); | 128 &audio_client_); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 368 |
| 369 bool AudioCapturer::IsSupported() { | 369 bool AudioCapturer::IsSupported() { |
| 370 return true; | 370 return true; |
| 371 } | 371 } |
| 372 | 372 |
| 373 std::unique_ptr<AudioCapturer> AudioCapturer::Create() { | 373 std::unique_ptr<AudioCapturer> AudioCapturer::Create() { |
| 374 return base::WrapUnique(new AudioCapturerWin()); | 374 return base::WrapUnique(new AudioCapturerWin()); |
| 375 } | 375 } |
| 376 | 376 |
| 377 } // namespace remoting | 377 } // namespace remoting |
| OLD | NEW |