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

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

Issue 2582533002: Simplify AudioInputRendererHost IPC interface. (Closed)
Patch Set: Rebase. 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
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_AUDIO_INPUT_CONTROLLER_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_
6 #define MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ 6 #define MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 52 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
53 // CrateLowLatency() ==> DoCreate() 53 // CrateLowLatency() ==> DoCreate()
54 // AudioManager::MakeAudioInputStream() 54 // AudioManager::MakeAudioInputStream()
55 // AudioInputStream::Open() 55 // AudioInputStream::Open()
56 // .- - - - - - - - - - - - -> OnError() 56 // .- - - - - - - - - - - - -> OnError()
57 // .-------------------------> OnCreated() 57 // .-------------------------> OnCreated()
58 // kCreated 58 // kCreated
59 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 59 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
60 // Record() ==> DoRecord() 60 // Record() ==> DoRecord()
61 // AudioInputStream::Start() 61 // AudioInputStream::Start()
62 // .-------------------------> OnRecording()
63 // kRecording 62 // kRecording
64 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 63 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
65 // Close() ==> DoClose() 64 // Close() ==> DoClose()
66 // state_ = kClosed 65 // state_ = kClosed
67 // AudioInputStream::Stop() 66 // AudioInputStream::Stop()
68 // AudioInputStream::Close() 67 // AudioInputStream::Close()
69 // SyncWriter::Close() 68 // SyncWriter::Close()
70 // Closure::Run() <-----------------. 69 // Closure::Run() <-----------------.
71 // (closure-task) 70 // (closure-task)
72 // 71 //
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 // Native input stream reports an error. Exact reason differs between 105 // Native input stream reports an error. Exact reason differs between
107 // platforms. 106 // platforms.
108 STREAM_ERROR, // = 3 107 STREAM_ERROR, // = 3
109 }; 108 };
110 109
111 // An event handler that receives events from the AudioInputController. The 110 // An event handler that receives events from the AudioInputController. The
112 // following methods are all called on the audio thread. 111 // following methods are all called on the audio thread.
113 class MEDIA_EXPORT EventHandler { 112 class MEDIA_EXPORT EventHandler {
114 public: 113 public:
115 virtual void OnCreated(AudioInputController* controller) = 0; 114 virtual void OnCreated(AudioInputController* controller) = 0;
116 virtual void OnRecording(AudioInputController* controller) = 0;
117 virtual void OnError(AudioInputController* controller, 115 virtual void OnError(AudioInputController* controller,
118 ErrorCode error_code) = 0; 116 ErrorCode error_code) = 0;
119 virtual void OnData(AudioInputController* controller, 117 virtual void OnData(AudioInputController* controller,
120 const AudioBus* data) = 0; 118 const AudioBus* data) = 0;
121 virtual void OnLog(AudioInputController* controller, 119 virtual void OnLog(AudioInputController* controller,
122 const std::string& message) = 0; 120 const std::string& message) = 0;
123 121
124 protected: 122 protected:
125 virtual ~EventHandler() {} 123 virtual ~EventHandler() {}
126 }; 124 };
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 // Used for audio debug recordings. Accessed on audio thread. 394 // Used for audio debug recordings. Accessed on audio thread.
397 const std::unique_ptr<AudioInputWriter> debug_writer_; 395 const std::unique_ptr<AudioInputWriter> debug_writer_;
398 396
399 private: 397 private:
400 DISALLOW_COPY_AND_ASSIGN(AudioInputController); 398 DISALLOW_COPY_AND_ASSIGN(AudioInputController);
401 }; 399 };
402 400
403 } // namespace media 401 } // namespace media
404 402
405 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ 403 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698