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 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // audio processing. | 216 // audio processing. |
217 // The return value is the new microphone volume, in the range of |0, 255]. | 217 // The return value is the new microphone volume, in the range of |0, 255]. |
218 // When the volume does not need to be updated, it returns 0. | 218 // When the volume does not need to be updated, it returns 0. |
219 virtual int CaptureData(const std::vector<int>& channels, | 219 virtual int CaptureData(const std::vector<int>& channels, |
220 const int16* audio_data, | 220 const int16* audio_data, |
221 int sample_rate, | 221 int sample_rate, |
222 int number_of_channels, | 222 int number_of_channels, |
223 int number_of_frames, | 223 int number_of_frames, |
224 int audio_delay_milliseconds, | 224 int audio_delay_milliseconds, |
225 int current_volume, | 225 int current_volume, |
226 bool need_audio_processing, | 226 bool need_audio_processing) = 0; |
227 bool key_pressed) = 0; | |
228 | 227 |
229 // Set the format for the capture audio parameters. | 228 // Set the format for the capture audio parameters. |
230 virtual void SetCaptureFormat(const media::AudioParameters& params) = 0; | 229 virtual void SetCaptureFormat(const media::AudioParameters& params) = 0; |
231 | 230 |
232 protected: | 231 protected: |
233 virtual ~WebRtcAudioCapturerSink() {} | 232 virtual ~WebRtcAudioCapturerSink() {} |
234 }; | 233 }; |
235 | 234 |
236 // Note that this class inherits from webrtc::AudioDeviceModule but due to | 235 // Note that this class inherits from webrtc::AudioDeviceModule but due to |
237 // the high number of non-implemented methods, we move the cruft over to the | 236 // the high number of non-implemented methods, we move the cruft over to the |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 // WebRtcAudioCapturerSink implementation. | 332 // WebRtcAudioCapturerSink implementation. |
334 | 333 |
335 // Called on the AudioInputDevice worker thread. | 334 // Called on the AudioInputDevice worker thread. |
336 virtual int CaptureData(const std::vector<int>& channels, | 335 virtual int CaptureData(const std::vector<int>& channels, |
337 const int16* audio_data, | 336 const int16* audio_data, |
338 int sample_rate, | 337 int sample_rate, |
339 int number_of_channels, | 338 int number_of_channels, |
340 int number_of_frames, | 339 int number_of_frames, |
341 int audio_delay_milliseconds, | 340 int audio_delay_milliseconds, |
342 int current_volume, | 341 int current_volume, |
343 bool need_audio_processing, | 342 bool need_audio_processing) OVERRIDE; |
344 bool key_pressed) OVERRIDE; | |
345 | 343 |
346 // Called on the main render thread. | 344 // Called on the main render thread. |
347 virtual void SetCaptureFormat(const media::AudioParameters& params) OVERRIDE; | 345 virtual void SetCaptureFormat(const media::AudioParameters& params) OVERRIDE; |
348 | 346 |
349 // WebRtcAudioRendererSource implementation. | 347 // WebRtcAudioRendererSource implementation. |
350 | 348 |
351 // Called on the AudioInputDevice worker thread. | 349 // Called on the AudioInputDevice worker thread. |
352 virtual void RenderData(uint8* audio_data, | 350 virtual void RenderData(uint8* audio_data, |
353 int number_of_channels, | 351 int number_of_channels, |
354 int number_of_frames, | 352 int number_of_frames, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 // Stores latest microphone volume received in a CaptureData() callback. | 400 // Stores latest microphone volume received in a CaptureData() callback. |
403 // Range is [0, 255]. | 401 // Range is [0, 255]. |
404 uint32_t microphone_volume_; | 402 uint32_t microphone_volume_; |
405 | 403 |
406 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); | 404 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); |
407 }; | 405 }; |
408 | 406 |
409 } // namespace content | 407 } // namespace content |
410 | 408 |
411 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 409 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
OLD | NEW |