Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: ppapi/c/dev/ppb_audio_trusted_dev.h

Issue 5202002: changes for proxy audio (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_completion_callback.h"
9 #include "ppapi/c/pp_instance.h"
8 #include "ppapi/c/pp_resource.h" 10 #include "ppapi/c/pp_resource.h"
9 11
10 #define PPB_AUDIO_TRUSTED_DEV_INTERFACE "PPB_AudioTrusted(Dev);0.1" 12 #define PPB_AUDIO_TRUSTED_DEV_INTERFACE "PPB_AudioTrusted(Dev);0.2"
11 13
12 // This interface is used to get access to the audio buffer and a socket on 14 // This interface is to be used by proxy implementations. All
13 // which the client can block until the audio is ready to accept more data. 15 // functions should be called from the main thread only. The
14 // This interface should be used by NaCl to implement the Audio interface. 16 // resource returned is an Audio resource; most of the PPB_Audio_Dev
17 // interface is also usable on this resource.
15 struct PPB_AudioTrusted_Dev { 18 struct PPB_AudioTrusted_Dev {
16 // Returns a Buffer object that has the audio buffer. 19 // Returns an audio resource.
17 PP_Resource (*GetBuffer)(PP_Resource audio); 20 PP_Resource (*CreateTrusted)(PP_Instance instance);
18 21 // Opens a paused audio interface, used by trusted side of proxy.
brettw 2010/11/22 18:22:09 Put blank lines between functions.
nfullagar 2010/11/23 02:48:58 Done.
19 // Returns a select()-able/Wait()-able OS-specific descriptor. The browser 22 // Returns 0 on success, negative error code on failure
20 // will put a byte on the socket each time the buffer is ready to be filled. 23 int32_t (*Open)(PP_Resource audio, PP_Resource config,
brettw 2010/11/22 18:22:09 Rather than "Returns 0 on success, negative error
neb 2010/11/22 19:48:26 Why is Open() separate from CreateTrusted(), aren'
brettw 2010/11/22 20:14:47 At least in my patch, I this separation because I
nfullagar 2010/11/23 02:48:58 Done.
nfullagar 2010/11/23 02:48:58 Same as Brett, needed to pass PP_Resource in the c
21 // The plugin can then implement its own audio thread using select()/poll() to 24 PP_CompletionCallback create_callback);
22 // block until the browser is ready to receive data. 25 // Get the sync socket. Use from completion callback.
23 int (*GetOSDescriptor)(PP_Resource audio); 26 // Returns PP_TRUE on success.
27 PP_Bool (*GetSyncSocket)(PP_Resource audio, int* sync_socket);
28 // Get the shared memory interface. Use from completion callback.
29 // Returns PP_TRUE on success.
30 PP_Bool (*GetSharedMemory)(PP_Resource audio,
31 uint64_t* shm_handle,
32 int32_t* shm_size);
33 // Close the resource. If the completion callback passed in on Open
34 // has not yet fired, it will be fired from here with an error condition.
35 void (*Close)(PP_Resource audio);
brettw 2010/11/22 18:22:09 I don't think we need this. There's no way to inte
nfullagar 2010/11/23 02:48:58 Close() removed
24 }; 36 };
25 37
26 #endif // PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_ 38 #endif // PPAPI_C_DEV_PPB_AUDIO_TRUSTED_DEV_H_
27
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698