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

Unified Diff: media/audio/audio_manager_base.cc

Issue 9691001: Audio software mixer. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 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: media/audio/audio_manager_base.cc
===================================================================
--- media/audio/audio_manager_base.cc (revision 129817)
+++ media/audio/audio_manager_base.cc (working copy)
@@ -5,12 +5,15 @@
#include "media/audio/audio_manager_base.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/message_loop_proxy.h"
#include "base/threading/thread.h"
-#include "media/audio/audio_output_dispatcher.h"
+#include "media/audio/audio_output_dispatcher_impl.h"
+#include "media/audio/audio_output_mixer.h"
#include "media/audio/audio_output_proxy.h"
#include "media/audio/fake_audio_input_stream.h"
#include "media/audio/fake_audio_output_stream.h"
+#include "media/base/media_switches.h"
static const int kStreamCloseDelaySeconds = 5;
@@ -134,9 +137,16 @@
scoped_refptr<AudioOutputDispatcher>& dispatcher =
output_dispatchers_[params];
- if (!dispatcher)
- dispatcher = new AudioOutputDispatcher(
- this, params, base::TimeDelta::FromSeconds(kStreamCloseDelaySeconds));
+ if (!dispatcher) {
+ base::TimeDelta close_delay =
+ base::TimeDelta::FromSeconds(kStreamCloseDelaySeconds);
+ const CommandLine* cmd_line = CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kEnableAudioMixer)) {
+ dispatcher = new AudioOutputMixer(this, params, close_delay);
+ } else {
+ dispatcher = new AudioOutputDispatcherImpl(this, params, close_delay);
+ }
+ }
return new AudioOutputProxy(dispatcher);
}

Powered by Google App Engine
This is Rietveld 408576698