OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_HARDWARE_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_HARDWARE_H_ |
6 #define CONTENT_RENDERER_MEDIA_AUDIO_HARDWARE_H_ | 6 #define CONTENT_RENDERER_MEDIA_AUDIO_HARDWARE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 // Contains static methods to query hardware properties from the browser | 12 // Contains static methods to query hardware properties from the browser |
13 // process. Values are cached to avoid unnecessary round trips, but the cache | 13 // process. Values are cached to avoid unnecessary round trips, but the cache |
14 // can be cleared if needed (currently only used by tests). | 14 // can be cleared if needed (currently only used by tests). |
15 namespace audio_hardware { | 15 namespace audio_hardware { |
16 | 16 |
17 // Fetch the sample rate of the default audio output end point device. | 17 // Fetch the sample rate of the default audio output end point device. |
18 // Must be called from RenderThreadImpl::current(). | 18 // Must be called from RenderThreadImpl::current(). |
19 CONTENT_EXPORT double GetOutputSampleRate(); | 19 CONTENT_EXPORT double GetOutputSampleRate(); |
20 | 20 |
21 // Fetch the sample rate of the default audio input end point device. | 21 // Fetch the sample rate of the default audio input end point device. |
22 // Must be called from RenderThreadImpl::current(). | 22 // Must be called from RenderThreadImpl::current(). |
23 CONTENT_EXPORT double GetInputSampleRate(); | 23 CONTENT_EXPORT double GetInputSampleRate(); |
24 | 24 |
25 // Fetch the buffer size we use for the default output device. | 25 // Fetch the buffer size we use for the default output device. |
26 // Must be called from RenderThreadImpl::current(). | 26 // Must be called from RenderThreadImpl::current(). |
27 // Must be used in conjunction with AUDIO_PCM_LOW_LATENCY. | |
27 CONTENT_EXPORT size_t GetOutputBufferSize(); | 28 CONTENT_EXPORT size_t GetOutputBufferSize(); |
28 | 29 |
30 // Computes a buffer size based on the given |sample_rate|. Must be used in | |
31 // conjunction with AUDIO_PCM_LINEAR. | |
32 CONTENT_EXPORT size_t GetHighLatencyOutputBufferSize(int sample_rate); | |
33 | |
29 // Fetch the number of audio channels for the default input device. | 34 // Fetch the number of audio channels for the default input device. |
30 // Must be called from RenderThreadImpl::current(). | 35 // Must be called from RenderThreadImpl::current(). |
31 CONTENT_EXPORT uint32 GetInputChannelCount(); | 36 CONTENT_EXPORT uint32 GetInputChannelCount(); |
32 | 37 |
33 // Forces the next call to any of the Get functions to query the hardware | 38 // Forces the next call to any of the Get functions to query the hardware |
34 // and repopulate the cache. | 39 // and repopulate the cache. |
35 CONTENT_EXPORT void ResetCache(); | 40 CONTENT_EXPORT void ResetCache(); |
36 } // namespace audio_hardware | 41 } // namespace audio_hardware |
scherkus (not reviewing)
2012/02/23 18:27:43
nit: can you add a line above here?
vrk (LEFT CHROMIUM)
2012/02/23 22:33:18
Done.
| |
37 | 42 |
38 #endif // CONTENT_RENDERER_MEDIA_AUDIO_HARDWARE_H_ | 43 #endif // CONTENT_RENDERER_MEDIA_AUDIO_HARDWARE_H_ |
OLD | NEW |