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

Unified Diff: ppapi/thunk/ppb_audio_input_thunk.cc

Issue 11411047: Introduce PPB_AudioInput_Dev v0.3 and refactor the device enumeration code: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/thunk/ppb_audio_input_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/thunk/ppb_audio_input_thunk.cc
diff --git a/ppapi/thunk/ppb_audio_input_thunk.cc b/ppapi/thunk/ppb_audio_input_thunk.cc
index 94d978df98ee2e476fbb77bd9ec5b5924791977e..5fa512ee3b6784e9f4103fd739e1baf08f547326 100644
--- a/ppapi/thunk/ppb_audio_input_thunk.cc
+++ b/ppapi/thunk/ppb_audio_input_thunk.cc
@@ -31,17 +31,37 @@ PP_Bool IsAudioInput(PP_Resource resource) {
return PP_FromBool(enter.succeeded());
}
+int32_t EnumerateDevices0_2(PP_Resource audio_input,
+ PP_Resource* devices,
+ PP_CompletionCallback callback) {
+ EnterAudioInput enter(audio_input, callback, true);
+ if (enter.failed())
+ return enter.retval();
+
+ return enter.SetResult(enter.object()->EnumerateDevices0_2(devices,
+ enter.callback()));
+}
+
int32_t EnumerateDevices(PP_Resource audio_input,
- PP_Resource* devices,
+ PP_ArrayOutput output,
PP_CompletionCallback callback) {
EnterAudioInput enter(audio_input, callback, true);
if (enter.failed())
return enter.retval();
- return enter.SetResult(enter.object()->EnumerateDevices(devices,
+ return enter.SetResult(enter.object()->EnumerateDevices(output,
enter.callback()));
}
+int32_t MonitorDeviceChange(PP_Resource audio_input,
+ PP_MonitorDeviceChangeCallback callback,
+ void* user_data) {
+ EnterAudioInput enter(audio_input, true);
+ if (enter.failed())
+ return enter.retval();
+ return enter.object()->MonitorDeviceChange(callback, user_data);
+}
+
int32_t Open(PP_Resource audio_input,
PP_Resource device_ref,
PP_Resource config,
@@ -98,7 +118,19 @@ void Close(PP_Resource audio_input) {
const PPB_AudioInput_Dev_0_2 g_ppb_audioinput_0_2_thunk = {
&Create,
&IsAudioInput,
+ &EnumerateDevices0_2,
+ &Open,
+ &GetCurrentConfig,
+ &StartCapture,
+ &StopCapture,
+ &Close
+};
+
+const PPB_AudioInput_Dev_0_3 g_ppb_audioinput_0_3_thunk = {
+ &Create,
+ &IsAudioInput,
&EnumerateDevices,
+ &MonitorDeviceChange,
&Open,
&GetCurrentConfig,
&StartCapture,
@@ -112,5 +144,9 @@ const PPB_AudioInput_Dev_0_2* GetPPB_AudioInput_Dev_0_2_Thunk() {
return &g_ppb_audioinput_0_2_thunk;
}
+const PPB_AudioInput_Dev_0_3* GetPPB_AudioInput_Dev_0_3_Thunk() {
+ return &g_ppb_audioinput_0_3_thunk;
+}
+
} // namespace thunk
} // namespace ppapi
« no previous file with comments | « ppapi/thunk/ppb_audio_input_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698