diff options
-rw-r--r-- | media/base/mock_ffmpeg.cc | 21 | ||||
-rw-r--r-- | media/base/mock_ffmpeg.h | 9 | ||||
-rw-r--r-- | third_party/ffmpeg/avcodec-52.sigs | 3 | ||||
-rwxr-xr-x | third_party/ffmpeg/ffmpeg.gyp | 1 | ||||
-rw-r--r-- | third_party/ffmpeg/source/config/Chrome/linux/ia32/config.h | 6 | ||||
-rw-r--r-- | third_party/ffmpeg/source/config/Chrome/linux/x64/config.h | 6 | ||||
-rw-r--r-- | third_party/ffmpeg/source/config/Chrome/mac/ia32/config.h | 6 |
7 files changed, 43 insertions, 9 deletions
diff --git a/media/base/mock_ffmpeg.cc b/media/base/mock_ffmpeg.cc index d9879b1..40be225 100644 --- a/media/base/mock_ffmpeg.cc +++ b/media/base/mock_ffmpeg.cc @@ -122,6 +122,27 @@ int avcodec_decode_video2(AVCodecContext* avctx, AVFrame* picture, AVCodecDecodeVideo2(avctx, picture, got_picture_ptr, avpkt); } +AVBitStreamFilterContext* av_bitstream_filter_init(const char* name) { + return media::MockFFmpeg::get()->AVBitstreamFilterInit(name); +} + +int av_bitstream_filter_filter(AVBitStreamFilterContext* bsfc, + AVCodecContext* avctx, + const char* args, + uint8_t** poutbuf, + int* poutbuf_size, + const uint8_t* buf, + int buf_size, + int keyframe) { + return media::MockFFmpeg::get()-> + AVBitstreamFilterFilter(bsfc, avctx, args, poutbuf, poutbuf_size, buf, + buf_size, keyframe); +} + +void av_bitstream_filter_close(AVBitStreamFilterContext* bsf) { + return media::MockFFmpeg::get()->AVBitstreamFilterClose(bsf); +} + int av_open_input_file(AVFormatContext** format, const char* filename, AVInputFormat* input_format, int buffer_size, AVFormatParameters* parameters) { diff --git a/media/base/mock_ffmpeg.h b/media/base/mock_ffmpeg.h index eb3c86b..cfa9a1e 100644 --- a/media/base/mock_ffmpeg.h +++ b/media/base/mock_ffmpeg.h @@ -16,6 +16,8 @@ class MockFFmpeg { MockFFmpeg(); virtual ~MockFFmpeg(); + // TODO(ajwong): Organize this class, and make sure that all mock entrypoints + // are still used. MOCK_METHOD0(AVCodecInit, void()); MOCK_METHOD1(AVRegisterProtocol, int(URLProtocol* protocol)); MOCK_METHOD0(AVRegisterAll, void()); @@ -29,6 +31,13 @@ class MockFFmpeg { MOCK_METHOD4(AVCodecDecodeVideo2, int(AVCodecContext* avctx, AVFrame* picture, int* got_picture_ptr, AVPacket* avpkt)); + MOCK_METHOD1(AVBitstreamFilterInit, + AVBitStreamFilterContext*(const char *name)); + MOCK_METHOD8(AVBitstreamFilterFilter, + int(AVBitStreamFilterContext* bsfc, AVCodecContext* avctx, + const char* args, uint8_t** poutbuf, int* poutbuf_size, + const uint8_t* buf, int buf_size, int keyframe)); + MOCK_METHOD1(AVBitstreamFilterClose, void(AVBitStreamFilterContext* bsf)); MOCK_METHOD5(AVOpenInputFile, int(AVFormatContext** format, const char* filename, diff --git a/third_party/ffmpeg/avcodec-52.sigs b/third_party/ffmpeg/avcodec-52.sigs index a7474c8..2458e3a 100644 --- a/third_party/ffmpeg/avcodec-52.sigs +++ b/third_party/ffmpeg/avcodec-52.sigs @@ -18,3 +18,6 @@ void av_init_packet(AVPacket *pkt); int av_dup_packet(AVPacket *pkt); void avcodec_flush_buffers(AVCodecContext *avctx); void avcodec_init(void); +AVBitStreamFilterContext *av_bitstream_filter_init(const char *name); +int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe); +void av_bitstream_filter_close(AVBitStreamFilterContext *bsf); diff --git a/third_party/ffmpeg/ffmpeg.gyp b/third_party/ffmpeg/ffmpeg.gyp index 9a2eb1e..ced0572 100755 --- a/third_party/ffmpeg/ffmpeg.gyp +++ b/third_party/ffmpeg/ffmpeg.gyp @@ -81,6 +81,7 @@ 'source/patched-ffmpeg-mt/libavcodec/fft.c', 'source/patched-ffmpeg-mt/libavcodec/golomb.c', 'source/patched-ffmpeg-mt/libavcodec/h264.c', + 'source/patched-ffmpeg-mt/libavcodec/h264_mp4toannexb_bsf.c', 'source/patched-ffmpeg-mt/libavcodec/h264_parser.c', 'source/patched-ffmpeg-mt/libavcodec/h264idct.c', 'source/patched-ffmpeg-mt/libavcodec/h264pred.c', diff --git a/third_party/ffmpeg/source/config/Chrome/linux/ia32/config.h b/third_party/ffmpeg/source/config/Chrome/linux/ia32/config.h index c53c578..ad299e0 100644 --- a/third_party/ffmpeg/source/config/Chrome/linux/ia32/config.h +++ b/third_party/ffmpeg/source/config/Chrome/linux/ia32/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -#define FFMPEG_CONFIGURATION "--disable-ffmpeg --disable-ffplay --disable-ffserver --enable-shared --disable-static --disable-debug --enable-pthreads --disable-network --disable-encoders --disable-decoders --disable-hwaccels --disable-muxers --disable-demuxers --disable-parsers --disable-bsfs --disable-protocols --disable-devices --disable-filters --enable-decoder=aac --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=theora --enable-decoder=vorbis --enable-demuxer=mp3 --enable-demuxer=mov --enable-demuxer=ogg --enable-parser=mpegaudio --prefix=/tmp/nothing --enable-yasm --arch=i686 --extra-cflags=-m32 --extra-ldflags=-m32" +#define FFMPEG_CONFIGURATION "--disable-ffmpeg --disable-ffplay --disable-ffserver --enable-shared --disable-static --disable-debug --enable-pthreads --disable-network --disable-encoders --disable-decoders --disable-hwaccels --disable-muxers --disable-demuxers --disable-parsers --disable-bsfs --disable-protocols --disable-devices --disable-filters --enable-decoder=aac --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=theora --enable-decoder=vorbis --enable-demuxer=mp3 --enable-demuxer=mov --enable-demuxer=ogg --enable-parser=mpegaudio --enable-bsf=h264_mp4toannexb --prefix=/tmp/nothing --enable-yasm --arch=i686 --extra-cflags=-m32 --extra-ldflags=-m32" #define FFMPEG_DATADIR "/tmp/nothing/share/ffmpeg" #define ARCH_ALPHA 0 #define ARCH_ARM 0 @@ -101,7 +101,7 @@ #define HAVE_WINSOCK2_H 0 #define HAVE_XFORM_ASM 0 #define HAVE_YASM 1 -#define CONFIG_BSFS 0 +#define CONFIG_BSFS 1 #define CONFIG_DECODERS 1 #define CONFIG_DEMUXERS 1 #define CONFIG_ENCODERS 0 @@ -518,7 +518,7 @@ #define CONFIG_VC1_PARSER 0 #define CONFIG_VP3_PARSER 0 #define CONFIG_DUMP_EXTRADATA_BSF 0 -#define CONFIG_H264_MP4TOANNEXB_BSF 0 +#define CONFIG_H264_MP4TOANNEXB_BSF 1 #define CONFIG_IMX_DUMP_HEADER_BSF 0 #define CONFIG_MJPEGA_DUMP_HEADER_BSF 0 #define CONFIG_MP3_HEADER_COMPRESS_BSF 0 diff --git a/third_party/ffmpeg/source/config/Chrome/linux/x64/config.h b/third_party/ffmpeg/source/config/Chrome/linux/x64/config.h index 7169b3d..2ce3f54 100644 --- a/third_party/ffmpeg/source/config/Chrome/linux/x64/config.h +++ b/third_party/ffmpeg/source/config/Chrome/linux/x64/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -#define FFMPEG_CONFIGURATION "--disable-ffmpeg --disable-ffplay --disable-ffserver --enable-shared --disable-static --disable-debug --enable-pthreads --disable-network --disable-encoders --disable-decoders --disable-hwaccels --disable-muxers --disable-demuxers --disable-parsers --disable-bsfs --disable-protocols --disable-devices --disable-filters --enable-decoder=aac --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=theora --enable-decoder=vorbis --enable-demuxer=mp3 --enable-demuxer=mov --enable-demuxer=ogg --enable-parser=mpegaudio --prefix=./chrome-ffmpeg" +#define FFMPEG_CONFIGURATION "--disable-ffmpeg --disable-ffplay --disable-ffserver --enable-shared --disable-static --disable-debug --enable-pthreads --disable-network --disable-encoders --disable-decoders --disable-hwaccels --disable-muxers --disable-demuxers --disable-parsers --disable-bsfs --disable-protocols --disable-devices --disable-filters --enable-decoder=aac --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=theora --enable-decoder=vorbis --enable-demuxer=mp3 --enable-demuxer=mov --enable-demuxer=ogg --enable-parser=mpegaudio --enable-bsf=h264_mp4toannexb --prefix=./chrome-ffmpeg" #define FFMPEG_DATADIR "./chrome-ffmpeg/share/ffmpeg" #define ARCH_ALPHA 0 #define ARCH_ARM 0 @@ -101,7 +101,7 @@ #define HAVE_WINSOCK2_H 0 #define HAVE_XFORM_ASM 0 #define HAVE_YASM 1 -#define CONFIG_BSFS 0 +#define CONFIG_BSFS 1 #define CONFIG_DECODERS 1 #define CONFIG_DEMUXERS 1 #define CONFIG_ENCODERS 0 @@ -518,7 +518,7 @@ #define CONFIG_VC1_PARSER 0 #define CONFIG_VP3_PARSER 0 #define CONFIG_DUMP_EXTRADATA_BSF 0 -#define CONFIG_H264_MP4TOANNEXB_BSF 0 +#define CONFIG_H264_MP4TOANNEXB_BSF 1 #define CONFIG_IMX_DUMP_HEADER_BSF 0 #define CONFIG_MJPEGA_DUMP_HEADER_BSF 0 #define CONFIG_MP3_HEADER_COMPRESS_BSF 0 diff --git a/third_party/ffmpeg/source/config/Chrome/mac/ia32/config.h b/third_party/ffmpeg/source/config/Chrome/mac/ia32/config.h index 05e939d..fd827c7 100644 --- a/third_party/ffmpeg/source/config/Chrome/mac/ia32/config.h +++ b/third_party/ffmpeg/source/config/Chrome/mac/ia32/config.h @@ -1,7 +1,7 @@ /* Automatically generated by configure - do not modify! */ #ifndef FFMPEG_CONFIG_H #define FFMPEG_CONFIG_H -#define FFMPEG_CONFIGURATION "--disable-ffmpeg --disable-ffplay --disable-ffserver --enable-shared --disable-static --disable-debug --enable-pthreads --disable-network --disable-encoders --disable-decoders --disable-hwaccels --disable-muxers --disable-demuxers --disable-parsers --disable-bsfs --disable-protocols --disable-devices --disable-filters --enable-decoder=aac --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=theora --enable-decoder=vorbis --enable-demuxer=mp3 --enable-demuxer=mov --enable-demuxer=ogg --enable-parser=mpegaudio --prefix=/tmp/nothing" +#define FFMPEG_CONFIGURATION "--disable-ffmpeg --disable-ffplay --disable-ffserver --enable-shared --disable-static --disable-debug --enable-pthreads --disable-network --disable-encoders --disable-decoders --disable-hwaccels --disable-muxers --disable-demuxers --disable-parsers --disable-bsfs --disable-protocols --disable-devices --disable-filters --enable-decoder=aac --enable-decoder=h264 --enable-decoder=mp3 --enable-decoder=theora --enable-decoder=vorbis --enable-demuxer=mp3 --enable-demuxer=mov --enable-demuxer=ogg --enable-parser=mpegaudio --enable-bsf=h264_mp4toannexb --prefix=/tmp/nothing" #define FFMPEG_DATADIR "/tmp/nothing/share/ffmpeg" #define ARCH_ALPHA 0 #define ARCH_ARM 0 @@ -101,7 +101,7 @@ #define HAVE_WINSOCK2_H 0 #define HAVE_XFORM_ASM 0 #define HAVE_YASM 1 -#define CONFIG_BSFS 0 +#define CONFIG_BSFS 1 #define CONFIG_DECODERS 1 #define CONFIG_DEMUXERS 1 #define CONFIG_ENCODERS 0 @@ -518,7 +518,7 @@ #define CONFIG_VC1_PARSER 0 #define CONFIG_VP3_PARSER 0 #define CONFIG_DUMP_EXTRADATA_BSF 0 -#define CONFIG_H264_MP4TOANNEXB_BSF 0 +#define CONFIG_H264_MP4TOANNEXB_BSF 1 #define CONFIG_IMX_DUMP_HEADER_BSF 0 #define CONFIG_MJPEGA_DUMP_HEADER_BSF 0 #define CONFIG_MP3_HEADER_COMPRESS_BSF 0 |