summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_audio_input_proxy.h
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-07 07:48:48 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-07 07:48:48 +0000
commiteed24562b1e6a431fc726195e1114eed01b1694f (patch)
tree2ae570b6f55f7043e62bc25dca335d03ba75bb52 /ppapi/proxy/ppb_audio_input_proxy.h
parente974ad29d8f31b1f86bb551dc99ad4e5e62b002c (diff)
downloadchromium_src-eed24562b1e6a431fc726195e1114eed01b1694f.zip
chromium_src-eed24562b1e6a431fc726195e1114eed01b1694f.tar.gz
chromium_src-eed24562b1e6a431fc726195e1114eed01b1694f.tar.bz2
PPB_AudioInput_Dev: support multiple audio input devices - Part 1.
- This CL implements PPB_AudioInput_Dev v0.2 and extends examples/audio_input. - This CL doesn't actually open devices other than the default one. That will be in a separate CL. BUG=None TEST=examples/audio_input Review URL: http://codereview.chromium.org/9557007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_audio_input_proxy.h')
-rw-r--r--ppapi/proxy/ppb_audio_input_proxy.h47
1 files changed, 30 insertions, 17 deletions
diff --git a/ppapi/proxy/ppb_audio_input_proxy.h b/ppapi/proxy/ppb_audio_input_proxy.h
index e50b03b..61125c6 100644
--- a/ppapi/proxy/ppb_audio_input_proxy.h
+++ b/ppapi/proxy/ppb_audio_input_proxy.h
@@ -5,7 +5,9 @@
#ifndef PPAPI_PROXY_PPB_AUDIO_INPUT_PROXY_H_
#define PPAPI_PROXY_PPB_AUDIO_INPUT_PROXY_H_
+#include <string>
#include <utility>
+#include <vector>
#include "base/basictypes.h"
#include "base/shared_memory.h"
@@ -20,6 +22,7 @@
namespace ppapi {
class HostResource;
+struct DeviceRefData;
namespace proxy {
@@ -28,12 +31,14 @@ class PPB_AudioInput_Proxy : public InterfaceProxy {
explicit PPB_AudioInput_Proxy(Dispatcher* dispatcher);
virtual ~PPB_AudioInput_Proxy();
- static PP_Resource CreateProxyResource(
+ static PP_Resource CreateProxyResource0_1(
PP_Instance instance,
- PP_Resource config_id,
+ PP_Resource config,
PPB_AudioInput_Callback audio_input_callback,
void* user_data);
+ static PP_Resource CreateProxyResource(PP_Instance instance);
+
// InterfaceProxy implementation.
virtual bool OnMessageReceived(const IPC::Message& msg);
@@ -42,23 +47,31 @@ class PPB_AudioInput_Proxy : public InterfaceProxy {
private:
// Message handlers.
// Plugin->renderer message handlers.
- void OnMsgCreate(PP_Instance instance_id,
- int32_t sample_rate,
- uint32_t sample_frame_count,
- ppapi::HostResource* result);
- void OnMsgStartOrStop(const ppapi::HostResource& audio_id, bool capture);
+ void OnMsgCreate(PP_Instance instance, ppapi::HostResource* result);
+ void OnMsgEnumerateDevices(const ppapi::HostResource& audio_input);
+ void OnMsgOpen(const ppapi::HostResource& audio_input,
+ const std::string& device_id,
+ int32_t sample_rate,
+ uint32_t sample_frame_count);
+ void OnMsgStartOrStop(const ppapi::HostResource& audio_input, bool capture);
+ void OnMsgClose(const ppapi::HostResource& audio_input);
// Renderer->plugin message handlers.
- void OnMsgNotifyAudioStreamCreated(const ppapi::HostResource& audio_id,
- int32_t result_code,
- IPC::PlatformFileForTransit socket_handle,
- base::SharedMemoryHandle handle,
- uint32_t length);
-
- void AudioInputChannelConnected(int32_t result,
- const ppapi::HostResource& resource);
-
- // In the renderer, this is called in response to a stream created message.
+ void OnMsgEnumerateDevicesACK(
+ const ppapi::HostResource& audio_input,
+ int32_t result,
+ const std::vector<ppapi::DeviceRefData>& devices);
+ void OnMsgOpenACK(const ppapi::HostResource& audio_input,
+ int32_t result,
+ IPC::PlatformFileForTransit socket_handle,
+ base::SharedMemoryHandle handle,
+ uint32_t length);
+
+ void EnumerateDevicesACKInHost(int32_t result,
+ const ppapi::HostResource& audio_input);
+ void OpenACKInHost(int32_t result, const ppapi::HostResource& audio_input);
+
+ // In the renderer, this is called in response to an OpenACK message.
// It will retrieve the shared memory and socket handles and place them into
// the given out params. The return value is a PPAPI error code.
//