Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(409)

Side by Side Diff: content/renderer/media/webmediaplayer_ms_compositor.h

Issue 2472273002: Move passing of WebRTC rendering frames from main thread to compositor thread (Closed)
Patch Set: Make |render_frame_suspended_| android specific. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698