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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // webrtc::RefCountedModule implementation. | 215 // webrtc::RefCountedModule implementation. |
216 // The creator must call AddRef() after construction and use Release() | 216 // The creator must call AddRef() after construction and use Release() |
217 // to release the reference and delete this object. | 217 // to release the reference and delete this object. |
218 virtual int32_t AddRef() OVERRIDE; | 218 virtual int32_t AddRef() OVERRIDE; |
219 virtual int32_t Release() OVERRIDE; | 219 virtual int32_t Release() OVERRIDE; |
220 | 220 |
221 // We need this one to support runnable method tasks. | 221 // We need this one to support runnable method tasks. |
222 static bool ImplementsThreadSafeReferenceCounting() { return true; } | 222 static bool ImplementsThreadSafeReferenceCounting() { return true; } |
223 | 223 |
224 // AudioDevice::RenderCallback implementation. | 224 // AudioDevice::RenderCallback implementation. |
225 virtual size_t Render(const std::vector<float*>& audio_data, | 225 virtual int Render(const std::vector<float*>& audio_data, |
226 size_t number_of_frames, | 226 int number_of_frames, |
227 size_t audio_delay_milliseconds) OVERRIDE; | 227 int audio_delay_milliseconds) OVERRIDE; |
228 virtual void OnRenderError() OVERRIDE; | 228 virtual void OnRenderError() OVERRIDE; |
229 | 229 |
230 // AudioInputDevice::CaptureCallback implementation. | 230 // AudioInputDevice::CaptureCallback implementation. |
231 virtual void Capture(const std::vector<float*>& audio_data, | 231 virtual void Capture(const std::vector<float*>& audio_data, |
232 size_t number_of_frames, | 232 int number_of_frames, |
233 size_t audio_delay_milliseconds, | 233 int audio_delay_milliseconds, |
234 double volume) OVERRIDE; | 234 double volume) OVERRIDE; |
235 virtual void OnCaptureError() OVERRIDE; | 235 virtual void OnCaptureError() OVERRIDE; |
236 | 236 |
237 // AudioInputDevice::CaptureEventHandler implementation. | 237 // AudioInputDevice::CaptureEventHandler implementation. |
238 virtual void OnDeviceStarted(const std::string& device_id) OVERRIDE; | 238 virtual void OnDeviceStarted(const std::string& device_id) OVERRIDE; |
239 virtual void OnDeviceStopped() OVERRIDE; | 239 virtual void OnDeviceStopped() OVERRIDE; |
240 | 240 |
241 // webrtc::Module implementation. | 241 // webrtc::Module implementation. |
242 virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE; | 242 virtual int32_t ChangeUniqueId(const int32_t id) OVERRIDE; |
243 virtual int32_t TimeUntilNextProcess() OVERRIDE; | 243 virtual int32_t TimeUntilNextProcess() OVERRIDE; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 virtual int32_t PlayoutSampleRate(uint32_t* samples_per_sec) const OVERRIDE; | 358 virtual int32_t PlayoutSampleRate(uint32_t* samples_per_sec) const OVERRIDE; |
359 | 359 |
360 virtual int32_t ResetAudioDevice() OVERRIDE; | 360 virtual int32_t ResetAudioDevice() OVERRIDE; |
361 virtual int32_t SetLoudspeakerStatus(bool enable) OVERRIDE; | 361 virtual int32_t SetLoudspeakerStatus(bool enable) OVERRIDE; |
362 virtual int32_t GetLoudspeakerStatus(bool* enabled) const OVERRIDE; | 362 virtual int32_t GetLoudspeakerStatus(bool* enabled) const OVERRIDE; |
363 | 363 |
364 // Sets the session id. | 364 // Sets the session id. |
365 void SetSessionId(int session_id); | 365 void SetSessionId(int session_id); |
366 | 366 |
367 // Accessors. | 367 // Accessors. |
368 size_t input_buffer_size() const { | 368 int input_buffer_size() const { |
369 return input_audio_parameters_.frames_per_buffer(); | 369 return input_audio_parameters_.frames_per_buffer(); |
370 } | 370 } |
371 size_t output_buffer_size() const { | 371 int output_buffer_size() const { |
372 return output_audio_parameters_.frames_per_buffer(); | 372 return output_audio_parameters_.frames_per_buffer(); |
373 } | 373 } |
374 int input_channels() const { | 374 int input_channels() const { |
375 return input_audio_parameters_.channels(); | 375 return input_audio_parameters_.channels(); |
376 } | 376 } |
377 int output_channels() const { | 377 int output_channels() const { |
378 return output_audio_parameters_.channels(); | 378 return output_audio_parameters_.channels(); |
379 } | 379 } |
380 int input_sample_rate() const { | 380 int input_sample_rate() const { |
381 return input_audio_parameters_.sample_rate(); | 381 return input_audio_parameters_.sample_rate(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 bool playing_; | 447 bool playing_; |
448 bool recording_; | 448 bool recording_; |
449 | 449 |
450 // Local copy of the current Automatic Gain Control state. | 450 // Local copy of the current Automatic Gain Control state. |
451 bool agc_is_enabled_; | 451 bool agc_is_enabled_; |
452 | 452 |
453 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); | 453 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); |
454 }; | 454 }; |
455 | 455 |
456 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 456 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
OLD | NEW |