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