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

Unified Diff: media/audio/audio_input_controller.cc

Issue 3148003: Allow unit tests to use a mock audio input controller. (Closed)
Patch Set: Address review comments from Jeremy and Alpha Created 10 years, 4 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
« no previous file with comments | « media/audio/audio_input_controller.h ('k') | media/audio/test_audio_input_controller_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller.cc
diff --git a/media/audio/audio_input_controller.cc b/media/audio/audio_input_controller.cc
index f94c00420da66b5eff1a0f15426eff165f3deec6..d64fb700f5fa5c1237f2da6ada73a0f49068e38b 100644
--- a/media/audio/audio_input_controller.cc
+++ b/media/audio/audio_input_controller.cc
@@ -15,6 +15,9 @@ const int kMaxSamplesPerPacket = kMaxSampleRate;
namespace media {
+// static
+AudioInputController::Factory* AudioInputController::factory_ = NULL;
+
AudioInputController::AudioInputController(EventHandler* handler)
: handler_(handler),
stream_(NULL),
@@ -40,6 +43,11 @@ scoped_refptr<AudioInputController> AudioInputController::Create(
(samples_per_packet > kMaxSamplesPerPacket) || (samples_per_packet < 0))
return NULL;
+ if (factory_) {
+ return factory_->Create(event_handler, format, channels, sample_rate,
+ bits_per_sample, samples_per_packet);
+ }
+
scoped_refptr<AudioInputController> controller = new AudioInputController(
event_handler);
« no previous file with comments | « media/audio/audio_input_controller.h ('k') | media/audio/test_audio_input_controller_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698