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

Unified Diff: media/filters/video_renderer_base.cc

Issue 2101022: refactoring decoder interface (Closed)
Patch Set: q Created 10 years, 7 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 683a1700e8f592569425c2f963ce580f8f9c37d2..4833d349774af4c6234d8a0aced0733bd88a7cef 100644
--- a/media/filters/video_renderer_base.cc
+++ b/media/filters/video_renderer_base.cc
@@ -146,6 +146,8 @@ void VideoRendererBase::Initialize(VideoDecoder* decoder,
decoder_ = decoder;
scoped_ptr<FilterCallback> c(callback);
+ decoder_->set_fill_buffer_done_callback(
+ NewCallback(this, &VideoRendererBase::OnFillBufferDone));
// Notify the pipeline of the video dimensions.
if (!ParseMediaFormat(decoder->media_format(), &width_, &height_,
&uses_egl_image_)) {
@@ -312,7 +314,7 @@ void VideoRendererBase::GetCurrentFrame(scoped_refptr<VideoFrame>* frame_out) {
*frame_out = current_frame_;
}
-void VideoRendererBase::OnReadComplete(VideoFrame* frame) {
+void VideoRendererBase::OnFillBufferDone(scoped_refptr<VideoFrame> frame) {
AutoLock auto_lock(lock_);
// TODO(ajwong): Work around cause we don't synchronize on stop. Correct
@@ -367,7 +369,11 @@ void VideoRendererBase::ScheduleRead_Locked() {
DCHECK_NE(kEnded, state_);
DCHECK_LT(pending_reads_, kMaxFrames);
++pending_reads_;
- decoder_->Read(NewCallback(this, &VideoRendererBase::OnReadComplete));
+ // TODO(jiesun): We use dummy buffer to feed decoder to let decoder to
+ // provide buffer pools. In the future, we may want to implement real
+ // buffer pool to recycle buffers.
+ scoped_refptr<VideoFrame> video_frame;
+ decoder_->FillThisBuffer(video_frame);
}
base::TimeDelta VideoRendererBase::CalculateSleepDuration(
« 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