Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_DEV_PPB_AUDIO_TRUSTED_DEV_H_ | 5 #ifndef PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_ |
| 6 #define PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_ | 6 #define PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_instance.h" | |
| 8 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
| 9 | 10 |
| 10 #define PPB_AUDIO_TRUSTED_DEV_INTERFACE "PPB_AudioTrusted(Dev);0.1" | 11 #define PPB_AUDIO_TRUSTED_DEV_INTERFACE "PPB_AudioTrusted(Dev);0.2" |
| 11 | 12 |
| 12 // This interface is used to get access to the audio buffer and a socket on | 13 // 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
| |
| 13 // which the client can block until the audio is ready to accept more data. | 14 // enabling the access to the handles needed for proxied audio. |
| 14 // This interface should be used by NaCl to implement the Audio interface. | 15 // Returns PP_TRUE on success. |
| 16 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
| |
| 17 PP_Resource pp_audio, | |
| 18 int64_t shared_memory_handle, | |
|
darin (slow to review)
2010/11/19 17:45:39
int64_t -> uint64_t like PPB_ImageData_Trusted?
| |
| 19 size_t shared_memory_size, | |
| 20 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
| |
| 21 | |
| 22 // This interface is to be used by proxy implementations. | |
| 15 struct PPB_AudioTrusted_Dev { | 23 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
| |
| 16 // Returns a Buffer object that has the audio buffer. | 24 // Creates a paused audio interface, used by trusted side of proxy. |
| 17 PP_Resource (*GetBuffer)(PP_Resource audio); | 25 // It returns an audio resource, so the remaining functionality |
| 18 | 26 // can be accessed through the PPB_Audio_Dev interface. |
| 19 // Returns a select()-able/Wait()-able OS-specific descriptor. The browser | 27 PP_Resource (*Create)(PP_Instance instance, PP_Resource config, |
| 20 // will put a byte on the socket each time the buffer is ready to be filled. | 28 PPB_AudioTrusted_Callback create_callback); |
|
darin (slow to review)
2010/11/19 17:45:39
nit: please indent this line so that you have:
| |
| 21 // The plugin can then implement its own audio thread using select()/poll() to | |
| 22 // block until the browser is ready to receive data. | |
| 23 int (*GetOSDescriptor)(PP_Resource audio); | |
| 24 }; | 29 }; |
| 25 | 30 |
| 26 #endif // PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_ | 31 #endif // PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_ |
| 27 | |
| OLD | NEW |