| 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, | |
| 93 int audio_delay_milliseconds, | 92 int audio_delay_milliseconds, |
| 94 double volume) = 0; | 93 double volume) = 0; |
| 95 virtual void OnCaptureError() = 0; | 94 virtual void OnCaptureError() = 0; |
| 96 protected: | 95 protected: |
| 97 virtual ~CaptureCallback(); | 96 virtual ~CaptureCallback(); |
| 98 }; | 97 }; |
| 99 | 98 |
| 100 class MEDIA_EXPORT CaptureEventHandler { | 99 class MEDIA_EXPORT CaptureEventHandler { |
| 101 public: | 100 public: |
| 102 // Notification to the client that the device with the specific |device_id| | 101 // Notification to the client that the device with the specific |device_id| |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 base::Lock audio_thread_lock_; | 201 base::Lock audio_thread_lock_; |
| 203 AudioDeviceThread audio_thread_; | 202 AudioDeviceThread audio_thread_; |
| 204 scoped_ptr<AudioInputDevice::AudioThreadCallback> audio_callback_; | 203 scoped_ptr<AudioInputDevice::AudioThreadCallback> audio_callback_; |
| 205 | 204 |
| 206 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); | 205 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); |
| 207 }; | 206 }; |
| 208 | 207 |
| 209 } // namespace media | 208 } // namespace media |
| 210 | 209 |
| 211 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ | 210 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ |
| OLD | NEW |