OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 virtual ~WebRtcAudioRendererSource() {} | 201 virtual ~WebRtcAudioRendererSource() {} |
202 }; | 202 }; |
203 | 203 |
204 class WebRtcAudioCapturerSink { | 204 class WebRtcAudioCapturerSink { |
205 public: | 205 public: |
206 // Callback to deliver the captured interleaved data. | 206 // Callback to deliver the captured interleaved data. |
207 virtual void CaptureData(const int16* audio_data, | 207 virtual void CaptureData(const int16* audio_data, |
208 int number_of_channels, | 208 int number_of_channels, |
209 int number_of_frames, | 209 int number_of_frames, |
210 int audio_delay_milliseconds, | 210 int audio_delay_milliseconds, |
211 double volume) = 0; | 211 double volume, |
| 212 bool key_pressed) = 0; |
212 | 213 |
213 // Set the format for the capture audio parameters. | 214 // Set the format for the capture audio parameters. |
214 virtual void SetCaptureFormat(const media::AudioParameters& params) = 0; | 215 virtual void SetCaptureFormat(const media::AudioParameters& params) = 0; |
215 | 216 |
216 protected: | 217 protected: |
217 virtual ~WebRtcAudioCapturerSink() {} | 218 virtual ~WebRtcAudioCapturerSink() {} |
218 }; | 219 }; |
219 | 220 |
220 // Note that this class inherits from webrtc::AudioDeviceModule but due to | 221 // Note that this class inherits from webrtc::AudioDeviceModule but due to |
221 // the high number of non-implemented methods, we move the cruft over to the | 222 // the high number of non-implemented methods, we move the cruft over to the |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // Make destructor private to ensure that we can only be deleted by Release(). | 313 // Make destructor private to ensure that we can only be deleted by Release(). |
313 virtual ~WebRtcAudioDeviceImpl(); | 314 virtual ~WebRtcAudioDeviceImpl(); |
314 | 315 |
315 // WebRtcAudioCapturerSink implementation. | 316 // WebRtcAudioCapturerSink implementation. |
316 | 317 |
317 // Called on the AudioInputDevice worker thread. | 318 // Called on the AudioInputDevice worker thread. |
318 virtual void CaptureData(const int16* audio_data, | 319 virtual void CaptureData(const int16* audio_data, |
319 int number_of_channels, | 320 int number_of_channels, |
320 int number_of_frames, | 321 int number_of_frames, |
321 int audio_delay_milliseconds, | 322 int audio_delay_milliseconds, |
322 double volume) OVERRIDE; | 323 double volume, |
| 324 bool key_pressed) OVERRIDE; |
323 | 325 |
324 // Called on the main render thread. | 326 // Called on the main render thread. |
325 virtual void SetCaptureFormat(const media::AudioParameters& params) OVERRIDE; | 327 virtual void SetCaptureFormat(const media::AudioParameters& params) OVERRIDE; |
326 | 328 |
327 // WebRtcAudioRendererSource implementation. | 329 // WebRtcAudioRendererSource implementation. |
328 | 330 |
329 // Called on the AudioInputDevice worker thread. | 331 // Called on the AudioInputDevice worker thread. |
330 virtual void RenderData(uint8* audio_data, | 332 virtual void RenderData(uint8* audio_data, |
331 int number_of_channels, | 333 int number_of_channels, |
332 int number_of_frames, | 334 int number_of_frames, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // Stores latest microphone volume received in a CaptureData() callback. | 382 // Stores latest microphone volume received in a CaptureData() callback. |
381 // Range is [0, 255]. | 383 // Range is [0, 255]. |
382 uint32_t microphone_volume_; | 384 uint32_t microphone_volume_; |
383 | 385 |
384 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); | 386 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); |
385 }; | 387 }; |
386 | 388 |
387 } // namespace content | 389 } // namespace content |
388 | 390 |
389 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 391 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
OLD | NEW |