| 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_RENDERER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 17 #include "base/threading/non_thread_safe.h" | 17 #include "base/threading/non_thread_safe.h" |
| 18 #include "base/threading/thread_checker.h" | 18 #include "base/threading/thread_checker.h" |
| 19 #include "content/public/renderer/media_stream_audio_renderer.h" | 19 #include "content/public/renderer/media_stream_audio_renderer.h" |
| 20 #include "content/renderer/media/webrtc_audio_device_impl.h" | 20 #include "content/renderer/media/webrtc_audio_device_impl.h" |
| 21 #include "media/base/audio_decoder.h" | 21 #include "media/base/audio_decoder.h" |
| 22 #include "media/base/audio_pull_fifo.h" | 22 #include "media/base/audio_pull_fifo.h" |
| 23 #include "media/base/audio_renderer_sink.h" | 23 #include "media/base/audio_renderer_sink.h" |
| 24 #include "media/base/channel_layout.h" | 24 #include "media/base/channel_layout.h" |
| 25 #include "media/base/output_device.h" | 25 #include "media/base/output_device.h" |
| 26 #include "third_party/WebKit/public/platform/WebMediaStream.h" | 26 #include "third_party/WebKit/public/platform/WebMediaStream.h" |
| 27 | 27 |
| 28 namespace media { | 28 namespace media { |
| 29 class AudioOutputDevice; | 29 class RestartableAudioOutputDevice; |
| 30 } // namespace media | 30 } // namespace media |
| 31 | 31 |
| 32 namespace webrtc { | 32 namespace webrtc { |
| 33 class AudioSourceInterface; | 33 class AudioSourceInterface; |
| 34 } // namespace webrtc | 34 } // namespace webrtc |
| 35 | 35 |
| 36 namespace content { | 36 namespace content { |
| 37 | 37 |
| 38 class WebRtcAudioRendererSource; | 38 class WebRtcAudioRendererSource; |
| 39 | 39 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // |sink_|. | 207 // |sink_|. |
| 208 void PrepareSink(); | 208 void PrepareSink(); |
| 209 | 209 |
| 210 // The RenderFrame in which the audio is rendered into |sink_|. | 210 // The RenderFrame in which the audio is rendered into |sink_|. |
| 211 const int source_render_frame_id_; | 211 const int source_render_frame_id_; |
| 212 const int session_id_; | 212 const int session_id_; |
| 213 | 213 |
| 214 const scoped_refptr<base::SingleThreadTaskRunner> signaling_thread_; | 214 const scoped_refptr<base::SingleThreadTaskRunner> signaling_thread_; |
| 215 | 215 |
| 216 // The sink (destination) for rendered audio. | 216 // The sink (destination) for rendered audio. |
| 217 scoped_refptr<media::AudioOutputDevice> sink_; | 217 scoped_refptr<media::RestartableAudioOutputDevice> sink_; |
| 218 | 218 |
| 219 // The media stream that holds the audio tracks that this renderer renders. | 219 // The media stream that holds the audio tracks that this renderer renders. |
| 220 const blink::WebMediaStream media_stream_; | 220 const blink::WebMediaStream media_stream_; |
| 221 | 221 |
| 222 // Audio data source from the browser process. | 222 // Audio data source from the browser process. |
| 223 WebRtcAudioRendererSource* source_; | 223 WebRtcAudioRendererSource* source_; |
| 224 | 224 |
| 225 // Protects access to |state_|, |source_|, |audio_fifo_|, | 225 // Protects access to |state_|, |source_|, |audio_fifo_|, |
| 226 // |audio_delay_milliseconds_|, |fifo_delay_milliseconds_|, |current_time_|, | 226 // |audio_delay_milliseconds_|, |fifo_delay_milliseconds_|, |current_time_|, |
| 227 // |sink_params_| and |render_callback_count_| | 227 // |sink_params_| and |render_callback_count_| |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 // Used for triggering new UMA histogram. Counts number of render | 264 // Used for triggering new UMA histogram. Counts number of render |
| 265 // callbacks modulo |kNumCallbacksBetweenRenderTimeHistograms|. | 265 // callbacks modulo |kNumCallbacksBetweenRenderTimeHistograms|. |
| 266 int render_callback_count_; | 266 int render_callback_count_; |
| 267 | 267 |
| 268 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); | 268 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); |
| 269 }; | 269 }; |
| 270 | 270 |
| 271 } // namespace content | 271 } // namespace content |
| 272 | 272 |
| 273 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 273 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
| OLD | NEW |