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_WEBMEDIAPLAYER_MS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/synchronization/lock.h" | 11 #include "base/synchronization/lock.h" |
12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
13 #include "cc/layers/video_frame_provider.h" | 13 #include "cc/layers/video_frame_provider.h" |
14 #include "media/filters/skcanvas_video_renderer.h" | 14 #include "media/filters/skcanvas_video_renderer.h" |
15 #include "skia/ext/platform_canvas.h" | 15 #include "skia/ext/platform_canvas.h" |
16 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 16 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 class WebFrame; | 20 class WebFrame; |
21 class WebMediaPlayerClient; | 21 class WebMediaPlayerClient; |
22 } | 22 } |
23 | 23 |
24 namespace media { | 24 namespace media { |
25 class MediaLog; | 25 class MediaLog; |
26 } | 26 } |
27 | 27 |
28 namespace webkit { | |
29 class WebLayerImpl; | |
30 } | |
31 | 28 |
32 namespace content { | 29 namespace content { |
33 class MediaStreamAudioRenderer; | 30 class MediaStreamAudioRenderer; |
34 class MediaStreamRendererFactory; | 31 class MediaStreamRendererFactory; |
35 class VideoFrameProvider; | 32 class VideoFrameProvider; |
| 33 class WebLayerImpl; |
36 class WebMediaPlayerDelegate; | 34 class WebMediaPlayerDelegate; |
37 | 35 |
38 // WebMediaPlayerMS delegates calls from WebCore::MediaPlayerPrivate to | 36 // WebMediaPlayerMS delegates calls from WebCore::MediaPlayerPrivate to |
39 // Chrome's media player when "src" is from media stream. | 37 // Chrome's media player when "src" is from media stream. |
40 // | 38 // |
41 // WebMediaPlayerMS works with multiple objects, the most important ones are: | 39 // WebMediaPlayerMS works with multiple objects, the most important ones are: |
42 // | 40 // |
43 // VideoFrameProvider | 41 // VideoFrameProvider |
44 // provides video frames for rendering. | 42 // provides video frames for rendering. |
45 // | 43 // |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 // modifications on the main thread, and all reads on the compositing thread. | 159 // modifications on the main thread, and all reads on the compositing thread. |
162 scoped_refptr<media::VideoFrame> current_frame_; | 160 scoped_refptr<media::VideoFrame> current_frame_; |
163 // |current_frame_used_| is updated on both main and compositing thread. | 161 // |current_frame_used_| is updated on both main and compositing thread. |
164 // It's used to track whether |current_frame_| was painted for detecting | 162 // It's used to track whether |current_frame_| was painted for detecting |
165 // when to increase |dropped_frame_count_|. | 163 // when to increase |dropped_frame_count_|. |
166 bool current_frame_used_; | 164 bool current_frame_used_; |
167 // |current_frame_lock_| protects |current_frame_used_| and |current_frame_|. | 165 // |current_frame_lock_| protects |current_frame_used_| and |current_frame_|. |
168 base::Lock current_frame_lock_; | 166 base::Lock current_frame_lock_; |
169 bool pending_repaint_; | 167 bool pending_repaint_; |
170 | 168 |
171 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; | 169 scoped_ptr<WebLayerImpl> video_weblayer_; |
172 | 170 |
173 // A pointer back to the compositor to inform it about state changes. This is | 171 // A pointer back to the compositor to inform it about state changes. This is |
174 // not NULL while the compositor is actively using this webmediaplayer. | 172 // not NULL while the compositor is actively using this webmediaplayer. |
175 cc::VideoFrameProvider::Client* video_frame_provider_client_; | 173 cc::VideoFrameProvider::Client* video_frame_provider_client_; |
176 | 174 |
177 bool received_first_frame_; | 175 bool received_first_frame_; |
178 bool sequence_started_; | 176 bool sequence_started_; |
179 base::TimeDelta start_time_; | 177 base::TimeDelta start_time_; |
180 base::TimeDelta current_time_; | 178 base::TimeDelta current_time_; |
181 unsigned total_frame_count_; | 179 unsigned total_frame_count_; |
182 unsigned dropped_frame_count_; | 180 unsigned dropped_frame_count_; |
183 media::SkCanvasVideoRenderer video_renderer_; | 181 media::SkCanvasVideoRenderer video_renderer_; |
184 | 182 |
185 scoped_refptr<MediaStreamAudioRenderer> audio_renderer_; | 183 scoped_refptr<MediaStreamAudioRenderer> audio_renderer_; |
186 | 184 |
187 scoped_refptr<media::MediaLog> media_log_; | 185 scoped_refptr<media::MediaLog> media_log_; |
188 | 186 |
189 scoped_ptr<MediaStreamRendererFactory> renderer_factory_; | 187 scoped_ptr<MediaStreamRendererFactory> renderer_factory_; |
190 | 188 |
191 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMS); | 189 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMS); |
192 }; | 190 }; |
193 | 191 |
194 } // namespace content | 192 } // namespace content |
195 | 193 |
196 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ | 194 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ |
OLD | NEW |