OLD | NEW |
---|---|
(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 #ifndef CONTENT_RENDERER_MEDIA_RENDERER_AUDIO_HARDWARE_CONFIG_H_ | |
6 #define CONTENT_RENDERER_MEDIA_RENDERER_AUDIO_HARDWARE_CONFIG_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
henrika (OOO until Aug 14)
2013/01/29 10:46:49
Why do you need this one here?
DaleCurtis
2013/01/30 01:31:06
Necessary for the DISALLOW_COPY_AND_ASSIGN() macro
| |
9 #include "base/synchronization/lock.h" | |
10 #include "content/common/content_export.h" | |
11 #include "media/base/audio_hardware_config.h" | |
12 | |
13 namespace content { | |
14 | |
15 // Provides access to the audio hardware configuration from the renderer side. | |
16 class CONTENT_EXPORT RendererAudioHardwareConfig | |
17 : public media::AudioHardwareConfig { | |
18 public: | |
19 // Must be constructed on the render thread. RendererAudioHardwareConfig | |
20 // sends a synchronous IPC to retrieve the audio hardware configuration; once | |
21 // complete accessors and updaters may be called from any thread. | |
22 RendererAudioHardwareConfig(); | |
23 virtual ~RendererAudioHardwareConfig(); | |
24 | |
25 // Constructor for tests which don't have a render thread. | |
26 RendererAudioHardwareConfig(int output_buffer_size, int output_sample_rate, | |
henrika (OOO until Aug 14)
2013/01/29 10:46:49
Should it be public?
DaleCurtis
2013/01/30 01:31:06
Easier if it is. Otherwise there's a bunch of ugly
| |
27 int input_sample_rate, | |
28 media::ChannelLayout input_channel_layout); | |
29 | |
30 // Accessors for the currently cached hardware configuration. Safe to call | |
31 // from any thread. | |
32 virtual int GetOutputBufferSize() OVERRIDE; | |
33 virtual int GetOutputSampleRate() OVERRIDE; | |
34 virtual int GetInputSampleRate() OVERRIDE; | |
35 virtual media::ChannelLayout GetInputChannelLayout() OVERRIDE; | |
36 | |
37 // Allows callers to update the cached values for either input or output. The | |
38 // values are paired under the assumption that these values will only be set | |
39 // after an input or output device change respectively. Safe to call from | |
40 // any thread. | |
41 void UpdateInputConfig(int sample_rate, media::ChannelLayout channel_layout); | |
henrika (OOO until Aug 14)
2013/01/29 10:46:49
OK, now I get it. Seen as implementation detail an
| |
42 void UpdateOutputConfig(int buffer_size, int sample_rate); | |
43 | |
44 private: | |
45 // Cached values; access is protected by |config_lock_|. | |
46 base::Lock config_lock_; | |
henrika (OOO until Aug 14)
2013/01/29 10:46:49
How is this class used today? Are all methods only
DaleCurtis
2013/01/29 19:36:00
AudioRendererMixerManager::GetMixer() may be calle
| |
47 int output_buffer_size_; | |
48 int output_sample_rate_; | |
49 int input_sample_rate_; | |
50 media::ChannelLayout input_channel_layout_; | |
51 | |
52 DISALLOW_COPY_AND_ASSIGN(RendererAudioHardwareConfig); | |
53 }; | |
54 | |
55 } // namespace content | |
56 | |
57 #endif // CONTENT_RENDERER_MEDIA_RENDERER_AUDIO_HARDWARE_CONFIG_H_ | |
OLD | NEW |