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

Side by Side Diff: media/filters/video_renderer_base.cc

Issue 9718013: Merge FilterStatusCB into PipelineStatusCB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep ResetAndRunCB in filters.h. Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/threading/platform_thread.h" 7 #include "base/threading/platform_thread.h"
8 #include "media/base/buffers.h" 8 #include "media/base/buffers.h"
9 #include "media/base/filter_host.h" 9 #include "media/base/filter_host.h"
10 #include "media/base/limits.h" 10 #include "media/base/limits.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 base::PlatformThread::Join(thread_to_join); 82 base::PlatformThread::Join(thread_to_join);
83 83
84 callback.Run(); 84 callback.Run();
85 } 85 }
86 86
87 void VideoRendererBase::SetPlaybackRate(float playback_rate) { 87 void VideoRendererBase::SetPlaybackRate(float playback_rate) {
88 base::AutoLock auto_lock(lock_); 88 base::AutoLock auto_lock(lock_);
89 playback_rate_ = playback_rate; 89 playback_rate_ = playback_rate;
90 } 90 }
91 91
92 void VideoRendererBase::Seek(base::TimeDelta time, const FilterStatusCB& cb) { 92 void VideoRendererBase::Seek(base::TimeDelta time, const PipelineStatusCB& cb) {
93 base::AutoLock auto_lock(lock_); 93 base::AutoLock auto_lock(lock_);
94 DCHECK_EQ(state_, kFlushed) << "Must flush prior to seeking."; 94 DCHECK_EQ(state_, kFlushed) << "Must flush prior to seeking.";
95 DCHECK(!cb.is_null()); 95 DCHECK(!cb.is_null());
96 DCHECK(seek_cb_.is_null()); 96 DCHECK(seek_cb_.is_null());
97 97
98 state_ = kSeeking; 98 state_ = kSeeking;
99 seek_cb_ = cb; 99 seek_cb_ = cb;
100 seek_timestamp_ = time; 100 seek_timestamp_ = time;
101 AttemptRead_Locked(); 101 AttemptRead_Locked();
102 } 102 }
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 486
487 int VideoRendererBase::NumFrames_Locked() const { 487 int VideoRendererBase::NumFrames_Locked() const {
488 lock_.AssertAcquired(); 488 lock_.AssertAcquired();
489 int outstanding_frames = 489 int outstanding_frames =
490 (current_frame_ ? 1 : 0) + (last_available_frame_ ? 1 : 0) + 490 (current_frame_ ? 1 : 0) + (last_available_frame_ ? 1 : 0) +
491 (current_frame_ && (current_frame_ == last_available_frame_) ? -1 : 0); 491 (current_frame_ && (current_frame_ == last_available_frame_) ? -1 : 0);
492 return ready_frames_.size() + outstanding_frames; 492 return ready_frames_.size() + outstanding_frames;
493 } 493 }
494 494
495 } // namespace media 495 } // namespace media
OLDNEW
« media/filters/ffmpeg_video_decoder.cc ('K') | « media/filters/video_renderer_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698