From d771bcae33d7503796235d2199186a821582cd09 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Mon, 23 Jul 2001 20:58:31 +0000 Subject: [PATCH] added CONFIG_AC3, CONFIG_MPGLIB, CONFIG_DECODERS and CONFIG_ENCODERS (Arpi: don't forget to put CONFIG_DECODERS in mplayer) Originally committed as revision 9 to svn://svn.ffmpeg.org/ffmpeg/trunk --- configure | 16 ++++++++++++++++ libav/utils.c | 1 - libavcodec/Makefile | 11 +++++++++++ libavcodec/ac3dec.c | 9 --------- libavcodec/avcodec.h | 1 - libavcodec/utils.c | 12 ++++++++++++ 6 files changed, 39 insertions(+), 11 deletions(-) diff --git a/configure b/configure index df3087a3a..568e24df3 100755 --- a/configure +++ b/configure @@ -74,3 +74,19 @@ if [ "$gprof" = "yes" ] ; then echo "TARGET_GPROF=yes" >> config.mak echo "#define HAVE_GPROF 1" >> config.h fi + +# if you do not want to use encoders, disable that. +echo "#define CONFIG_ENCODERS 1" >> config.h +echo "CONFIG_ENCODERS=yes" >> config.mak + +# if you do not want to use decoders, disable that. +echo "#define CONFIG_DECODERS 1" >> config.h +echo "CONFIG_DECODERS=yes" >> config.mak + +# special AC3 and MPGLIB enabling stuff in case you already have it +# without libavcodec. +echo "#define CONFIG_AC3 1" >> config.h +echo "CONFIG_AC3=yes" >> config.mak + +echo "#define CONFIG_MPGLIB 1" >> config.h +echo "CONFIG_MPGLIB=yes" >> config.mak diff --git a/libav/utils.c b/libav/utils.c index 9018d0fb8..b29961c63 100644 --- a/libav/utils.c +++ b/libav/utils.c @@ -126,7 +126,6 @@ void register_all(void) { avcodec_init(); avcodec_register_all(); - avcodec_register_more(); register_avformat(&mp2_format); register_avformat(&ac3_format); diff --git a/libavcodec/Makefile b/libavcodec/Makefile index e6dbe85be..3c79f403f 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -10,14 +10,18 @@ OBJS= common.o utils.o mpegvideo.o h263.o jrevdct.o jfdctfst.o \ ASM_OBJS= # currently using libac3 for ac3 decoding +ifeq ($(CONFIG_AC3),yes) OBJS+= ac3dec.o \ libac3/bit_allocate.o libac3/bitstream.o libac3/downmix.o \ libac3/imdct.o libac3/parse.o +endif # currently using mpglib for mpeg audio decoding +ifeq ($(CONFIG_MPGLIB),yes) OBJS+= mpegaudiodec.o \ mpglib/layer1.o mpglib/layer2.o mpglib/layer3.o \ mpglib/dct64_i386.o mpglib/decode_i386.o mpglib/tabinit.o +endif # i386 mmx specific stuff ifeq ($(TARGET_MMX),yes) @@ -71,3 +75,10 @@ imgresample-test: imgresample.c dct-test: dct-test.o jfdctfst.o i386/fdct_mmx.o i386/fdctdata.o fdctref.o $(CC) -o $@ $^ + +# +# include dependency files if they exist +# +ifneq ($(wildcard .depend),) +include .depend +endif diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 7332a11d8..ac8789b63 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -178,12 +178,3 @@ AVCodec ac3_decoder = { ac3_decode_end, ac3_decode_frame, }; - -/* register codecs which could clash with mplayer symbols */ -/* XXX: rename all symbols to avoid clashed */ -void avcodec_register_more(void) -{ - register_avcodec(&mp3_decoder); - register_avcodec(&ac3_decoder); -} - diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 8516d2a17..f3462aa17 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -174,4 +174,3 @@ int avcodec_encode_video(AVCodecContext *avctx, UINT8 *buf, int buf_size, int avcodec_close(AVCodecContext *avctx); void avcodec_register_all(void); -void avcodec_register_more(void); diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 9497f9011..39801f42c 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -244,6 +244,8 @@ void avcodec_init(void) /* simple call to use all the codecs */ void avcodec_register_all(void) { + /* encoders */ +#ifdef CONFIG_ENCODERS register_avcodec(&ac3_encoder); register_avcodec(&mp2_encoder); register_avcodec(&mpeg1video_encoder); @@ -253,15 +255,25 @@ void avcodec_register_all(void) register_avcodec(&mjpeg_encoder); register_avcodec(&opendivx_encoder); register_avcodec(&msmpeg4_encoder); +#endif /* CONFIG_ENCODERS */ register_avcodec(&pcm_codec); register_avcodec(&rawvideo_codec); + /* decoders */ +#ifdef CONFIG_DECODERS register_avcodec(&h263_decoder); register_avcodec(&opendivx_decoder); register_avcodec(&msmpeg4_decoder); register_avcodec(&mpeg_decoder); register_avcodec(&h263i_decoder); register_avcodec(&rv10_decoder); +#ifdef CONFIG_MPGLIB + register_avcodec(&mp3_decoder); +#endif +#ifdef CONFIG_AC3 + register_avcodec(&ac3_decoder); +#endif +#endif /* CONFIG_DECODERS */ } static int encode_init(AVCodecContext *s) -- 2.11.0