OLD | NEW |
---|---|
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 <code>PPB_Audio</code> interface, which provides | 7 * This file defines the <code>PPB_Audio</code> interface, which provides |
8 * realtime stereo audio streaming capabilities. | 8 * realtime stereo audio streaming capabilities. |
9 */ | 9 */ |
10 | 10 |
11 [generate_thunk] | |
12 | |
13 label Chrome { | 11 label Chrome { |
14 M14 = 1.0 | 12 M14 = 1.0, |
13 M30 = 1.1 | |
15 }; | 14 }; |
16 | 15 |
17 /** | 16 /** |
18 * <code>PPB_Audio_Callback</code> defines the type of an audio callback | 17 * <code>PPB_Audio_Callback</code> defines the type of an audio callback |
19 * function used to fill the audio buffer with data. Please see the | 18 * function used to fill the audio buffer with data. Please see the |
20 * Create() function in the <code>PPB_Audio</code> interface for | 19 * Create() function in the <code>PPB_Audio</code> interface for |
21 * more details on this callback. | 20 * more details on this callback. |
21 * | |
22 * @param[in] sample_buffer A buffer to fill with audio data. | |
23 * @param[in] buffer_size_in_bytes The size of the buffer in bytes. | |
24 * @param[in] latency How long before the audio data is to be presented. | |
25 * @param[inout] user_data An opaque pointer that was passed into | |
26 * <code>PPB_Audio.Create()</code>. | |
22 */ | 27 */ |
23 typedef void PPB_Audio_Callback([out] mem_t sample_buffer, | 28 typedef void PPB_Audio_Callback([out] mem_t sample_buffer, |
24 [in] uint32_t buffer_size_in_bytes, | 29 [in] uint32_t buffer_size_in_bytes, |
30 [in, version=1.1] PP_TimeDelta latency, | |
25 [inout] mem_t user_data); | 31 [inout] mem_t user_data); |
dmichael (off chromium)
2013/08/06 19:43:25
Should we consider defining 2 kinds of callbacks i
yzshen1
2013/08/07 20:51:06
I am a little bit concerned about that, because ma
| |
26 | 32 |
27 /** | 33 /** |
28 * The <code>PPB_Audio</code> interface contains pointers to several functions | 34 * The <code>PPB_Audio</code> interface contains pointers to several functions |
29 * for handling audio resources. Refer to the | 35 * for handling audio resources. Refer to the |
30 * <a href="/native-client/{{pepperversion}}/devguide/coding/audio">Audio</a> | 36 * <a href="/native-client/{{pepperversion}}/devguide/coding/audio">Audio</a> |
31 * chapter in the Developer's Guide for information on using this interface. | 37 * chapter in the Developer's Guide for information on using this interface. |
32 * Please see descriptions for each <code>PPB_Audio</code> and | 38 * Please see descriptions for each <code>PPB_Audio</code> and |
33 * <code>PPB_AudioConfig</code> function for more details. A C example using | 39 * <code>PPB_AudioConfig</code> function for more details. A C example using |
34 * <code>PPB_Audio</code> and <code>PPB_AudioConfig</code> follows. | 40 * <code>PPB_Audio</code> and <code>PPB_AudioConfig</code> follows. |
35 * | 41 * |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 * @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if | 144 * @return A <code>PP_Bool</code> containing <code>PP_TRUE</code> if |
139 * successful, otherwise <code>PP_FALSE</code>. Also returns | 145 * successful, otherwise <code>PP_FALSE</code>. Also returns |
140 * <code>PP_TRUE</code> (and is a no-op) if called while playback is already | 146 * <code>PP_TRUE</code> (and is a no-op) if called while playback is already |
141 * stopped. If a callback is in progress, StopPlayback() will block until the | 147 * stopped. If a callback is in progress, StopPlayback() will block until the |
142 * callback completes. | 148 * callback completes. |
143 */ | 149 */ |
144 PP_Bool StopPlayback( | 150 PP_Bool StopPlayback( |
145 [in] PP_Resource audio); | 151 [in] PP_Resource audio); |
146 }; | 152 }; |
147 | 153 |
OLD | NEW |