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