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_LOCAL_AUDIO_RENDERER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/message_loop/message_loop_proxy.h" | 12 #include "base/message_loop/message_loop_proxy.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/public/renderer/media_stream_audio_sink.h" | 16 #include "content/public/renderer/media_stream_audio_sink.h" |
17 #include "content/renderer/media/media_stream_audio_renderer.h" | 17 #include "content/renderer/media/media_stream_audio_renderer.h" |
18 #include "content/renderer/media/webrtc_audio_device_impl.h" | 18 #include "content/renderer/media/webrtc_audio_device_impl.h" |
19 #include "content/renderer/media/webrtc_local_audio_track.h" | 19 #include "content/renderer/media/webrtc_local_audio_track.h" |
20 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" | 20 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h" |
21 | 21 |
22 namespace media { | 22 namespace media { |
23 class AudioBus; | 23 class AudioBus; |
24 class AudioFifo; | 24 class AudioBlockFifo; |
25 class AudioOutputDevice; | 25 class AudioOutputDevice; |
26 class AudioParameters; | 26 class AudioParameters; |
27 } | 27 } |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 | 30 |
31 class WebRtcAudioCapturer; | 31 class WebRtcAudioCapturer; |
32 | 32 |
33 // WebRtcLocalAudioRenderer is a MediaStreamAudioRenderer designed for rendering | 33 // WebRtcLocalAudioRenderer is a MediaStreamAudioRenderer designed for rendering |
34 // local audio media stream tracks, | 34 // local audio media stream tracks, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 const int session_id_; | 117 const int session_id_; |
118 | 118 |
119 // MessageLoop associated with the single thread that performs all control | 119 // MessageLoop associated with the single thread that performs all control |
120 // tasks. Set to the MessageLoop that invoked the ctor. | 120 // tasks. Set to the MessageLoop that invoked the ctor. |
121 const scoped_refptr<base::MessageLoopProxy> message_loop_; | 121 const scoped_refptr<base::MessageLoopProxy> message_loop_; |
122 | 122 |
123 // The sink (destination) for rendered audio. | 123 // The sink (destination) for rendered audio. |
124 scoped_refptr<media::AudioOutputDevice> sink_; | 124 scoped_refptr<media::AudioOutputDevice> sink_; |
125 | 125 |
126 // Contains copies of captured audio frames. | 126 // Contains copies of captured audio frames. |
127 scoped_ptr<media::AudioFifo> loopback_fifo_; | 127 scoped_ptr<media::AudioBlockFifo> loopback_fifo_; |
128 | 128 |
129 // Stores last time a render callback was received. The time difference | 129 // Stores last time a render callback was received. The time difference |
130 // between a new time stamp and this value can be used to derive the | 130 // between a new time stamp and this value can be used to derive the |
131 // total render time. | 131 // total render time. |
132 base::TimeTicks last_render_time_; | 132 base::TimeTicks last_render_time_; |
133 | 133 |
134 // Keeps track of total time audio has been rendered. | 134 // Keeps track of total time audio has been rendered. |
135 base::TimeDelta total_render_time_; | 135 base::TimeDelta total_render_time_; |
136 | 136 |
137 // The audio parameters of the capture source. | 137 // The audio parameters of the capture source. |
(...skipping 25 matching lines...) Expand all Loading... |
163 | 163 |
164 // Used to DCHECK that some methods are called on the capture audio thread. | 164 // Used to DCHECK that some methods are called on the capture audio thread. |
165 base::ThreadChecker capture_thread_checker_; | 165 base::ThreadChecker capture_thread_checker_; |
166 | 166 |
167 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioRenderer); | 167 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioRenderer); |
168 }; | 168 }; |
169 | 169 |
170 } // namespace content | 170 } // namespace content |
171 | 171 |
172 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ | 172 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_RENDERER_H_ |
OLD | NEW |