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

Unified Diff: media/filters/video_renderer_base.cc

Issue 7461016: Replace VideoDecoder::media_format() with significantly simpler width()/height() methods. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: fixes Created 9 years, 5 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 038a1a88e4876a62b8afa65cf2083cc12bcf7f08..94e1bdfe3e1d229239d8493a883a1da8d70b4790 100644
--- a/media/filters/video_renderer_base.cc
+++ b/media/filters/video_renderer_base.cc
@@ -28,10 +28,7 @@ static const int64 kMaxSleepMilliseconds = 60;
static const int kIdleMilliseconds = 10;
VideoRendererBase::VideoRendererBase()
- : width_(0),
- height_(0),
- surface_format_(VideoFrame::INVALID),
- frame_available_(&lock_),
+ : frame_available_(&lock_),
state_(kUninitialized),
thread_(base::kNullThreadHandle),
pending_reads_(0),
@@ -45,27 +42,6 @@ VideoRendererBase::~VideoRendererBase() {
DCHECK(state_ == kUninitialized || state_ == kStopped);
}
-// static
-bool VideoRendererBase::ParseMediaFormat(
- const MediaFormat& media_format,
- VideoFrame::Format* surface_format_out,
- int* width_out, int* height_out) {
- int surface_format;
- if (!media_format.GetAsInteger(MediaFormat::kSurfaceFormat, &surface_format))
- return false;
- if (surface_format_out)
- *surface_format_out = static_cast<VideoFrame::Format>(surface_format);
-
- int width, height;
- if (!media_format.GetAsInteger(MediaFormat::kWidth, &width))
- return false;
- if (!media_format.GetAsInteger(MediaFormat::kHeight, &height))
- return false;
- if (width_out) *width_out = width;
- if (height_out) *height_out = height;
- return true;
-}
-
void VideoRendererBase::Play(FilterCallback* callback) {
base::AutoLock auto_lock(lock_);
DCHECK_EQ(kPrerolled, state_);
@@ -173,13 +149,7 @@ void VideoRendererBase::Initialize(VideoDecoder* decoder,
base::Unretained(this)));
// Notify the pipeline of the video dimensions.
- if (!ParseMediaFormat(decoder->media_format(),
- &surface_format_,
- &width_, &height_)) {
- EnterErrorState_Locked(PIPELINE_ERROR_INITIALIZATION_FAILED);
- return;
- }
- host()->SetVideoSize(width_, height_);
+ host()->SetVideoSize(decoder_->width(), decoder_->height());
// Initialize the subclass.
// TODO(scherkus): do we trust subclasses not to do something silly while
@@ -479,10 +449,6 @@ void VideoRendererBase::ConsumeVideoFrame(scoped_refptr<VideoFrame> frame) {
}
}
-VideoDecoder* VideoRendererBase::GetDecoder() {
- return decoder_.get();
-}
-
void VideoRendererBase::ReadInput(scoped_refptr<VideoFrame> frame) {
// We should never return empty frames or EOS frame.
DCHECK(frame.get() && !frame->IsEndOfStream());
« 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