From: ddennedy Date: Thu, 18 Dec 2008 07:37:29 +0000 (+0000) Subject: avformat/configure, avformat/Makefile, avformat/factory.c: add configure option X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=20e57e509a9849d166c4e3d9805746788a275ab7;p=melted avformat/configure, avformat/Makefile, avformat/factory.c: add configure option --avformat-no-codecs, which will build the avformat module without the producer and consumer - useful to people who want to make a version entirely without including FFmpeg's codecs, which present patent royalty licensing issues. git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1271 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/modules/avformat/Makefile b/src/modules/avformat/Makefile index a2ff738..6a6dd5c 100644 --- a/src/modules/avformat/Makefile +++ b/src/modules/avformat/Makefile @@ -4,12 +4,16 @@ include config.mak TARGET = ../libmltavformat$(LIBSUF) OBJS = factory.o \ - producer_avformat.o \ - consumer_avformat.o \ filter_avcolour_space.o \ filter_avresample.o \ filter_avdeinterlace.o +ifdef CODECS +OBJS += producer_avformat.o \ + consumer_avformat.o +CFLAGS += -DCODECS +endif + CFLAGS+=-I../.. LDFLAGS+=-L../../framework diff --git a/src/modules/avformat/configure b/src/modules/avformat/configure index 5ab6e7d..27b65ce 100755 --- a/src/modules/avformat/configure +++ b/src/modules/avformat/configure @@ -20,6 +20,7 @@ FFMPEG/avformat options: --avformat-ldextra=libs - Provide additional libs to link with --avformat-suffix=suff - Specify a custom suffix for an ffmpeg shared build --avformat-swscale - Use ffmpeg libswcale instead of img_convert + --avformat-no-codecs - Disable the producer and consumer to avoid the FFmpeg codecs NOTE: The recommended version of FFmpeg is SVN-r$svn_rev. @@ -57,6 +58,7 @@ else export svn_ffmpeg_extra= export avformat_suffix= export swscale= + export codecs=true for i in "$@" do @@ -70,6 +72,7 @@ else --avformat-suffix=* ) avformat_suffix="${i#--avformat-suffix=}" ;; --avformat-swscale ) swscale=true ;; --avformat-swscaler ) swscale=true ;; + --avformat-no-codecs ) codecs=false ;; esac done @@ -154,5 +157,7 @@ else echo "EXTRA_LIBS=$extra_libs" >> config.mak echo "AVFORMAT_SUFFIX=$avformat_suffix" >> config.mak + [ "$codecs" = "true" ] && echo "CODECS=1" >> config.mak + exit 0 fi diff --git a/src/modules/avformat/factory.c b/src/modules/avformat/factory.c index 96af91b..7e4332c 100644 --- a/src/modules/avformat/factory.c +++ b/src/modules/avformat/factory.c @@ -96,13 +96,15 @@ static void avformat_init( ) static void *create_service( mlt_profile profile, mlt_service_type type, const char *id, void *arg ) { avformat_init( ); +#ifdef CODECS if ( !strcmp( id, "avformat" ) ) { if ( type == producer_type ) return producer_avformat_init( profile, arg ); else if ( type == consumer_type ) - return consumer_avformat_init( profile, arg ); + return consumer_avformat_init( profile, arg ); } +#endif if ( !strcmp( id, "avcolour_space" ) ) return filter_avcolour_space_init( arg ); if ( !strcmp( id, "avdeinterlace" ) ) @@ -139,12 +141,13 @@ static mlt_properties avformat_metadata( mlt_service_type type, const char *id, MLT_REPOSITORY { +#ifdef CODECS MLT_REGISTER( consumer_type, "avformat", create_service ); MLT_REGISTER( producer_type, "avformat", create_service ); + MLT_REGISTER_METADATA( producer_type, "avformat", avformat_metadata, NULL ); +#endif MLT_REGISTER( filter_type, "avcolour_space", create_service ); MLT_REGISTER( filter_type, "avcolor_space", create_service ); MLT_REGISTER( filter_type, "avdeinterlace", create_service ); MLT_REGISTER( filter_type, "avresample", create_service ); - - MLT_REGISTER_METADATA( producer_type, "avformat", avformat_metadata, NULL ); }