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_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 M19 = 0.2 | 12 M19 = 0.2, |
| 13 M25 = 0.3 |
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); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 * - <code>devices</code> must be valid until <code>callback</code> is called, | 73 * - <code>devices</code> must be valid until <code>callback</code> is called, |
73 * if the method returns <code>PP_OK_COMPLETIONPENDING</code>; | 74 * if the method returns <code>PP_OK_COMPLETIONPENDING</code>; |
74 * - the ref count of the returned <code>devices</code> has already been | 75 * - the ref count of the returned <code>devices</code> has already been |
75 * increased by 1 for the caller. | 76 * increased by 1 for the caller. |
76 * | 77 * |
77 * @param[in] audio_input A <code>PP_Resource</code> corresponding to an audio | 78 * @param[in] audio_input A <code>PP_Resource</code> corresponding to an audio |
78 * input resource. | 79 * input resource. |
79 * @param[out] devices Once the operation is completed successfully, | 80 * @param[out] devices Once the operation is completed successfully, |
80 * <code>devices</code> will be set to a <code>PPB_ResourceArray_Dev</code> | 81 * <code>devices</code> will be set to a <code>PPB_ResourceArray_Dev</code> |
81 * resource, which holds a list of <code>PPB_DeviceRef_Dev</code> resources. | 82 * resource, which holds a list of <code>PPB_DeviceRef_Dev</code> resources. |
82 * @param[in] callback A <code>PP_CompletionCallback</code> to run on | 83 * @param[in] callback A <code>PP_CompletionCallback</code> to run on |
83 * completion. | 84 * completion. |
84 * | 85 * |
85 * @return An error code from <code>pp_errors.h</code>. | 86 * @return An error code from <code>pp_errors.h</code>. |
86 */ | 87 */ |
| 88 [deprecate=0.3] |
87 int32_t EnumerateDevices( | 89 int32_t EnumerateDevices( |
88 [in] PP_Resource audio_input, | 90 [in] PP_Resource audio_input, |
89 [out] PP_Resource devices, | 91 [out] PP_Resource devices, |
90 [in] PP_CompletionCallback callback); | 92 [in] PP_CompletionCallback callback); |
91 | 93 |
92 /** | 94 /** |
| 95 * Enumerates audio input devices. |
| 96 * |
| 97 * @param[in] audio_input A <code>PP_Resource</code> corresponding to an audio |
| 98 * input resource. |
| 99 * @param[in] output An output array which will receive |
| 100 * <code>PPB_DeviceRef_Dev</code> resources on success. Please note that the |
| 101 * ref count of those resources has already been increased by 1 for the |
| 102 * caller. |
| 103 * @param[in] callback A <code>PP_CompletionCallback</code> to run on |
| 104 * completion. |
| 105 * |
| 106 * @return An error code from <code>pp_errors.h</code>. |
| 107 */ |
| 108 [version=0.3] |
| 109 int32_t EnumerateDevices( |
| 110 [in] PP_Resource audio_input, |
| 111 [in] PP_ArrayOutput output, |
| 112 [in] PP_CompletionCallback callback); |
| 113 |
| 114 /** |
| 115 * Requests device change notifications. |
| 116 * |
| 117 * @param[in] audio_input A <code>PP_Resource</code> corresponding to an audio |
| 118 * input resource. |
| 119 * @param[in] callback The callback to receive notifications. If not NULL, it |
| 120 * will be called once for the currently available devices, and then every |
| 121 * time the list of available devices changes. All calls will happen on the |
| 122 * same thread as the one on which MonitorDeviceChange() is called. It will |
| 123 * receive notifications until <code>audio_input</code> is destroyed or |
| 124 * <code>MonitorDeviceChange()</code> is called to set a new callback for |
| 125 * <code>audio_input</code>. You can pass NULL to cancel sending |
| 126 * notifications. |
| 127 * @param[inout] user_data An opaque pointer that will be passed to |
| 128 * <code>callback</code>. |
| 129 * |
| 130 * @return An error code from <code>pp_errors.h</code>. |
| 131 */ |
| 132 [version=0.3] |
| 133 int32_t MonitorDeviceChange( |
| 134 [in] PP_Resource audio_input, |
| 135 [in] PP_MonitorDeviceChangeCallback callback, |
| 136 [inout] mem_t user_data); |
| 137 |
| 138 /** |
93 * Opens an audio input device. No sound will be captured until | 139 * Opens an audio input device. No sound will be captured until |
94 * StartCapture() is called. | 140 * StartCapture() is called. |
95 * | 141 * |
96 * @param[in] audio_input A <code>PP_Resource</code> corresponding to an audio | 142 * @param[in] audio_input A <code>PP_Resource</code> corresponding to an audio |
97 * input resource. | 143 * input resource. |
98 * @param[in] device_ref Identifies an audio input device. It could be one of | 144 * @param[in] device_ref Identifies an audio input device. It could be one of |
99 * the resource in the array returned by EnumerateDevices(), or 0 which means | 145 * the resource in the array returned by EnumerateDevices(), or 0 which means |
100 * the default device. | 146 * the default device. |
101 * @param[in] config A <code>PPB_AudioConfig</code> audio configuration | 147 * @param[in] config A <code>PPB_AudioConfig</code> audio configuration |
102 * resource. | 148 * resource. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 * not valid to call Open() again after a call to this method. | 209 * not valid to call Open() again after a call to this method. |
164 * If an audio input resource is destroyed while a device is still open, then | 210 * If an audio input resource is destroyed while a device is still open, then |
165 * it will be implicitly closed, so you are not required to call this method. | 211 * it will be implicitly closed, so you are not required to call this method. |
166 * | 212 * |
167 * @param[in] audio_input A <code>PP_Resource</code> corresponding to an audio | 213 * @param[in] audio_input A <code>PP_Resource</code> corresponding to an audio |
168 * input resource. | 214 * input resource. |
169 */ | 215 */ |
170 void Close( | 216 void Close( |
171 [in] PP_Resource audio_input); | 217 [in] PP_Resource audio_input); |
172 }; | 218 }; |
OLD | NEW |