OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // * Initial state | 34 // * Initial state |
35 // | 35 // |
36 namespace media { | 36 namespace media { |
37 | 37 |
38 class MEDIA_EXPORT AudioInputController | 38 class MEDIA_EXPORT AudioInputController |
39 : public base::RefCountedThreadSafe<AudioInputController>, | 39 : public base::RefCountedThreadSafe<AudioInputController>, |
40 public AudioInputStream::AudioInputCallback { | 40 public AudioInputStream::AudioInputCallback { |
41 public: | 41 public: |
42 // An event handler that receives events from the AudioInputController. The | 42 // An event handler that receives events from the AudioInputController. The |
43 // following methods are called on the audio input controller thread. | 43 // following methods are called on the audio input controller thread. |
44 class EventHandler { | 44 class MEDIA_EXPORT EventHandler { |
45 public: | 45 public: |
46 virtual ~EventHandler() {} | 46 virtual ~EventHandler() {} |
47 virtual void OnCreated(AudioInputController* controller) = 0; | 47 virtual void OnCreated(AudioInputController* controller) = 0; |
48 virtual void OnRecording(AudioInputController* controller) = 0; | 48 virtual void OnRecording(AudioInputController* controller) = 0; |
49 virtual void OnError(AudioInputController* controller, int error_code) = 0; | 49 virtual void OnError(AudioInputController* controller, int error_code) = 0; |
50 virtual void OnData(AudioInputController* controller, const uint8* data, | 50 virtual void OnData(AudioInputController* controller, const uint8* data, |
51 uint32 size) = 0; | 51 uint32 size) = 0; |
52 }; | 52 }; |
53 | 53 |
54 // A synchronous writer interface used by AudioInputController for | 54 // A synchronous writer interface used by AudioInputController for |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 SyncWriter* sync_writer_; | 164 SyncWriter* sync_writer_; |
165 | 165 |
166 static Factory* factory_; | 166 static Factory* factory_; |
167 | 167 |
168 DISALLOW_COPY_AND_ASSIGN(AudioInputController); | 168 DISALLOW_COPY_AND_ASSIGN(AudioInputController); |
169 }; | 169 }; |
170 | 170 |
171 } // namespace media | 171 } // namespace media |
172 | 172 |
173 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ | 173 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ |
OLD | NEW |