added CONFIG_AC3, CONFIG_MPGLIB, CONFIG_DECODERS and CONFIG_ENCODERS (Arpi: don't...
authorFabrice Bellard <fabrice@bellard.org>
Mon, 23 Jul 2001 20:58:31 +0000 (20:58 +0000)
committerFabrice Bellard <fabrice@bellard.org>
Mon, 23 Jul 2001 20:58:31 +0000 (20:58 +0000)
Originally committed as revision 9 to svn://svn.ffmpeg.org/ffmpeg/trunk

configure
libav/utils.c
libavcodec/Makefile
libavcodec/ac3dec.c
libavcodec/avcodec.h
libavcodec/utils.c

index df3087a..568e24d 100755 (executable)
--- 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
index 9018d0f..b29961c 100644 (file)
@@ -126,7 +126,6 @@ void register_all(void)
 {
     avcodec_init();
     avcodec_register_all();
-    avcodec_register_more();
 
     register_avformat(&mp2_format);
     register_avformat(&ac3_format);
index e6dbe85..3c79f40 100644 (file)
@@ -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
index 7332a11..ac8789b 100644 (file)
@@ -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);
-}
-
index 8516d2a..f3462aa 100644 (file)
@@ -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);
index 9497f90..39801f4 100644 (file)
@@ -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)