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

Unified Diff: content/renderer/media/rtc_video_decoder.cc

Issue 7461016: Replace VideoDecoder::media_format() with significantly simpler width()/height() methods. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: 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
Index: content/renderer/media/rtc_video_decoder.cc
diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc
index 847091c3333cceaf9086c18e69ea0cb0f5f5f4bd..f6d0e5b97c3a151aa13f1ba829d09b66e4ee95fc 100644
--- a/content/renderer/media/rtc_video_decoder.cc
+++ b/content/renderer/media/rtc_video_decoder.cc
@@ -11,7 +11,6 @@
#include "media/base/filter_host.h"
#include "media/base/filters.h"
#include "media/base/limits.h"
-#include "media/base/media_format.h"
#include "media/base/video_frame.h"
using media::DemuxerStream;
@@ -19,7 +18,6 @@ using media::FilterCallback;
using media::FilterStatusCB;
using media::kNoTimestamp;
using media::Limits;
-using media::MediaFormat;
using media::PIPELINE_OK;
using media::StatisticsCallback;
using media::VideoDecoder;
@@ -34,8 +32,7 @@ RTCVideoDecoder::RTCVideoDecoder(MessageLoop* message_loop,
state_(kUnInitialized) {
}
-RTCVideoDecoder::~RTCVideoDecoder() {
-}
+RTCVideoDecoder::~RTCVideoDecoder() {}
void RTCVideoDecoder::Initialize(DemuxerStream* demuxer_stream,
FilterCallback* filter_callback,
@@ -55,10 +52,6 @@ void RTCVideoDecoder::Initialize(DemuxerStream* demuxer_stream,
lock_.Acquire();
frame_queue_available_.clear();
lock_.Release();
- media_format_.SetAsInteger(MediaFormat::kWidth, width_);
- media_format_.SetAsInteger(MediaFormat::kHeight, height_);
- media_format_.SetAsInteger(MediaFormat::kSurfaceType,
- static_cast<int>(VideoFrame::YV12));
state_ = kNormal;
@@ -137,10 +130,6 @@ void RTCVideoDecoder::Seek(base::TimeDelta time, const FilterStatusCB& cb) {
cb.Run(PIPELINE_OK);
}
-const MediaFormat& RTCVideoDecoder::media_format() {
- return media_format_;
-}
-
void RTCVideoDecoder::ProduceVideoFrame(
scoped_refptr<VideoFrame> video_frame) {
if (MessageLoop::current() != message_loop_) {
@@ -159,12 +148,18 @@ bool RTCVideoDecoder::ProvidesBuffer() {
return true;
}
+int RTCVideoDecoder::width() {
+ return width_;
+}
+
+int RTCVideoDecoder::height() {
+ return height_;
+}
+
bool RTCVideoDecoder::SetSize(int width, int height, int reserved) {
width_ = width;
Ami GONE FROM CHROMIUM 2011/07/20 16:30:22 Before this CL, width/height changes through calls
scherkus (not reviewing) 2011/07/20 16:51:52 Don't the lines I removed below reflect width/heig
Ami GONE FROM CHROMIUM 2011/07/20 16:56:26 D'oh. Yep. nm.
height_ = height;
- media_format_.SetAsInteger(MediaFormat::kWidth, width_);
- media_format_.SetAsInteger(MediaFormat::kHeight, height_);
host()->SetVideoSize(width_, height_);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698