| 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 "content/renderer/media/webrtc/processed_local_audio_source.h" | 5 #include "content/renderer/media/webrtc/processed_local_audio_source.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "content/renderer/media/audio_device_factory.h" | 10 #include "content/renderer/media/audio_device_factory.h" |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 SetVolume(new_volume); | 332 SetVolume(new_volume); |
| 333 | 333 |
| 334 // Update the |current_volume| to avoid passing the old volume to AGC. | 334 // Update the |current_volume| to avoid passing the old volume to AGC. |
| 335 current_volume = new_volume; | 335 current_volume = new_volume; |
| 336 } | 336 } |
| 337 } | 337 } |
| 338 } | 338 } |
| 339 | 339 |
| 340 void ProcessedLocalAudioSource::OnCaptureError(const std::string& message) { | 340 void ProcessedLocalAudioSource::OnCaptureError(const std::string& message) { |
| 341 WebRtcLogMessage("ProcessedLocalAudioSource::OnCaptureError: " + message); | 341 WebRtcLogMessage("ProcessedLocalAudioSource::OnCaptureError: " + message); |
| 342 OnAudioCaptureError(message); |
| 342 } | 343 } |
| 343 | 344 |
| 344 media::AudioParameters ProcessedLocalAudioSource::GetInputFormat() const { | 345 media::AudioParameters ProcessedLocalAudioSource::GetInputFormat() const { |
| 345 return audio_processor_ ? audio_processor_->InputFormat() | 346 return audio_processor_ ? audio_processor_->InputFormat() |
| 346 : media::AudioParameters(); | 347 : media::AudioParameters(); |
| 347 } | 348 } |
| 348 | 349 |
| 349 int ProcessedLocalAudioSource::GetBufferSize(int sample_rate) const { | 350 int ProcessedLocalAudioSource::GetBufferSize(int sample_rate) const { |
| 350 DCHECK(thread_checker_.CalledOnValidThread()); | 351 DCHECK(thread_checker_.CalledOnValidThread()); |
| 351 #if defined(OS_ANDROID) | 352 #if defined(OS_ANDROID) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 366 | 367 |
| 367 // If the buffer size is missing from the StreamDeviceInfo, provide 10ms as a | 368 // If the buffer size is missing from the StreamDeviceInfo, provide 10ms as a |
| 368 // fall-back. | 369 // fall-back. |
| 369 // | 370 // |
| 370 // TODO(miu): Identify where/why the buffer size might be missing, fix the | 371 // TODO(miu): Identify where/why the buffer size might be missing, fix the |
| 371 // code, and then require it here. http://crbug.com/638081 | 372 // code, and then require it here. http://crbug.com/638081 |
| 372 return (sample_rate / 100); | 373 return (sample_rate / 100); |
| 373 } | 374 } |
| 374 | 375 |
| 375 } // namespace content | 376 } // namespace content |
| OLD | NEW |