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