summaryrefslogtreecommitdiffstats
path: root/ppapi/api/ppb_audio_config.idl
diff options
context:
space:
mode:
authornoelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-16 23:53:22 +0000
committernoelallen@google.com <noelallen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-16 23:53:22 +0000
commit745b0d43a1f129f008ec1cdf50cb7afedeba1f02 (patch)
treebc84c5f95a643f85ce5d70967e1075a577dc999f /ppapi/api/ppb_audio_config.idl
parent63e26829823d96127ad24eabbca69e4d6008d7aa (diff)
downloadchromium_src-745b0d43a1f129f008ec1cdf50cb7afedeba1f02.zip
chromium_src-745b0d43a1f129f008ec1cdf50cb7afedeba1f02.tar.gz
chromium_src-745b0d43a1f129f008ec1cdf50cb7afedeba1f02.tar.bz2
Update the IDL
Final update of the IDL so that we can switch to using generated code for ppapi/c/ and ppapi/c/trusted. BUG= http://code.google.com/p/chromium/issues/detail?id=74634 TEST= tryserver TBR= dmichael@chromium.org Review URL: http://codereview.chromium.org/7390023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92805 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/api/ppb_audio_config.idl')
-rw-r--r--ppapi/api/ppb_audio_config.idl131
1 files changed, 95 insertions, 36 deletions
diff --git a/ppapi/api/ppb_audio_config.idl b/ppapi/api/ppb_audio_config.idl
index 2c73e03..bef8c22 100644
--- a/ppapi/api/ppb_audio_config.idl
+++ b/ppapi/api/ppb_audio_config.idl
@@ -3,15 +3,23 @@
* found in the LICENSE file.
*/
-/* This file defines the AudioConfig interface. */
+/**
+ * This file defines the PPB_AudioConfig interface for establishing an
+ * audio configuration resource within the browser.
+ */
+label Chrome {
+ M13 = 0.5,
+ M14 = 1.0
+};
/**
* This enumeration contains audio frame count constants.
- * PP_AUDIOMINSAMPLEFRAMECOUNT is the minimum possible frame count.
- * PP_AUDIOMAXSAMPLEFRAMECOUNT is the maximum possible frame count.
+ * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> is the minimum possible frame
+ * count. <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> is the maximum possible
+ * frame count.
*/
-enum PP_AudioFrameSize {
+[unnamed] enum PP_AudioFrameSize {
PP_AUDIOMINSAMPLEFRAMECOUNT = 64,
PP_AUDIOMAXSAMPLEFRAMECOUNT = 32768
};
@@ -19,10 +27,11 @@ enum PP_AudioFrameSize {
/**
* PP_AudioSampleRate is an enumeration of the different audio sampling rates.
- * PP_AUDIOSAMPLERATE_44100 is the sample rate used on CDs and
- * PP_AUDIOSAMPLERATE_48000 is the sample rate used on DVDs and Digital Audio
- * Tapes.
+ * <code>PP_AUDIOSAMPLERATE_44100</code> is the sample rate used on CDs and
+ * <code>PP_AUDIOSAMPLERATE_48000</code> is the sample rate used on DVDs and
+ * Digital Audio Tapes.
*/
+[assert_size(4)]
enum PP_AudioSampleRate {
PP_AUDIOSAMPLERATE_NONE = 0,
PP_AUDIOSAMPLERATE_44100 = 44100,
@@ -30,67 +39,117 @@ enum PP_AudioSampleRate {
} ;
-/* Interface for configuring audio output */
-interface PPB_AudioConfig_0_5 {
- /* Create a 16 bit stereo config with the given sample rate. We guarantee
- * that PP_AUDIOSAMPLERATE_44100 and PP_AUDIOSAMPLERATE_48000 sample rates
- * are supported. The |sample_frame_count| should be the result of calling
- * RecommendSampleFrameCount. If the sample frame count or bit rate aren't
- * supported, this function will fail and return a null resource.
+/**
+ * The <code>PPB_AudioConfig</code> interface contains pointers to several
+ * functions for establishing your audio configuration within the browser.
+ * This interface only supports stereo * 16bit output.
+ *
+ * Refer to the
+ * <a href="/chrome/nativeclient/docs/audio.html">Pepper
+ * Audio API Code Walkthrough</a> for information on using this interface.
+ */
+[macro="PPB_AUDIO_CONFIG_INTERFACE"]
+interface PPB_AudioConfig {
+ /**
+ * CreateStereo16bit() creates a 16 bit audio configuration resource. The
+ * <code>sample_frame_count</code> should be the result of calling
+ * <code>RecommendSampleFrameCount</code>. If the sample frame count or bit
+ * rate isn't supported, this function will fail and return a null resource.
*
* A single sample frame on a stereo device means one value for the left
* channel and one value for the right channel.
*
* Buffer layout for a stereo int16 configuration:
- * int16_t* buffer16;
- * buffer16[0] is the first left channel sample
- * buffer16[1] is the first right channel sample
- * buffer16[2] is the second left channel sample
- * buffer16[3] is the second right channel sample
+ * <code>int16_t *buffer16;</code>
+ * <code>buffer16[0]</code> is the first left channel sample.
+ * <code>buffer16[1]</code> is the first right channel sample.
+ * <code>buffer16[2]</code> is the second left channel sample.
+ * <code>buffer16[3]</code> is the second right channel sample.
* ...
- * buffer16[2 * (sample_frame_count - 1)] is the last left channel sample
- * buffer16[2 * (sample_frame_count - 1) + 1] is the last right channel
- * sample
+ * <code>buffer16[2 * (sample_frame_count - 1)]</code> is the last left
+ * channel sample.
+ * <code>buffer16[2 * (sample_frame_count - 1) + 1]</code> is the last
+ * right channel sample.
* Data will always be in the native endian format of the platform.
+ *
+ * @param[in] instance A <code>PP_Instance indentifying</code> one instance
+ * of a module.
+ * @param[in] sample_rate A P<code>P_AudioSampleRate</code> which is either
+ * <code>PP_AUDIOSAMPLERATE_44100</code> or
+ * <code>PP_AUDIOSAMPLERATE_48000</code>.
+ * @param[in] sample_frame_count A <code>uint32_t</code> frame count returned
+ * from the <code>RecommendSampleFrameCount</code> function.
+ * @return A <code>PP_Resource</code> containing the
+ * <code>PPB_Audio_Config</code> if successful or a null resource if the
+ * sample frame count or bit rate are not supported.
*/
PP_Resource CreateStereo16Bit(
[in] PP_Instance instance,
[in] PP_AudioSampleRate sample_rate,
[in] uint32_t sample_frame_count);
- /* Returns a supported sample frame count closest to the given requested
- * count. The sample frame count determines the overall latency of audio.
- * Since one "frame" is always buffered in advance, smaller frame counts
- * will yield lower latency, but higher CPU utilization.
+ /**
+ * RecommendSampleFrameCount() returns the supported sample frame count
+ * closest to the requested count. The sample frame count determines the
+ * overall latency of audio. Since one "frame" is always buffered in advance,
+ * smaller frame counts will yield lower latency, but higher CPU utilization.
*
* Supported sample frame counts will vary by hardware and system (consider
* that the local system might be anywhere from a cell phone or a high-end
- * audio workstation). Sample counts less than PP_AUDIOMINSAMPLEFRAMECOUNT
- * and greater than PP_AUDIOMAXSAMPLEFRAMECOUNT are never supported on any
+ * audio workstation). Sample counts less than
+ * <code>PP_AUDIOMINSAMPLEFRAMECOUNT</code> and greater than
+ * <code>PP_AUDIOMAXSAMPLEFRAMECOUNT</code> are never supported on any
* system, but values in between aren't necessarily valid. This function
* will return a supported count closest to the requested value.
*
- * If you pass PP_AUDIOSAMPLERATE_NONE as the requested sample count, the
- * recommended sample for the local system is returned.
+ * @param[in] sample_rate A <code>PP_AudioSampleRate which is either
+ * <code>PP_AUDIOSAMPLERATE_44100</code> or
+ * <code>PP_AUDIOSAMPLERATE_48000.</code>
+ * @param[in] requested_sample_frame_count A <code>uint_32t</code> requested
+ * frame count.
+ * @return A <code>uint32_t</code> containing the recommended sample frame
+ * count if successful.
*/
uint32_t RecommendSampleFrameCount(
[in] PP_AudioSampleRate sample_rate,
[in] uint32_t requested_sample_frame_count);
- /* Returns true if the given resource is an AudioConfig object. */
+ /**
+ * IsAudioConfig() determines if the given resource is a
+ * <code>PPB_Audio_Config</code>.
+ *
+ * @param[in] resource A <code>PP_Resource</code> containing the audio config
+ * resource.
+ * @return A <code>PP_BOOL</code> containing <code>PP_TRUE</code> if the given
+ * resource is an <code>AudioConfig</code> resource, otherwise
+ * <code>PP_FALSE</code>.
+ */
PP_Bool IsAudioConfig(
[in] PP_Resource resource);
- /* Returns the sample rate for the given AudioConfig resource. If the
- * resource is invalid, this will return PP_AUDIOSAMPLERATE_NONE.
+ /**
+ * GetSampleRate() returns the sample rate for the given
+ * <code>PPB_Audio_Config</code>.
+ *
+ * @param[in] config A <code>PP_Resource</code> containing the
+ * <code>PPB_Audio_Config</code>.
+ * @return A <code>PP_AudioSampleRate</code> containing sample rate or
+ * <code>PP_AUDIOSAMPLERATE_NONE</code> if the resource is invalid.
*/
PP_AudioSampleRate GetSampleRate(
[in] PP_Resource config);
- /* Returns the sample frame count for the given AudioConfig resource. If the
- * resource is invalid, this will return 0. See RecommendSampleFrameCount for
- * more on sample frame counts.
+ /**
+ * GetSampleFrameCount() returns the sample frame count for the given
+ * <code>PPB_Audio_Config</code>.
+ *
+ * @param[in] config A <code>PP_Resource</code> containing the audio config
+ * resource.
+ * @return A <code>uint32_t</code> containing sample frame count or
+ * 0 if the resource is invalid. See <code>RecommendSampleFrameCount</code>
+ * for more on sample frame counts.
*/
uint32_t GetSampleFrameCount(
[in] PP_Resource config);
};
+