OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ |
6 #define PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
| 9 #include "ppapi/c/pp_macros.h" |
9 #include "ppapi/c/pp_module.h" | 10 #include "ppapi/c/pp_module.h" |
10 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
11 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
12 | 13 |
13 #define PPB_AUDIO_CONFIG_DEV_INTERFACE "PPB_AudioConfig(Dev);0.3" | 14 #define PPB_AUDIO_CONFIG_DEV_INTERFACE "PPB_AudioConfig(Dev);0.3" |
14 | 15 |
15 enum { | 16 enum { |
16 PP_AUDIOMINSAMPLEFRAMECOUNT = 64, | 17 PP_AUDIOMINSAMPLEFRAMECOUNT = 64, |
17 PP_AUDIOMAXSAMPLEFRAMECOUNT = 32768 | 18 PP_AUDIOMAXSAMPLEFRAMECOUNT = 32768 |
18 }; | 19 }; |
19 | 20 |
20 typedef enum { | 21 typedef enum { |
21 PP_AUDIOSAMPLERATE_NONE = 0, | 22 PP_AUDIOSAMPLERATE_NONE = 0, |
22 PP_AUDIOSAMPLERATE_44100 = 44100, | 23 PP_AUDIOSAMPLERATE_44100 = 44100, |
23 PP_AUDIOSAMPLERATE_48000 = 48000 | 24 PP_AUDIOSAMPLERATE_48000 = 48000 |
24 } PP_AudioSampleRate_Dev; | 25 } PP_AudioSampleRate_Dev; |
| 26 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_AudioSampleRate_Dev, 4); |
25 | 27 |
26 /** | 28 /** |
27 * Audio configuration. This base configuration interface supports only stereo | 29 * Audio configuration. This base configuration interface supports only stereo |
28 * 16bit output. This class is not mutable, therefore it is okay to access | 30 * 16bit output. This class is not mutable, therefore it is okay to access |
29 * instances from different threads. | 31 * instances from different threads. |
30 */ | 32 */ |
31 struct PPB_AudioConfig_Dev { | 33 struct PPB_AudioConfig_Dev { |
32 /** | 34 /** |
33 * Create a 16 bit stereo config with the given sample rate. We guarantee | 35 * Create a 16 bit stereo config with the given sample rate. We guarantee |
34 * that PP_AUDIOSAMPLERATE_44100 and PP_AUDIOSAMPLERATE_48000 sample rates | 36 * that PP_AUDIOSAMPLERATE_44100 and PP_AUDIOSAMPLERATE_48000 sample rates |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 87 |
86 /** | 88 /** |
87 * Returns the sample frame count for the given AudioConfig resource. If the | 89 * Returns the sample frame count for the given AudioConfig resource. If the |
88 * resource is invalid, this will return 0. See RecommendSampleFrameCount for | 90 * resource is invalid, this will return 0. See RecommendSampleFrameCount for |
89 * more on sample frame counts. | 91 * more on sample frame counts. |
90 */ | 92 */ |
91 uint32_t (*GetSampleFrameCount)(PP_Resource config); | 93 uint32_t (*GetSampleFrameCount)(PP_Resource config); |
92 }; | 94 }; |
93 | 95 |
94 #endif // PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ | 96 #endif // PPAPI_C_DEV_PPB_AUDIO_CONFIG_DEV_H_ |
OLD | NEW |