diff options
author | Jason Millard <jsm174@gmail.com> | 2007-05-12 23:33:53 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2007-05-12 23:33:53 +0000 |
commit | cd61e40781f7e28fe90ed258955026cff137ed97 (patch) | |
tree | 375393bb5b4fb10997e7de040c35f28611c0752c /libavcodec | |
parent | cf329752227e5a3b56b4eea75ea86e9570a81891 (diff) | |
download | ffmpeg-cd61e40781f7e28fe90ed258955026cff137ed97.tar.gz |
allow to enable or disable every bitstream filters individually
Original patch by Jason Millard jsm174 _at_ gmail
Date: On Fri, 11 May 2007 11:14:01 -0400
Subject: [FFmpeg-devel] enable/disable bitstream filters?
Originally committed as revision 9010 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/Makefile | 8 | ||||
-rw-r--r-- | libavcodec/allcodecs.c | 17 | ||||
-rw-r--r-- | libavcodec/bitstream_filter.c | 10 | ||||
-rw-r--r-- | libavcodec/mjpeg.c | 2 | ||||
-rw-r--r-- | libavcodec/mpeg12.c | 2 |
5 files changed, 32 insertions, 7 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile index ef7a6cda4c..b811f8cb5d 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -302,6 +302,14 @@ OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o +OBJS-$(CONFIG_DUMP_EXTRADATA_BSF) += bitstream_filter.o +OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF) += bitstream_filter.o +OBJS-$(CONFIG_NOISE_BSF) += bitstream_filter.o +OBJS-$(CONFIG_MP3_HEADER_COMPRESS_BSF) += bitstream_filter.o +OBJS-$(CONFIG_MP3_HEADER_DECOMPRESS_BSF) += bitstream_filter.o +OBJS-$(CONFIG_MJPEGA_DUMP_HEADER_BSF) += mjpeg.o +OBJS-$(CONFIG_IMX_DUMP_HEADER_BSF) += mpeg12.o + OBJS-$(HAVE_PTHREADS) += pthread.o OBJS-$(HAVE_W32THREADS) += w32thread.o OBJS-$(HAVE_OS2THREADS) += os2thread.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 9f639727c3..4c18f5742a 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -34,6 +34,8 @@ #define REGISTER_PARSER(X,x) \ if(ENABLE_##X##_PARSER) av_register_codec_parser(&x##_parser) +#define REGISTER_BSF(X,x) \ + if(ENABLE_##X##_BSF) av_register_bitstream_filter(&x##_bsf) /** * Register all the codecs, parsers and bitstream filters which were enabled at @@ -273,12 +275,13 @@ void avcodec_register_all(void) REGISTER_PARSER (PNM, pnm); REGISTER_PARSER (VC1, vc1); - av_register_bitstream_filter(&dump_extradata_bsf); - av_register_bitstream_filter(&remove_extradata_bsf); - av_register_bitstream_filter(&noise_bsf); - av_register_bitstream_filter(&mp3_header_compress_bsf); - av_register_bitstream_filter(&mp3_header_decompress_bsf); - av_register_bitstream_filter(&mjpega_dump_header_bsf); - av_register_bitstream_filter(&imx_dump_header_bsf); + /* bitstream filters */ + REGISTER_BSF (DUMP_EXTRADATA, dump_extradata); + REGISTER_BSF (REMOVE_EXTRADATA, remove_extradata); + REGISTER_BSF (NOISE, noise); + REGISTER_BSF (MP3_HEADER_COMPRESS, mp3_header_compress); + REGISTER_BSF (MP3_HEADER_DECOMPRESS, mp3_header_decompress); + REGISTER_BSF (MJPEGA_DUMP_HEADER, mjpega_dump_header); + REGISTER_BSF (IMX_DUMP_HEADER, imx_dump_header); } diff --git a/libavcodec/bitstream_filter.c b/libavcodec/bitstream_filter.c index 89fc4e1759..5ff9c72c4e 100644 --- a/libavcodec/bitstream_filter.c +++ b/libavcodec/bitstream_filter.c @@ -253,32 +253,42 @@ static int mp3_header_decompress(AVBitStreamFilterContext *bsfc, AVCodecContext return 1; } +#ifdef CONFIG_DUMP_EXTRADATA_BSF AVBitStreamFilter dump_extradata_bsf={ "dump_extra", 0, dump_extradata, }; +#endif +#ifdef CONFIG_REMOVE_EXTRADATA_BSF AVBitStreamFilter remove_extradata_bsf={ "remove_extra", 0, remove_extradata, }; +#endif +#ifdef CONFIG_NOISE_BSF AVBitStreamFilter noise_bsf={ "noise", sizeof(int), noise, }; +#endif +#ifdef CONFIG_MP3_HEADER_COMPRESS_BSF AVBitStreamFilter mp3_header_compress_bsf={ "mp3comp", 0, mp3_header_compress, }; +#endif +#ifdef CONFIG_MP3_HEADER_DECOMPRESS_BSF AVBitStreamFilter mp3_header_decompress_bsf={ "mp3decomp", 0, mp3_header_decompress, }; +#endif diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c index 5fa2059be3..eb95e4092c 100644 --- a/libavcodec/mjpeg.c +++ b/libavcodec/mjpeg.c @@ -2564,8 +2564,10 @@ AVCodec ljpeg_encoder = { //FIXME avoid MPV_* lossless jpeg shouldnt need them }; #endif +#ifdef CONFIG_MJPEGA_DUMP_HEADER_BSF AVBitStreamFilter mjpega_dump_header_bsf = { "mjpegadump", 0, mjpega_dump_header, }; +#endif diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 20ebcdbd3b..25fc14b4af 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -3354,6 +3354,7 @@ AVCodec mpeg_xvmc_decoder = { #endif +#ifdef CONFIG_IMX_DUMP_HEADER_BSF static int imx_dump_header(AVBitStreamFilterContext *bsfc, AVCodecContext *avctx, const char *args, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size, int keyframe) @@ -3382,6 +3383,7 @@ AVBitStreamFilter imx_dump_header_bsf = { 0, imx_dump_header, }; +#endif /* this is ugly i know, but the alternative is too make hundreds of vars global and prefix them with ff_mpeg1_ |