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 /* From trusted/ppb_audio_trusted.idl modified Sat Jul 16 16:51:03 2011. */ | 6 /* From trusted/ppb_audio_trusted.idl modified Wed Oct 5 14:06:02 2011. */ |
7 | 7 |
8 #ifndef PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_ | 8 #ifndef PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_ |
9 #define PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_ | 9 #define PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_ |
10 | 10 |
11 #include "ppapi/c/pp_completion_callback.h" | 11 #include "ppapi/c/pp_completion_callback.h" |
12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
15 #include "ppapi/c/pp_stdint.h" | 15 #include "ppapi/c/pp_stdint.h" |
16 | 16 |
17 #define PPB_AUDIO_TRUSTED_INTERFACE_0_6 "PPB_AudioTrusted;0.6" | 17 #define PPB_AUDIO_TRUSTED_INTERFACE_0_6 "PPB_AudioTrusted;0.6" |
18 #define PPB_AUDIO_TRUSTED_INTERFACE PPB_AUDIO_TRUSTED_INTERFACE_0_6 | 18 #define PPB_AUDIO_TRUSTED_INTERFACE PPB_AUDIO_TRUSTED_INTERFACE_0_6 |
19 | 19 |
20 /** | 20 /** |
21 * @file | 21 * @file |
22 * This file defines the trusted audio interface. | 22 * This file defines the trusted audio interface. |
23 */ | 23 */ |
24 | 24 |
25 | 25 |
26 /** | 26 /** |
27 * @addtogroup Interfaces | 27 * @addtogroup Interfaces |
28 * @{ | 28 * @{ |
29 */ | 29 */ |
30 /** | 30 /** |
31 * This interface is to be used by proxy implementations. All | 31 * This interface is to be used by proxy implementations. All |
32 * functions should be called from the main thread only. The | 32 * functions should be called from the main thread only. The |
33 * resource returned is an Audio resource; most of the PPB_Audio | 33 * resource returned is an Audio resource; most of the PPB_Audio |
34 * interface is also usable on this resource. | 34 * interface is also usable on this resource. |
35 */ | 35 */ |
36 struct PPB_AudioTrusted { | 36 struct PPB_AudioTrusted_0_6 { |
37 /** Returns an audio resource. */ | 37 /** Returns an audio resource. */ |
38 PP_Resource (*CreateTrusted)(PP_Instance instance); | 38 PP_Resource (*CreateTrusted)(PP_Instance instance); |
39 /** | 39 /** |
40 * Opens a paused audio interface, used by trusted side of proxy. | 40 * Opens a paused audio interface, used by trusted side of proxy. |
41 * Returns PP_ERROR_WOULD_BLOCK on success, and invokes | 41 * Returns PP_ERROR_WOULD_BLOCK on success, and invokes |
42 * the |create_callback| asynchronously to complete. | 42 * the |create_callback| asynchronously to complete. |
43 * As this function should always be invoked from the main thread, | 43 * As this function should always be invoked from the main thread, |
44 * do not use the blocking variant of PP_CompletionCallback. | 44 * do not use the blocking variant of PP_CompletionCallback. |
45 */ | 45 */ |
46 int32_t (*Open)(PP_Resource audio, | 46 int32_t (*Open)(PP_Resource audio, |
47 PP_Resource config, | 47 PP_Resource config, |
48 struct PP_CompletionCallback create_callback); | 48 struct PP_CompletionCallback create_callback); |
49 /** | 49 /** |
50 * Get the sync socket. Use once Open has completed. | 50 * Get the sync socket. Use once Open has completed. |
51 * Returns PP_OK on success. | 51 * Returns PP_OK on success. |
52 */ | 52 */ |
53 int32_t (*GetSyncSocket)(PP_Resource audio, int* sync_socket); | 53 int32_t (*GetSyncSocket)(PP_Resource audio, int* sync_socket); |
54 /** | 54 /** |
55 * Get the shared memory interface. Use once Open has completed. | 55 * Get the shared memory interface. Use once Open has completed. |
56 * Returns PP_OK on success. | 56 * Returns PP_OK on success. |
57 */ | 57 */ |
58 int32_t (*GetSharedMemory)(PP_Resource audio, | 58 int32_t (*GetSharedMemory)(PP_Resource audio, |
59 int* shm_handle, | 59 int* shm_handle, |
60 uint32_t* shm_size); | 60 uint32_t* shm_size); |
61 }; | 61 }; |
| 62 |
| 63 typedef struct PPB_AudioTrusted_0_6 PPB_AudioTrusted; |
62 /** | 64 /** |
63 * @} | 65 * @} |
64 */ | 66 */ |
65 | 67 |
66 #endif /* PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_ */ | 68 #endif /* PPAPI_C_TRUSTED_PPB_AUDIO_TRUSTED_H_ */ |
67 | 69 |
OLD | NEW |