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

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

Issue 7932005: Reland r101418: Fix aspect ratio and clarify video frame dimensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/callback.h" 9 #include "media/base/callback.h"
10 #include "media/base/filter_host.h" 10 #include "media/base/filter_host.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 decoder_ = decoder; 141 decoder_ = decoder;
142 AutoCallbackRunner done_runner(callback); 142 AutoCallbackRunner done_runner(callback);
143 143
144 statistics_callback_.reset(stats_callback); 144 statistics_callback_.reset(stats_callback);
145 145
146 decoder_->set_consume_video_frame_callback( 146 decoder_->set_consume_video_frame_callback(
147 base::Bind(&VideoRendererBase::ConsumeVideoFrame, 147 base::Bind(&VideoRendererBase::ConsumeVideoFrame,
148 base::Unretained(this))); 148 base::Unretained(this)));
149 149
150 // Notify the pipeline of the video dimensions. 150 // Notify the pipeline of the video dimensions.
151 host()->SetVideoSize(decoder_->width(), decoder_->height()); 151 host()->SetNaturalVideoSize(decoder_->natural_size());
152 152
153 // Initialize the subclass. 153 // Initialize the subclass.
154 // TODO(scherkus): do we trust subclasses not to do something silly while 154 // TODO(scherkus): do we trust subclasses not to do something silly while
155 // we're holding the lock? 155 // we're holding the lock?
156 if (!OnInitialize(decoder)) { 156 if (!OnInitialize(decoder)) {
157 EnterErrorState_Locked(PIPELINE_ERROR_INITIALIZATION_FAILED); 157 EnterErrorState_Locked(PIPELINE_ERROR_INITIALIZATION_FAILED);
158 return; 158 return;
159 } 159 }
160 160
161 // We're all good! Consider ourselves flushed. (ThreadMain() should never 161 // We're all good! Consider ourselves flushed. (ThreadMain() should never
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 void VideoRendererBase::DoStopOrErrorFlush_Locked() { 592 void VideoRendererBase::DoStopOrErrorFlush_Locked() {
593 DCHECK(!pending_paint_); 593 DCHECK(!pending_paint_);
594 DCHECK(!pending_paint_with_last_available_); 594 DCHECK(!pending_paint_with_last_available_);
595 lock_.AssertAcquired(); 595 lock_.AssertAcquired();
596 FlushBuffers_Locked(); 596 FlushBuffers_Locked();
597 last_available_frame_ = NULL; 597 last_available_frame_ = NULL;
598 DCHECK_EQ(pending_reads_, 0); 598 DCHECK_EQ(pending_reads_, 0);
599 } 599 }
600 600
601 } // namespace media 601 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_video_decoder_unittest.cc ('k') | media/filters/video_renderer_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698