From 60e84363e57b943ea4901d497648ea111c2877cb Mon Sep 17 00:00:00 2001 From: "scherkus@chromium.org" Date: Sat, 19 Sep 2009 01:23:00 +0000 Subject: Disable FFmpeg logging as it interferes with layout tests. We could disable logging as soon as FFmpeg is loaded in InitializeMediaLibrary(), but we may want logging enabled for different applications using the media library (i.e., media_bench). BUG=16779 TEST=running chrome, test_shell on theora videos shouldn't print any boring log messages Review URL: http://codereview.chromium.org/212013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26641 0039d316-1c4b-4281-b951-d872f2087c98 --- media/base/mock_ffmpeg.cc | 7 +++++++ media/base/mock_ffmpeg.h | 2 ++ media/filters/ffmpeg_common.h | 1 + media/filters/ffmpeg_glue.cc | 3 +++ 4 files changed, 13 insertions(+) (limited to 'media') 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); -- cgit v1.1