Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1316)

Unified Diff: media/base/audio_hardware_config.cc

Issue 11880009: Introduce AudioHardwareConfig for renderer side audio device info. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style nits. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/audio_hardware_config.h ('k') | media/base/audio_hardware_config_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_hardware_config.cc
diff --git a/media/base/audio_hardware_config.cc b/media/base/audio_hardware_config.cc
new file mode 100644
index 0000000000000000000000000000000000000000..eaacc690d1d38edba8eedfcfb2804a88813d8d27
--- /dev/null
+++ b/media/base/audio_hardware_config.cc
@@ -0,0 +1,53 @@
+// 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 "media/base/audio_hardware_config.h"
+
+namespace media {
+
+AudioHardwareConfig::AudioHardwareConfig(
+ int output_buffer_size, int output_sample_rate,
+ int input_sample_rate, ChannelLayout input_channel_layout)
+ : output_buffer_size_(output_buffer_size),
+ output_sample_rate_(output_sample_rate),
+ input_sample_rate_(input_sample_rate),
+ input_channel_layout_(input_channel_layout) {
+}
+
+AudioHardwareConfig::~AudioHardwareConfig() {}
+
+int AudioHardwareConfig::GetOutputBufferSize() {
+ base::AutoLock auto_lock(config_lock_);
+ return output_buffer_size_;
+}
+
+int AudioHardwareConfig::GetOutputSampleRate() {
+ base::AutoLock auto_lock(config_lock_);
+ return output_sample_rate_;
+}
+
+int AudioHardwareConfig::GetInputSampleRate() {
+ base::AutoLock auto_lock(config_lock_);
+ return input_sample_rate_;
+}
+
+ChannelLayout AudioHardwareConfig::GetInputChannelLayout() {
+ base::AutoLock auto_lock(config_lock_);
+ return input_channel_layout_;
+}
+
+void AudioHardwareConfig::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 AudioHardwareConfig::UpdateOutputConfig(int buffer_size, int sample_rate) {
+ base::AutoLock auto_lock(config_lock_);
+ output_buffer_size_ = buffer_size;
+ output_sample_rate_ = sample_rate;
+}
+
+} // namespace media
« no previous file with comments | « media/base/audio_hardware_config.h ('k') | media/base/audio_hardware_config_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698