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

Unified Diff: media/mp4/mp4_stream_parser.cc

Issue 10830110: Remove VideoDecoderConfig::aspect_ratio_xxx methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments & added tests Created 8 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: media/mp4/mp4_stream_parser.cc
diff --git a/media/mp4/mp4_stream_parser.cc b/media/mp4/mp4_stream_parser.cc
index c7a1c4dbafe985926d73624c67bfea5c7d7f7c87..0e4afd4dbeb4d89e603baed38a5f912518d212de 100644
--- a/media/mp4/mp4_stream_parser.cc
+++ b/media/mp4/mp4_stream_parser.cc
@@ -11,6 +11,7 @@
#include "media/base/audio_decoder_config.h"
#include "media/base/stream_parser_buffer.h"
#include "media/base/video_decoder_config.h"
+#include "media/base/video_util.h"
#include "media/mp4/box_definitions.h"
#include "media/mp4/box_reader.h"
#include "media/mp4/es_descriptor.h"
@@ -219,14 +220,16 @@ bool MP4StreamParser::ParseMoov(BoxReader* reader) {
RCHECK(EmitKeyNeeded(entry.sinf.info.track_encryption));
// TODO(strobe): Recover correct crop box
+ gfx::Size coded_size(entry.width, entry.height);
+ gfx::Rect visible_rect(coded_size);
+ gfx::Size natural_size = GetNaturalSize(visible_rect.size(),
+ entry.pixel_aspect.h_spacing,
+ entry.pixel_aspect.v_spacing);
video_config.Initialize(kCodecH264, H264PROFILE_MAIN, VideoFrame::YV12,
- gfx::Size(entry.width, entry.height),
- gfx::Rect(0, 0, entry.width, entry.height),
- entry.pixel_aspect.h_spacing,
- entry.pixel_aspect.v_spacing,
+ coded_size, visible_rect, natural_size,
// No decoder-specific buffer needed for AVC;
// SPS/PPS are embedded in the video stream
- NULL, 0, false);
+ NULL, 0, true);
has_video_ = true;
video_track_id_ = track->header.track_id;
}
« media/filters/pipeline_integration_test.cc ('K') | « media/filters/pipeline_integration_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698