Chromium Code Reviews| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 // Difference between GetCurrentFrame(): GetCurrentFrame() is designed for | 81 // Difference between GetCurrentFrame(): GetCurrentFrame() is designed for |
| 82 // chrome compositor to pull frame from WebMediaPlayerMSCompositor, and thus | 82 // chrome compositor to pull frame from WebMediaPlayerMSCompositor, and thus |
| 83 // calling GetCurrentFrame() will affect statistics like |dropped_frames_| | 83 // calling GetCurrentFrame() will affect statistics like |dropped_frames_| |
| 84 // etc. Calling this function has no side effect. | 84 // etc. Calling this function has no side effect. |
| 85 scoped_refptr<media::VideoFrame> GetCurrentFrameWithoutUpdatingStatistics(); | 85 scoped_refptr<media::VideoFrame> GetCurrentFrameWithoutUpdatingStatistics(); |
| 86 | 86 |
| 87 void StartRendering(); | 87 void StartRendering(); |
| 88 void StopRendering(); | 88 void StopRendering(); |
| 89 void ReplaceCurrentFrameWithACopy(); | 89 void ReplaceCurrentFrameWithACopy(); |
| 90 | 90 |
| 91 base::WeakPtr<WebMediaPlayerMSCompositor> GetWeakPtr(); | |
|
perkj_chrome
2016/11/09 15:27:13
So these weakptr's may only be dereferences on the
emircan
2016/11/11 22:27:19
Yes, they would be used to post tasks on composito
| |
| 92 | |
| 91 private: | 93 private: |
| 92 friend class WebMediaPlayerMSTest; | 94 friend class WebMediaPlayerMSTest; |
| 93 | 95 |
| 94 bool MapTimestampsToRenderTimeTicks( | 96 bool MapTimestampsToRenderTimeTicks( |
| 95 const std::vector<base::TimeDelta>& timestamps, | 97 const std::vector<base::TimeDelta>& timestamps, |
| 96 std::vector<base::TimeTicks>* wall_clock_times); | 98 std::vector<base::TimeTicks>* wall_clock_times); |
| 97 | 99 |
| 98 void SetCurrentFrame(const scoped_refptr<media::VideoFrame>& frame); | 100 void SetCurrentFrame(const scoped_refptr<media::VideoFrame>& frame); |
| 99 | 101 |
| 100 // For algorithm enabled case only: given the render interval, update | 102 // For algorithm enabled case only: given the render interval, update |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 | 151 |
| 150 bool stopped_; | 152 bool stopped_; |
| 151 | 153 |
| 152 std::map<base::TimeDelta, base::TimeTicks> timestamps_to_clock_times_; | 154 std::map<base::TimeDelta, base::TimeTicks> timestamps_to_clock_times_; |
| 153 | 155 |
| 154 // |current_frame_lock_| protects |current_frame_used_by_compositor_|, | 156 // |current_frame_lock_| protects |current_frame_used_by_compositor_|, |
| 155 // |current_frame_|, and |rendering_frame_buffer_|. | 157 // |current_frame_|, and |rendering_frame_buffer_|. |
| 156 base::Lock current_frame_lock_; | 158 base::Lock current_frame_lock_; |
| 157 | 159 |
| 158 // Make sure the weak pointer factory member is the last member of the class. | 160 // Make sure the weak pointer factory member is the last member of the class. |
| 159 base::WeakPtrFactory<WebMediaPlayerMSCompositor> weak_ptr_factory_; | 161 base::WeakPtrFactory<WebMediaPlayerMSCompositor> weak_factory_for_compositor_; |
| 160 | 162 |
| 161 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMSCompositor); | 163 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMSCompositor); |
| 162 }; | 164 }; |
| 163 } // namespace content | 165 } // namespace content |
| 164 | 166 |
| 165 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H_ | 167 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_COMPOSITOR_H_ |
| OLD | NEW |