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

Unified Diff: media/filters/ffmpeg_video_decoder_unittest.cc

Issue 2874433002: Fix/Disable ffmpeg Media Tests on Android (Closed)
Patch Set: Using pragmas and default params as suggested by watk Created 3 years, 7 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/base/test_helpers.cc ('k') | no next file » | 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 72ca256ec53f971706f3f983ae182ff9cc2773e1..870a551cdbf5c7d6aeb171c3fe15c38b7ba9c081 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -42,12 +42,28 @@ using ::testing::Return;
using ::testing::SaveArg;
using ::testing::StrictMock;
+#if !defined(OS_ANDROID)
+#define USE_VP8
+#endif
+#if defined(OS_ANDROID) && !defined(DISABLE_FFMPEG_VIDEO_DECODERS) && \
+ BUILDFLAG(USE_PROPRIETARY_CODECS)
+#define USE_H264
+#endif
+
namespace media {
static const VideoPixelFormat kVideoFormat = PIXEL_FORMAT_YV12;
+#if defined(USE_VP8)
static const gfx::Size kCodedSize(320, 240);
static const gfx::Rect kVisibleRect(320, 240);
static const gfx::Size kNaturalSize(320, 240);
+#elif defined(USE_H264)
+static const gfx::Size kCodedSize(320, 180);
+static const gfx::Rect kVisibleRect(320, 180);
+static const gfx::Size kNaturalSize(320, 180);
+#else
+#error No valid decoder available.
+#endif
ACTION_P(ReturnBuffer, buffer) {
arg0.Run(buffer.get() ? DemuxerStream::kOk : DemuxerStream::kAborted, buffer);
@@ -68,7 +84,14 @@ class FFmpegVideoDecoderTest : public testing::Test {
// Initialize various test buffers.
frame_buffer_.reset(new uint8_t[kCodedSize.GetArea()]);
end_of_stream_buffer_ = DecoderBuffer::CreateEOSBuffer();
+#if defined(USE_VP8)
i_frame_buffer_ = ReadTestDataFile("vp8-I-frame-320x240");
+#elif defined(USE_H264)
+ i_frame_buffer_ = ReadTestDataFile("h264-320x180-frame-0");
+#else
+#error No valid decoder available.
+#endif
+
corrupt_i_frame_buffer_ = ReadTestDataFile("vp8-corrupt-I-frame");
}
@@ -77,7 +100,13 @@ class FFmpegVideoDecoderTest : public testing::Test {
}
void Initialize() {
+#if defined(USE_VP8)
InitializeWithConfig(TestVideoConfig::Normal());
+#elif defined(USE_H264)
+ InitializeWithConfig(TestVideoConfig::Normal(kCodecH264));
+#else
+#error No valid decoder available.
+#endif
}
void InitializeWithConfigWithResult(const VideoDecoderConfig& config,
@@ -93,7 +122,13 @@ class FFmpegVideoDecoderTest : public testing::Test {
}
void Reinitialize() {
+#if defined(USE_VP8)
InitializeWithConfig(TestVideoConfig::Large());
+#elif defined(USE_H264)
+ InitializeWithConfig(TestVideoConfig::Large(kCodecH264));
+#else
+#error No valid decoder available.
+#endif
}
void Reset() {
@@ -310,6 +345,10 @@ TEST_F(FFmpegVideoDecoderTest, DecodeFrame_DecodeErrorAtEndOfStream) {
DecodeSingleFrame(corrupt_i_frame_buffer_));
}
+// The following tests depend on vp8 test files, which are not supported on
+// Android by default. Re-enable once appropriate test files have been added.
+// crbug.com/720008
+#if !defined(USE_VP8)
// Decode |i_frame_buffer_| and then a frame with a larger width and verify
// the output size was adjusted.
TEST_F(FFmpegVideoDecoderTest, DecodeFrame_LargerWidth) {
@@ -333,6 +372,7 @@ TEST_F(FFmpegVideoDecoderTest, DecodeFrame_LargerHeight) {
TEST_F(FFmpegVideoDecoderTest, DecodeFrame_SmallerHeight) {
DecodeIFrameThenTestFile("vp8-I-frame-320x120", 320, 120);
}
+#endif // USE_VP8
// Test resetting when decoder has initialized but not decoded.
TEST_F(FFmpegVideoDecoderTest, Reset_Initialized) {
« no previous file with comments | « media/base/test_helpers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698