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

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

Issue 2665163002: Refactor AudioInputController and split stat by stream type. (Closed)
Patch Set: Compile Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_ 5 #ifndef MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_
6 #define MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_ 6 #define MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "media/audio/audio_input_controller.h" 10 #include "media/audio/audio_input_controller.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 TestAudioInputController* controller) = 0; 53 TestAudioInputController* controller) = 0;
54 virtual void TestAudioControllerClosed( 54 virtual void TestAudioControllerClosed(
55 TestAudioInputController* controller) = 0; 55 TestAudioInputController* controller) = 0;
56 }; 56 };
57 57
58 TestAudioInputController(TestAudioInputControllerFactory* factory, 58 TestAudioInputController(TestAudioInputControllerFactory* factory,
59 AudioManager* audio_manager, 59 AudioManager* audio_manager,
60 const AudioParameters& audio_parameters, 60 const AudioParameters& audio_parameters,
61 EventHandler* event_handler, 61 EventHandler* event_handler,
62 SyncWriter* sync_writer, 62 SyncWriter* sync_writer,
63 UserInputMonitor* user_input_monitor); 63 UserInputMonitor* user_input_monitor,
64 StreamType type);
64 65
65 // Returns the event handler installed on the AudioInputController. 66 // Returns the event handler installed on the AudioInputController.
66 EventHandler* event_handler() const { return event_handler_; } 67 EventHandler* event_handler() const { return event_handler_; }
67 68
68 // Returns a pointer to the audio callback for the AudioInputController. 69 // Returns a pointer to the audio callback for the AudioInputController.
69 SyncWriter* sync_writer() const { return sync_writer_; } 70 SyncWriter* sync_writer() const { return sync_writer_; }
70 71
71 // Notifies the TestAudioControllerOpened() event to the delegate (if any). 72 // Notifies the TestAudioControllerOpened() event to the delegate (if any).
72 void Record() override; 73 void Record() override;
73 74
(...skipping 28 matching lines...) Expand all
102 TestAudioInputControllerFactory(); 103 TestAudioInputControllerFactory();
103 ~TestAudioInputControllerFactory() override; 104 ~TestAudioInputControllerFactory() override;
104 105
105 // AudioInputController::Factory methods. 106 // AudioInputController::Factory methods.
106 AudioInputController* Create( 107 AudioInputController* Create(
107 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 108 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
108 AudioInputController::SyncWriter* sync_writer, 109 AudioInputController::SyncWriter* sync_writer,
109 AudioManager* audio_manager, 110 AudioManager* audio_manager,
110 AudioInputController::EventHandler* event_handler, 111 AudioInputController::EventHandler* event_handler,
111 AudioParameters params, 112 AudioParameters params,
112 UserInputMonitor* user_input_monitor) override; 113 UserInputMonitor* user_input_monitor,
114 AudioInputController::StreamType type) override;
113 115
114 void set_delegate(TestAudioInputControllerDelegate* delegate) { 116 void set_delegate(TestAudioInputControllerDelegate* delegate) {
115 delegate_ = delegate; 117 delegate_ = delegate;
116 } 118 }
117 119
118 TestAudioInputController* controller() const { return controller_; } 120 TestAudioInputController* controller() const { return controller_; }
119 121
120 private: 122 private:
121 friend class TestAudioInputController; 123 friend class TestAudioInputController;
122 124
123 // Invoked by a TestAudioInputController when it gets destroyed. 125 // Invoked by a TestAudioInputController when it gets destroyed.
124 void OnTestAudioInputControllerDestroyed( 126 void OnTestAudioInputControllerDestroyed(
125 TestAudioInputController* controller); 127 TestAudioInputController* controller);
126 128
127 // The caller of Create owns this object. 129 // The caller of Create owns this object.
128 TestAudioInputController* controller_; 130 TestAudioInputController* controller_;
129 131
130 // The delegate for tests for receiving audio controller events. 132 // The delegate for tests for receiving audio controller events.
131 TestAudioInputControllerDelegate* delegate_; 133 TestAudioInputControllerDelegate* delegate_;
132 134
133 DISALLOW_COPY_AND_ASSIGN(TestAudioInputControllerFactory); 135 DISALLOW_COPY_AND_ASSIGN(TestAudioInputControllerFactory);
134 }; 136 };
135 137
136 } // namespace media 138 } // namespace media
137 139
138 #endif // MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_ 140 #endif // MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_
OLDNEW
« no previous file with comments | « media/audio/audio_input_controller_unittest.cc ('k') | media/audio/test_audio_input_controller_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698