| Index: content/renderer/media/renderer_audio_hardware_config.cc
|
| diff --git a/content/renderer/media/renderer_audio_hardware_config.cc b/content/renderer/media/renderer_audio_hardware_config.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..77b8bcc37dd9f54e4c28c6ed19b14ef96ceccf08
|
| --- /dev/null
|
| +++ b/content/renderer/media/renderer_audio_hardware_config.cc
|
| @@ -0,0 +1,59 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "content/renderer/media/renderer_audio_hardware_config.h"
|
| +
|
| +#include "content/common/view_messages.h"
|
| +#include "content/renderer/render_thread_impl.h"
|
| +
|
| +namespace content {
|
| +
|
| +RendererAudioHardwareConfig::RendererAudioHardwareConfig()
|
| + : output_buffer_size_(0),
|
| + output_sample_rate_(0),
|
| + input_sample_rate_(0),
|
| + input_channel_layout_(media::CHANNEL_LAYOUT_NONE) {
|
| + CHECK(RenderThreadImpl::current());
|
| + RenderThreadImpl::current()->Send(new ViewHostMsg_GetAudioHardwareConfig(
|
| + &output_buffer_size_, &output_sample_rate_, &input_sample_rate_,
|
| + &input_channel_layout_));
|
| +}
|
| +
|
| +RendererAudioHardwareConfig::~RendererAudioHardwareConfig() {}
|
| +
|
| +int RendererAudioHardwareConfig::GetOutputBufferSize() {
|
| + base::AutoLock auto_lock(config_lock_);
|
| + return output_buffer_size_;
|
| +}
|
| +
|
| +int RendererAudioHardwareConfig::GetOutputSampleRate() {
|
| + base::AutoLock auto_lock(config_lock_);
|
| + return output_sample_rate_;
|
| +}
|
| +
|
| +int RendererAudioHardwareConfig::GetInputSampleRate() {
|
| + base::AutoLock auto_lock(config_lock_);
|
| + return input_sample_rate_;
|
| +}
|
| +
|
| +media::ChannelLayout RendererAudioHardwareConfig::GetInputChannelLayout() {
|
| + base::AutoLock auto_lock(config_lock_);
|
| + return input_channel_layout_;
|
| +}
|
| +
|
| +void RendererAudioHardwareConfig::UpdateInputConfig(
|
| + int sample_rate, media::ChannelLayout channel_layout) {
|
| + base::AutoLock auto_lock(config_lock_);
|
| + input_sample_rate_ = sample_rate;
|
| + input_channel_layout_ = channel_layout;
|
| +}
|
| +
|
| +void RendererAudioHardwareConfig::UpdateOutputConfig(int buffer_size,
|
| + int sample_rate) {
|
| + base::AutoLock auto_lock(config_lock_);
|
| + output_buffer_size_ = buffer_size;
|
| + output_sample_rate_ = sample_rate;
|
| +}
|
| +
|
| +} // namespace content
|
|
|