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 | 5 |
6 /* From ppb_audio_config.idl modified Wed Aug 24 20:49:30 2011. */ | 6 /* From ppb_audio_config.idl modified Mon Aug 29 10:11:34 2011. */ |
7 | 7 |
8 #ifndef PPAPI_C_PPB_AUDIO_CONFIG_H_ | 8 #ifndef PPAPI_C_PPB_AUDIO_CONFIG_H_ |
9 #define PPAPI_C_PPB_AUDIO_CONFIG_H_ | 9 #define PPAPI_C_PPB_AUDIO_CONFIG_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
15 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
16 | 16 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 * <code>buffer16[1]</code> is the first right channel sample. | 84 * <code>buffer16[1]</code> is the first right channel sample. |
85 * <code>buffer16[2]</code> is the second left channel sample. | 85 * <code>buffer16[2]</code> is the second left channel sample. |
86 * <code>buffer16[3]</code> is the second right channel sample. | 86 * <code>buffer16[3]</code> is the second right channel sample. |
87 * ... | 87 * ... |
88 * <code>buffer16[2 * (sample_frame_count - 1)]</code> is the last left | 88 * <code>buffer16[2 * (sample_frame_count - 1)]</code> is the last left |
89 * channel sample. | 89 * channel sample. |
90 * <code>buffer16[2 * (sample_frame_count - 1) + 1]</code> is the last | 90 * <code>buffer16[2 * (sample_frame_count - 1) + 1]</code> is the last |
91 * right channel sample. | 91 * right channel sample. |
92 * Data will always be in the native endian format of the platform. | 92 * Data will always be in the native endian format of the platform. |
93 * | 93 * |
94 * @param[in] instance A <code>PP_Instance indentifying</code> one instance | 94 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
95 * of a module. | 95 * of a module. |
96 * @param[in] sample_rate A P<code>P_AudioSampleRate</code> which is either | 96 * @param[in] sample_rate A P<code>P_AudioSampleRate</code> which is either |
97 * <code>PP_AUDIOSAMPLERATE_44100</code> or | 97 * <code>PP_AUDIOSAMPLERATE_44100</code> or |
98 * <code>PP_AUDIOSAMPLERATE_48000</code>. | 98 * <code>PP_AUDIOSAMPLERATE_48000</code>. |
99 * @param[in] sample_frame_count A <code>uint32_t</code> frame count returned | 99 * @param[in] sample_frame_count A <code>uint32_t</code> frame count returned |
100 * from the <code>RecommendSampleFrameCount</code> function. | 100 * from the <code>RecommendSampleFrameCount</code> function. |
| 101 * |
101 * @return A <code>PP_Resource</code> containing the | 102 * @return A <code>PP_Resource</code> containing the |
102 * <code>PPB_Audio_Config</code> if successful or a null resource if the | 103 * <code>PPB_Audio_Config</code> if successful or a null resource if the |
103 * sample frame count or bit rate are not supported. | 104 * sample frame count or bit rate are not supported. |
104 */ | 105 */ |
105 PP_Resource (*CreateStereo16Bit)(PP_Instance instance, | 106 PP_Resource (*CreateStereo16Bit)(PP_Instance instance, |
106 PP_AudioSampleRate sample_rate, | 107 PP_AudioSampleRate sample_rate, |
107 uint32_t sample_frame_count); | 108 uint32_t sample_frame_count); |
108 /** | 109 /** |
109 * RecommendSampleFrameCount() returns the supported sample frame count | 110 * RecommendSampleFrameCount() returns the supported sample frame count |
110 * closest to the requested count. The sample frame count determines the | 111 * closest to the requested count. The sample frame count determines the |
111 * overall latency of audio. Since one "frame" is always buffered in advance, | 112 * overall latency of audio. Since one "frame" is always buffered in advance, |
112 * smaller frame counts will yield lower latency, but higher CPU utilization. | 113 * smaller frame counts will yield lower latency, but higher CPU utilization. |
113 * | 114 * |
114 * Supported sample frame counts will vary by hardware and system (consider | 115 * Supported sample frame counts will vary by hardware and system (consider |
115 * that the local system might be anywhere from a cell phone or a high-end | 116 * that the local system might be anywhere from a cell phone or a high-end |
116 * audio workstation). Sample counts less than | 117 * audio workstation). Sample counts less than |
117 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than | 118 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than |
118 * <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any | 119 * <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any |
119 * system, but values in between aren't necessarily valid. This function | 120 * system, but values in between aren't necessarily valid. This function |
120 * will return a supported count closest to the requested value. | 121 * will return a supported count closest to the requested value. |
121 * | 122 * |
122 * @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either | 123 * @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either |
123 * <code>PP_AUDIOSAMPLERATE_44100</code> or | 124 * <code>PP_AUDIOSAMPLERATE_44100</code> or |
124 * <code>PP_AUDIOSAMPLERATE_48000.</code> | 125 * <code>PP_AUDIOSAMPLERATE_48000.</code> |
125 * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested | 126 * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested |
126 * frame count. | 127 * frame count. |
| 128 * |
127 * @return A <code>uint32_t</code> containing the recommended sample frame | 129 * @return A <code>uint32_t</code> containing the recommended sample frame |
128 * count if successful. | 130 * count if successful. |
129 */ | 131 */ |
130 uint32_t (*RecommendSampleFrameCount)( | 132 uint32_t (*RecommendSampleFrameCount)( |
131 PP_AudioSampleRate sample_rate, | 133 PP_AudioSampleRate sample_rate, |
132 uint32_t requested_sample_frame_count); | 134 uint32_t requested_sample_frame_count); |
133 /** | 135 /** |
134 * IsAudioConfig() determines if the given resource is a | 136 * IsAudioConfig() determines if the given resource is a |
135 * <code>PPB_Audio_Config</code>. | 137 * <code>PPB_Audio_Config</code>. |
136 * | 138 * |
137 * @param[in] resource A <code>PP_Resource</code> containing the audio config | 139 * @param[in] resource A <code>PP_Resource</code> corresponding to an audio |
138 * resource. | 140 * config resource. |
139 * @return A <code>PP_BOOL</code> containing <code>PP_TRUE</code> if the given | 141 * |
| 142 * @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if the given |
140 * resource is an <code>AudioConfig</code> resource, otherwise | 143 * resource is an <code>AudioConfig</code> resource, otherwise |
141 * <code>PP_FALSE</code>. | 144 * <code>PP_FALSE</code>. |
142 */ | 145 */ |
143 PP_Bool (*IsAudioConfig)(PP_Resource resource); | 146 PP_Bool (*IsAudioConfig)(PP_Resource resource); |
144 /** | 147 /** |
145 * GetSampleRate() returns the sample rate for the given | 148 * GetSampleRate() returns the sample rate for the given |
146 * <code>PPB_Audio_Config</code>. | 149 * <code>PPB_Audio_Config</code>. |
147 * | 150 * |
148 * @param[in] config A <code>PP_Resource</code> containing the | 151 * @param[in] config A <code>PP_Resource</code> corresponding to a |
149 * <code>PPB_Audio_Config</code>. | 152 * <code>PPB_Audio_Config</code>. |
| 153 * |
150 * @return A <code>PP_AudioSampleRate</code> containing sample rate or | 154 * @return A <code>PP_AudioSampleRate</code> containing sample rate or |
151 * <code>PP_AUDIOSAMPLERATE_NONE</code> if the resource is invalid. | 155 * <code>PP_AUDIOSAMPLERATE_NONE</code> if the resource is invalid. |
152 */ | 156 */ |
153 PP_AudioSampleRate (*GetSampleRate)(PP_Resource config); | 157 PP_AudioSampleRate (*GetSampleRate)(PP_Resource config); |
154 /** | 158 /** |
155 * GetSampleFrameCount() returns the sample frame count for the given | 159 * GetSampleFrameCount() returns the sample frame count for the given |
156 * <code>PPB_Audio_Config</code>. | 160 * <code>PPB_Audio_Config</code>. |
157 * | 161 * |
158 * @param[in] config A <code>PP_Resource</code> containing the audio config | 162 * @param[in] config A <code>PP_Resource</code> corresponding to an audio |
159 * resource. | 163 * config resource. |
| 164 * |
160 * @return A <code>uint32_t</code> containing sample frame count or | 165 * @return A <code>uint32_t</code> containing sample frame count or |
161 * 0 if the resource is invalid. See <code>RecommendSampleFrameCount</code> | 166 * 0 if the resource is invalid. Refer to |
162 * for more on sample frame counts. | 167 * RecommendSampleFrameCount() for more on sample frame counts. |
163 */ | 168 */ |
164 uint32_t (*GetSampleFrameCount)(PP_Resource config); | 169 uint32_t (*GetSampleFrameCount)(PP_Resource config); |
165 }; | 170 }; |
166 /** | 171 /** |
167 * @} | 172 * @} |
168 */ | 173 */ |
169 | 174 |
170 #endif /* PPAPI_C_PPB_AUDIO_CONFIG_H_ */ | 175 #endif /* PPAPI_C_PPB_AUDIO_CONFIG_H_ */ |
171 | 176 |
OLD | NEW |