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 CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // Callback to deliver the captured interleaved data. | 205 // Callback to deliver the captured interleaved data. |
206 virtual void CaptureData(const int16* audio_data, | 206 virtual void CaptureData(const int16* audio_data, |
207 int number_of_channels, | 207 int number_of_channels, |
208 int number_of_frames, | 208 int number_of_frames, |
209 int audio_delay_milliseconds, | 209 int audio_delay_milliseconds, |
210 double volume) = 0; | 210 double volume) = 0; |
211 | 211 |
212 // Set the format for the capture audio parameters. | 212 // Set the format for the capture audio parameters. |
213 virtual void SetCaptureFormat(const media::AudioParameters& params) = 0; | 213 virtual void SetCaptureFormat(const media::AudioParameters& params) = 0; |
214 | 214 |
215 // Callback to notify the client that the capturer is being stopped. | |
216 virtual void OnCaptureDeviceStopped() = 0; | |
217 | |
218 protected: | 215 protected: |
219 virtual ~WebRtcAudioCapturerSink() {} | 216 virtual ~WebRtcAudioCapturerSink() {} |
220 }; | 217 }; |
221 | 218 |
222 class CONTENT_EXPORT WebRtcAudioDeviceImpl | 219 class CONTENT_EXPORT WebRtcAudioDeviceImpl |
223 : NON_EXPORTED_BASE(public webrtc::AudioDeviceModule), | 220 : NON_EXPORTED_BASE(public webrtc::AudioDeviceModule), |
224 NON_EXPORTED_BASE(public WebRtcAudioCapturerSink), | 221 NON_EXPORTED_BASE(public WebRtcAudioCapturerSink), |
225 NON_EXPORTED_BASE(public WebRtcAudioRendererSource) { | 222 NON_EXPORTED_BASE(public WebRtcAudioRendererSource) { |
226 public: | 223 public: |
227 // Methods called on main render thread. | 224 // Methods called on main render thread. |
(...skipping 13 matching lines...) Expand all Loading... |
241 virtual void SetRenderFormat(const media::AudioParameters& params) OVERRIDE; | 238 virtual void SetRenderFormat(const media::AudioParameters& params) OVERRIDE; |
242 virtual void RemoveRenderer(WebRtcAudioRenderer* renderer) OVERRIDE; | 239 virtual void RemoveRenderer(WebRtcAudioRenderer* renderer) OVERRIDE; |
243 | 240 |
244 // WebRtcAudioCapturerSink implementation. | 241 // WebRtcAudioCapturerSink implementation. |
245 virtual void CaptureData(const int16* audio_data, | 242 virtual void CaptureData(const int16* audio_data, |
246 int number_of_channels, | 243 int number_of_channels, |
247 int number_of_frames, | 244 int number_of_frames, |
248 int audio_delay_milliseconds, | 245 int audio_delay_milliseconds, |
249 double volume) OVERRIDE; | 246 double volume) OVERRIDE; |
250 virtual void SetCaptureFormat(const media::AudioParameters& params) OVERRIDE; | 247 virtual void SetCaptureFormat(const media::AudioParameters& params) OVERRIDE; |
251 virtual void OnCaptureDeviceStopped() OVERRIDE; | |
252 | 248 |
253 // webrtc::Module implementation. | 249 // webrtc::Module implementation. |
254 virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE; | 250 virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE; |
255 virtual int32_t TimeUntilNextProcess() OVERRIDE; | 251 virtual int32_t TimeUntilNextProcess() OVERRIDE; |
256 virtual int32_t Process() OVERRIDE; | 252 virtual int32_t Process() OVERRIDE; |
257 | 253 |
258 // webrtc::AudioDeviceModule implementation. | 254 // webrtc::AudioDeviceModule implementation. |
259 virtual int32_t ActiveAudioLayer(AudioLayer* audio_layer) const OVERRIDE; | 255 virtual int32_t ActiveAudioLayer(AudioLayer* audio_layer) const OVERRIDE; |
260 virtual ErrorCode LastError() const OVERRIDE; | 256 virtual ErrorCode LastError() const OVERRIDE; |
261 | 257 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 // Used for histograms of total recording and playout times. | 454 // Used for histograms of total recording and playout times. |
459 base::Time start_capture_time_; | 455 base::Time start_capture_time_; |
460 base::Time start_render_time_; | 456 base::Time start_render_time_; |
461 | 457 |
462 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); | 458 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); |
463 }; | 459 }; |
464 | 460 |
465 } // namespace content | 461 } // namespace content |
466 | 462 |
467 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 463 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
OLD | NEW |