summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_instance_proxy.cc
diff options
context:
space:
mode:
authornfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-18 01:10:19 +0000
committernfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-18 01:10:19 +0000
commitc59ed589fde8d4c9225b7b1b125286f842a42e56 (patch)
treefdaa00c2a9f51d0030e3b05bb289630ad5f2e211 /ppapi/proxy/ppb_instance_proxy.cc
parent86bd8a2b5e1ce2965551271109be51244d2fcb42 (diff)
downloadchromium_src-c59ed589fde8d4c9225b7b1b125286f842a42e56.zip
chromium_src-c59ed589fde8d4c9225b7b1b125286f842a42e56.tar.gz
chromium_src-c59ed589fde8d4c9225b7b1b125286f842a42e56.tar.bz2
Work on improving PpbAudioConfig:RecommendSampleFrameCount
Add version 1.1 which will query the audio back end for the best available sample frame count. Also add RecommendSampleRate. Switch pepper plugin delegate to use AUDIO_PCM_LOW_LATENCY if client request is compatible. TEST=included BUG=http://code.google.com/p/chromium/issues/detail?id=107572 Review URL: https://chromiumcodereview.appspot.com/9129007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122653 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/ppb_instance_proxy.cc')
-rw-r--r--ppapi/proxy/ppb_instance_proxy.cc39
1 files changed, 39 insertions, 0 deletions
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index 5bdde43..1f71e87 100644
--- a/ppapi/proxy/ppb_instance_proxy.cc
+++ b/ppapi/proxy/ppb_instance_proxy.cc
@@ -6,6 +6,7 @@
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/pp_var.h"
+#include "ppapi/c/ppb_audio_config.h"
#include "ppapi/c/ppb_instance.h"
#include "ppapi/c/ppb_messaging.h"
#include "ppapi/c/ppb_mouse_lock.h"
@@ -82,6 +83,12 @@ bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) {
OnHostMsgBindGraphics)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_IsFullFrame,
OnHostMsgIsFullFrame)
+ IPC_MESSAGE_HANDLER(
+ PpapiHostMsg_PPBInstance_GetAudioHardwareOutputSampleRate,
+ OnHostMsgGetAudioHardwareOutputSampleRate)
+ IPC_MESSAGE_HANDLER(
+ PpapiHostMsg_PPBInstance_GetAudioHardwareOutputBufferSize,
+ OnHostMsgGetAudioHardwareOutputBufferSize)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ExecuteScript,
OnHostMsgExecuteScript)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDefaultCharSet,
@@ -185,6 +192,24 @@ PP_Var PPB_Instance_Proxy::ExecuteScript(PP_Instance instance,
return result.Return(dispatcher());
}
+uint32_t PPB_Instance_Proxy::GetAudioHardwareOutputSampleRate(
+ PP_Instance instance) {
+ uint32_t result = PP_AUDIOSAMPLERATE_NONE;
+ dispatcher()->Send(
+ new PpapiHostMsg_PPBInstance_GetAudioHardwareOutputSampleRate(
+ API_ID_PPB_INSTANCE, instance, &result));
+ return result;
+}
+
+uint32_t PPB_Instance_Proxy::GetAudioHardwareOutputBufferSize(
+ PP_Instance instance) {
+ uint32_t result = 0;
+ dispatcher()->Send(
+ new PpapiHostMsg_PPBInstance_GetAudioHardwareOutputBufferSize(
+ API_ID_PPB_INSTANCE, instance, &result));
+ return result;
+}
+
PP_Var PPB_Instance_Proxy::GetDefaultCharSet(PP_Instance instance) {
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance);
if (!dispatcher)
@@ -421,6 +446,20 @@ void PPB_Instance_Proxy::OnHostMsgBindGraphics(PP_Instance instance,
}
}
+void PPB_Instance_Proxy::OnHostMsgGetAudioHardwareOutputSampleRate(
+ PP_Instance instance, uint32_t* result) {
+ EnterInstanceNoLock enter(instance, false);
+ if (enter.succeeded())
+ *result = enter.functions()->GetAudioHardwareOutputSampleRate(instance);
+}
+
+void PPB_Instance_Proxy::OnHostMsgGetAudioHardwareOutputBufferSize(
+ PP_Instance instance, uint32_t* result) {
+ EnterInstanceNoLock enter(instance, false);
+ if (enter.succeeded())
+ *result = enter.functions()->GetAudioHardwareOutputBufferSize(instance);
+}
+
void PPB_Instance_Proxy::OnHostMsgIsFullFrame(PP_Instance instance,
PP_Bool* result) {
EnterInstanceNoLock enter(instance, false);