From 5dc7913c02c07dd97dba0fca6bac926af63dcdfc Mon Sep 17 00:00:00 2001 From: ddennedy Date: Mon, 22 Dec 2008 04:26:12 +0000 Subject: [PATCH] avformat/configure, avformat/Makfile, avformat/factory.c: Add a --avformat-no-filters configure option to facilitate building a codecs and muxers only module. Change the module filename for a no-codecs build to libmltffmpeg.so to prevent a clash with a no-filters module (libmltavformat.so). git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1283 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/avformat/Makefile | 18 +++++++++++++----- src/modules/avformat/configure | 4 ++++ src/modules/avformat/factory.c | 8 ++++++++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/modules/avformat/Makefile b/src/modules/avformat/Makefile index 0007fd9f..5c8b8afa 100644 --- a/src/modules/avformat/Makefile +++ b/src/modules/avformat/Makefile @@ -1,16 +1,23 @@ include ../../../config.mak include config.mak +ifndef CODECS +TARGET = ../libmltffmpeg$(LIBSUF) +else TARGET = ../libmltavformat$(LIBSUF) +endif -OBJS = factory.o \ - filter_avcolour_space.o \ - filter_avresample.o \ - filter_avdeinterlace.o +OBJS = factory.o +ifdef FILTERS +OBJS += filter_avcolour_space.o \ + filter_avresample.o \ + filter_avdeinterlace.o ifdef SWSCALE OBJS += filter_swscale.o endif +CFLAGS += -DFILTERS +endif ifdef CODECS OBJS += producer_avformat.o \ @@ -58,7 +65,7 @@ distclean: clean clean: #if [ $(LOCAL_FFMPEG) ] ; then $(MAKE) -C ffmpeg clean ; fi - rm -f $(OBJS) $(TARGET) + rm -f $(OBJS) ../libmltffmpeg$(LIBSUF) ../libmltavformat$(LIBSUF) install: all install -m 755 $(TARGET) "$(DESTDIR)$(libdir)/mlt" @@ -67,6 +74,7 @@ install: all uninstall: rm "$(DESTDIR)$(libdir)/mlt/libmltavformat$(LIBSUF)" + rm "$(DESTDIR)$(libdir)/mlt/libmltffmpeg$(LIBSUF)" rm -rf "$(DESTDIR)$(prefix)/share/mlt/avformat" ifneq ($(wildcard .depend),) diff --git a/src/modules/avformat/configure b/src/modules/avformat/configure index 27b65ce9..365cb2cf 100755 --- a/src/modules/avformat/configure +++ b/src/modules/avformat/configure @@ -21,6 +21,7 @@ FFMPEG/avformat options: --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 + --avformat-no-filters - Disable the filters to make a codecs+muxers-only plugin NOTE: The recommended version of FFmpeg is SVN-r$svn_rev. @@ -59,6 +60,7 @@ else export avformat_suffix= export swscale= export codecs=true + export filters=true for i in "$@" do @@ -73,6 +75,7 @@ else --avformat-swscale ) swscale=true ;; --avformat-swscaler ) swscale=true ;; --avformat-no-codecs ) codecs=false ;; + --avformat-no-filters ) filters=false ;; esac done @@ -158,6 +161,7 @@ else echo "EXTRA_LIBS=$extra_libs" >> config.mak echo "AVFORMAT_SUFFIX=$avformat_suffix" >> config.mak [ "$codecs" = "true" ] && echo "CODECS=1" >> config.mak + [ "$filters" = "true" ] && echo "FILTERS=1" >> config.mak exit 0 fi diff --git a/src/modules/avformat/factory.c b/src/modules/avformat/factory.c index 0952a95c..992b9f24 100644 --- a/src/modules/avformat/factory.c +++ b/src/modules/avformat/factory.c @@ -106,14 +106,18 @@ static void *create_service( mlt_profile profile, mlt_service_type type, const c return consumer_avformat_init( profile, arg ); } #endif +#ifdef FILTERS if ( !strcmp( id, "avcolour_space" ) ) return filter_avcolour_space_init( arg ); if ( !strcmp( id, "avdeinterlace" ) ) return filter_avdeinterlace_init( arg ); if ( !strcmp( id, "avresample" ) ) return filter_avresample_init( arg ); +#ifdef SWSCALE if ( !strcmp( id, "swscale" ) ) return filter_swscale_init( profile, arg ); +#endif +#endif return NULL; } @@ -149,9 +153,13 @@ MLT_REPOSITORY MLT_REGISTER( producer_type, "avformat", create_service ); MLT_REGISTER_METADATA( producer_type, "avformat", avformat_metadata, NULL ); #endif +#ifdef FILTERS 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 ); +#ifdef SWSCALE MLT_REGISTER( filter_type, "swscale", create_service ); +#endif +#endif } -- 2.39.2