#include <vector>
#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"
void QueueVideoFrame(size_t window_id,
scoped_refptr<VideoFrameTexture> 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);
// 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<scoped_refptr<VideoFrameTexture> > pending_frames;
// |texture_target|.
void RenderTexture(uint32 texture_target, uint32 texture_id);
- // Timer to trigger the RenderContent() repeatly.
- scoped_ptr<base::RepeatingTimer<RenderingHelper> > render_timer_;
base::MessageLoop* message_loop_;
scoped_refptr<gfx::GLContext> gl_context_;
gfx::Size thumbnail_size_;
GLuint program_;
base::TimeDelta frame_duration_;
+ base::TimeTicks scheduled_render_time_;
+ base::CancelableClosure render_task_;
DISALLOW_COPY_AND_ASSIGN(RenderingHelper);
};