Chromium Code Reviews| Index: ppapi/c/dev/ppb_audio_trusted_dev.h |
| =================================================================== |
| --- ppapi/c/dev/ppb_audio_trusted_dev.h (revision 66651) |
| +++ ppapi/c/dev/ppb_audio_trusted_dev.h (working copy) |
| @@ -5,23 +5,27 @@ |
| #ifndef PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_ |
| #define PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_ |
| +#include "ppapi/c/pp_instance.h" |
| #include "ppapi/c/pp_resource.h" |
| -#define PPB_AUDIO_TRUSTED_DEV_INTERFACE "PPB_AudioTrusted(Dev);0.1" |
| +#define PPB_AUDIO_TRUSTED_DEV_INTERFACE "PPB_AudioTrusted(Dev);0.2" |
| -// This interface is used to get access to the audio buffer and a socket on |
| -// which the client can block until the audio is ready to accept more data. |
| -// This interface should be used by NaCl to implement the Audio interface. |
| +// This callback is invoked during StreamCreated() from the main thead, |
|
darin (slow to review)
2010/11/19 17:45:39
this comment refers to chromium implementation spe
|
| +// enabling the access to the handles needed for proxied audio. |
| +// Returns PP_TRUE on success. |
| +typedef PP_Bool (*PPB_AudioTrusted_Callback)(PP_Instance pp_instance, |
|
darin (slow to review)
2010/11/19 17:45:39
nit: PP_ instead of PPB_
PPB_ is reserved for int
darin (slow to review)
2010/11/19 17:45:39
nit: we usually don't use the prefix "pp_" in vari
|
| + PP_Resource pp_audio, |
| + int64_t shared_memory_handle, |
|
darin (slow to review)
2010/11/19 17:45:39
int64_t -> uint64_t like PPB_ImageData_Trusted?
|
| + size_t shared_memory_size, |
| + int64_t socket_handle); |
|
darin (slow to review)
2010/11/19 17:45:39
why is socket_handle int64_t? shouldn't it just b
|
| + |
| +// This interface is to be used by proxy implementations. |
| struct PPB_AudioTrusted_Dev { |
|
darin (slow to review)
2010/11/19 17:45:39
As discussed in person, I think the API would be b
|
| - // Returns a Buffer object that has the audio buffer. |
| - PP_Resource (*GetBuffer)(PP_Resource audio); |
| - |
| - // Returns a select()-able/Wait()-able OS-specific descriptor. The browser |
| - // will put a byte on the socket each time the buffer is ready to be filled. |
| - // The plugin can then implement its own audio thread using select()/poll() to |
| - // block until the browser is ready to receive data. |
| - int (*GetOSDescriptor)(PP_Resource audio); |
| + // Creates a paused audio interface, used by trusted side of proxy. |
| + // It returns an audio resource, so the remaining functionality |
| + // can be accessed through the PPB_Audio_Dev interface. |
| + PP_Resource (*Create)(PP_Instance instance, PP_Resource config, |
| + PPB_AudioTrusted_Callback create_callback); |
|
darin (slow to review)
2010/11/19 17:45:39
nit: please indent this line so that you have:
|
| }; |
| #endif // PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_ |
| - |