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

Unified Diff: media/filters/video_renderer_base.cc

Issue 9155003: Fix media timeline so that thumb never exceeds buffered data (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase ToT, again Created 8 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/video_renderer_base.h ('k') | media/filters/video_renderer_base_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_base.cc
diff --git a/media/filters/video_renderer_base.cc b/media/filters/video_renderer_base.cc
index 72c8972af8046cf768c07894cf2b673c9ef29b29..aa5dff16e639501cd25531548d4230834ecf5bd4 100644
--- a/media/filters/video_renderer_base.cc
+++ b/media/filters/video_renderer_base.cc
@@ -64,6 +64,8 @@ void VideoRendererBase::Stop(const base::Closure& callback) {
base::AutoLock auto_lock(lock_);
state_ = kStopped;
+ statistics_callback_.Reset();
+ video_time_cb_.Reset();
if (!pending_paint_ && !pending_paint_with_last_available_)
DoStopOrError_Locked();
@@ -101,15 +103,18 @@ void VideoRendererBase::Seek(base::TimeDelta time, const FilterStatusCB& cb) {
void VideoRendererBase::Initialize(VideoDecoder* decoder,
const PipelineStatusCB& callback,
- const StatisticsCallback& stats_callback) {
+ const StatisticsCallback& stats_callback,
+ const VideoTimeCB& video_time_cb) {
base::AutoLock auto_lock(lock_);
DCHECK(decoder);
DCHECK(!callback.is_null());
DCHECK(!stats_callback.is_null());
+ DCHECK(!video_time_cb.is_null());
DCHECK_EQ(kUninitialized, state_);
decoder_ = decoder;
statistics_callback_ = stats_callback;
+ video_time_cb_ = video_time_cb;
// Notify the pipeline of the video dimensions.
host()->SetNaturalVideoSize(decoder_->natural_size());
@@ -383,6 +388,8 @@ void VideoRendererBase::FrameReady(scoped_refptr<VideoFrame> frame) {
// This one's a keeper! Place it in the ready queue.
ready_frames_.push_back(frame);
DCHECK_LE(NumFrames_Locked(), limits::kMaxVideoFrames);
+ if (!frame->IsEndOfStream())
+ video_time_cb_.Run(frame->GetTimestamp() + frame->GetDuration());
frame_available_.Signal();
PipelineStatistics statistics;
« no previous file with comments | « media/filters/video_renderer_base.h ('k') | media/filters/video_renderer_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698