blob: d72fce7b4e234c2f225e28b528c15900dd2582d2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
// 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"
using base::AutoLock;
using media::AudioParameters;
namespace media {
AudioHardwareConfig::AudioHardwareConfig(
const AudioParameters& input_params,
const AudioParameters& output_params)
: input_params_(input_params),
output_params_(output_params) {
}
AudioHardwareConfig::~AudioHardwareConfig() {}
int AudioHardwareConfig::GetOutputBufferSize() const {
AutoLock auto_lock(config_lock_);
return output_params_.frames_per_buffer();
}
int AudioHardwareConfig::GetOutputSampleRate() const {
AutoLock auto_lock(config_lock_);
return output_params_.sample_rate();
}
ChannelLayout AudioHardwareConfig::GetOutputChannelLayout() const {
AutoLock auto_lock(config_lock_);
return output_params_.channel_layout();
}
int AudioHardwareConfig::GetOutputChannels() const {
AutoLock auto_lock(config_lock_);
return output_params_.channels();
}
int AudioHardwareConfig::GetInputSampleRate() const {
AutoLock auto_lock(config_lock_);
return input_params_.sample_rate();
}
ChannelLayout AudioHardwareConfig::GetInputChannelLayout() const {
AutoLock auto_lock(config_lock_);
return input_params_.channel_layout();
}
int AudioHardwareConfig::GetInputChannels() const {
AutoLock auto_lock(config_lock_);
return input_params_.channels();
}
media::AudioParameters
AudioHardwareConfig::GetInputConfig() const {
AutoLock auto_lock(config_lock_);
return input_params_;
}
media::AudioParameters
AudioHardwareConfig::GetOutputConfig() const {
AutoLock auto_lock(config_lock_);
return output_params_;
}
void AudioHardwareConfig::UpdateInputConfig(
const AudioParameters& input_params) {
AutoLock auto_lock(config_lock_);
input_params_ = input_params;
}
void AudioHardwareConfig::UpdateOutputConfig(
const AudioParameters& output_params) {
AutoLock auto_lock(config_lock_);
output_params_ = output_params;
}
} // namespace media
|