[Ffmpeg-devel] [PATCH] conditionally build parts of lavc

Diego Biurrun diego
Sat Jul 15 18:34:58 CEST 2006


On Sat, Jul 15, 2006 at 03:42:57PM +0100, M?ns Rullg?rd wrote:
> 
> Here's a patch that lets parts of lavc and lavf be built only if some
> enabled codec needs them.  The dependencies may need to be adjusted a
> little, and some code could be moved between files to make it work
> better, but this should be good for an initial review.
> 
> Please test and comment.
> 
> --- configure	(revision 5752)
> +++ configure	(working copy)
> @@ -2094,10 +2095,16 @@
>    echo "AMR_CFLAGS=-DIF2=1" >> config.mak
>  fi
>  
> +for codec in $DECODER_LIST $ENCODER_LIST $PARSER_LIST $DEMUXER_LIST $MUXER_LIST; do
> -for codec in $DECODER_LIST $ENCODER_LIST $PARSER_LIST $DEMUXER_LIST $MUXER_LIST; do

Hmm, cosmetic change?

> --- libavcodec/Makefile	(revision 5752)
> +++ libavcodec/Makefile	(working copy)
> @@ -8,21 +8,31 @@
>  CFLAGS=$(OPTFLAGS) -DHAVE_AV_CONFIG_H -I.. -I$(SRC_PATH)/libavutil \
>         -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE $(AMR_CFLAGS)
>  
> -OBJS= bitstream.o utils.o mem.o allcodecs.o \
> -      mpegvideo.o jrevdct.o jfdctfst.o jfdctint.o\
> -      mjpeg.o resample.o resample2.o dsputil.o \
> -      motion_est.o imgconvert.o imgresample.o \
> -      mpeg12.o mpegaudiodec.o simple_idct.o \
> -      ratecontrol.o eval.o error_resilience.o \
> -      fft.o mdct.o raw.o golomb.o cabac.o\
> -      faandct.o parser.o \
> -      vp3dsp.o h264idct.o rangecoder.o pnm.o h263.o msmpeg4.o h263dec.o \
> +OBJS= utils.o mem.o allcodecs.o \
> +      resample.o resample2.o \
> +      imgconvert.o imgresample.o \
> +      parser.o \
>        opt.o \
>        bitstream_filter.o \

Maybe it's time to put all these on single lines, they seem to get
changed once in a while.  Then again it's probably unnecessary...

> --- confdeps.mak	(revision 0)
> +++ confdeps.mak	(revision 0)
> @@ -0,0 +1,351 @@
> +or = $(if $(findstring $(1),$(foreach v,$(2),$($(v)))),echo $@,false)

That's a nice one.  Why something like OR is not directly available in
Makefiles escapes me...

> +CONFIG_AMR_NB_DECODER:
> +	@$(call or,yes,CONFIG_AMR_NB CONFIG_AMR_NB_FIXED)
> +CONFIG_AMR_NB_ENCODER:
> +	@$(call or,yes,CONFIG_AMR_NB CONFIG_AMR_NB_FIXED)

I assume this could also be solved in configure by doing something along
the lines of setting

CONFIG_AMR_NB and CONFIG_AMR_NB_FIXED
or
CONFIG_AMR_NB and CONFIG_AMR_NB_FLOAT

Diego




More information about the ffmpeg-devel mailing list