From 7a032766439f88961cf02aa8b06e31c865c30692 Mon Sep 17 00:00:00 2001 From: "dalecurtis@google.com" Date: Wed, 22 Feb 2012 23:06:45 +0000 Subject: Fix media code to work with new ffmpeg. Once ffmpeg git, svn are updated to new ffmpeg, will update DEPS in this CL. Which when committed, should seal the deal for the ffmpeg roll. API Changes: avutil: SampleFormat->AVSampleFormat avutil: av_get_bits_per_sample_fmt -> av_get_bytes_per_sample avcodec: avcodec_open -> avcodec_open2(..., NULL) avcodec: avcodec_decode_video2(... AVPacket ...) -> const AVPacket. avformat: av_open_input_file -> avformat_open_input avformat: av_register_protocol2 -> ffurl_register_protocol avformat: av_close_input_file -> avformat_close_input(&...) avformat: av_find_stream_info -> avformat_find_stream_info(..., NULL) URLContext now has a url_open2 method as well, for now I've set this to NULL. Also fixes: - ffmpeg_unittests change threading to mirror ffmpeg_video_decoder. There's an issue where threading causes the last frames of a no-audio video to be clipped. It existed before this ffmpeg roll, but because threading was disabled by default in ffmpeg, we never noticed it. - ffmpeg_demuxer_tests: GetBitrate_UnsetInContainer_NoFileSize now passes. - New ffmpeg_unittests passes: sync0_ogv/FFmpegTest.Seek_Video/0, where GetParam() = "sync0.ogv" sync1_ogv/FFmpegTest.Seek_Video/0, where GetParam() = "sync1.ogv" sync2_ogv/FFmpegTest.Seek_Video/0, where GetParam() = "sync2.ogv" FFmpeg fixups here, https://chromiumcodereview.appspot.com/9325049/ New git repo here: http://git.chromium.org/gitweb/?p=chromium/third_party/ffmpeg.git;a=summary Merge+Patches diff: https://chromiumcodereview.appspot.com/9317107 BUG=110776 TEST=unittests, layouttests, etc. Trybots. Review URL: https://chromiumcodereview.appspot.com/9317096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123123 0039d316-1c4b-4281-b951-d872f2087c98 --- media/webm/webm_stream_parser.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'media/webm') diff --git a/media/webm/webm_stream_parser.cc b/media/webm/webm_stream_parser.cc index f1d6001..d49ed7c 100644 --- a/media/webm/webm_stream_parser.cc +++ b/media/webm/webm_stream_parser.cc @@ -46,7 +46,7 @@ class FFmpegConfigHelper { scoped_ptr url_protocol_; // FFmpeg format context for this demuxer. It is created by - // av_open_input_file() during demuxer initialization and cleaned up with + // avformat_open_input() during demuxer initialization and cleaned up with // DestroyAVFormatContext() in the destructor. AVFormatContext* format_context_; @@ -139,7 +139,7 @@ AVFormatContext* FFmpegConfigHelper::CreateFormatContext(const uint8* data, // Open FFmpeg AVFormatContext. AVFormatContext* context = NULL; - int result = av_open_input_file(&context, key.c_str(), NULL, 0, NULL); + int result = avformat_open_input(&context, key.c_str(), NULL, NULL); if (result < 0) return NULL; @@ -148,7 +148,7 @@ AVFormatContext* FFmpegConfigHelper::CreateFormatContext(const uint8* data, } bool FFmpegConfigHelper::SetupStreamConfigs() { - int result = av_find_stream_info(format_context_); + int result = avformat_find_stream_info(format_context_, NULL); if (result < 0) return false; -- cgit v1.1