| 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" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 if (sink_) { | 175 if (sink_) { |
| 176 sink_->OnClose(this); | 176 sink_->OnClose(this); |
| 177 sink_ = NULL; | 177 sink_ = NULL; |
| 178 } | 178 } |
| 179 | 179 |
| 180 // Inform the audio manager that we have been closed. This will cause our | 180 // Inform the audio manager that we have been closed. This will cause our |
| 181 // destruction. | 181 // destruction. |
| 182 manager_->ReleaseInputStream(this); | 182 manager_->ReleaseInputStream(this); |
| 183 } | 183 } |
| 184 | 184 |
| 185 double WASAPIAudioInputStream::GetMaxVolume() { |
| 186 // TODO(xians): Add volume support. |
| 187 return 0.0; |
| 188 } |
| 189 |
| 190 void WASAPIAudioInputStream::SetVolume(double volume) { |
| 191 // TODO(xians): Add volume support. |
| 192 } |
| 193 |
| 194 double WASAPIAudioInputStream::GetVolume() { |
| 195 // TODO(xians): Add volume support. |
| 196 return 0.0; |
| 197 } |
| 198 |
| 185 // static | 199 // static |
| 186 double WASAPIAudioInputStream::HardwareSampleRate(ERole device_role) { | 200 double WASAPIAudioInputStream::HardwareSampleRate(ERole device_role) { |
| 187 base::win::ScopedCoMem<WAVEFORMATEX> audio_engine_mix_format; | 201 base::win::ScopedCoMem<WAVEFORMATEX> audio_engine_mix_format; |
| 188 HRESULT hr = GetMixFormat(device_role, &audio_engine_mix_format); | 202 HRESULT hr = GetMixFormat(device_role, &audio_engine_mix_format); |
| 189 if (FAILED(hr)) | 203 if (FAILED(hr)) |
| 190 return 0.0; | 204 return 0.0; |
| 191 | 205 |
| 192 return static_cast<double>(audio_engine_mix_format->nSamplesPerSec); | 206 return static_cast<double>(audio_engine_mix_format->nSamplesPerSec); |
| 193 } | 207 } |
| 194 | 208 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 hr = audio_client_->SetEventHandle(audio_samples_ready_event_.Get()); | 540 hr = audio_client_->SetEventHandle(audio_samples_ready_event_.Get()); |
| 527 if (FAILED(hr)) | 541 if (FAILED(hr)) |
| 528 return hr; | 542 return hr; |
| 529 | 543 |
| 530 // Get access to the IAudioCaptureClient interface. This interface | 544 // Get access to the IAudioCaptureClient interface. This interface |
| 531 // enables us to read input data from the capture endpoint buffer. | 545 // enables us to read input data from the capture endpoint buffer. |
| 532 hr = audio_client_->GetService(__uuidof(IAudioCaptureClient), | 546 hr = audio_client_->GetService(__uuidof(IAudioCaptureClient), |
| 533 audio_capture_client_.ReceiveVoid()); | 547 audio_capture_client_.ReceiveVoid()); |
| 534 return hr; | 548 return hr; |
| 535 } | 549 } |
| OLD | NEW |