OLD | NEW |
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 <string> | 8 #include <string> |
9 #include "base/atomicops.h" | 9 #include "base/atomicops.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 namespace media { | 73 namespace media { |
74 | 74 |
75 class MEDIA_EXPORT AudioInputController | 75 class MEDIA_EXPORT AudioInputController |
76 : public base::RefCountedThreadSafe<AudioInputController>, | 76 : public base::RefCountedThreadSafe<AudioInputController>, |
77 public AudioInputStream::AudioInputCallback { | 77 public AudioInputStream::AudioInputCallback { |
78 public: | 78 public: |
79 // An event handler that receives events from the AudioInputController. The | 79 // An event handler that receives events from the AudioInputController. The |
80 // following methods are all called on the audio thread. | 80 // following methods are all called on the audio thread. |
81 class MEDIA_EXPORT EventHandler { | 81 class MEDIA_EXPORT EventHandler { |
82 public: | 82 public: |
83 virtual ~EventHandler() {} | |
84 virtual void OnCreated(AudioInputController* controller) = 0; | 83 virtual void OnCreated(AudioInputController* controller) = 0; |
85 virtual void OnRecording(AudioInputController* controller) = 0; | 84 virtual void OnRecording(AudioInputController* controller) = 0; |
86 virtual void OnError(AudioInputController* controller, int error_code) = 0; | 85 virtual void OnError(AudioInputController* controller, int error_code) = 0; |
87 virtual void OnData(AudioInputController* controller, const uint8* data, | 86 virtual void OnData(AudioInputController* controller, const uint8* data, |
88 uint32 size) = 0; | 87 uint32 size) = 0; |
| 88 |
| 89 protected: |
| 90 virtual ~EventHandler() {} |
89 }; | 91 }; |
90 | 92 |
91 // A synchronous writer interface used by AudioInputController for | 93 // A synchronous writer interface used by AudioInputController for |
92 // synchronous writing. | 94 // synchronous writing. |
93 class SyncWriter { | 95 class SyncWriter { |
94 public: | 96 public: |
95 virtual ~SyncWriter() {} | 97 virtual ~SyncWriter() {} |
96 | 98 |
97 // Notify the synchronous writer about the number of bytes in the | 99 // Notify the synchronous writer about the number of bytes in the |
98 // soundcard which has been recorded. | 100 // soundcard which has been recorded. |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 static Factory* factory_; | 254 static Factory* factory_; |
253 | 255 |
254 double max_volume_; | 256 double max_volume_; |
255 | 257 |
256 DISALLOW_COPY_AND_ASSIGN(AudioInputController); | 258 DISALLOW_COPY_AND_ASSIGN(AudioInputController); |
257 }; | 259 }; |
258 | 260 |
259 } // namespace media | 261 } // namespace media |
260 | 262 |
261 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ | 263 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ |
OLD | NEW |