OLD | NEW |
1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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_AudioInput_Dev</code> interface, which | 7 * This file defines the <code>PPB_AudioInput_Dev</code> interface, which |
8 * provides realtime audio input capture. | 8 * provides realtime audio input capture. |
9 */ | 9 */ |
10 | 10 |
11 label Chrome { | 11 label Chrome { |
12 M17 = 0.1 | 12 M17 = 0.1, |
| 13 M18 = 0.2 |
13 }; | 14 }; |
14 | 15 |
15 /** | 16 /** |
16 * <code>PPB_AudioInput_Callback</code> defines the type of an audio callback | 17 * <code>PPB_AudioInput_Callback</code> defines the type of an audio callback |
17 * function used to provide the audio buffer with data. This callback will be | 18 * function used to provide the audio buffer with data. This callback will be |
18 * called on a separate thread from the creation thread. | 19 * called on a separate thread from the creation thread. |
19 */ | 20 */ |
20 typedef void PPB_AudioInput_Callback([in] mem_t sample_buffer, | 21 typedef void PPB_AudioInput_Callback([in] mem_t sample_buffer, |
21 [in] uint32_t buffer_size_in_bytes, | 22 [in] uint32_t buffer_size_in_bytes, |
22 [inout] mem_t user_data); | 23 [inout] mem_t user_data); |
23 | 24 |
24 /** | 25 /** |
25 * The <code>PPB_AudioInput_Dev</code> interface contains pointers to several | 26 * The <code>PPB_AudioInput_Dev</code> interface contains pointers to several |
26 * functions for handling audio input resources. | 27 * functions for handling audio input resources. |
27 */ | 28 */ |
28 [version=0.1, macro="PPB_AUDIO_INPUT_DEV_INTERFACE"] | 29 [version=0.1, macro="PPB_AUDIO_INPUT_DEV_INTERFACE"] |
29 interface PPB_AudioInput_Dev { | 30 interface PPB_AudioInput_Dev { |
30 /** | 31 /** |
31 * Create is a pointer to a function that creates an audio input resource. | 32 * Create is a pointer to a function that creates an audio input resource. |
32 * No sound will be captured until StartCapture() is called. | 33 * No sound will be captured until StartCapture() is called. |
33 */ | 34 */ |
34 PP_Resource Create( | 35 PP_Resource Create( |
35 [in] PP_Instance instance, | 36 [in] PP_Instance instance, |
36 [in] PP_Resource config, | 37 [in] PP_Resource config, |
37 [in] PPB_AudioInput_Callback audio_input_callback, | 38 [in] PPB_AudioInput_Callback audio_input_callback, |
38 [inout] mem_t user_data); | 39 [inout] mem_t user_data); |
39 | 40 |
40 /** | 41 /** |
| 42 * Create is a pointer to a function that creates an audio input resource. |
| 43 * No sound will be captured until StartCapture() is called. |
| 44 * |
| 45 * @param[in] device_ref A <code>PP_Resource</code> identifying an audio |
| 46 * input device, returned by <code>PPB_DeviceEnumerator_Dev</code>. |
| 47 */ |
| 48 [version=0.2] |
| 49 PP_Resource Create( |
| 50 [in] PP_Instance instance, |
| 51 [in] PP_Resource device_ref, |
| 52 [in] PP_Resource config, |
| 53 [in] PPB_AudioInput_Callback audio_input_callback, |
| 54 [inout] mem_t user_data); |
| 55 |
| 56 /** |
41 * IsAudioInput is a pointer to a function that determines if the given | 57 * IsAudioInput is a pointer to a function that determines if the given |
42 * resource is an audio input resource. | 58 * resource is an audio input resource. |
43 * | 59 * |
44 * @param[in] resource A PP_Resource containing a resource. | 60 * @param[in] resource A PP_Resource containing a resource. |
45 * | 61 * |
46 * @return A PP_BOOL containing containing PP_TRUE if the given resource is | 62 * @return A PP_BOOL containing containing PP_TRUE if the given resource is |
47 * an audio input resource, otherwise PP_FALSE. | 63 * an audio input resource, otherwise PP_FALSE. |
48 */ | 64 */ |
49 PP_Bool IsAudioInput( | 65 PP_Bool IsAudioInput( |
50 [in] PP_Resource audio_input); | 66 [in] PP_Resource audio_input); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 * | 101 * |
86 * @return A PP_BOOL containing PP_TRUE if successful, otherwise PP_FALSE. | 102 * @return A PP_BOOL containing PP_TRUE if successful, otherwise PP_FALSE. |
87 * Also returns PP_TRUE (and is a no-op) if called while capture is already | 103 * Also returns PP_TRUE (and is a no-op) if called while capture is already |
88 * stopped. If a buffer is being captured, StopCapture will block until the | 104 * stopped. If a buffer is being captured, StopCapture will block until the |
89 * call completes. | 105 * call completes. |
90 */ | 106 */ |
91 PP_Bool StopCapture( | 107 PP_Bool StopCapture( |
92 [in] PP_Resource audio_input); | 108 [in] PP_Resource audio_input); |
93 }; | 109 }; |
94 | 110 |
OLD | NEW |