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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 // A list of raw pointer of WebRtcPlayoutDataSource::Sink objects which want | 373 // A list of raw pointer of WebRtcPlayoutDataSource::Sink objects which want |
374 // to get the playout data, the sink need to call RemovePlayoutSink() | 374 // to get the playout data, the sink need to call RemovePlayoutSink() |
375 // before it goes away. | 375 // before it goes away. |
376 PlayoutDataSinkList playout_sinks_; | 376 PlayoutDataSinkList playout_sinks_; |
377 | 377 |
378 // Weak reference to the audio callback. | 378 // Weak reference to the audio callback. |
379 // The webrtc client defines |audio_transport_callback_| by calling | 379 // The webrtc client defines |audio_transport_callback_| by calling |
380 // RegisterAudioCallback(). | 380 // RegisterAudioCallback(). |
381 webrtc::AudioTransport* audio_transport_callback_; | 381 webrtc::AudioTransport* audio_transport_callback_; |
382 | 382 |
383 // Cached value of the current audio delay on the input/capture side. | |
384 int input_delay_ms_; | |
385 | |
386 // Cached value of the current audio delay on the output/renderer side. | 383 // Cached value of the current audio delay on the output/renderer side. |
387 int output_delay_ms_; | 384 int output_delay_ms_; |
388 | 385 |
389 // Protects |recording_|, |output_delay_ms_|, |input_delay_ms_|, |renderer_| | 386 // Protects |recording_|, |output_delay_ms_|, |input_delay_ms_|, |renderer_| |
390 // |recording_|, |microphone_volume_| and |playout_sinks_|. | 387 // |recording_|, |microphone_volume_| and |playout_sinks_|. |
391 mutable base::Lock lock_; | 388 mutable base::Lock lock_; |
392 | 389 |
393 // Used to protect the racing of calling OnData() since there can be more | 390 // Used to protect the racing of calling OnData() since there can be more |
394 // than one input stream calling OnData(). | 391 // than one input stream calling OnData(). |
395 mutable base::Lock capture_callback_lock_; | 392 mutable base::Lock capture_callback_lock_; |
396 | 393 |
397 bool initialized_; | 394 bool initialized_; |
398 bool playing_; | 395 bool playing_; |
399 bool recording_; | 396 bool recording_; |
400 | 397 |
401 // Stores latest microphone volume received in a CaptureData() callback. | |
402 // Range is [0, 255]. | |
403 uint32_t microphone_volume_; | |
404 | |
405 // Buffer used for temporary storage during render callback. | 398 // Buffer used for temporary storage during render callback. |
406 // It is only accessed by the audio render thread. | 399 // It is only accessed by the audio render thread. |
407 std::vector<int16_t> render_buffer_; | 400 std::vector<int16_t> render_buffer_; |
408 | 401 |
409 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); | 402 DISALLOW_COPY_AND_ASSIGN(WebRtcAudioDeviceImpl); |
410 }; | 403 }; |
411 | 404 |
412 } // namespace content | 405 } // namespace content |
413 | 406 |
414 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ | 407 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_DEVICE_IMPL_H_ |
OLD | NEW |