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 <memory> | |
12 #include <string> | 11 #include <string> |
13 #include <vector> | 12 #include <vector> |
14 | 13 |
15 #include "base/macros.h" | 14 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
17 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
18 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
19 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
20 #include "base/threading/thread_checker.h" | 19 #include "base/threading/thread_checker.h" |
21 #include "content/public/renderer/media_stream_audio_renderer.h" | 20 #include "content/public/renderer/media_stream_audio_renderer.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 PlayingState* state); | 186 PlayingState* state); |
188 | 187 |
189 // Called whenever the Play/Pause state changes of any of the renderers | 188 // Called whenever the Play/Pause state changes of any of the renderers |
190 // or if the volume of any of them is changed. | 189 // or if the volume of any of them is changed. |
191 // Here we update the shared Play state and apply volume scaling to all audio | 190 // Here we update the shared Play state and apply volume scaling to all audio |
192 // sources associated with the |media_stream| based on the collective volume | 191 // sources associated with the |media_stream| based on the collective volume |
193 // of playing renderers. | 192 // of playing renderers. |
194 void OnPlayStateChanged(const blink::WebMediaStream& media_stream, | 193 void OnPlayStateChanged(const blink::WebMediaStream& media_stream, |
195 PlayingState* state); | 194 PlayingState* state); |
196 | 195 |
197 // Called when |state| is about to be destructed. | |
198 void OnPlayStateRemoved(PlayingState* state); | |
199 | |
200 // Updates |sink_params_| and |audio_fifo_| based on |sink_|, and initializes | 196 // Updates |sink_params_| and |audio_fifo_| based on |sink_|, and initializes |
201 // |sink_|. | 197 // |sink_|. |
202 void PrepareSink(); | 198 void PrepareSink(); |
203 | 199 |
204 // The RenderFrame in which the audio is rendered into |sink_|. | 200 // The RenderFrame in which the audio is rendered into |sink_|. |
205 const int source_render_frame_id_; | 201 const int source_render_frame_id_; |
206 const int session_id_; | 202 const int session_id_; |
207 | 203 |
208 const scoped_refptr<base::SingleThreadTaskRunner> signaling_thread_; | 204 const scoped_refptr<base::SingleThreadTaskRunner> signaling_thread_; |
209 | 205 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 // Stores the maximum time spent waiting for render data from the source. Used | 254 // Stores the maximum time spent waiting for render data from the source. Used |
259 // for logging UMA data. Logged and reset when Stop() is called. | 255 // for logging UMA data. Logged and reset when Stop() is called. |
260 base::TimeDelta max_render_time_; | 256 base::TimeDelta max_render_time_; |
261 | 257 |
262 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); | 258 DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioRenderer); |
263 }; | 259 }; |
264 | 260 |
265 } // namespace content | 261 } // namespace content |
266 | 262 |
267 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ | 263 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_AUDIO_RENDERER_H_ |
OLD | NEW |