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

Side by Side Diff: media/audio/test_audio_input_controller_factory.cc

Issue 4661001: Simplified AudioOutputStream interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/test_audio_input_controller_factory.h ('k') | media/audio/win/audio_manager_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/test_audio_input_controller_factory.h" 5 #include "media/audio/test_audio_input_controller_factory.h"
6 #include "media/audio/audio_io.h" 6 #include "media/audio/audio_io.h"
7 7
8 namespace media { 8 namespace media {
9 9
10 TestAudioInputController::TestAudioInputController( 10 TestAudioInputController::TestAudioInputController(
11 TestAudioInputControllerFactory* factory, EventHandler* event_handler) 11 TestAudioInputControllerFactory* factory, EventHandler* event_handler)
12 : AudioInputController(event_handler), 12 : AudioInputController(event_handler),
13 factory_(factory), 13 factory_(factory),
14 event_handler_(event_handler) { 14 event_handler_(event_handler) {
15 } 15 }
16 16
17 TestAudioInputController::~TestAudioInputController() { 17 TestAudioInputController::~TestAudioInputController() {
18 // Inform the factory so that it allows creating new instances in future. 18 // Inform the factory so that it allows creating new instances in future.
19 factory_->OnTestAudioInputControllerDestroyed(this); 19 factory_->OnTestAudioInputControllerDestroyed(this);
20 } 20 }
21 21
22 TestAudioInputControllerFactory::TestAudioInputControllerFactory() 22 TestAudioInputControllerFactory::TestAudioInputControllerFactory()
23 : controller_(NULL) { 23 : controller_(NULL) {
24 } 24 }
25 25
26 AudioInputController* TestAudioInputControllerFactory::Create( 26 AudioInputController* TestAudioInputControllerFactory::Create(
27 AudioInputController::EventHandler* event_handler, 27 AudioInputController::EventHandler* event_handler,
28 AudioParameters params, 28 AudioParameters params) {
29 int samples_per_packet) {
30 DCHECK(!controller_); // Only one test instance managed at a time. 29 DCHECK(!controller_); // Only one test instance managed at a time.
31 controller_ = new TestAudioInputController(this, event_handler); 30 controller_ = new TestAudioInputController(this, event_handler);
32 return controller_; 31 return controller_;
33 } 32 }
34 33
35 void TestAudioInputControllerFactory::OnTestAudioInputControllerDestroyed( 34 void TestAudioInputControllerFactory::OnTestAudioInputControllerDestroyed(
36 TestAudioInputController* controller) { 35 TestAudioInputController* controller) {
37 DCHECK(controller_ == controller); 36 DCHECK(controller_ == controller);
38 controller_ = NULL; 37 controller_ = NULL;
39 } 38 }
40 39
41 } // namespace media 40 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/test_audio_input_controller_factory.h ('k') | media/audio/win/audio_manager_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698