| 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 "media/audio/win/audio_low_latency_input_win.h" | 5 #include "media/audio/win/audio_low_latency_input_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "media/audio/audio_util.h" | 10 #include "media/audio/audio_util.h" |
| 11 #include "media/audio/win/audio_manager_win.h" | 11 #include "media/audio/win/audio_manager_win.h" |
| 12 #include "media/audio/win/avrt_wrapper_win.h" | 12 #include "media/audio/win/avrt_wrapper_win.h" |
| 13 | 13 |
| 14 using base::win::ScopedComPtr; | 14 using base::win::ScopedComPtr; |
| 15 using base::win::ScopedCOMInitializer; | 15 using base::win::ScopedCOMInitializer; |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 WASAPIAudioInputStream::WASAPIAudioInputStream( | 19 WASAPIAudioInputStream::WASAPIAudioInputStream( |
| 20 AudioManagerWin* manager, const AudioParameters& params, | 20 AudioManagerWin* manager, const AudioParameters& params, |
| 21 const std::string& device_id) | 21 const std::string& device_id) |
| 22 : com_init_(ScopedCOMInitializer::kMTA), | 22 : manager_(manager), |
| 23 manager_(manager), | |
| 24 capture_thread_(NULL), | 23 capture_thread_(NULL), |
| 25 opened_(false), | 24 opened_(false), |
| 26 started_(false), | 25 started_(false), |
| 27 endpoint_buffer_size_frames_(0), | 26 endpoint_buffer_size_frames_(0), |
| 28 device_id_(device_id), | 27 device_id_(device_id), |
| 29 sink_(NULL) { | 28 sink_(NULL) { |
| 30 DCHECK(manager_); | 29 DCHECK(manager_); |
| 31 | 30 |
| 32 // Load the Avrt DLL if not already loaded. Required to support MMCSS. | 31 // Load the Avrt DLL if not already loaded. Required to support MMCSS. |
| 33 bool avrt_init = avrt::Initialize(); | 32 bool avrt_init = avrt::Initialize(); |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 return hr; | 637 return hr; |
| 639 | 638 |
| 640 // Obtain a reference to the ISimpleAudioVolume interface which enables | 639 // Obtain a reference to the ISimpleAudioVolume interface which enables |
| 641 // us to control the master volume level of an audio session. | 640 // us to control the master volume level of an audio session. |
| 642 hr = audio_client_->GetService(__uuidof(ISimpleAudioVolume), | 641 hr = audio_client_->GetService(__uuidof(ISimpleAudioVolume), |
| 643 simple_audio_volume_.ReceiveVoid()); | 642 simple_audio_volume_.ReceiveVoid()); |
| 644 return hr; | 643 return hr; |
| 645 } | 644 } |
| 646 | 645 |
| 647 } // namespace media | 646 } // namespace media |
| OLD | NEW |