OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_COMPOSITOR_H | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H |
6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H | 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 30 matching lines...) Expand all Loading... | |
41 // This class is designed to handle the work load on compositor thread for | 41 // This class is designed to handle the work load on compositor thread for |
42 // WebMediaPlayerMS. It will be instantiated on the main thread, but destroyed | 42 // WebMediaPlayerMS. It will be instantiated on the main thread, but destroyed |
43 // on the compositor thread. | 43 // on the compositor thread. |
44 // | 44 // |
45 // WebMediaPlayerMSCompositor utilizes VideoRendererAlgorithm to store the | 45 // WebMediaPlayerMSCompositor utilizes VideoRendererAlgorithm to store the |
46 // incoming frames and select the best frame for rendering to maximize the | 46 // incoming frames and select the best frame for rendering to maximize the |
47 // smoothness, if REFERENCE_TIMEs are populated for incoming VideoFrames. | 47 // smoothness, if REFERENCE_TIMEs are populated for incoming VideoFrames. |
48 // Otherwise, WebMediaPlayerMSCompositor will simply store the most recent | 48 // Otherwise, WebMediaPlayerMSCompositor will simply store the most recent |
49 // frame, and submit it whenever asked by the compositor. | 49 // frame, and submit it whenever asked by the compositor. |
50 class CONTENT_EXPORT WebMediaPlayerMSCompositor | 50 class CONTENT_EXPORT WebMediaPlayerMSCompositor |
51 : public NON_EXPORTED_BASE(cc::VideoFrameProvider) { | 51 : public NON_EXPORTED_BASE(cc::VideoFrameProvider), |
52 public NON_EXPORTED_BASE( | |
53 base::SupportsWeakPtr<WebMediaPlayerMSCompositor>) { | |
DaleCurtis
2016/01/07 21:05:46
Instead of using SupportsWeakPtr, can you just add
qiangchen
2016/01/08 17:10:12
Done.
| |
52 public: | 54 public: |
53 // This |url| represents the media stream we are rendering. |url| is used to | 55 // This |url| represents the media stream we are rendering. |url| is used to |
54 // find out what web stream this WebMediaPlayerMSCompositor is playing, and | 56 // find out what web stream this WebMediaPlayerMSCompositor is playing, and |
55 // together with flag "--disable-rtc-smoothness-algorithm" determine whether | 57 // together with flag "--disable-rtc-smoothness-algorithm" determine whether |
56 // we enable algorithm or not. | 58 // we enable algorithm or not. |
57 WebMediaPlayerMSCompositor( | 59 WebMediaPlayerMSCompositor( |
58 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, | 60 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, |
59 const blink::WebURL& url, | 61 const blink::WebURL& url, |
60 const base::WeakPtr<WebMediaPlayerMS>& player); | 62 const base::WeakPtr<WebMediaPlayerMS>& player); |
61 | 63 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
145 | 147 |
146 std::map<base::TimeDelta, base::TimeTicks> timestamps_to_clock_times_; | 148 std::map<base::TimeDelta, base::TimeTicks> timestamps_to_clock_times_; |
147 | 149 |
148 // |current_frame_lock_| protects |current_frame_used_by_compositor_|, | 150 // |current_frame_lock_| protects |current_frame_used_by_compositor_|, |
149 // |current_frame_|, and |rendering_frame_buffer_|. | 151 // |current_frame_|, and |rendering_frame_buffer_|. |
150 base::Lock current_frame_lock_; | 152 base::Lock current_frame_lock_; |
151 }; | 153 }; |
152 } | 154 } |
153 | 155 |
154 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H | 156 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H |
OLD | NEW |