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

Unified Diff: content/renderer/media/audio_device_factory.cc

Issue 12383016: Merge AssociateStreamWithProducer message into CreateStream message for both audio output and input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments. Created 7 years, 9 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/media/audio_device_factory.cc
diff --git a/content/renderer/media/audio_device_factory.cc b/content/renderer/media/audio_device_factory.cc
index fae521e5dd6248255888957ddde42f5aef3144ca..f7f454cbdd4e8d8a618a5b25dfb5e1a48464bd77 100644
--- a/content/renderer/media/audio_device_factory.cc
+++ b/content/renderer/media/audio_device_factory.cc
@@ -7,8 +7,9 @@
#include "base/logging.h"
#include "content/renderer/media/audio_input_message_filter.h"
#include "content/renderer/media/audio_message_filter.h"
-#include "content/renderer/media/renderer_audio_output_device.h"
+#include "content/renderer/render_thread_impl.h"
#include "media/audio/audio_input_device.h"
+#include "media/audio/audio_output_device.h"
namespace content {
@@ -16,24 +17,35 @@ namespace content {
AudioDeviceFactory* AudioDeviceFactory::factory_ = NULL;
// static
-scoped_refptr<RendererAudioOutputDevice> AudioDeviceFactory::NewOutputDevice() {
- RendererAudioOutputDevice* device = NULL;
- if (factory_)
- device = factory_->CreateOutputDevice();
-
- return device ? device : new RendererAudioOutputDevice(
- AudioMessageFilter::Get(), AudioMessageFilter::Get()->io_message_loop());
+scoped_refptr<media::AudioOutputDevice> AudioDeviceFactory::NewOutputDevice(
+ int render_view_id) {
+ if (factory_) {
+ media::AudioOutputDevice* const device =
+ factory_->CreateOutputDevice(render_view_id);
+ if (device)
+ return device;
+ }
+
+ AudioMessageFilter* const filter =
+ RenderThreadImpl::current()->audio_message_filter();
DaleCurtis 2013/03/07 21:02:58 I don't think this works? AudioRendererMixerManage
miu 2013/04/16 00:07:36 I dedcided to put the AudioMessageFilter::Get() st
+ return new media::AudioOutputDevice(
+ filter->CreateAudioOutputIPC(render_view_id), filter->io_message_loop());
}
// static
-scoped_refptr<media::AudioInputDevice> AudioDeviceFactory::NewInputDevice() {
- media::AudioInputDevice* device = NULL;
- if (factory_)
- device = factory_->CreateInputDevice();
-
- return device ? device : new media::AudioInputDevice(
- AudioInputMessageFilter::Get(),
- AudioInputMessageFilter::Get()->io_message_loop());
+scoped_refptr<media::AudioInputDevice> AudioDeviceFactory::NewInputDevice(
+ int render_view_id) {
+ if (factory_) {
+ media::AudioInputDevice* const device =
+ factory_->CreateInputDevice(render_view_id);
+ if (device)
+ return device;
+ }
+
+ AudioInputMessageFilter* const filter =
+ RenderThreadImpl::current()->audio_input_message_filter();
+ return new media::AudioInputDevice(
+ filter->CreateAudioInputIPC(render_view_id), filter->io_message_loop());
}
AudioDeviceFactory::AudioDeviceFactory() {

Powered by Google App Engine
This is Rietveld 408576698