| 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 <stdint.h> | 10 #include <stdint.h> |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 DCHECK(thread_checker_.CalledOnValidThread()); | 139 DCHECK(thread_checker_.CalledOnValidThread()); |
| 140 wave_format_ex_.Reset(nullptr); | 140 wave_format_ex_.Reset(nullptr); |
| 141 mm_device_enumerator_.Reset(); | 141 mm_device_enumerator_.Reset(); |
| 142 audio_capture_client_.Reset(); | 142 audio_capture_client_.Reset(); |
| 143 audio_client_.Reset(); | 143 audio_client_.Reset(); |
| 144 mm_device_.Reset(); | 144 mm_device_.Reset(); |
| 145 audio_volume_.Reset(); | 145 audio_volume_.Reset(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool AudioCapturerWin::Initialize() { | 148 bool AudioCapturerWin::Initialize() { |
| 149 DCHECK(!audio_capture_client_.get()); | 149 DCHECK(!audio_capture_client_.Get()); |
| 150 DCHECK(!audio_client_.get()); | 150 DCHECK(!audio_client_.Get()); |
| 151 DCHECK(!mm_device_.get()); | 151 DCHECK(!mm_device_.Get()); |
| 152 DCHECK(!audio_volume_.get()); | 152 DCHECK(!audio_volume_.Get()); |
| 153 DCHECK(static_cast<PWAVEFORMATEX>(wave_format_ex_) == nullptr); | 153 DCHECK(static_cast<PWAVEFORMATEX>(wave_format_ex_) == nullptr); |
| 154 DCHECK(thread_checker_.CalledOnValidThread()); | 154 DCHECK(thread_checker_.CalledOnValidThread()); |
| 155 | 155 |
| 156 HRESULT hr = S_OK; | 156 HRESULT hr = S_OK; |
| 157 hr = mm_device_enumerator_.CreateInstance(__uuidof(MMDeviceEnumerator)); | 157 hr = mm_device_enumerator_.CreateInstance(__uuidof(MMDeviceEnumerator)); |
| 158 if (FAILED(hr)) { | 158 if (FAILED(hr)) { |
| 159 LOG(ERROR) << "Failed to create IMMDeviceEnumerator. Error " << hr; | 159 LOG(ERROR) << "Failed to create IMMDeviceEnumerator. Error " << hr; |
| 160 return false; | 160 return false; |
| 161 } | 161 } |
| 162 | 162 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 425 |
| 426 bool AudioCapturer::IsSupported() { | 426 bool AudioCapturer::IsSupported() { |
| 427 return true; | 427 return true; |
| 428 } | 428 } |
| 429 | 429 |
| 430 std::unique_ptr<AudioCapturer> AudioCapturer::Create() { | 430 std::unique_ptr<AudioCapturer> AudioCapturer::Create() { |
| 431 return base::WrapUnique(new AudioCapturerWin()); | 431 return base::WrapUnique(new AudioCapturerWin()); |
| 432 } | 432 } |
| 433 | 433 |
| 434 } // namespace remoting | 434 } // namespace remoting |
| OLD | NEW |