diff options
author | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-17 23:49:56 +0000 |
---|---|---|
committer | ajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-17 23:49:56 +0000 |
commit | 7aac3055e4809d516b05ddb9dd063346c2f94514 (patch) | |
tree | 17062b983be0063e60d63709065797f9aa61cc57 /ppapi/thunk | |
parent | 81c5deaba63aaddb9fcac95b4c1364f19edd6270 (diff) | |
download | chromium_src-7aac3055e4809d516b05ddb9dd063346c2f94514.zip chromium_src-7aac3055e4809d516b05ddb9dd063346c2f94514.tar.gz chromium_src-7aac3055e4809d516b05ddb9dd063346c2f94514.tar.bz2 |
Revert 110587 - Microphone support for Pepper Flash.
[Committing for pbrophy@adobe.com. Original review:
http://codereview.chromium.org/8138008/ .]
This change supports audio capture from the microphone and supplies the data
through a Pepper interface. Its enumeration is limited to the default audio
device that uses mono 44.1kHz.
TBR=tony@chromium.org
Review URL: http://codereview.chromium.org/8574029
TBR=viettrungluu@chromium.org
Review URL: http://codereview.chromium.org/8569003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110602 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r-- | ppapi/thunk/interfaces_ppb_public_dev.h | 3 | ||||
-rw-r--r-- | ppapi/thunk/ppb_audio_input_api.h | 33 | ||||
-rw-r--r-- | ppapi/thunk/ppb_audio_input_thunk.cc | 74 | ||||
-rw-r--r-- | ppapi/thunk/ppb_audio_input_trusted_thunk.cc | 67 | ||||
-rw-r--r-- | ppapi/thunk/resource_creation_api.h | 9 | ||||
-rw-r--r-- | ppapi/thunk/thunk.h | 3 |
6 files changed, 1 insertions, 188 deletions
diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h index 7ef9f30..574c954 100644 --- a/ppapi/thunk/interfaces_ppb_public_dev.h +++ b/ppapi/thunk/interfaces_ppb_public_dev.h @@ -7,7 +7,6 @@ #include "ppapi/thunk/interfaces_preamble.h" -PROXIED_API(PPB_AudioInput) PROXIED_API(PPB_Buffer) PROXIED_API(PPB_Context3D) PROXIED_API(PPB_CursorControl) @@ -24,8 +23,6 @@ PROXIED_API(PPB_VideoCapture) PROXIED_API(PPB_VideoDecoder) UNPROXIED_API(PPB_Widget) -PROXIED_IFACE(PPB_AudioInput, PPB_AUDIO_INPUT_DEV_INTERFACE_0_1, - PPB_AudioInput_Dev) PROXIED_IFACE(NoAPIName, PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_1, PPB_IMEInputEvent_Dev) PROXIED_IFACE(PPB_Buffer, PPB_BUFFER_DEV_INTERFACE_0_4, PPB_Buffer_Dev) diff --git a/ppapi/thunk/ppb_audio_input_api.h b/ppapi/thunk/ppb_audio_input_api.h deleted file mode 100644 index f42f0d5..0000000 --- a/ppapi/thunk/ppb_audio_input_api.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_THUNK_AUDIO_INPUT_API_H_ -#define PPAPI_THUNK_AUDIO_INPUT_API_H_ - -#include "ppapi/c/dev/ppb_audio_input_dev.h" -#include "ppapi/c/pp_completion_callback.h" -#include "ppapi/thunk/ppapi_thunk_export.h" - -namespace ppapi { -namespace thunk { - -class PPB_AudioInput_API { - public: - virtual ~PPB_AudioInput_API() {} - - virtual PP_Resource GetCurrentConfig() = 0; - virtual PP_Bool StartCapture() = 0; - virtual PP_Bool StopCapture() = 0; - - // Trusted API. - virtual int32_t OpenTrusted(PP_Resource config_id, - PP_CompletionCallback create_callback) = 0; - virtual int32_t GetSyncSocket(int* sync_socket) = 0; - virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) = 0; -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_AUDIO_INPUT_API_H_ diff --git a/ppapi/thunk/ppb_audio_input_thunk.cc b/ppapi/thunk/ppb_audio_input_thunk.cc deleted file mode 100644 index 7b6f31c..0000000 --- a/ppapi/thunk/ppb_audio_input_thunk.cc +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/pp_errors.h" -#include "ppapi/thunk/common.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_audio_input_api.h" -#include "ppapi/thunk/resource_creation_api.h" -#include "ppapi/thunk/thunk.h" - -namespace ppapi { -namespace thunk { - -namespace { - -typedef EnterResource<PPB_AudioInput_API> EnterAudioInput; - -PP_Resource Create(PP_Instance instance, - PP_Resource config_id, - PPB_AudioInput_Callback callback, - void* user_data) { - EnterFunction<ResourceCreationAPI> enter(instance, true); - if (enter.failed()) - return 0; - - return enter.functions()->CreateAudioInput(instance, config_id, - callback, user_data); -} - -PP_Bool IsAudioInput(PP_Resource resource) { - EnterAudioInput enter(resource, false); - return PP_FromBool(enter.succeeded()); -} - -PP_Resource GetCurrentConfiguration(PP_Resource audio_id) { - EnterAudioInput enter(audio_id, true); - if (enter.failed()) - return 0; - return enter.object()->GetCurrentConfig(); -} - -PP_Bool StartCapture(PP_Resource audio_input) { - EnterAudioInput enter(audio_input, true); - if (enter.failed()) - return PP_FALSE; - - return enter.object()->StartCapture(); -} - -PP_Bool StopCapture(PP_Resource audio_input) { - EnterAudioInput enter(audio_input, true); - if (enter.failed()) - return PP_FALSE; - - return enter.object()->StopCapture(); -} - -const PPB_AudioInput_Dev g_ppb_audioinput_thunk = { - &Create, - &IsAudioInput, - &GetCurrentConfiguration, - &StartCapture, - &StopCapture -}; - -} // namespace - -const PPB_AudioInput_Dev* GetPPB_AudioInput_Dev_Thunk() { - return &g_ppb_audioinput_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/ppb_audio_input_trusted_thunk.cc b/ppapi/thunk/ppb_audio_input_trusted_thunk.cc deleted file mode 100644 index 1de878c..0000000 --- a/ppapi/thunk/ppb_audio_input_trusted_thunk.cc +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/c/pp_errors.h" -#include "ppapi/c/trusted/ppb_audio_input_trusted_dev.h" -#include "ppapi/thunk/common.h" -#include "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_audio_input_api.h" -#include "ppapi/thunk/resource_creation_api.h" -#include "ppapi/thunk/thunk.h" - -namespace ppapi { -namespace thunk { - -namespace { - -typedef EnterResource<PPB_AudioInput_API> EnterAudioInput; - -PP_Resource Create(PP_Instance instance_id) { - EnterFunction<ResourceCreationAPI> enter(instance_id, true); - if (enter.failed()) - return 0; - return enter.functions()->CreateAudioInputTrusted(instance_id); -} - -int32_t Open(PP_Resource audio_id, - PP_Resource config_id, - PP_CompletionCallback create_callback) { - EnterAudioInput enter(audio_id, true); - if (enter.failed()) - return MayForceCallback(create_callback, PP_ERROR_BADRESOURCE); - int32_t result = enter.object()->OpenTrusted(config_id, create_callback); - return MayForceCallback(create_callback, result); -} - -int32_t GetSyncSocket(PP_Resource audio_id, int* sync_socket) { - EnterAudioInput enter(audio_id, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->GetSyncSocket(sync_socket); -} - -int32_t GetSharedMemory(PP_Resource audio_id, - int* shm_handle, - uint32_t* shm_size) { - EnterAudioInput enter(audio_id, true); - if (enter.failed()) - return PP_ERROR_BADRESOURCE; - return enter.object()->GetSharedMemory(shm_handle, shm_size); -} - -const PPB_AudioInputTrusted_Dev g_ppb_audioinput_trusted_thunk = { - &Create, - &Open, - &GetSyncSocket, - &GetSharedMemory, -}; - -} // namespace - -const PPB_AudioInputTrusted_Dev* GetPPB_AudioInputTrusted_Thunk() { - return &g_ppb_audioinput_trusted_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/resource_creation_api.h b/ppapi/thunk/resource_creation_api.h index b9e26d5..dd37bed 100644 --- a/ppapi/thunk/resource_creation_api.h +++ b/ppapi/thunk/resource_creation_api.h @@ -5,7 +5,6 @@ #ifndef PPAPI_THUNK_RESOURCE_CREATION_API_H_ #define PPAPI_THUNK_RESOURCE_CREATION_API_H_ -#include "ppapi/c/dev/ppb_audio_input_dev.h" #include "ppapi/c/dev/ppb_file_chooser_dev.h" #include "ppapi/c/dev/ppb_video_layer_dev.h" #include "ppapi/c/pp_bool.h" @@ -44,16 +43,10 @@ class ResourceCreationAPI { PP_Resource config_id, PPB_Audio_Callback audio_callback, void* user_data) = 0; - virtual PP_Resource CreateAudioTrusted(PP_Instance instance) = 0; + virtual PP_Resource CreateAudioTrusted(PP_Instance instace) = 0; virtual PP_Resource CreateAudioConfig(PP_Instance instance, PP_AudioSampleRate sample_rate, uint32_t sample_frame_count) = 0; - virtual PP_Resource CreateAudioInput( - PP_Instance instance, - PP_Resource config_id, - PPB_AudioInput_Callback audio_input_callback, - void* user_data) = 0; - virtual PP_Resource CreateAudioInputTrusted(PP_Instance instance) = 0; virtual PP_Resource CreateBroker(PP_Instance instance) = 0; virtual PP_Resource CreateBuffer(PP_Instance instance, uint32_t size) = 0; virtual PP_Resource CreateContext3D(PP_Instance instance, diff --git a/ppapi/thunk/thunk.h b/ppapi/thunk/thunk.h index 5f6a62c..8990b94 100644 --- a/ppapi/thunk/thunk.h +++ b/ppapi/thunk/thunk.h @@ -27,7 +27,6 @@ #undef PROXIED_IFACE #undef IFACE -struct PPB_AudioInputTrusted_Dev; struct PPB_AudioTrusted; struct PPB_BrokerTrusted; struct PPB_BufferTrusted; @@ -53,8 +52,6 @@ namespace thunk { // Old-style thunk getters. Only put trusted/private stuff here (it hasn't // yet been converted to the new system). Otherwise, add the declaration to // the appropriate interfaces_*.h file. -PPAPI_THUNK_EXPORT const PPB_AudioInputTrusted_Dev* - GetPPB_AudioInputTrusted_Thunk(); PPAPI_THUNK_EXPORT const PPB_AudioTrusted* GetPPB_AudioTrusted_Thunk(); PPAPI_THUNK_EXPORT const PPB_BrokerTrusted* GetPPB_Broker_Thunk(); PPAPI_THUNK_EXPORT const PPB_BufferTrusted* GetPPB_BufferTrusted_Thunk(); |