diff options
author | Andras Becsi <andras.becsi@digia.com> | 2013-12-11 21:33:03 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2013-12-13 12:34:07 +0100 |
commit | f2a33ff9cbc6d19943f1c7fbddd1f23d23975577 (patch) | |
tree | 0586a32aa390ade8557dfd6b4897f43a07449578 /chromium/media/ffmpeg | |
parent | 5362912cdb5eea702b68ebe23702468d17c3017a (diff) | |
download | qtwebengine-chromium-f2a33ff9cbc6d19943f1c7fbddd1f23d23975577.tar.gz |
Update Chromium to branch 1650 (31.0.1650.63)
Change-Id: I57d8c832eaec1eb2364e0a8e7352a6dd354db99f
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'chromium/media/ffmpeg')
-rw-r--r-- | chromium/media/ffmpeg/ffmpeg_common.cc | 4 | ||||
-rw-r--r-- | chromium/media/ffmpeg/ffmpeg_common.h | 3 | ||||
-rw-r--r-- | chromium/media/ffmpeg/ffmpeg_common_unittest.cc | 18 | ||||
-rw-r--r-- | chromium/media/ffmpeg/ffmpeg_regression_tests.cc | 9 | ||||
-rw-r--r-- | chromium/media/ffmpeg/ffmpeg_unittest.cc | 14 |
5 files changed, 37 insertions, 11 deletions
diff --git a/chromium/media/ffmpeg/ffmpeg_common.cc b/chromium/media/ffmpeg/ffmpeg_common.cc index 9693bbb4de2..72b31252f85 100644 --- a/chromium/media/ffmpeg/ffmpeg_common.cc +++ b/chromium/media/ffmpeg/ffmpeg_common.cc @@ -291,7 +291,9 @@ static void AVCodecContextToAudioDecoderConfig( codec_context->extradata, codec_context->extradata_size, is_encrypted, - record_stats); + record_stats, + base::TimeDelta(), + base::TimeDelta()); if (codec != kCodecOpus) { DCHECK_EQ(av_get_bytes_per_sample(codec_context->sample_fmt) * 8, config->bits_per_channel()); diff --git a/chromium/media/ffmpeg/ffmpeg_common.h b/chromium/media/ffmpeg/ffmpeg_common.h index 99e1cc246ec..ccd2aa59756 100644 --- a/chromium/media/ffmpeg/ffmpeg_common.h +++ b/chromium/media/ffmpeg/ffmpeg_common.h @@ -95,7 +95,8 @@ ChannelLayout ChannelLayoutToChromeChannelLayout(int64_t layout, int channels); // Converts FFmpeg's audio sample format to Chrome's SampleFormat. -SampleFormat AVSampleFormatToSampleFormat(AVSampleFormat sample_format); +MEDIA_EXPORT SampleFormat + AVSampleFormatToSampleFormat(AVSampleFormat sample_format); // Converts FFmpeg's pixel formats to its corresponding supported video format. VideoFrame::Format PixelFormatToVideoFormat(PixelFormat pixel_format); diff --git a/chromium/media/ffmpeg/ffmpeg_common_unittest.cc b/chromium/media/ffmpeg/ffmpeg_common_unittest.cc index 33ad46ed109..2fa61ace486 100644 --- a/chromium/media/ffmpeg/ffmpeg_common_unittest.cc +++ b/chromium/media/ffmpeg/ffmpeg_common_unittest.cc @@ -79,4 +79,22 @@ TEST_F(FFmpegCommonTest, TimeBaseConversions) { } } +TEST_F(FFmpegCommonTest, VerifyFormatSizes) { + for (AVSampleFormat format = AV_SAMPLE_FMT_NONE; + format < AV_SAMPLE_FMT_NB; + format = static_cast<AVSampleFormat>(format + 1)) { + SampleFormat sample_format = AVSampleFormatToSampleFormat(format); + if (sample_format == kUnknownSampleFormat) { + // This format not supported, so skip it. + continue; + } + + // Have FFMpeg compute the size of a buffer of 1 channel / 1 frame + // with 1 byte alignment to make sure the sizes match. + int single_buffer_size = av_samples_get_buffer_size(NULL, 1, 1, format, 1); + int bytes_per_channel = SampleFormatToBytesPerChannel(sample_format); + EXPECT_EQ(bytes_per_channel, single_buffer_size); + } +} + } // namespace media diff --git a/chromium/media/ffmpeg/ffmpeg_regression_tests.cc b/chromium/media/ffmpeg/ffmpeg_regression_tests.cc index 19f00f81aef..0b68fd0896c 100644 --- a/chromium/media/ffmpeg/ffmpeg_regression_tests.cc +++ b/chromium/media/ffmpeg/ffmpeg_regression_tests.cc @@ -152,6 +152,11 @@ FFMPEG_TEST_CASE(Cr234630b, "security/234630b.mov", PIPELINE_ERROR_DECODE, FFMPEG_TEST_CASE(Cr242786, "security/242786.webm", PIPELINE_OK, PIPELINE_OK, kNullVideoHash, "-1.72,-0.83,0.84,1.70,1.23,-0.53,"); +// Test for out-of-bounds access with slightly corrupt file (detection logic +// thinks it's a MONO file, but actually contains STEREO audio). +FFMPEG_TEST_CASE(Cr275590, "security/275590.m4a", + DECODER_ERROR_NOT_SUPPORTED, DEMUXER_ERROR_COULD_NOT_OPEN, + kNullVideoHash, kNullAudioHash); // General MP4 test cases. FFMPEG_TEST_CASE(MP4_0, "security/aac.10419.mp4", DEMUXER_ERROR_COULD_NOT_OPEN, @@ -359,7 +364,7 @@ FLAKY_FFMPEG_TEST_CASE(WEBM_2, "security/uninitialize.webm"); TEST_P(FFmpegRegressionTest, BasicPlayback) { if (GetParam().init_status == PIPELINE_OK) { ASSERT_TRUE(Start(GetTestDataFilePath(GetParam().filename), - GetParam().init_status, true)); + GetParam().init_status, kHashed)); Play(); ASSERT_EQ(WaitUntilEndedOrError(), GetParam().end_status); EXPECT_EQ(GetParam().video_md5, GetVideoHash()); @@ -374,7 +379,7 @@ TEST_P(FFmpegRegressionTest, BasicPlayback) { } } else { ASSERT_FALSE(Start(GetTestDataFilePath(GetParam().filename), - GetParam().init_status, true)); + GetParam().init_status, kHashed)); EXPECT_EQ(GetParam().video_md5, GetVideoHash()); EXPECT_EQ(GetParam().audio_md5, GetAudioHash()); } diff --git a/chromium/media/ffmpeg/ffmpeg_unittest.cc b/chromium/media/ffmpeg/ffmpeg_unittest.cc index d774a0605ab..255d2aad47f 100644 --- a/chromium/media/ffmpeg/ffmpeg_unittest.cc +++ b/chromium/media/ffmpeg/ffmpeg_unittest.cc @@ -17,9 +17,9 @@ #include "base/files/memory_mapped_file.h" #include "base/memory/scoped_ptr.h" #include "base/path_service.h" -#include "base/perftimer.h" #include "base/strings/string_util.h" #include "base/test/perf_test_suite.h" +#include "base/test/perf_time_logger.h" #include "media/base/media.h" #include "media/ffmpeg/ffmpeg_common.h" #include "media/filters/ffmpeg_glue.h" @@ -424,27 +424,27 @@ FFMPEG_TEST_CASE(counting, ogv); TEST_P(FFmpegTest, Perf) { { - PerfTimeLogger timer("Opening file"); + base::PerfTimeLogger timer("Opening file"); OpenFile(GetParam()); } { - PerfTimeLogger timer("Opening codecs"); + base::PerfTimeLogger timer("Opening codecs"); OpenCodecs(); } { - PerfTimeLogger timer("Reading file"); + base::PerfTimeLogger timer("Reading file"); ReadRemainingFile(); } if (has_audio()) { - PerfTimeLogger timer("Decoding audio"); + base::PerfTimeLogger timer("Decoding audio"); DecodeRemainingAudio(); } if (has_video()) { - PerfTimeLogger timer("Decoding video"); + base::PerfTimeLogger timer("Decoding video"); DecodeRemainingVideo(); } { - PerfTimeLogger timer("Seeking to zero"); + base::PerfTimeLogger timer("Seeking to zero"); SeekTo(0); } } |