Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: ppapi/api/ppb_audio_config.idl

Issue 9129007: Work on improving PpbAudioConfig:RecommendSampleFrameCount (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 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 /** 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 M14 = 1.0 12 M14 = 1.0,
13 M18 = 1.1
13 }; 14 };
14 15
15 /** 16 /**
16 * This enumeration contains audio frame count constants. 17 * This enumeration contains audio frame count constants.
17 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> is the minimum possible frame 18 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> is the minimum possible frame
18 * count. <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> is the maximum possible 19 * count. <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> is the maximum possible
19 * frame count. 20 * frame count.
20 */ 21 */
21 [unnamed] enum PP_AudioFrameSize { 22 [unnamed] enum PP_AudioFrameSize {
22 PP_AUDIOMINSAMPLEFRAMECOUNT = 64, 23 PP_AUDIOMINSAMPLEFRAMECOUNT = 64,
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 /**
93 * This comment block applies to version 1.0, which is deprecated in favor of
94 * the same function signature but with different behavior.
dmichael (off chromium) 2012/01/24 16:54:38 FWIW, it looks like the interface did change to re
nfullagar 2012/01/24 19:14:58 thx, comment updated. On 2012/01/24 16:54:38, dmi
95 *
96 * RecommendSampleFrameCount() returns the supported sample frame count
97 * closest to the requested count. The sample frame count determines the
98 * overall latency of audio. Since one "frame" is always buffered in advance,
99 * smaller frame counts will yield lower latency, but higher CPU utilization.
100 *
101 * Sample counts less than
102 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than
103 * <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any
104 * system, but values in between aren't necessarily glitch-free.
105 *
106 * @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either
107 * <code>PP_AUDIOSAMPLERATE_44100</code> or
108 * <code>PP_AUDIOSAMPLERATE_48000.</code>
109 * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested
110 * frame count.
111 *
112 * @return A <code>uint32_t</code> containing the recommended sample frame
113 * count if successful.
114 */
115 [deprecate=1.1]
116 uint32_t RecommendSampleFrameCount(
117 [in] PP_AudioSampleRate sample_rate,
118 [in] uint32_t requested_sample_frame_count);
119
120 /**
92 * RecommendSampleFrameCount() returns the supported sample frame count 121 * RecommendSampleFrameCount() returns the supported sample frame count
93 * closest to the requested count. The sample frame count determines the 122 * closest to the requested count. The sample frame count determines the
94 * overall latency of audio. Since one "frame" is always buffered in advance, 123 * overall latency of audio. Since one "frame" is always buffered in advance,
95 * smaller frame counts will yield lower latency, but higher CPU utilization. 124 * smaller frame counts will yield lower latency, but higher CPU utilization.
96 * 125 *
97 * Supported sample frame counts will vary by hardware and system (consider 126 * 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 127 * that the local system might be anywhere from a cell phone or a high-end
99 * audio workstation). Sample counts less than 128 * audio workstation). Sample counts less than
100 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than 129 * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than
101 * <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any 130 * <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any
102 * system, but values in between aren't necessarily valid. This function 131 * system, but values in between aren't necessarily valid. This function
103 * will return a supported count closest to the requested value. 132 * will return a supported count closest to the requested value.
104 * 133 *
134 * @param[in] instance
105 * @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either 135 * @param[in] sample_rate A <code>PP_AudioSampleRate</code> which is either
106 * <code>PP_AUDIOSAMPLERATE_44100</code> or 136 * <code>PP_AUDIOSAMPLERATE_44100</code> or
107 * <code>PP_AUDIOSAMPLERATE_48000.</code> 137 * <code>PP_AUDIOSAMPLERATE_48000.</code>
108 * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested 138 * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested
109 * frame count. 139 * frame count.
110 * 140 *
111 * @return A <code>uint32_t</code> containing the recommended sample frame 141 * @return A <code>uint32_t</code> containing the recommended sample frame
112 * count if successful. 142 * count if successful.
113 */ 143 */
144 [version=1.1]
114 uint32_t RecommendSampleFrameCount( 145 uint32_t RecommendSampleFrameCount(
146 [in] PP_Instance instance,
115 [in] PP_AudioSampleRate sample_rate, 147 [in] PP_AudioSampleRate sample_rate,
116 [in] uint32_t requested_sample_frame_count); 148 [in] uint32_t requested_sample_frame_count);
117 149
118 /** 150 /**
119 * IsAudioConfig() determines if the given resource is a 151 * IsAudioConfig() determines if the given resource is a
120 * <code>PPB_Audio_Config</code>. 152 * <code>PPB_Audio_Config</code>.
121 * 153 *
122 * @param[in] resource A <code>PP_Resource</code> corresponding to an audio 154 * @param[in] resource A <code>PP_Resource</code> corresponding to an audio
123 * config resource. 155 * config resource.
124 * 156 *
(...skipping 23 matching lines...) Expand all
148 * 180 *
149 * @param[in] config A <code>PP_Resource</code> corresponding to an audio 181 * @param[in] config A <code>PP_Resource</code> corresponding to an audio
150 * config resource. 182 * config resource.
151 * 183 *
152 * @return A <code>uint32_t</code> containing sample frame count or 184 * @return A <code>uint32_t</code> containing sample frame count or
153 * 0 if the resource is invalid. Refer to 185 * 0 if the resource is invalid. Refer to
154 * RecommendSampleFrameCount() for more on sample frame counts. 186 * RecommendSampleFrameCount() for more on sample frame counts.
155 */ 187 */
156 uint32_t GetSampleFrameCount( 188 uint32_t GetSampleFrameCount(
157 [in] PP_Resource config); 189 [in] PP_Resource config);
190
191 /**
192 * RecommendSampleRate() returns the native sample rate that the browser
193 * is using in the backend. Applications that use the recommended sample
194 * rate will have potentially better latency and fidelity.
195 *
196 * @param[in] instance
197 *
198 * @return A <code>uint32_t</code> containing the recommended sample frame
199 * count if successful.
200 */
201 [version=1.1]
202 PP_AudioSampleRate RecommendSampleRate(
203 [in] PP_Instance instance);
204
158 }; 205 };
159 206
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698