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) { |