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 // Low-latency audio capturing class utilizing audio input stream provided | 5 // Low-latency audio capturing class utilizing audio input stream provided |
6 // by a server (browser) process by use of an IPC interface. | 6 // by a server (browser) process by use of an IPC interface. |
7 // | 7 // |
8 // Relationship of classes: | 8 // Relationship of classes: |
9 // | 9 // |
10 // AudioInputController AudioInputDevice | 10 // AudioInputController AudioInputDevice |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // TODO(henrika): Add support for event handling (e.g. OnStateChanged, | 81 // TODO(henrika): Add support for event handling (e.g. OnStateChanged, |
82 // OnCaptureStopped etc.) and ensure that we can deliver these notifications | 82 // OnCaptureStopped etc.) and ensure that we can deliver these notifications |
83 // to any clients using this class. | 83 // to any clients using this class. |
84 class MEDIA_EXPORT AudioInputDevice | 84 class MEDIA_EXPORT AudioInputDevice |
85 : NON_EXPORTED_BASE(public AudioInputIPCDelegate), | 85 : NON_EXPORTED_BASE(public AudioInputIPCDelegate), |
86 NON_EXPORTED_BASE(public ScopedLoopObserver), | 86 NON_EXPORTED_BASE(public ScopedLoopObserver), |
87 public base::RefCountedThreadSafe<AudioInputDevice> { | 87 public base::RefCountedThreadSafe<AudioInputDevice> { |
88 public: | 88 public: |
89 class MEDIA_EXPORT CaptureCallback { | 89 class MEDIA_EXPORT CaptureCallback { |
90 public: | 90 public: |
91 virtual void Capture(const std::vector<float*>& audio_data, | 91 virtual void Capture(AudioBus* audio_bus, |
92 int number_of_frames, | 92 int number_of_frames, |
93 int audio_delay_milliseconds, | 93 int audio_delay_milliseconds, |
94 double volume) = 0; | 94 double volume) = 0; |
95 virtual void OnCaptureError() = 0; | 95 virtual void OnCaptureError() = 0; |
96 protected: | 96 protected: |
97 virtual ~CaptureCallback(); | 97 virtual ~CaptureCallback(); |
98 }; | 98 }; |
99 | 99 |
100 class MEDIA_EXPORT CaptureEventHandler { | 100 class MEDIA_EXPORT CaptureEventHandler { |
101 public: | 101 public: |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 base::Lock audio_thread_lock_; | 202 base::Lock audio_thread_lock_; |
203 AudioDeviceThread audio_thread_; | 203 AudioDeviceThread audio_thread_; |
204 scoped_ptr<AudioInputDevice::AudioThreadCallback> audio_callback_; | 204 scoped_ptr<AudioInputDevice::AudioThreadCallback> audio_callback_; |
205 | 205 |
206 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); | 206 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); |
207 }; | 207 }; |
208 | 208 |
209 } // namespace media | 209 } // namespace media |
210 | 210 |
211 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ | 211 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ |
OLD | NEW |