summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-19 01:23:00 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-19 01:23:00 +0000
commit60e84363e57b943ea4901d497648ea111c2877cb (patch)
treeffdbcbe4a4b31bde01d69b4562a5a657f2edf61b /media
parentd594b4ae847b2acf973e326cdf71e438265ed257 (diff)
downloadchromium_src-60e84363e57b943ea4901d497648ea111c2877cb.zip
chromium_src-60e84363e57b943ea4901d497648ea111c2877cb.tar.gz
chromium_src-60e84363e57b943ea4901d497648ea111c2877cb.tar.bz2
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
Diffstat (limited to 'media')
-rw-r--r--media/base/mock_ffmpeg.cc7
-rw-r--r--media/base/mock_ffmpeg.h2
-rw-r--r--media/filters/ffmpeg_common.h1
-rw-r--r--media/filters/ffmpeg_glue.cc3
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);