Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
|
dmichael (off chromium)
2011/08/24 15:30:42
ppb_audio_config.idl is in this CL, but ppb_audio_
| |
| 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 /** | 6 /** |
| 7 * This file defines the PPB_AudioConfig interface for establishing an | 7 * This file defines the PPB_AudioConfig interface for establishing an |
| 8 * audio configuration resource within the browser. | 8 * audio configuration resource within the browser. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 label Chrome { | 11 label Chrome { |
| 12 M13 = 0.5, | 12 M13 = 0.5, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 65 * <code>buffer16[1]</code> is the first right channel sample. | 65 * <code>buffer16[1]</code> is the first right channel sample. |
| 66 * <code>buffer16[2]</code> is the second left channel sample. | 66 * <code>buffer16[2]</code> is the second left channel sample. |
| 67 * <code>buffer16[3]</code> is the second right channel sample. | 67 * <code>buffer16[3]</code> is the second right channel sample. |
| 68 * ... | 68 * ... |
| 69 * <code>buffer16[2 * (sample_frame_count - 1)]</code> is the last left | 69 * <code>buffer16[2 * (sample_frame_count - 1)]</code> is the last left |
| 70 * channel sample. | 70 * channel sample. |
| 71 * <code>buffer16[2 * (sample_frame_count - 1) + 1]</code> is the last | 71 * <code>buffer16[2 * (sample_frame_count - 1) + 1]</code> is the last |
| 72 * right channel sample. | 72 * right channel sample. |
| 73 * Data will always be in the native endian format of the platform. | 73 * Data will always be in the native endian format of the platform. |
| 74 * | 74 * |
| 75 * @param[in] instance A <code>PP_Instance indentifying</code> one instance | 75 * @param[in] instance A <code>PP_Instance</code> identifying one instance |
| 76 * of a module. | 76 * of a module. |
| 77 * @param[in] sample_rate A P<code>P_AudioSampleRate</code> which is either | 77 * @param[in] sample_rate A P<code>P_AudioSampleRate</code> which is either |
| 78 * <code>PP_AUDIOSAMPLERATE_44100</code> or | 78 * <code>PP_AUDIOSAMPLERATE_44100</code> or |
| 79 * <code>PP_AUDIOSAMPLERATE_48000</code>. | 79 * <code>PP_AUDIOSAMPLERATE_48000</code>. |
| 80 * @param[in] sample_frame_count A <code>uint32_t</code> frame count returned | 80 * @param[in] sample_frame_count A <code>uint32_t</code> frame count returned |
| 81 * from the <code>RecommendSampleFrameCount</code> function. | 81 * from the <code>RecommendSampleFrameCount</code> function. |
| 82 * | |
| 82 * @return A <code>PP_Resource</code> containing the | 83 * @return A <code>PP_Resource</code> containing the |
| 83 * <code>PPB_Audio_Config</code> if successful or a null resource if the | 84 * <code>PPB_Audio_Config</code> if successful or a null resource if the |
| 84 * sample frame count or bit rate are not supported. | 85 * sample frame count or bit rate are not supported. |
| 85 */ | 86 */ |
| 86 PP_Resource CreateStereo16Bit( | 87 PP_Resource CreateStereo16Bit( |
| 87 [in] PP_Instance instance, | 88 [in] PP_Instance instance, |
| 88 [in] PP_AudioSampleRate sample_rate, | 89 [in] PP_AudioSampleRate sample_rate, |
| 89 [in] uint32_t sample_frame_count); | 90 [in] uint32_t sample_frame_count); |
| 90 | 91 |
| 91 /** | 92 /** |
| 92 * RecommendSampleFrameCount() returns the supported sample frame count | 93 * RecommendSampleFrameCount() returns the supported sample frame count |
| 93 * closest to the requested count. The sample frame count determines the | 94 * closest to the requested count. The sample frame count determines the |
| 94 * overall latency of audio. Since one "frame" is always buffered in advance, | 95 * overall latency of audio. Since one "frame" is always buffered in advance, |
| 95 * smaller frame counts will yield lower latency, but higher CPU utilization. | 96 * smaller frame counts will yield lower latency, but higher CPU utilization. |
| 96 * | 97 * |
| 97 * Supported sample frame counts will vary by hardware and system (consider | 98 * Supported sample frame counts will vary by hardware and system (consider |
| 98 * that the local system might be anywhere from a cell phone or a high-end | 99 * that the local system might be anywhere from a cell phone or a high-end |
| 99 * audio workstation). Sample counts less than | 100 * audio workstation). Sample counts less than |
| 100 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than | 101 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than |
| 101 * <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any | 102 * <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any |
| 102 * system, but values in between aren't necessarily valid. This function | 103 * system, but values in between aren't necessarily valid. This function |
| 103 * will return a supported count closest to the requested value. | 104 * will return a supported count closest to the requested value. |
| 104 * | 105 * |
| 105 * @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either | 106 * @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either |
| 106 * <code>PP_AUDIOSAMPLERATE_44100</code> or | 107 * <code>PP_AUDIOSAMPLERATE_44100</code> or |
| 107 * <code>PP_AUDIOSAMPLERATE_48000.</code> | 108 * <code>PP_AUDIOSAMPLERATE_48000.</code> |
| 108 * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested | 109 * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested |
| 109 * frame count. | 110 * frame count. |
| 111 * | |
| 110 * @return A <code>uint32_t</code> containing the recommended sample frame | 112 * @return A <code>uint32_t</code> containing the recommended sample frame |
| 111 * count if successful. | 113 * count if successful. |
| 112 */ | 114 */ |
| 113 uint32_t RecommendSampleFrameCount( | 115 uint32_t RecommendSampleFrameCount( |
| 114 [in] PP_AudioSampleRate sample_rate, | 116 [in] PP_AudioSampleRate sample_rate, |
| 115 [in] uint32_t requested_sample_frame_count); | 117 [in] uint32_t requested_sample_frame_count); |
| 116 | 118 |
| 117 /** | 119 /** |
| 118 * IsAudioConfig() determines if the given resource is a | 120 * IsAudioConfig() determines if the given resource is a |
| 119 * <code>PPB_Audio_Config</code>. | 121 * <code>PPB_Audio_Config</code>. |
| 120 * | 122 * |
| 121 * @param[in] resource A <code>PP_Resource</code> containing the audio config | 123 * @param[in] resource A <code>PP_Resource</code> corresponding to an audio |
| 122 * resource. | 124 * config resource. |
| 123 * @return A <code>PP_BOOL</code> containing <code>PP_TRUE</code> if the given | 125 * |
| 126 * @return A <code>PP_Bool</code> containing <code>PP_True</code> if the given | |
| 124 * resource is an <code>AudioConfig</code> resource, otherwise | 127 * resource is an <code>AudioConfig</code> resource, otherwise |
| 125 * <code>PP_FALSE</code>. | 128 * <code>PP_False</code>. |
| 126 */ | 129 */ |
| 127 PP_Bool IsAudioConfig( | 130 PP_Bool IsAudioConfig( |
| 128 [in] PP_Resource resource); | 131 [in] PP_Resource resource); |
| 129 | 132 |
| 130 /** | 133 /** |
| 131 * GetSampleRate() returns the sample rate for the given | 134 * GetSampleRate() returns the sample rate for the given |
| 132 * <code>PPB_Audio_Config</code>. | 135 * <code>PPB_Audio_Config</code>. |
| 133 * | 136 * |
| 134 * @param[in] config A <code>PP_Resource</code> containing the | 137 * @param[in] config A <code>PP_Resource</code> corresponding to an |
| 135 * <code>PPB_Audio_Config</code>. | 138 * <code>PPB_Audio_Config</code>. |
| 139 * | |
| 136 * @return A <code>PP_AudioSampleRate</code> containing sample rate or | 140 * @return A <code>PP_AudioSampleRate</code> containing sample rate or |
| 137 * <code>PP_AUDIOSAMPLERATE_NONE</code> if the resource is invalid. | 141 * <code>PP_AUDIOSAMPLERATE_NONE</code> if the resource is invalid. |
| 138 */ | 142 */ |
| 139 PP_AudioSampleRate GetSampleRate( | 143 PP_AudioSampleRate GetSampleRate( |
| 140 [in] PP_Resource config); | 144 [in] PP_Resource config); |
| 141 | 145 |
| 142 /** | 146 /** |
| 143 * GetSampleFrameCount() returns the sample frame count for the given | 147 * GetSampleFrameCount() returns the sample frame count for the given |
| 144 * <code>PPB_Audio_Config</code>. | 148 * <code>PPB_Audio_Config</code>. |
| 145 * | 149 * |
| 146 * @param[in] config A <code>PP_Resource</code> containing the audio config | 150 * @param[in] config A <code>PP_Resource</code> corresponding to an audio |
| 147 * resource. | 151 * config resource. |
| 152 * | |
| 148 * @return A <code>uint32_t</code> containing sample frame count or | 153 * @return A <code>uint32_t</code> containing sample frame count or |
| 149 * 0 if the resource is invalid. See <code>RecommendSampleFrameCount</code> | 154 * 0 if the resource is invalid. Refer to |
| 150 * for more on sample frame counts. | 155 * <code>RecommendSampleFrameCount</code> for more on sample frame counts. |
| 151 */ | 156 */ |
| 152 uint32_t GetSampleFrameCount( | 157 uint32_t GetSampleFrameCount( |
| 153 [in] PP_Resource config); | 158 [in] PP_Resource config); |
| 154 }; | 159 }; |
| 155 | 160 |
| OLD | NEW |