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 #ifndef PPAPI_C_PPB_AUDIO_H_ | 5 #ifndef PPAPI_C_PPB_AUDIO_H_ |
6 #define PPAPI_C_PPB_AUDIO_H_ | 6 #define PPAPI_C_PPB_AUDIO_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_module.h" | 10 #include "ppapi/c/pp_module.h" |
11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
12 #include "ppapi/c/pp_stdint.h" | 12 #include "ppapi/c/pp_stdint.h" |
13 | 13 |
14 #define PPB_AUDIO_INTERFACE "PPB_Audio;1.0" | 14 #define PPB_AUDIO_INTERFACE "PPB_Audio;0.5" |
15 | 15 |
16 // Callback function type for SetCallback. | 16 // Callback function type for SetCallback. |
17 typedef void (*PPB_Audio_Callback)(void* sample_buffer, | 17 typedef void (*PPB_Audio_Callback)(void* sample_buffer, |
18 size_t buffer_size_in_bytes, | 18 size_t buffer_size_in_bytes, |
19 void* user_data); | 19 void* user_data); |
20 | 20 |
21 // Callback-based audio interface. User of audio must set the callback that will | 21 // Callback-based audio interface. User of audio must set the callback that will |
22 // be called each time that the buffer needs to be filled. | 22 // be called each time that the buffer needs to be filled. |
23 // | 23 // |
24 // A C++ example: | 24 // A C++ example: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 PP_Bool (*StartPlayback)(PP_Resource audio); | 64 PP_Bool (*StartPlayback)(PP_Resource audio); |
65 | 65 |
66 // Stop the playback. If playback is already stopped, this is a no-op and | 66 // Stop the playback. If playback is already stopped, this is a no-op and |
67 // returns PP_TRUE. On error, returns PP_FALSE. If a callback is in progress, | 67 // returns PP_TRUE. On error, returns PP_FALSE. If a callback is in progress, |
68 // StopPlayback will block until callback completes. | 68 // StopPlayback will block until callback completes. |
69 PP_Bool (*StopPlayback)(PP_Resource audio); | 69 PP_Bool (*StopPlayback)(PP_Resource audio); |
70 }; | 70 }; |
71 | 71 |
72 #endif /* PPAPI_C_PPB_DEVICE_CONTEXT_AUDIO_H_ */ | 72 #endif /* PPAPI_C_PPB_DEVICE_CONTEXT_AUDIO_H_ */ |
73 | 73 |
OLD | NEW |