| 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 <windows.h> | 7 #include <windows.h> |
| 8 #include <avrt.h> | 8 #include <avrt.h> |
| 9 #include <mmreg.h> | 9 #include <mmreg.h> |
| 10 #include <mmsystem.h> | 10 #include <mmsystem.h> |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 bool AudioCapturerWin::Start(const PacketCapturedCallback& callback) { | 51 bool AudioCapturerWin::Start(const PacketCapturedCallback& callback) { |
| 52 DCHECK(!audio_capture_client_.get()); | 52 DCHECK(!audio_capture_client_.get()); |
| 53 DCHECK(!audio_client_.get()); | 53 DCHECK(!audio_client_.get()); |
| 54 DCHECK(!mm_device_.get()); | 54 DCHECK(!mm_device_.get()); |
| 55 DCHECK(static_cast<PWAVEFORMATEX>(wave_format_ex_) == nullptr); | 55 DCHECK(static_cast<PWAVEFORMATEX>(wave_format_ex_) == nullptr); |
| 56 DCHECK(thread_checker_.CalledOnValidThread()); | 56 DCHECK(thread_checker_.CalledOnValidThread()); |
| 57 | 57 |
| 58 callback_ = callback; | 58 callback_ = callback; |
| 59 | 59 |
| 60 // Initialize the capture timer. | 60 // Initialize the capture timer. |
| 61 capture_timer_.reset(new base::RepeatingTimer<AudioCapturerWin>()); | 61 capture_timer_.reset(new base::RepeatingTimer()); |
| 62 | 62 |
| 63 HRESULT hr = S_OK; | 63 HRESULT hr = S_OK; |
| 64 | 64 |
| 65 base::win::ScopedComPtr<IMMDeviceEnumerator> mm_device_enumerator; | 65 base::win::ScopedComPtr<IMMDeviceEnumerator> mm_device_enumerator; |
| 66 hr = mm_device_enumerator.CreateInstance(__uuidof(MMDeviceEnumerator)); | 66 hr = mm_device_enumerator.CreateInstance(__uuidof(MMDeviceEnumerator)); |
| 67 if (FAILED(hr)) { | 67 if (FAILED(hr)) { |
| 68 LOG(ERROR) << "Failed to create IMMDeviceEnumerator. Error " << hr; | 68 LOG(ERROR) << "Failed to create IMMDeviceEnumerator. Error " << hr; |
| 69 return false; | 69 return false; |
| 70 } | 70 } |
| 71 | 71 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 258 |
| 259 bool AudioCapturer::IsSupported() { | 259 bool AudioCapturer::IsSupported() { |
| 260 return true; | 260 return true; |
| 261 } | 261 } |
| 262 | 262 |
| 263 scoped_ptr<AudioCapturer> AudioCapturer::Create() { | 263 scoped_ptr<AudioCapturer> AudioCapturer::Create() { |
| 264 return make_scoped_ptr(new AudioCapturerWin()); | 264 return make_scoped_ptr(new AudioCapturerWin()); |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace remoting | 267 } // namespace remoting |
| OLD | NEW |