X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Fcommon%2Fgpu%2Fmedia%2Frendering_helper.h;h=26e8fb20cf0f9e7aee34e5c70a91ae709ae79b37;hb=3545e9f2671f595d2a2f3ee75ca0393b01e35ef6;hp=6b0013f5b93b1dcad4eb313bd648b857cf867860;hpb=7d210d4c7e9ba36e635eabc5b5780495f8a63292;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/common/gpu/media/rendering_helper.h b/src/content/common/gpu/media/rendering_helper.h index 6b0013f..26e8fb2 100644 --- a/src/content/common/gpu/media/rendering_helper.h +++ b/src/content/common/gpu/media/rendering_helper.h @@ -10,6 +10,7 @@ #include #include "base/basictypes.h" +#include "base/cancelable_callback.h" #include "base/time/time.h" #include "base/timer/timer.h" #include "ui/gfx/geometry/rect.h" @@ -100,8 +101,9 @@ class RenderingHelper { void QueueVideoFrame(size_t window_id, scoped_refptr video_frame); - // Drops all the pending video frames of the specified window. - void DropPendingFrames(size_t window_id); + // Flushes the pending frames. Notify the rendering_helper there won't be + // more video frames. + void Flush(size_t window_id); // Delete |texture_id|. void DeleteTexture(uint32 texture_id); @@ -130,6 +132,12 @@ class RenderingHelper { // timer-driven playback. bool last_frame_rendered; + // True if there won't be any new video frames comming. + bool is_flushing; + + // The number of frames need to be dropped to catch up the rendering. + int frames_to_drop; + // The video frames pending for rendering. std::queue > pending_frames; @@ -147,8 +155,6 @@ class RenderingHelper { // |texture_target|. void RenderTexture(uint32 texture_target, uint32 texture_id); - // Timer to trigger the RenderContent() repeatly. - scoped_ptr > render_timer_; base::MessageLoop* message_loop_; scoped_refptr gl_context_; @@ -168,6 +174,8 @@ class RenderingHelper { gfx::Size thumbnail_size_; GLuint program_; base::TimeDelta frame_duration_; + base::TimeTicks scheduled_render_time_; + base::CancelableClosure render_task_; DISALLOW_COPY_AND_ASSIGN(RenderingHelper); };