diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-12 14:20:02 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-12 14:20:02 +0000 |
commit | 50a178a8ee4ad3333104f07c34d0b2ffd522b177 (patch) | |
tree | d0d3818ba7c51ffdf268e9ae64d0791f9b60823a | |
parent | 29a80d8fad910269d09c0886f4132d9e6c3e8514 (diff) | |
download | chromium_src-50a178a8ee4ad3333104f07c34d0b2ffd522b177.zip chromium_src-50a178a8ee4ad3333104f07c34d0b2ffd522b177.tar.gz chromium_src-50a178a8ee4ad3333104f07c34d0b2ffd522b177.tar.bz2 |
FFmpeg fixups for M33 roll. Now with more Opus!
Besides the DEPs update there's also:
- Remove deprecated usage of avcodec_alloc_frame()
- Remove deprecated usage of pkt->pkt_pts
- Fix end trimming for ogg opus playbacks.
- Remove fragile bytes decoded check for end trimming.
Not all of the Opus issues are fixed yet, this just
pulls in the FFmpeg side of the fixes. Chrome changes
are in a followup patch set.
BUG=104241,166752,168524,315165
TEST=unittests, asan, ogg opus links from bugs.
Review URL: https://codereview.chromium.org/111153003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240320 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | DEPS | 4 | ||||
-rw-r--r-- | media/base/media_file_checker.cc | 2 | ||||
-rw-r--r-- | media/cdm/ppapi/ffmpeg_cdm_audio_decoder.cc | 2 | ||||
-rw-r--r-- | media/cdm/ppapi/ffmpeg_cdm_video_decoder.cc | 2 | ||||
-rw-r--r-- | media/ffmpeg/ffmpeg_unittest.cc | 4 | ||||
-rw-r--r-- | media/filters/audio_file_reader.cc | 2 | ||||
-rw-r--r-- | media/filters/ffmpeg_audio_decoder.cc | 2 | ||||
-rw-r--r-- | media/filters/ffmpeg_video_decoder.cc | 4 | ||||
-rw-r--r-- | media/filters/opus_audio_decoder.cc | 8 | ||||
-rw-r--r-- | media/filters/pipeline_integration_test.cc | 9 |
10 files changed, 19 insertions, 20 deletions
@@ -36,8 +36,8 @@ vars = { # These two FFmpeg variables must be updated together. One is used for SVN # checkouts and the other for Git checkouts. - "ffmpeg_revision": "237181", - "ffmpeg_hash": "9186343787c9fe2af1a3b0350ac556508dfbaaf6", + "ffmpeg_revision": "240211", + "ffmpeg_hash": "8dc45cbcad763762bb679de280bdc584f35aa22f", "sfntly_revision": "228", "lighttpd_revision": "33737", diff --git a/media/base/media_file_checker.cc b/media/base/media_file_checker.cc index d49638a..494657d 100644 --- a/media/base/media_file_checker.cc +++ b/media/base/media_file_checker.cc @@ -60,7 +60,7 @@ bool MediaFileChecker::Start(base::TimeDelta check_time) { AVPacket packet; scoped_ptr_malloc<AVFrame, media::ScopedPtrAVFreeFrame> frame( - avcodec_alloc_frame()); + av_frame_alloc()); int result = 0; base::Time deadline = base::Time::Now() + diff --git a/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.cc b/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.cc index b682379..082b35e 100644 --- a/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.cc +++ b/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.cc @@ -180,7 +180,7 @@ bool FFmpegCdmAudioDecoder::Initialize(const cdm::AudioDecoderConfig& config) { } // Success! - av_frame_.reset(avcodec_alloc_frame()); + av_frame_.reset(av_frame_alloc()); samples_per_second_ = config.samples_per_second; bytes_per_frame_ = codec_context_->channels * config.bits_per_channel / 8; output_timestamp_helper_.reset( diff --git a/media/cdm/ppapi/ffmpeg_cdm_video_decoder.cc b/media/cdm/ppapi/ffmpeg_cdm_video_decoder.cc index 615a4c3..7ffda24 100644 --- a/media/cdm/ppapi/ffmpeg_cdm_video_decoder.cc +++ b/media/cdm/ppapi/ffmpeg_cdm_video_decoder.cc @@ -174,7 +174,7 @@ bool FFmpegCdmVideoDecoder::Initialize(const cdm::VideoDecoderConfig& config) { return false; } - av_frame_.reset(avcodec_alloc_frame()); + av_frame_.reset(av_frame_alloc()); is_initialized_ = true; return true; diff --git a/media/ffmpeg/ffmpeg_unittest.cc b/media/ffmpeg/ffmpeg_unittest.cc index bd23266..9f24845 100644 --- a/media/ffmpeg/ffmpeg_unittest.cc +++ b/media/ffmpeg/ffmpeg_unittest.cc @@ -91,8 +91,8 @@ class FFmpegTest : public testing::TestWithParam<const char*> { duration_(AV_NOPTS_VALUE) { InitializeFFmpeg(); - audio_buffer_.reset(avcodec_alloc_frame()); - video_buffer_.reset(avcodec_alloc_frame()); + audio_buffer_.reset(av_frame_alloc()); + video_buffer_.reset(av_frame_alloc()); } virtual ~FFmpegTest() { diff --git a/media/filters/audio_file_reader.cc b/media/filters/audio_file_reader.cc index 330b135..092c8f5 100644 --- a/media/filters/audio_file_reader.cc +++ b/media/filters/audio_file_reader.cc @@ -132,7 +132,7 @@ int AudioFileReader::Read(AudioBus* audio_bus) { // Holds decoded audio. scoped_ptr_malloc<AVFrame, ScopedPtrAVFreeFrame> av_frame( - avcodec_alloc_frame()); + av_frame_alloc()); // Read until we hit EOF or we've read the requested number of frames. AVPacket packet; diff --git a/media/filters/ffmpeg_audio_decoder.cc b/media/filters/ffmpeg_audio_decoder.cc index 33b1e29..00f7566 100644 --- a/media/filters/ffmpeg_audio_decoder.cc +++ b/media/filters/ffmpeg_audio_decoder.cc @@ -372,7 +372,7 @@ bool FFmpegAudioDecoder::ConfigureDecoder() { } // Success! - av_frame_.reset(avcodec_alloc_frame()); + av_frame_.reset(av_frame_alloc()); channel_layout_ = config.channel_layout(); samples_per_second_ = config.samples_per_second(); output_timestamp_helper_.reset( diff --git a/media/filters/ffmpeg_video_decoder.cc b/media/filters/ffmpeg_video_decoder.cc index 83c850d..b875765 100644 --- a/media/filters/ffmpeg_video_decoder.cc +++ b/media/filters/ffmpeg_video_decoder.cc @@ -104,8 +104,6 @@ int FFmpegVideoDecoder::GetVideoBuffer(AVCodecContext* codec_context, frame->opaque = NULL; video_frame.swap(reinterpret_cast<VideoFrame**>(&frame->opaque)); frame->type = FF_BUFFER_TYPE_USER; - frame->pkt_pts = codec_context->pkt ? codec_context->pkt->pts : - AV_NOPTS_VALUE; frame->width = codec_context->width; frame->height = codec_context->height; frame->format = codec_context->pix_fmt; @@ -382,7 +380,7 @@ bool FFmpegVideoDecoder::ConfigureDecoder() { return false; } - av_frame_.reset(avcodec_alloc_frame()); + av_frame_.reset(av_frame_alloc()); return true; } diff --git a/media/filters/opus_audio_decoder.cc b/media/filters/opus_audio_decoder.cc index 7aa9319..37e1abd 100644 --- a/media/filters/opus_audio_decoder.cc +++ b/media/filters/opus_audio_decoder.cc @@ -601,11 +601,13 @@ bool OpusAudioDecoder::Decode(const scoped_refptr<DecoderBuffer>& input, // Decoding finished successfully, update statistics. PipelineStatistics statistics; - statistics.audio_bytes_decoded = - frames_decoded * - demuxer_stream_->audio_decoder_config().bytes_per_frame(); + statistics.audio_bytes_decoded = input->data_size(); statistics_cb_.Run(statistics); + // Discard the buffer to indicate we need more data. + if (!frames_decoded) + *output_buffer = NULL; + return true; } diff --git a/media/filters/pipeline_integration_test.cc b/media/filters/pipeline_integration_test.cc index f828402..bdf33f2 100644 --- a/media/filters/pipeline_integration_test.cc +++ b/media/filters/pipeline_integration_test.cc @@ -60,7 +60,6 @@ const int kAppendTimeMs = kAppendTimeSec * 1000; const int k320WebMFileDurationMs = 2737; const int k640WebMFileDurationMs = 2763; const int kOpusEndTrimmingWebMFileDurationMs = 2771; -const uint32 kOpusEndTrimmingWebMFileAudioBytes = 528676; const int kVP9WebMFileDurationMs = 2735; const int kVP8AWebMFileDurationMs = 2700; @@ -567,8 +566,6 @@ TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource_Opus_WebM) { Play(); ASSERT_TRUE(WaitUntilOnEnded()); - EXPECT_EQ(kOpusEndTrimmingWebMFileAudioBytes, - pipeline_->GetStatistics().audio_bytes_decoded); source.Abort(); Stop(); } @@ -1063,10 +1060,12 @@ TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { TEST_F(PipelineIntegrationTest, BasicPlayback_AudioOnly_Opus_WebM) { ASSERT_TRUE(Start(GetTestDataFilePath("bear-opus-end-trimming.webm"), PIPELINE_OK)); + EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); + EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); + EXPECT_EQ(kOpusEndTrimmingWebMFileDurationMs, + pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); Play(); ASSERT_TRUE(WaitUntilOnEnded()); - EXPECT_EQ(kOpusEndTrimmingWebMFileAudioBytes, - pipeline_->GetStatistics().audio_bytes_decoded); } // Verify that VP9 video in WebM containers can be played back. |