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

Unified Diff: media/filters/ffmpeg_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: 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/ffmpeg_video_decoder.h ('k') | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder.cc
diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc
index 6fcbdffce40fa669fc04d4453aa44a906ee3b9eb..c6409ba33106474f2bf04dd2e8c431d5479126a6 100644
--- a/media/filters/ffmpeg_video_decoder.cc
+++ b/media/filters/ffmpeg_video_decoder.cc
@@ -12,7 +12,6 @@
#include "media/base/filters.h"
#include "media/base/filter_host.h"
#include "media/base/limits.h"
-#include "media/base/media_format.h"
#include "media/base/video_frame.h"
#include "media/ffmpeg/ffmpeg_common.h"
#include "media/video/ffmpeg_video_decode_engine.h"
@@ -95,13 +94,6 @@ void FFmpegVideoDecoder::OnInitializeComplete(const VideoCodecInfo& info) {
AutoCallbackRunner done_runner(initialize_callback_.release());
if (info.success) {
- media_format_.SetAsInteger(MediaFormat::kWidth,
- info.stream_info.surface_width);
- media_format_.SetAsInteger(MediaFormat::kHeight,
- info.stream_info.surface_height);
- media_format_.SetAsInteger(
- MediaFormat::kSurfaceFormat,
- static_cast<int>(info.stream_info.surface_format));
state_ = kNormal;
} else {
host()->SetError(PIPELINE_ERROR_DECODE);
@@ -272,10 +264,6 @@ void FFmpegVideoDecoder::OnReadCompleteTask(scoped_refptr<Buffer> buffer) {
decode_engine_->ConsumeVideoSample(buffer);
}
-const MediaFormat& FFmpegVideoDecoder::media_format() {
- return media_format_;
-}
-
void FFmpegVideoDecoder::ProduceVideoFrame(
scoped_refptr<VideoFrame> video_frame) {
if (MessageLoop::current() != message_loop_) {
@@ -352,6 +340,16 @@ bool FFmpegVideoDecoder::ProvidesBuffer() {
return info_.provides_buffers;
}
+int FFmpegVideoDecoder::width() {
+ DCHECK(info_.success);
+ return info_.stream_info.surface_width;
+}
+
+int FFmpegVideoDecoder::height() {
+ DCHECK(info_.success);
+ return info_.stream_info.surface_height;
+}
+
void FFmpegVideoDecoder::FlushBuffers() {
while (!frame_queue_flushed_.empty()) {
scoped_refptr<VideoFrame> video_frame;
« no previous file with comments | « media/filters/ffmpeg_video_decoder.h ('k') | media/filters/ffmpeg_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698