diff options
Diffstat (limited to 'media')
-rw-r--r-- | media/base/mock_ffmpeg.cc | 7 | ||||
-rw-r--r-- | media/base/mock_ffmpeg.h | 2 | ||||
-rw-r--r-- | media/filters/ffmpeg_common.h | 1 | ||||
-rw-r--r-- | media/filters/ffmpeg_glue.cc | 3 |
4 files changed, 13 insertions, 0 deletions
diff --git a/media/base/mock_ffmpeg.cc b/media/base/mock_ffmpeg.cc index 541f476..d9879b1 100644 --- a/media/base/mock_ffmpeg.cc +++ b/media/base/mock_ffmpeg.cc @@ -27,6 +27,9 @@ MockFFmpeg::MockFFmpeg() // TODO(scherkus): this feels gross and I need to think of a way to better // inject/mock singletons. if (!protocol_) { + EXPECT_CALL(*this, AVLogSetLevel(AV_LOG_QUIET)) + .Times(AtMost(1)) + .WillOnce(Return()); EXPECT_CALL(*this, AVCodecInit()) .Times(AtMost(1)) .WillOnce(Return()); @@ -176,6 +179,10 @@ void av_free(void* ptr) { int av_dup_packet(AVPacket* packet) { return media::MockFFmpeg::get()->AVDupPacket(packet); } + +void av_log_set_level(int level) { + media::MockFFmpeg::get()->AVLogSetLevel(level); +} } // extern "C" } // namespace media diff --git a/media/base/mock_ffmpeg.h b/media/base/mock_ffmpeg.h index 9471dec..eb3c86b 100644 --- a/media/base/mock_ffmpeg.h +++ b/media/base/mock_ffmpeg.h @@ -49,6 +49,8 @@ class MockFFmpeg { MOCK_METHOD1(AVFree, void(void* ptr)); MOCK_METHOD1(AVDupPacket, int(AVPacket* packet)); + MOCK_METHOD1(AVLogSetLevel, void(int level)); + // Used for verifying check points during tests. MOCK_METHOD1(CheckPoint, void(int id)); diff --git a/media/filters/ffmpeg_common.h b/media/filters/ffmpeg_common.h index 94f5af8..1e792f4 100644 --- a/media/filters/ffmpeg_common.h +++ b/media/filters/ffmpeg_common.h @@ -21,6 +21,7 @@ extern "C" { MSVC_PUSH_DISABLE_WARNING(4244); #include "third_party/ffmpeg/include/libavcodec/avcodec.h" #include "third_party/ffmpeg/include/libavformat/avformat.h" +#include "third_party/ffmpeg/include/libavutil/log.h" MSVC_POP_WARNING(); } // extern "C" diff --git a/media/filters/ffmpeg_glue.cc b/media/filters/ffmpeg_glue.cc index 35e35c91..3c8433c 100644 --- a/media/filters/ffmpeg_glue.cc +++ b/media/filters/ffmpeg_glue.cc @@ -101,6 +101,9 @@ static URLProtocol kFFmpegURLProtocol = { }; FFmpegGlue::FFmpegGlue() { + // Before doing anything disable logging as it interferes with layout tests. + av_log_set_level(AV_LOG_QUIET); + // Register our protocol glue code with FFmpeg. avcodec_init(); av_register_protocol(&kFFmpegURLProtocol); |