| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 virtual int32_t SetRecordingSampleRate( | 362 virtual int32_t SetRecordingSampleRate( |
| 363 const uint32_t samples_per_sec) OVERRIDE; | 363 const uint32_t samples_per_sec) OVERRIDE; |
| 364 virtual int32_t RecordingSampleRate(uint32_t* samples_per_sec) const OVERRIDE; | 364 virtual int32_t RecordingSampleRate(uint32_t* samples_per_sec) const OVERRIDE; |
| 365 virtual int32_t SetPlayoutSampleRate(const uint32_t samples_per_sec) OVERRIDE; | 365 virtual int32_t SetPlayoutSampleRate(const uint32_t samples_per_sec) OVERRIDE; |
| 366 virtual int32_t PlayoutSampleRate(uint32_t* samples_per_sec) const OVERRIDE; | 366 virtual int32_t PlayoutSampleRate(uint32_t* samples_per_sec) const OVERRIDE; |
| 367 | 367 |
| 368 virtual int32_t ResetAudioDevice() OVERRIDE; | 368 virtual int32_t ResetAudioDevice() OVERRIDE; |
| 369 virtual int32_t SetLoudspeakerStatus(bool enable) OVERRIDE; | 369 virtual int32_t SetLoudspeakerStatus(bool enable) OVERRIDE; |
| 370 virtual int32_t GetLoudspeakerStatus(bool* enabled) const OVERRIDE; | 370 virtual int32_t GetLoudspeakerStatus(bool* enabled) const OVERRIDE; |
| 371 | 371 |
| 372 // Sets the session id. | |
| 373 void SetSessionId(int session_id); | |
| 374 | |
| 375 // Sets the |renderer_|, returns false if |renderer_| has already existed. | 372 // Sets the |renderer_|, returns false if |renderer_| has already existed. |
| 376 bool SetRenderer(WebRtcAudioRenderer* renderer); | 373 bool SetRenderer(WebRtcAudioRenderer* renderer); |
| 377 | 374 |
| 378 const scoped_refptr<WebRtcAudioCapturer>& capturer() const { | 375 const scoped_refptr<WebRtcAudioCapturer>& capturer() const { |
| 379 return capturer_; | 376 return capturer_; |
| 380 } | 377 } |
| 381 | 378 |
| 382 // Accessors. | 379 // Accessors. |
| 383 int input_buffer_size() const { | 380 int input_buffer_size() const { |
| 384 return input_audio_parameters_.frames_per_buffer(); | 381 return input_audio_parameters_.frames_per_buffer(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 // Cached value of the current audio delay on the input/capture side. | 429 // Cached value of the current audio delay on the input/capture side. |
| 433 int input_delay_ms_; | 430 int input_delay_ms_; |
| 434 | 431 |
| 435 // Cached value of the current audio delay on the output/renderer side. | 432 // Cached value of the current audio delay on the output/renderer side. |
| 436 int output_delay_ms_; | 433 int output_delay_ms_; |
| 437 | 434 |
| 438 webrtc::AudioDeviceModule::ErrorCode last_error_; | 435 webrtc::AudioDeviceModule::ErrorCode last_error_; |
| 439 | 436 |
| 440 base::TimeTicks last_process_time_; | 437 base::TimeTicks last_process_time_; |
| 441 | 438 |
| 442 // Id of the media session to be started, it tells which device to be used | |
| 443 // on the input/capture side. | |
| 444 int session_id_; | |
| 445 | |
| 446 // Protects |recording_|, |output_delay_ms_|, |input_delay_ms_|, |renderer_|. | 439 // Protects |recording_|, |output_delay_ms_|, |input_delay_ms_|, |renderer_|. |
| 447 mutable base::Lock lock_; | 440 mutable base::Lock lock_; |
| 448 | 441 |
| 449 bool initialized_; | 442 bool initialized_; |
| 450 bool playing_; | 443 bool playing_; |
| 451 | 444 |
| 452 // Local copy of the current Automatic Gain Control state. | 445 // Local copy of the current Automatic Gain Control state. |
| 453 bool agc_is_enabled_; | 446 bool agc_is_enabled_; |
| 454 | 447 |
| 455 // Used for histograms of total recording and playout times. | 448 // Used for histograms of total recording and playout times. |
| 456 base::Time start_capture_time_; | 449 base::Time start_capture_time_; |
| 457 base::Time start_render_time_; | 450 base::Time start_render_time_; |
| 458 | 451 |
| 459 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); | 452 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); |
| 460 }; | 453 }; |
| 461 | 454 |
| 462 } // namespace content | 455 } // namespace content |
| 463 | 456 |
| 464 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 457 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
| OLD | NEW |