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

Unified Diff: media/filters/ffmpeg_video_decoder_unittest.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | media/filters/video_renderer_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder_unittest.cc
diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc
index 9501518d0e44ad74373ea1a6098f3ed7e03b3ff0..3b5a3e6ce69741a1cc2c4178e2c2502e70134ea5 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -33,8 +33,9 @@ using ::testing::Invoke;
namespace media {
-static const int kWidth = 1280;
-static const int kHeight = 720;
+static const gfx::Size kCodedSize(1280, 720);
+static const gfx::Rect kVisibleRect(1280, 720);
+static const gfx::Size kNaturalSize(1280, 720);
// Holds timestamp and duration data needed for properly enqueuing a frame.
struct TimeTuple {
@@ -97,8 +98,7 @@ class DecoderPrivateMock : public FFmpegVideoDecoder {
ACTION_P2(EngineInitialize, engine, success) {
engine->event_handler_ = arg1;
engine->info_.success = success;
- engine->info_.surface_width = kWidth;
- engine->info_.surface_height = kHeight;
+ engine->info_.natural_size = kNaturalSize;
engine->event_handler_->OnInitializeComplete(engine->info_);
}
@@ -143,11 +143,13 @@ class FFmpegVideoDecoderTest : public testing::Test {
memset(&codec_, 0, sizeof(codec_));
memset(&yuv_frame_, 0, sizeof(yuv_frame_));
base::TimeDelta zero;
- video_frame_ = VideoFrame::CreateFrame(VideoFrame::YV12, kWidth, kHeight,
+ video_frame_ = VideoFrame::CreateFrame(VideoFrame::YV12,
+ kVisibleRect.width(),
+ kVisibleRect.height(),
zero, zero);
stream_.codec = &codec_context_;
- codec_context_.width = kWidth;
- codec_context_.height = kHeight;
+ codec_context_.width = kVisibleRect.width();
+ codec_context_.height = kVisibleRect.height();
codec_context_.codec_id = CODEC_ID_H264;
stream_.r_frame_rate.num = 1;
stream_.r_frame_rate.den = 1;
@@ -243,8 +245,7 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_Successful) {
// Test that the uncompressed video surface matches the dimensions
// specified by FFmpeg.
- EXPECT_EQ(kWidth, decoder_->width());
- EXPECT_EQ(kHeight, decoder_->height());
+ EXPECT_EQ(kNaturalSize, decoder_->natural_size());
}
TEST_F(FFmpegVideoDecoderTest, OnError) {
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | media/filters/video_renderer_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698