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

Side by Side 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, 10 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "media/base/audio_hardware_config.h"
6
7 namespace media {
8
9 AudioHardwareConfig::AudioHardwareConfig(
10 int output_buffer_size, int output_sample_rate,
11 int input_sample_rate, ChannelLayout input_channel_layout)
12 : output_buffer_size_(output_buffer_size),
13 output_sample_rate_(output_sample_rate),
14 input_sample_rate_(input_sample_rate),
15 input_channel_layout_(input_channel_layout) {
16 }
17
18 AudioHardwareConfig::~AudioHardwareConfig() {}
19
20 int AudioHardwareConfig::GetOutputBufferSize() {
21 base::AutoLock auto_lock(config_lock_);
22 return output_buffer_size_;
23 }
24
25 int AudioHardwareConfig::GetOutputSampleRate() {
26 base::AutoLock auto_lock(config_lock_);
27 return output_sample_rate_;
28 }
29
30 int AudioHardwareConfig::GetInputSampleRate() {
31 base::AutoLock auto_lock(config_lock_);
32 return input_sample_rate_;
33 }
34
35 ChannelLayout AudioHardwareConfig::GetInputChannelLayout() {
36 base::AutoLock auto_lock(config_lock_);
37 return input_channel_layout_;
38 }
39
40 void AudioHardwareConfig::UpdateInputConfig(
41 int sample_rate, media::ChannelLayout channel_layout) {
42 base::AutoLock auto_lock(config_lock_);
43 input_sample_rate_ = sample_rate;
44 input_channel_layout_ = channel_layout;
45 }
46
47 void AudioHardwareConfig::UpdateOutputConfig(int buffer_size, int sample_rate) {
48 base::AutoLock auto_lock(config_lock_);
49 output_buffer_size_ = buffer_size;
50 output_sample_rate_ = sample_rate;
51 }
52
53 } // namespace media
OLDNEW
« 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