Added documentation to web_view.js/web_view_experimental.js regarding the webview...
[chromium-blink-merge.git] / ppapi / api / ppb_audio_frame.idl
blob660071690171dd9ed7e8e1c429ae73b862e18cf4
1 /* Copyright 2014 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 */
6 /**
7 * Defines the <code>PPB_AudioFrame</code> interface.
8 */
10 [generate_thunk]
12 label Chrome {
13 [channel=dev] M34 = 0.1
16 /**
17 * PP_AudioFrame_SampleRate is an enumeration of the different audio sample
18 * rates.
20 enum PP_AudioFrame_SampleRate {
21 PP_AUDIOFRAME_SAMPLERATE_UNKNOWN = 0,
22 PP_AUDIOFRAME_SAMPLERATE_44100 = 44100
25 /**
26 * PP_AudioFrame_SampleSize is an enumeration of the different audio sample
27 * sizes.
29 enum PP_AudioFrame_SampleSize {
30 PP_AUDIOFRAME_SAMPLESIZE_UNKNOWN = 0,
31 PP_AUDIOFRAME_SAMPLESIZE_16_BITS = 2
34 interface PPB_AudioFrame {
35 /**
36 * Determines if a resource is an AudioFrame resource.
38 * @param[in] resource The <code>PP_Resource</code> to test.
40 * @return A <code>PP_Bool</code> with <code>PP_TRUE</code> if the given
41 * resource is an AudioFrame resource or <code>PP_FALSE</code> otherwise.
43 PP_Bool IsAudioFrame([in] PP_Resource resource);
45 /**
46 * Gets the timestamp of the audio frame.
48 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
49 * resource.
51 * @return A <code>PP_TimeDelta</code> containing the timestamp of the audio
52 * frame. Given in seconds since the start of the containing audio stream.
54 [on_failure=0.0]
55 PP_TimeDelta GetTimestamp([in] PP_Resource frame);
57 /**
58 * Sets the timestamp of the audio frame.
60 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
61 * resource.
62 * @param[in] timestamp A <code>PP_TimeDelta</code> containing the timestamp
63 * of the audio frame. Given in seconds since the start of the containing
64 * audio stream.
66 void SetTimestamp([in] PP_Resource frame, [in] PP_TimeDelta timestamp);
68 /**
69 * Gets the sample size of the audio frame.
71 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
72 * resource.
74 * @return The sample size of the audio frame.
76 [on_failure=PP_AUDIOFRAME_SAMPLESIZE_UNKNOWN]
77 PP_AudioFrame_SampleSize GetSampleSize([in] PP_Resource frame);
79 /**
80 * Gets the number of channels in the audio frame.
82 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
83 * resource.
85 * @return The number of channels in the audio frame.
87 uint32_t GetNumberOfChannels([in] PP_Resource frame);
89 /**
90 * Gets the number of samples in the audio frame.
92 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
93 * resource.
95 * @return The number of samples in the audio frame.
96 * For example, at a sampling rate of 44,100 Hz in stereo audio, a frame
97 * containing 4410 * 2 samples would have a duration of 100 milliseconds.
99 uint32_t GetNumberOfSamples([in] PP_Resource frame);
102 * Gets the data buffer containing the audio frame samples.
104 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
105 * resource.
107 * @return A pointer to the beginning of the data buffer.
109 mem_t GetDataBuffer([in] PP_Resource frame);
112 * Gets the size of the data buffer in bytes.
114 * @param[in] frame A <code>PP_Resource</code> corresponding to an audio frame
115 * resource.
117 * @return The size of the data buffer in bytes.
119 uint32_t GetDataBufferSize([in] PP_Resource frame);