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

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

Issue 2624403002: Refactor AudioInputController and related interfaces. (Closed)
Patch Set: Address comments Created 3 years, 11 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
« no previous file with comments | « media/audio/audio_io.h ('k') | media/audio/test_audio_input_controller_factory.cc » ('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) 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 64
65 // Returns the event handler installed on the AudioInputController. 65 // Returns the event handler installed on the AudioInputController.
66 EventHandler* event_handler() const { return event_handler_; } 66 EventHandler* event_handler() const { return event_handler_; }
67 67
68 // Returns a pointer to the audio callback for the AudioInputController.
69 SyncWriter* sync_writer() const { return sync_writer_; }
70
68 // Notifies the TestAudioControllerOpened() event to the delegate (if any). 71 // Notifies the TestAudioControllerOpened() event to the delegate (if any).
69 void Record() override; 72 void Record() override;
70 73
71 // Ensure that the closure is run on the audio-manager thread. 74 // Ensure that the closure is run on the audio-manager thread.
72 void Close(const base::Closure& closed_task) override; 75 void Close(const base::Closure& closed_task) override;
73 76
74 const AudioParameters& audio_parameters() const { 77 const AudioParameters& audio_parameters() const {
75 return audio_parameters_; 78 return audio_parameters_;
76 } 79 }
77 80
78 protected: 81 protected:
79 ~TestAudioInputController() override; 82 ~TestAudioInputController() override;
80 83
81 private: 84 private:
82 AudioParameters audio_parameters_; 85 AudioParameters audio_parameters_;
83 86
84 // These are not owned by us and expected to be valid for this object's 87 // These are not owned by us and expected to be valid for this object's
85 // lifetime. 88 // lifetime.
86 TestAudioInputControllerFactory* factory_; 89 TestAudioInputControllerFactory* factory_;
87 EventHandler* event_handler_; 90 EventHandler* const event_handler_;
91 SyncWriter* const sync_writer_;
88 92
89 DISALLOW_COPY_AND_ASSIGN(TestAudioInputController); 93 DISALLOW_COPY_AND_ASSIGN(TestAudioInputController);
90 }; 94 };
91 95
92 typedef TestAudioInputController::Delegate TestAudioInputControllerDelegate; 96 typedef TestAudioInputController::Delegate TestAudioInputControllerDelegate;
93 97
94 // Simple AudioInputController::Factory method that creates 98 // Simple AudioInputController::Factory method that creates
95 // TestAudioInputControllers. 99 // TestAudioInputControllers.
96 class TestAudioInputControllerFactory : public AudioInputController::Factory { 100 class TestAudioInputControllerFactory : public AudioInputController::Factory {
97 public: 101 public:
(...skipping 27 matching lines...) Expand all
125 129
126 // The delegate for tests for receiving audio controller events. 130 // The delegate for tests for receiving audio controller events.
127 TestAudioInputControllerDelegate* delegate_; 131 TestAudioInputControllerDelegate* delegate_;
128 132
129 DISALLOW_COPY_AND_ASSIGN(TestAudioInputControllerFactory); 133 DISALLOW_COPY_AND_ASSIGN(TestAudioInputControllerFactory);
130 }; 134 };
131 135
132 } // namespace media 136 } // namespace media
133 137
134 #endif // MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_ 138 #endif // MEDIA_AUDIO_TEST_AUDIO_INPUT_CONTROLLER_FACTORY_H_
OLDNEW
« no previous file with comments | « media/audio/audio_io.h ('k') | media/audio/test_audio_input_controller_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698