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

Unified Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 2120273004: Getting rid of AudioHardwareConfig and its synchronous IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to guidou@ changes, dropped unknown frame id and default param caching Created 4 years, 5 months 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
Index: content/renderer/pepper/pepper_plugin_instance_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 29625e4a049ad9d5f3e9ebfd89b88307133d92e3..f5ae6682d055945238158563dafe2c7881de0ae2 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -28,6 +28,7 @@
#include "content/common/frame_messages.h"
#include "content/public/common/content_constants.h"
#include "content/public/renderer/content_renderer_client.h"
+#include "content/renderer/media/audio_device_factory.h"
#include "content/renderer/pepper/content_decryptor_delegate.h"
#include "content/renderer/pepper/event_conversion.h"
#include "content/renderer/pepper/fullscreen_container.h"
@@ -60,7 +61,6 @@
#include "content/renderer/render_widget.h"
#include "content/renderer/render_widget_fullscreen_pepper.h"
#include "content/renderer/sad_plugin.h"
-#include "media/base/audio_hardware_config.h"
#include "ppapi/c/dev/ppp_text_input_dev.h"
#include "ppapi/c/pp_rect.h"
#include "ppapi/c/ppb_audio_config.h"
@@ -2453,14 +2453,24 @@ PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance,
uint32_t PepperPluginInstanceImpl::GetAudioHardwareOutputSampleRate(
PP_Instance instance) {
- RenderThreadImpl* thread = RenderThreadImpl::current();
- return thread->GetAudioHardwareConfig()->GetOutputSampleRate();
+ return render_frame()
+ ? AudioDeviceFactory::GetOutputDeviceInfo(
+ render_frame()->GetRoutingID(), 0 /* session_id */,
+ std::string() /* device_id */, url::Origin(document_url()))
+ .output_params()
+ .sample_rate()
+ : 0;
}
uint32_t PepperPluginInstanceImpl::GetAudioHardwareOutputBufferSize(
PP_Instance instance) {
- RenderThreadImpl* thread = RenderThreadImpl::current();
- return thread->GetAudioHardwareConfig()->GetOutputBufferSize();
+ return render_frame()
+ ? AudioDeviceFactory::GetOutputDeviceInfo(
+ render_frame()->GetRoutingID(), 0 /* session_id */,
+ std::string() /* device_id */, url::Origin(document_url()))
+ .output_params()
+ .frames_per_buffer()
+ : 0;
}
PP_Var PepperPluginInstanceImpl::GetDefaultCharSet(PP_Instance instance) {

Powered by Google App Engine
This is Rietveld 408576698