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