mlt_repository.[hc]:
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Wed, 6 Feb 2008 08:58:48 +0000 (08:58 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Wed, 6 Feb 2008 08:58:48 +0000 (08:58 +0000)
  - dynamically locate and register modules instead of reading .dat files
  - added mlt_repository_register() and macros for modules and apps(!) to
    register their service factory functions
mlt_factory.[hc]: change mlt_factory_init() to return mlt_repository to app
mlt_properties.c: let mlt_properties_dir_list() take a NULL filter pattern
src/modules/*:
  - adapt to new module registration system - much simpler!
  - remove unncessary configure scripts (now optional!)

git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1058 d19143bc-622f-0410-bfdd-b5b2a6649095

56 files changed:
src/framework/mlt.h
src/framework/mlt_factory.c
src/framework/mlt_factory.h
src/framework/mlt_properties.c
src/framework/mlt_repository.c
src/framework/mlt_repository.h
src/modules/Makefile
src/modules/avformat/configure
src/modules/avformat/factory.c
src/modules/configure
src/modules/core/configure [deleted file]
src/modules/core/factory.c
src/modules/dv/configure
src/modules/dv/factory.c
src/modules/effectv/configure [deleted file]
src/modules/effectv/factory.c
src/modules/feeds/configure [deleted file]
src/modules/fezzik/configure [deleted file]
src/modules/fezzik/factory.c
src/modules/gtk2/configure
src/modules/gtk2/factory.c
src/modules/inigo/configure [deleted file]
src/modules/inigo/factory.c
src/modules/inigo/producer_inigo.c
src/modules/jackrack/configure
src/modules/jackrack/factory.c
src/modules/kdenlive/configure [deleted file]
src/modules/kdenlive/factory.c
src/modules/kino/configure
src/modules/kino/factory.c
src/modules/motion_est/configure
src/modules/motion_est/factory.c
src/modules/normalize/configure [deleted file]
src/modules/normalize/factory.c
src/modules/oldfilm/configure [deleted file]
src/modules/oldfilm/factory.c
src/modules/plus/configure [deleted file]
src/modules/plus/factory.c
src/modules/qimage/configure
src/modules/qimage/factory.c
src/modules/resample/configure
src/modules/resample/factory.c
src/modules/sdl/configure
src/modules/sdl/factory.c
src/modules/sox/configure
src/modules/sox/factory.c
src/modules/valerie/configure [deleted file]
src/modules/valerie/factory.c
src/modules/vmfx/configure [deleted file]
src/modules/vmfx/factory.c
src/modules/vorbis/configure
src/modules/vorbis/factory.c
src/modules/westley/configure
src/modules/westley/factory.c
src/modules/xine/configure
src/modules/xine/factory.c

index 6f97443..9e4f962 100644 (file)
@@ -42,6 +42,7 @@ extern "C"
 #include "mlt_parser.h"
 #include "mlt_geometry.h"
 #include "mlt_profile.h"
+#include "mlt_repository.h"
 
 #ifdef __cplusplus
 }
index d81c0c2..ec885b6 100644 (file)
 
 static char *mlt_prefix = NULL;
 static mlt_properties global_properties = NULL;
-static mlt_properties object_list = NULL;
-static mlt_repository producers = NULL;
-static mlt_repository filters = NULL;
-static mlt_repository transitions = NULL;
-static mlt_repository consumers = NULL;
+static mlt_repository repository = NULL;
 static mlt_properties event_object = NULL;
 static int unique_id = 0;
 
@@ -59,7 +55,7 @@ static void mlt_factory_create_done( mlt_listener listener, mlt_properties owner
 /** Construct the factories.
 */
 
-int mlt_factory_init( const char *prefix )
+mlt_repository mlt_factory_init( const char *prefix )
 {
        // Only initialise once
        if ( mlt_prefix == NULL )
@@ -93,14 +89,8 @@ int mlt_factory_init( const char *prefix )
                // Create the global properties
                global_properties = mlt_properties_new( );
 
-               // Create the object list.
-               object_list = mlt_properties_new( );
-
-               // Create a repository for each service type
-               producers = mlt_repository_init( object_list, prefix, "producers", "mlt_create_producer" );
-               filters = mlt_repository_init( object_list, prefix, "filters", "mlt_create_filter" );
-               transitions = mlt_repository_init( object_list, prefix, "transitions", "mlt_create_transition" );
-               consumers = mlt_repository_init( object_list, prefix, "consumers", "mlt_create_consumer" );
+               // Create the repository of services
+               repository = mlt_repository_init( prefix );
 
                // Force a clean up when app closes
                atexit( mlt_factory_close );
@@ -118,7 +108,7 @@ int mlt_factory_init( const char *prefix )
        }
 
 
-       return 0;
+       return repository;
 }
 
 /** Fetch the events object.
@@ -186,7 +176,7 @@ mlt_producer mlt_factory_producer( mlt_profile profile, const char *service, voi
        // Try to instantiate via the specified service
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( producers, profile, producer_type, service, input );
+               obj = mlt_repository_fetch( repository, profile, producer_type, service, input );
                mlt_events_fire( event_object, "producer-create-done", service, input, obj, NULL );
                if ( obj != NULL )
                {
@@ -209,7 +199,7 @@ mlt_filter mlt_factory_filter( mlt_profile profile, const char *service, void *i
 
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( filters, profile, filter_type, service, input );
+               obj = mlt_repository_fetch( repository, profile, filter_type, service, input );
                mlt_events_fire( event_object, "filter-create-done", service, input, obj, NULL );
        }
 
@@ -233,7 +223,7 @@ mlt_transition mlt_factory_transition( mlt_profile profile, const char *service,
 
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( transitions, profile, filter_type, service, input );
+               obj = mlt_repository_fetch( repository, profile, transition_type, service, input );
                mlt_events_fire( event_object, "transition-create-done", service, input, obj, NULL );
        }
 
@@ -260,7 +250,7 @@ mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *service, voi
 
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( consumers, profile, consumer_type, service, input );
+               obj = mlt_repository_fetch( repository, profile, consumer_type, service, input );
                mlt_events_fire( event_object, "consumer-create-done", service, input, obj, NULL );
        }
 
@@ -290,12 +280,8 @@ void mlt_factory_close( )
        if ( mlt_prefix != NULL )
        {
                mlt_properties_close( event_object );
-               mlt_repository_close( producers );
-               mlt_repository_close( filters );
-               mlt_repository_close( transitions );
-               mlt_repository_close( consumers );
                mlt_properties_close( global_properties );
-               mlt_properties_close( object_list );
+               mlt_repository_close( repository );
                free( mlt_prefix );
                mlt_prefix = NULL;
                mlt_pool_close( );
index d302521..82dc3ef 100644 (file)
@@ -23,8 +23,9 @@
 
 #include "mlt_types.h"
 #include "mlt_profile.h"
+#include "mlt_repository.h"
 
-extern int mlt_factory_init( const char *prefix );
+extern mlt_repository mlt_factory_init( const char *prefix );
 extern const char *mlt_factory_prefix( );
 extern char *mlt_environment( const char *name );
 extern int mlt_environment_set( const char *name, const char *value );
index c90c132..47e7fb0 100644 (file)
@@ -844,7 +844,9 @@ int mlt_properties_dir_list( mlt_properties this, const char *dirname, const cha
                {
                        sprintf( key, "%d", mlt_properties_count( this ) );
                        snprintf( fullname, 1024, "%s/%s", dirname, de->d_name );
-                       if ( de->d_name[ 0 ] != '.' && mlt_fnmatch( pattern, de->d_name ) )
+                       if ( pattern == NULL )
+                               mlt_properties_set( this, key, fullname );
+                       else if ( de->d_name[ 0 ] != '.' && mlt_fnmatch( pattern, de->d_name ) )
                                mlt_properties_set( this, key, fullname );
                        de = readdir( dir );
                }
index 826268d..7f474f3 100644 (file)
 
 struct mlt_repository_s
 {
-       struct mlt_properties_s parent;
+       struct mlt_properties_s parent; // a list of object files
+       mlt_properties consumers; // lists of entry points
+       mlt_properties filters;
+       mlt_properties producers;
+       mlt_properties transitions;
 };
 
-static char *construct_full_file( char *output, const char *prefix, const char *file )
+mlt_repository mlt_repository_init( const char *prefix )
 {
-       strcpy( output, prefix );
-       if ( prefix[ strlen( prefix ) - 1 ] != '/' )
-               strcat( output, "/" );
-       strcat( output, file );
-       return output;
-}
-
-static char *chomp( char *input )
-{
-       if ( input[ strlen( input ) - 1 ] == '\n' )
-               input[ strlen( input ) - 1 ] = '\0';
-       return input;
-}
-
-static mlt_properties construct_object( const char *prefix, const char *id )
-{
-       mlt_properties output = mlt_properties_new( );
-       mlt_properties_set( output, "prefix", prefix );
-       mlt_properties_set( output, "id", id );
-       return output;
-}
-
-static mlt_properties construct_service( mlt_properties object, const char *id )
-{
-       mlt_properties output = mlt_properties_new( );
-       mlt_properties_set_data( output, "object", object, 0, NULL, NULL );
-       mlt_properties_set( output, "id", id );
-       return output;
-}
-
-static void *construct_instance( mlt_properties service_properties, mlt_profile profile, mlt_service_type type, const char *symbol, void *input )
-{
-       // Extract the service
-       char *service = mlt_properties_get( service_properties, "id" );
-
-       // Get the object properties
-       void *object_properties = mlt_properties_get_data( service_properties, "object", NULL );
-
-       // Get the dlopen'd object
-       void *object = mlt_properties_get_data( object_properties, "dlopen", NULL );
-
-       // Get the dlsym'd symbol
-       void *( *symbol_ptr )( mlt_profile, mlt_service_type, const char *, void * ) = mlt_properties_get_data( object_properties, symbol, NULL );
-
-       // Check that we have object and open if we don't
-       if ( object == NULL )
+       // Construct the repository
+       mlt_repository this = calloc( sizeof( struct mlt_repository_s ), 1 );
+       mlt_properties_init( &this->parent, this );
+       this->consumers = mlt_properties_new();
+       this->filters = mlt_properties_new();
+       this->producers = mlt_properties_new();
+       this->transitions = mlt_properties_new();
+       
+       // Get the directory list
+       mlt_properties dir = mlt_properties_new();
+       int count = mlt_properties_dir_list( dir, prefix, NULL, 0 );
+       int i;
+       
+       // Iterate over files
+       for ( i = 0; i < count; i++ )
        {
-               char full_file[ 512 ];
-
-               // Get the prefix and id of the shared object
-               char *prefix = mlt_properties_get( object_properties, "prefix" );
-               char *file = mlt_properties_get( object_properties, "id" );
                int flags = RTLD_NOW;
+               const char *object_name = mlt_properties_get_value( dir, i);
 
                // Very temporary hack to allow the quicktime plugins to work
                // TODO: extend repository to allow this to be used on a case by case basis
-               if ( !strcmp( service, "kino" ) )
+               if ( strstr( object_name, "libmltkino" ) )
                        flags |= RTLD_GLOBAL;
 
-               // Construct the full file
-               construct_full_file( full_file, prefix, file );
-
                // Open the shared object
-               object = dlopen( full_file, flags );
+               void *object = dlopen( object_name, flags );            
                if ( object != NULL )
                {
-                       // Set it on the properties
-                       mlt_properties_set_data( object_properties, "dlopen", object, 0, ( mlt_destructor )dlclose, NULL );
-               }
-               else
-               {
-                       fprintf( stderr, "Failed to load plugin: %s\n", dlerror() );
+                       // Get the registration function
+                       int ( *symbol_ptr )( mlt_repository ) = dlsym( object, "mlt_register" );
+                       
+                       // Call the registration function
+                       if ( symbol_ptr != NULL )
+                       {
+                               symbol_ptr( this );
+                               
+                               // Register the object file for closure
+                               mlt_properties_set_data( &this->parent, object_name, object, 0, ( mlt_destructor )dlclose, NULL );
+                       }
+                       else
+                       {
+                               dlclose( object );
+                       }
                }
        }
-
-       // Now check if we have this symbol pointer
-       if ( object != NULL && symbol_ptr == NULL )
-       {
-               // Construct it now
-               symbol_ptr = dlsym( object, symbol );
-
-               // Set it on the properties
-               mlt_properties_set_data( object_properties, "dlsym", symbol_ptr, 0, NULL, NULL );
-       }
-
-       // Construct the service
-       return symbol_ptr != NULL ? symbol_ptr( profile, type, service, input ) : NULL;
+       
+       return this;
 }
 
-mlt_repository mlt_repository_init( mlt_properties object_list, const char *prefix, const char *data, const char *symbol )
+void mlt_repository_register( mlt_repository this, mlt_service_type service_type, const char *service, void *symbol )
 {
-       char full_file[ 512 ];
-       FILE *file;
-
-       // Construct the repository
-       mlt_repository this = calloc( sizeof( struct mlt_repository_s ), 1 );
-       mlt_properties_init( &this->parent, this );
-
-       // Add the symbol to THIS repository properties.
-       mlt_properties_set( &this->parent, "_symbol", symbol );
-
-       // Construct full file
-       construct_full_file( full_file, prefix, data );
-       strcat( full_file, ".dat" );
-
-       // Open the file
-       file = fopen( full_file, "r" );
-
-       // Parse the contents
-       if ( file != NULL )
+       // Add the entry point to the corresponding service list
+       switch ( service_type )
        {
-               char full[ 512 ];
-               char service[ 256 ];
-               char object[ 256 ];
-
-               while( fgets( full, 512, file ) )
-               {
-                       chomp( full );
-
-                       if ( full[ 0 ] != '#' && full[ 0 ] != '\0' && sscanf( full, "%s %s", service, object ) == 2 )
-                       {
-                               // Get the object properties first
-                               mlt_properties object_properties = mlt_properties_get_data( object_list, object, NULL );
-
-                               // If their are no properties, create them now
-                               if ( object_properties == NULL )
-                               {
-                                       // Construct the object
-                                       object_properties = construct_object( prefix, object );
-
-                                       // Add it to the object list
-                                       mlt_properties_set_data( object_list, object, object_properties, 0, ( mlt_destructor )mlt_properties_close, NULL );
-                               }
-
-                               // Now construct a property for the service
-                               mlt_properties service_properties = construct_service( object_properties, service );
-
-                               // Add it to the repository
-                               mlt_properties_set_data( &this->parent, service, service_properties, 0, ( mlt_destructor )mlt_properties_close, NULL );
-                       }
-               }
-
-               // Close the file
-               fclose( file );
+               case consumer_type:
+                       mlt_properties_set_data( this->consumers, service, symbol, 0, NULL, NULL );
+                       break;
+               case filter_type:
+                       mlt_properties_set_data( this->filters, service, symbol, 0, NULL, NULL );
+                       break;
+               case producer_type:
+                       mlt_properties_set_data( this->producers, service, symbol, 0, NULL, NULL );
+                       break;
+               case transition_type:
+                       mlt_properties_set_data( this->transitions, service, symbol, 0, NULL, NULL );
+                       break;
+               default:
+                       break;
        }
-
-       return this;
 }
 
 void *mlt_repository_fetch( mlt_repository this, mlt_profile profile, mlt_service_type type, const char *service, void *input )
 {
-       // Get the service properties
-       mlt_properties service_properties = mlt_properties_get_data( &this->parent, service, NULL );
+       void *( *symbol_ptr )( mlt_profile, mlt_service_type, const char *, void * ) = NULL;
 
-       // If the service exists
-       if ( service_properties != NULL )
+       // Get the entry point from the corresponding service list
+       switch ( type )
        {
-               // Get the symbol that is used to generate this service
-               char *symbol = mlt_properties_get( &this->parent, "_symbol" );
-
-               // Now get an instance of the service
-               return construct_instance( service_properties, profile, type, symbol, input );
+               case consumer_type:
+                       symbol_ptr = mlt_properties_get_data( this->consumers, service, NULL );
+                       break;
+               case filter_type:
+                       symbol_ptr = mlt_properties_get_data( this->filters, service, NULL );
+                       break;
+               case producer_type:
+                       symbol_ptr = mlt_properties_get_data( this->producers, service, NULL );
+                       break;
+               case transition_type:
+                       symbol_ptr = mlt_properties_get_data( this->transitions, service, NULL );
+                       break;
+               default:
+                       break;
        }
-
-       return NULL;
+       
+       // Construct the service
+       return ( symbol_ptr != NULL ) ? symbol_ptr( profile, type, service, input ) : NULL;
 }
 
 void mlt_repository_close( mlt_repository this )
 {
+       mlt_properties_close( this->consumers );
+       mlt_properties_close( this->filters );
+       mlt_properties_close( this->producers );
+       mlt_properties_close( this->transitions );
        mlt_properties_close( &this->parent );
        free( this );
 }
-
-
index f4b2e2c..c4e4142 100644 (file)
 
 typedef struct mlt_repository_s *mlt_repository;
 
+/** This macro can be used to register services if the function is declared as 
+*   void mlt_register( mlt_repository )
+*/
+#define MLT_REPOSITORY void mlt_register( mlt_repository repository )
+#define MLT_REGISTER( type, service, symbol  ) ( mlt_repository_register( repository, (type), (service), (symbol) ) )
+
 /** Public functions.
 */
 
-extern mlt_repository mlt_repository_init( mlt_properties object_list, const char *prefix, const char *file, const char *symbol );
+extern mlt_repository mlt_repository_init( const char *prefix );
+extern void mlt_repository_register( mlt_repository self, mlt_service_type service_type, const char *service, void *symbol );
 extern void *mlt_repository_fetch( mlt_repository self, mlt_profile profile, mlt_service_type type, const char *service, void *input );
 extern void mlt_repository_close( mlt_repository self );
 
index 251806a..fcbf3ea 100644 (file)
@@ -19,7 +19,6 @@ distclean:
        done
 
 install:
-       install -m 644 producers.dat filters.dat transitions.dat consumers.dat "$(DESTDIR)$(libdir)/mlt"
        list='$(SUBDIRS)'; \
        for subdir in $$list; do \
                if [ -f $$subdir/Makefile -a ! -f disable-$$subdir ] ; \
index eace4d0..e52d58e 100755 (executable)
@@ -141,19 +141,5 @@ else
        echo "EXTRA_LIBS=$extra_libs" >> config.mak
        echo "AVFORMAT_SUFFIX=$avformat_suffix" >> config.mak
 
-cat << EOF >> ../producers.dat
-avformat               libmltavformat$LIBSUF
-EOF
-
-cat << EOF >> ../filters.dat
-avdeinterlace  libmltavformat$LIBSUF
-avresample             libmltavformat$LIBSUF
-avcolour_space libmltavformat$LIBSUF
-EOF
-
-cat << EOF >> ../consumers.dat
-avformat               libmltavformat$LIBSUF
-EOF
-
 fi
 
index c197d90..fe2d65f 100644 (file)
@@ -92,17 +92,16 @@ static void avformat_init( )
        }
 }
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
+static void *create_service( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
 {
        avformat_init( );
        if ( !strcmp( id, "avformat" ) )
-               return producer_avformat_init( profile, arg );
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
-{
-       avformat_init( );
+       {
+               if ( type == producer_type )
+                       return producer_avformat_init( profile, arg );
+               else if ( type == consumer_type )
+                       return consumer_avformat_init( profile, arg );          
+       }
        if ( !strcmp( id, "avcolour_space" ) )
                return filter_avcolour_space_init( arg );
 #ifdef USE_MMX
@@ -114,16 +113,12 @@ void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char
        return NULL;
 }
 
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
+MLT_REPOSITORY
 {
-       return NULL;
+       MLT_REGISTER( consumer_type, "avformat", create_service );
+       MLT_REGISTER( producer_type, "avformat", create_service );
+       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 );
 }
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
-{
-       avformat_init( );
-       if ( !strcmp( id, "avformat" ) )
-               return consumer_avformat_init( profile, arg );
-       return NULL;
-}
-
index ee65413..e80a585 100755 (executable)
@@ -4,7 +4,7 @@
 [ "$help" != "1" ] && rm -f disable-* producers.dat filters.dat transitions.dat consumers.dat
 
 # Create the make.inc file
-echo SUBDIRS = `find . -maxdepth 1 -type d | grep -v CVS | grep -v "^.$" | sed 's/\.\///'` > make.inc
+echo SUBDIRS = `find . -maxdepth 1 -type d | grep -v .svn | grep -v "^.$" | sed 's/\.\///'` > make.inc
 
 # Iterate through arguments
 for i in "$@"
@@ -17,16 +17,22 @@ done
 # Iterate through each of the components
 for i in *
 do
-       if [ -x $i/configure -a \( "$help" = "1" -o ! -f disable-$i \) ]
+       if [ -d $i -a \( "$help" = "1" -o ! -f disable-$i \) ]
        then
                if [ "$gpl" = "true" -o ! -f $i/gpl ]
                then
-                       [ "$help" = "0" ] && echo "Configuring modules/$i:"
-                       olddir2=`pwd`
-                       cd $i
-                       ./configure "$@"
-                       [ $? != 0 ] && exit 1
-                       cd $olddir2
+                       [ -f $i/Makefile -a "$help" = "0" ] && echo "Configuring modules/$i:"
+                       if [ -x $i/configure ]
+                       then
+                               olddir2=`pwd`
+                               cd $i
+                               ./configure "$@"
+                               [ $? != 0 ] && exit 1
+                               cd $olddir2
+                       elif [ -f $i/configure ]
+                       then
+                               echo "  configure script is not set executable!"
+                       fi
                elif [ "$help" = "0" ]
                then
                        touch disable-$i
diff --git a/src/modules/core/configure b/src/modules/core/configure
deleted file mode 100755 (executable)
index 160844b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../producers.dat
-color                  libmltcore$LIBSUF
-colour                 libmltcore$LIBSUF
-noise                  libmltcore$LIBSUF
-ppm                            libmltcore$LIBSUF
-EOF
-
-cat << EOF >> ../filters.dat
-brightness             libmltcore$LIBSUF
-channelcopy            libmltcore$LIBSUF
-data_feed              libmltcore$LIBSUF
-data_show              libmltcore$LIBSUF
-gamma                  libmltcore$LIBSUF
-greyscale              libmltcore$LIBSUF
-luma                   libmltcore$LIBSUF
-mirror                 libmltcore$LIBSUF
-mono                   libmltcore$LIBSUF
-obscure                        libmltcore$LIBSUF
-region                 libmltcore$LIBSUF
-rescale                        libmltcore$LIBSUF
-resize                 libmltcore$LIBSUF
-transition             libmltcore$LIBSUF
-watermark              libmltcore$LIBSUF
-EOF
-
-cat << EOF >> ../transitions.dat
-composite              libmltcore$LIBSUF
-luma                   libmltcore$LIBSUF
-mix                            libmltcore$LIBSUF
-region                 libmltcore$LIBSUF
-EOF
-
-cat << EOF >> ../consumers.dat
-null                   libmltcore$LIBSUF
-EOF
-
-fi
index 2c92efb..5590764 100644 (file)
@@ -45,70 +45,31 @@ extern mlt_transition transition_luma_init( mlt_profile profile, mlt_service_typ
 extern mlt_transition transition_mix_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 #include "transition_region.h"
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
+MLT_REPOSITORY
 {
-       if ( !strcmp( id, "color" ) )
-               return producer_colour_init( profile, type, id, arg );
-       if ( !strcmp( id, "colour" ) )
-               return producer_colour_init( profile, type, id, arg );
-       if ( !strcmp( id, "noise" ) )
-               return producer_noise_init( profile, type, id, arg );
-       if ( !strcmp( id, "ppm" ) )
-               return producer_ppm_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
-{
-       if ( !strcmp( id, "brightness" ) )
-               return filter_brightness_init( profile, type, id, arg );
-       if ( !strcmp( id, "channelcopy" ) )
-               return filter_channelcopy_init( profile, type, id, arg );
-       if ( !strcmp( id, "data_feed" ) )
-               return filter_data_feed_init( profile, type, id, arg );
-       if ( !strcmp( id, "data_show" ) )
-               return filter_data_show_init( profile, type, id, arg );
-       if ( !strcmp( id, "gamma" ) )
-               return filter_gamma_init( profile, type, id, arg );
-       if ( !strcmp( id, "greyscale" ) )
-               return filter_greyscale_init( profile, type, id, arg );
-       if ( !strcmp( id, "luma" ) )
-               return filter_luma_init( profile, type, id, arg );
-       if ( !strcmp( id, "mirror" ) )
-               return filter_mirror_init( profile, type, id, arg );
-       if ( !strcmp( id, "mono" ) )
-               return filter_mono_init( profile, type, id, arg );
-       if ( !strcmp( id, "obscure" ) )
-               return filter_obscure_init( profile, type, id, arg );
-       if ( !strcmp( id, "region" ) )
-               return filter_region_init( profile, type, id, arg );
-       if ( !strcmp( id, "rescale" ) )
-               return filter_rescale_init( profile, type, id, arg );
-       if ( !strcmp( id, "resize" ) )
-               return filter_resize_init( profile, type, id, arg );
-       if ( !strcmp( id, "transition" ) )
-               return filter_transition_init( profile, type, id, arg );
-       if ( !strcmp( id, "watermark" ) )
-               return filter_watermark_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
-{
-       if ( !strcmp( id, "composite" ) )
-               return transition_composite_init( profile, type, id, arg );
-       if ( !strcmp( id, "luma" ) )
-               return transition_luma_init( profile, type, id, arg );
-       if ( !strcmp( id, "mix" ) )
-               return transition_mix_init( profile, type, id, arg );
-       if ( !strcmp( id, "region" ) )
-               return transition_region_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
-{
-       if ( !strcmp( id, "null" ) )
-               return consumer_null_init( profile, type, id, arg );
-       return NULL;
+       MLT_REGISTER( consumer_type, "null", consumer_null_init );
+       MLT_REGISTER( filter_type, "brightness", filter_brightness_init );
+       MLT_REGISTER( filter_type, "channelcopy", filter_channelcopy_init );
+       MLT_REGISTER( filter_type, "data_feed", filter_data_feed_init );
+       MLT_REGISTER( filter_type, "data_show", filter_data_show_init );
+       MLT_REGISTER( filter_type, "gamma", filter_gamma_init );
+       MLT_REGISTER( filter_type, "greyscale", filter_greyscale_init );
+       MLT_REGISTER( filter_type, "grayscale", filter_greyscale_init );
+       MLT_REGISTER( filter_type, "luma", filter_luma_init );
+       MLT_REGISTER( filter_type, "mirror", filter_mirror_init );
+       MLT_REGISTER( filter_type, "mono", filter_mono_init );
+       MLT_REGISTER( filter_type, "obscure", filter_obscure_init );
+       MLT_REGISTER( filter_type, "region", filter_region_init );
+       MLT_REGISTER( filter_type, "rescale", filter_rescale_init );
+       MLT_REGISTER( filter_type, "resize", filter_resize_init );
+       MLT_REGISTER( filter_type, "transition", filter_transition_init );
+       MLT_REGISTER( filter_type, "watermark", filter_watermark_init );
+       MLT_REGISTER( producer_type, "color", producer_colour_init );
+       MLT_REGISTER( producer_type, "colour", producer_colour_init );
+       MLT_REGISTER( producer_type, "noise", producer_noise_init );
+       MLT_REGISTER( producer_type, "ppm", producer_ppm_init );
+       MLT_REGISTER( transition_type, "composite", transition_composite_init );
+       MLT_REGISTER( transition_type, "luma", transition_luma_init );
+       MLT_REGISTER( transition_type, "mix", transition_mix_init );
+       MLT_REGISTER( transition_type, "region", transition_region_init );
 }
index 41b860a..6712ea6 100755 (executable)
@@ -6,13 +6,11 @@ then
        pkg-config libdv 2> /dev/null
        disable_libdv=$?
 
-       if [ "$disable_libdv" = "0" ]
+       if [ "$disable_libdv" != "0" ]
        then
-               echo "libdv                     libmltdv$LIBSUF" >> ../producers.dat
-               echo "libdv                     libmltdv$LIBSUF" >> ../consumers.dat
-       else
                echo "- libdv not found: disabling"
                touch ../disable-dv
+               exit 0
        fi
 
 fi
index 694032c..305fb9c 100644 (file)
 
 #include <string.h>
 
-#include <framework/mlt_consumer.h>
-#include <framework/mlt_producer.h>
+#include <framework/mlt.h>
 
 extern mlt_consumer consumer_libdv_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_producer producer_libdv_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "libdv" ) )
-               return producer_libdv_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       return NULL;
+       MLT_REGISTER( consumer_type, "libdv", consumer_libdv_init );
+       MLT_REGISTER( producer_type, "libdv", producer_libdv_init );
 }
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "libdv" ) )
-               return consumer_libdv_init( profile, type, id, arg );
-       return NULL;
-}
-
diff --git a/src/modules/effectv/configure b/src/modules/effectv/configure
deleted file mode 100755 (executable)
index 25f1d82..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../producers.dat
-EOF
-
-cat << EOF >> ../filters.dat
-BurningTV      libmlteffectv$LIBSUF
-EOF
-
-cat << EOF >> ../transitions.dat
-EOF
-
-cat << EOF >> ../consumers.dat
-EOF
-
-fi
index 2092b40..e28d765 100644 (file)
 
 extern mlt_filter filter_burn_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "BurningTV" ) )
-               return filter_burn_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
+       MLT_REGISTER( filter_type, "BurningTV", filter_burn_init );
+       MLT_REGISTER( filter_type, "burningtv", filter_burn_init );
 }
diff --git a/src/modules/feeds/configure b/src/modules/feeds/configure
deleted file mode 100755 (executable)
index e69de29..0000000
diff --git a/src/modules/fezzik/configure b/src/modules/fezzik/configure
deleted file mode 100755 (executable)
index 9d26d18..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../producers.dat
-fezzik                 libmltfezzik$LIBSUF
-hold                   libmltfezzik$LIBSUF
-EOF
-
-fi
-
index 33bfb07..87f22b9 100644 (file)
 extern mlt_producer producer_fezzik_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_producer producer_hold_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       if ( !strcmp( id, "fezzik" ) )
-               return producer_fezzik_init( profile, type, id, arg );
-       if ( !strcmp( id, "hold" ) )
-               return producer_hold_init( profile, type, id, arg );
-       return NULL;
+       MLT_REGISTER( producer_type, "fezzik", producer_fezzik_init );
+       MLT_REGISTER( producer_type, "hold", producer_hold_init );
 }
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
index d6c7f3f..725350b 100755 (executable)
@@ -33,11 +33,6 @@ then
        [ "$disable_pixbuf" = "0" ] && echo "USE_PIXBUF=1" >> config.mak
        [ "$disable_pango" = "0" ] && echo "USE_PANGO=1" >> config.mak
 
-       [ "$disable_pixbuf" = "0" ] && echo "pixbuf                     libmltgtk2$LIBSUF" >> ../producers.dat
-       [ "$disable_pango" = "0" ] && echo "pango                       libmltgtk2$LIBSUF" >> ../producers.dat
-       [ "$disable_pixbuf" = "0" ] && echo "gtkrescale         libmltgtk2$LIBSUF" >> ../filters.dat
-       [ "$disable_gtk2" = "0" ] && echo "gtk2_preview libmltgtk2$LIBSUF" >> ../consumers.dat
-
        exit 0
 fi
 
index 8b5e112..34d62e2 100644 (file)
@@ -46,7 +46,7 @@ static void initialise( )
        }
 }
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+void *create_service( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
 {
        initialise( );
 
@@ -60,30 +60,11 @@ void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const cha
                return producer_pango_init( arg );
 #endif
 
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       initialise( );
-
 #ifdef USE_PIXBUF
        if ( !strcmp( id, "gtkrescale" ) )
                return filter_rescale_init( profile, arg );
 #endif
 
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
-{
-       initialise( );
-
 #ifdef USE_GTK2
        if ( !strcmp( id, "gtk2_preview" ) )
                return consumer_gtk2_preview_init( profile, arg );
@@ -92,3 +73,10 @@ void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const cha
        return NULL;
 }
 
+MLT_REPOSITORY
+{
+       MLT_REGISTER( consumer_type, "gtk2_preview", create_service );
+       MLT_REGISTER( filter_type, "gtkrescale", create_service );
+       MLT_REGISTER( producer_type, "pango", create_service );
+       MLT_REGISTER( producer_type, "pixbuf", create_service );
+}
diff --git a/src/modules/inigo/configure b/src/modules/inigo/configure
deleted file mode 100755 (executable)
index 5296827..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../producers.dat
-inigo                  libmltinigo$LIBSUF
-inigo_file             libmltinigo$LIBSUF
-EOF
-
-fi
-
index ef8efcd..c1b2d0e 100644 (file)
 #include <string.h>
 #include <framework/mlt.h>
 
-extern mlt_producer producer_inigo_file_init( mlt_profile profile, char *file );
-extern mlt_producer producer_inigo_init( mlt_profile profile, char **argv );
+extern mlt_producer producer_inigo_file_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
+extern mlt_producer producer_inigo_init( mlt_profile profile, mlt_service_type type, const char *id, char **argv );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, void *arg )
+MLT_REPOSITORY
 {
-       if ( !strcmp( id, "inigo_file" ) )
-               return producer_inigo_file_init( profile, arg );
-       if ( !strcmp( id, "inigo" ) )
-               return producer_inigo_init( profile, arg );
-       return NULL;
+       MLT_REGISTER( producer_type, "inigo", producer_inigo_init );
+       MLT_REGISTER( producer_type, "inigo_file", producer_inigo_file_init );
 }
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
index 1970f9c..0ecbde4 100644 (file)
@@ -24,9 +24,9 @@
 
 #include <framework/mlt.h>
 
-mlt_producer producer_inigo_init( mlt_profile profile, char **argv );
+mlt_producer producer_inigo_init( mlt_profile profile, mlt_service_type type, const char *id, char **argv );
 
-mlt_producer producer_inigo_file_init( mlt_profile profile, char *file )
+mlt_producer producer_inigo_file_init( mlt_profile profile, mlt_service_type type, const char *id, char *file )
 {
        FILE *input = fopen( file, "r" );
        char **args = calloc( sizeof( char * ), 1000 );
@@ -43,7 +43,7 @@ mlt_producer producer_inigo_file_init( mlt_profile profile, char *file )
                }
        }
 
-       mlt_producer result = producer_inigo_init( profile, args );
+       mlt_producer result = producer_inigo_init( profile, type, id, args );
 
        if ( result != NULL )
        {
@@ -120,7 +120,7 @@ static mlt_transition create_transition( mlt_profile profile, mlt_field field, c
        return transition;
 }
 
-mlt_producer producer_inigo_init( mlt_profile profile, char **argv )
+mlt_producer producer_inigo_init( mlt_profile profile, mlt_service_type type, const char *id, char **argv )
 {
        int i;
        int track = 0;
index 01c8cdd..d10b294 100755 (executable)
@@ -17,15 +17,12 @@ then
                disable_ladspa=`[ -f "$ladspa_prefix/include/ladspa.h" ] && echo 1 || echo 0`
        fi
 
-       if [ "$disable_jack" = "0" -a "$disable_xml2" = "0" -a "$disable_ladspa" = "0" ]
+       if [ "$disable_jack" = "1" -o "$disable_xml2" = "1" -o "$disable_ladspa" = "1" ]
        then
-               echo "jackrack          libmltjackrack$LIBSUF" >> ../filters.dat
-               echo "ladspa            libmltjackrack$LIBSUF" >> ../filters.dat
-       else
                [ "$disable_jack" = "1" ] && echo "- jackrack not found: disabling"
                [ "$disable_xml2" = "1" ] && echo "- xml2 not found: disabling jackrack"
                [ "$disable_ladspa" = "1" ] && echo "- ladspa not found; disabling"
                touch ../disable-jackrack
        fi
-
+       exit 0
 fi
index e3121f2..1476b15 100644 (file)
 extern mlt_filter filter_jackrack_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_filter filter_ladspa_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "jackrack" ) )
-               return filter_jackrack_init( profile, type, id, arg );
-       else if ( !strcmp( id, "ladspa" ) )
-               return filter_ladspa_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
+       MLT_REGISTER( filter_type, "jackrack", filter_jackrack_init );
+       MLT_REGISTER( filter_type, "ladspa", filter_ladspa_init );
 }
diff --git a/src/modules/kdenlive/configure b/src/modules/kdenlive/configure
deleted file mode 100755 (executable)
index 792b6f2..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-       echo "boxblur           libmltkdenlive$LIBSUF" >> ../filters.dat
-       echo "wave              libmltkdenlive$LIBSUF" >> ../filters.dat
-       echo "framebuffer       libmltkdenlive$LIBSUF" >> ../producers.dat
-fi
index 1cc4dc6..430a24c 100644 (file)
@@ -24,28 +24,9 @@ extern mlt_filter filter_boxblur_init( mlt_profile profile, mlt_service_type typ
 extern mlt_filter filter_wave_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_producer producer_framebuffer_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       if ( !strcmp( id, "framebuffer" ) )
-               return producer_framebuffer_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "boxblur" ) )
-               return filter_boxblur_init( profile, type, id, arg );
-       if ( !strcmp( id, "wave" ) )
-               return filter_wave_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
+       MLT_REGISTER( filter_type, "boxblur", filter_boxblur_init );
+       MLT_REGISTER( filter_type, "wave", filter_wave_init );
+       MLT_REGISTER( producer_type, "framebuffer", producer_framebuffer_init );
 }
index 17c00f3..ae766d1 100755 (executable)
@@ -17,8 +17,7 @@ then
        [ "$libdv_disabled" = "0" ] && echo "HAVE_LIBDV=1" >> config.mak
 
        [ "$lqt_disabled" != "0" ] && echo "- libquicktime not found: only enabling dv avi support"
-       [ "$libdv_disabled" != 0 -a "$lqt_disabled" = "0" ] && echo "- libdv not found: mov dv may not have audio"
-
-       echo "kino                      libmltkino$LIBSUF" >> ../producers.dat
+       [ "$libdv_disabled" != "0" -a "$lqt_disabled" = "0" ] && echo "- libdv not found: mov dv may not have audio"
+       
+       exit 0
 fi
-
index 9316abb..13e8def 100644 (file)
 
 extern mlt_producer producer_kino_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       if ( !strcmp( id, "kino" ) )
-               return producer_kino_init( profile, type, id, arg );
-       return NULL;
+       MLT_REGISTER( producer_type, "kino", producer_kino_init );
 }
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
index 578862c..6116a9a 100755 (executable)
@@ -7,17 +7,6 @@ if [ "$motionest" = "false" ]
 then
        touch ../disable-motion_est
        echo "- motion estimation components disabled. Add --enable-motion-est to enable." 
-else
-cat << EOF >> ../producers.dat
-slowmotion             libmltmotion_est.so
-EOF
-
-cat << EOF >> ../filters.dat
-motion_est             libmltmotion_est.so
-vismv                  libmltmotion_est.so
-crop_detect            libmltmotion_est.so
-autotrack_rectangle    libmltmotion_est.so
-EOF
 fi
 
 fi
index 493d37f..1df0929 100644 (file)
@@ -23,22 +23,11 @@ extern mlt_filter filter_crop_detect_init( mlt_profile profile, mlt_service_type
 extern mlt_filter filter_autotrack_rectangle_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_producer producer_slowmotion_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       if ( !strcmp( id, "motion_est" ) )
-               return filter_motion_est_init( profile, type, id, arg );
-       if ( !strcmp( id, "vismv" ) )
-               return filter_vismv_init( profile, type, id, arg );
-       if ( !strcmp( id, "crop_detect" ) )
-               return filter_crop_detect_init( profile, type, id, arg );
-       if ( !strcmp( id, "autotrack_rectangle" ) )
-               return filter_autotrack_rectangle_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "slowmotion" ) )
-               return producer_slowmotion_init( profile, type, id, arg );
-       return NULL;
+       MLT_REGISTER( filter_type, "motion_est", filter_motion_est_init );
+       MLT_REGISTER( filter_type, "vismv", filter_vismv_init );
+       MLT_REGISTER( filter_type, "crop_detect", filter_crop_detect_init );
+       MLT_REGISTER( filter_type, "autotrack_rectangle", filter_autotrack_rectangle_init );
+       MLT_REGISTER( producer_type, "slowmotion", producer_slowmotion_init );
 }
diff --git a/src/modules/normalize/configure b/src/modules/normalize/configure
deleted file mode 100755 (executable)
index ec36a0e..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../filters.dat
-volume         libmltnormalize$LIBSUF
-EOF
-
-fi
index 2486250..3736d7d 100644 (file)
 
 extern mlt_filter filter_volume_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "volume" ) )
-               return filter_volume_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
+       MLT_REGISTER( filter_type, "volume", filter_volume_init );
 }
diff --git a/src/modules/oldfilm/configure b/src/modules/oldfilm/configure
deleted file mode 100755 (executable)
index 124baa8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-       echo "grain             libmltoldfilm$LIBSUF" >> ../filters.dat
-       echo "oldfilm           libmltoldfilm$LIBSUF" >> ../filters.dat
-       echo "lines             libmltoldfilm$LIBSUF" >> ../filters.dat
-       echo "dust              libmltoldfilm$LIBSUF" >> ../filters.dat
-fi
index fab7729..2ec90a1 100644 (file)
@@ -25,31 +25,10 @@ extern mlt_filter filter_grain_init( mlt_profile profile, mlt_service_type type,
 extern mlt_filter filter_lines_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_filter filter_oldfilm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "oldfilm" ) )
-               return filter_oldfilm_init( profile, type, id, arg );
-       if ( !strcmp( id, "dust" ) )
-               return filter_dust_init( profile, type, id, arg );
-       if ( !strcmp( id, "lines" ) )
-               return filter_lines_init( profile, type, id, arg );
-       if ( !strcmp( id, "grain" ) )
-               return filter_grain_init( profile, type, id, arg );
-
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
+       MLT_REGISTER( filter_type, "oldfilm", filter_oldfilm_init );
+       MLT_REGISTER( filter_type, "dust", filter_dust_init );
+       MLT_REGISTER( filter_type, "lines", filter_lines_init );
+       MLT_REGISTER( filter_type, "grain", filter_grain_init );
 }
diff --git a/src/modules/plus/configure b/src/modules/plus/configure
deleted file mode 100755 (executable)
index 77d9ce0..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../producers.dat
-EOF
-
-cat << EOF >> ../filters.dat
-affine                 libmltplus$LIBSUF
-charcoal               libmltplus$LIBSUF
-invert                 libmltplus$LIBSUF
-sepia                  libmltplus$LIBSUF
-EOF
-
-cat << EOF >> ../transitions.dat
-affine                 libmltplus$LIBSUF
-EOF
-
-cat << EOF >> ../consumers.dat
-EOF
-
-fi
index 2ff2865..2666f7f 100644 (file)
@@ -27,32 +27,11 @@ extern mlt_filter filter_invert_init( mlt_profile profile, mlt_service_type type
 extern mlt_filter filter_sepia_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_transition transition_affine_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "affine" ) )
-               return filter_affine_init( profile, type, id, arg );
-       if ( !strcmp( id, "charcoal" ) )
-               return filter_charcoal_init( profile, type, id, arg );
-       if ( !strcmp( id, "invert" ) )
-               return filter_invert_init( profile, type, id, arg );
-       if ( !strcmp( id, "sepia" ) )
-               return filter_sepia_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "affine" ) )
-               return transition_affine_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
+       MLT_REGISTER( filter_type, "affine", filter_affine_init );
+       MLT_REGISTER( filter_type, "charcoal", filter_charcoal_init );
+       MLT_REGISTER( filter_type, "invert", filter_invert_init );
+       MLT_REGISTER( filter_type, "sepia", filter_sepia_init );
+       MLT_REGISTER( transition_type, "affine", transition_affine_init );
 }
index 0e648f0..559404d 100755 (executable)
@@ -71,7 +71,6 @@ else
                        echo QTCXXFLAGS=-I$qimage_includedir >> config.mak
                        echo QTLIBS=-L$qimage_libdir/lib -lqt-mt >> config.mak
                fi
-               echo qimage             libmltqimage$LIBSUF >> ../producers.dat
        else
                echo "qimage: QT environment not found - disabling"
                touch ../disable-qimage
index f9d5886..61cb0ec 100644 (file)
 
 extern mlt_producer producer_qimage_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       if ( !strcmp( id, "qimage" ) )
-               return producer_qimage_init( profile, type, id, arg );
-       return NULL;
+       MLT_REGISTER( producer_type, "qimage", producer_qimage_init );
 }
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
index 58dd85b..954cb04 100755 (executable)
@@ -6,13 +6,11 @@ then
        pkg-config samplerate 2> /dev/null
        disable_samplerate=$?
 
-       if [ "$disable_samplerate" = "0" ]
+       if [ "$disable_samplerate" != "0" ]
        then
-               echo "resample          libmltresample$LIBSUF" >> ../filters.dat
-       else
                echo "- libsamplerate not found: disabling"
                touch ../disable-resample
        fi
-
+       exit 0
 fi
 
index 769e96e..c61ec51 100644 (file)
 
 extern mlt_filter filter_resample_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       return NULL;
+       MLT_REGISTER( filter_type, "resample", filter_resample_init );
 }
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "resample" ) )
-               return filter_resample_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
index af5568c..43b90d9 100755 (executable)
@@ -10,18 +10,14 @@ then
        then
                echo > config.mak
                image=`sdl-config --prefix`/include/SDL/SDL_image.h
-               echo "sdl                               libmltsdl$LIBSUF" >> ../consumers.dat
-               echo "sdl_preview               libmltsdl$LIBSUF" >> ../consumers.dat
-               echo "sdl_still                 libmltsdl$LIBSUF" >> ../consumers.dat
                if [ -f "$image" ]
                then
-                       echo "sdl_image                 libmltsdl$LIBSUF" >> ../producers.dat
                        echo "WITH_SDL_IMAGE=1" >> config.mak
                fi
        else
                echo "- sdl development libs not found: disabling"
                touch ../disable-sdl
        fi
-
+       exit 0
 fi
 
index 6ec79c0..68301c2 100644 (file)
@@ -29,33 +29,12 @@ extern mlt_consumer consumer_sdl_preview_init( mlt_profile profile, mlt_service_
 extern mlt_producer producer_sdl_image_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 #endif
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
+       MLT_REGISTER( consumer_type, "sdl", consumer_sdl_init );
+       MLT_REGISTER( consumer_type, "sdl_preview", consumer_sdl_preview_init );
+       MLT_REGISTER( consumer_type, "sdl_still", consumer_sdl_still_init );
 #ifdef WITH_SDL_IMAGE
-       if ( !strcmp( id, "sdl_image" ) )
-               return producer_sdl_image_init( profile, type, id, arg );
+       MLT_REGISTER( producer_type, "sdl_image", producer_sdl_image_init );
 #endif
-       return NULL;
 }
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "sdl" ) )
-               return consumer_sdl_init( profile, type, id, arg );
-       if ( !strcmp( id, "sdl_still" ) )
-               return consumer_sdl_still_init( profile, type, id, arg );
-       if ( !strcmp( id, "sdl_preview" ) )
-               return consumer_sdl_preview_init( profile, type, id, arg );
-       return NULL;
-}
-
index e306c0b..c29d40a 100755 (executable)
@@ -15,15 +15,15 @@ then
                if [ $disable_sox -eq 0 ]
                then
                        LIBDIR=lib
-                       #bits=$(uname -m)
-                       #case $bits in
-                       #x86_64)
-                       #       export LIBDIR=lib64
-                       #       ;;
-                       #*)
-                       #       export LIBDIR=lib
-                       #       ;;
-                       #esac
+                       bits=$(uname -m)
+                       case $bits in
+                       x86_64)
+                               [ -d /usr/lib/lib64 ] && export LIBDIR=lib64 || export LIBDIR=lib
+                               ;;
+                       *)
+                               export LIBDIR=lib
+                               ;;
+                       esac
 
                        sox=$(which sox)
                        # chop sox
@@ -35,12 +35,11 @@ then
                fi
        fi
 
-       if [ "$disable_sox" = "0" ]
+       if [ "$disable_sox" != "0" ]
        then
-               echo "sox               libmltsox$LIBSUF" >> ../filters.dat
-       else
                echo "- sox not found: disabling"
                touch ../disable-sox
        fi
 
+       exit 0
 fi
index fc6448d..048d3bc 100644 (file)
 
 extern mlt_filter filter_sox_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "sox" ) )
-               return filter_sox_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
+       MLT_REGISTER( filter_type, "sox", filter_sox_init );
 }
diff --git a/src/modules/valerie/configure b/src/modules/valerie/configure
deleted file mode 100755 (executable)
index 4149c6d..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../consumers.dat
-valerie                        libmltvalerie$LIBSUF
-EOF
-
-fi
-
index affef35..6dcae27 100644 (file)
 
 extern mlt_consumer consumer_valerie_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       return NULL;
+       MLT_REGISTER( consumer_type, "valerie", consumer_valerie_init );
 }
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "valerie" ) )
-               return consumer_valerie_init( profile, type, id, arg );
-       return NULL;
-}
-
diff --git a/src/modules/vmfx/configure b/src/modules/vmfx/configure
deleted file mode 100755 (executable)
index 70339bb..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../producers.dat
-pgm                            libmltvmfx$LIBSUF
-EOF
-
-cat << EOF >> ../filters.dat
-chroma                 libmltvmfx$LIBSUF
-chroma_hold            libmltvmfx$LIBSUF
-threshold              libmltvmfx$LIBSUF
-shape                  libmltvmfx$LIBSUF
-EOF
-
-cat << EOF >> ../transitions.dat
-EOF
-
-cat << EOF >> ../consumers.dat
-EOF
-
-fi
index 7dac576..3477bb8 100644 (file)
@@ -27,32 +27,11 @@ extern mlt_filter filter_mono_init( mlt_profile profile, mlt_service_type type,
 extern mlt_filter filter_shape_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_producer producer_pgm_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       if ( !strcmp( id, "pgm" ) )
-               return producer_pgm_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "chroma" ) )
-               return filter_chroma_init( profile, type, id, arg );
-       if ( !strcmp( id, "chroma_hold" ) )
-               return filter_chroma_hold_init( profile, type, id, arg );
-       if ( !strcmp( id, "threshold" ) )
-               return filter_mono_init( profile, type, id, arg );
-       if ( !strcmp( id, "shape" ) )
-               return filter_shape_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
+       MLT_REGISTER( filter_type, "chroma", filter_chroma_init );
+       MLT_REGISTER( filter_type, "chroma_hold", filter_chroma_hold_init );
+       MLT_REGISTER( filter_type, "threshold", filter_mono_init );
+       MLT_REGISTER( filter_type, "shape", filter_shape_init );
+       MLT_REGISTER( producer_type, "pgm", producer_pgm_init );
 }
index bfc4043..2f8c117 100755 (executable)
@@ -6,13 +6,11 @@ then
        pkg-config vorbisfile 2> /dev/null
        disable_vorbis=$?
 
-       if [ "$disable_vorbis" = "0" ]
+       if [ "$disable_vorbis" != "0" ]
        then
-               echo "vorbis            libmltvorbis$LIBSUF" >> ../producers.dat
-       else
                echo "- ogg vorbis not found: disabling"
                touch ../disable-vorbis
        fi
-
+       exit 0
 fi
 
index 080e151..3df2e75 100644 (file)
 
 extern mlt_producer producer_vorbis_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       if ( !strcmp( id, "vorbis" ) )
-               return producer_vorbis_init( profile, type, id, arg );
-       return NULL;
+       MLT_REGISTER( producer_type, "vorbis", producer_vorbis_init );
 }
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
index 65cbb5f..53aacd2 100755 (executable)
@@ -6,14 +6,11 @@ then
        which xml2-config > /dev/null 2>&1
        disable_xml2=$?
 
-       if [ "$disable_xml2" = "0" ]
+       if [ "$disable_xml2" != "0" ]
        then
-               echo "westley                   libmltwestley$LIBSUF" >> ../producers.dat
-               echo "westley-xml               libmltwestley$LIBSUF" >> ../producers.dat
-               echo "westley                   libmltwestley$LIBSUF" >> ../consumers.dat
-       else
                echo "- xml2 not found: disabling westley modules"
                touch ../disable-westley
        fi
+       exit 0
 fi
 
index 91ed5d1..87853f8 100644 (file)
 extern mlt_consumer consumer_westley_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 extern mlt_producer producer_westley_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       if ( !strcmp( id, "westley" ) )
-               return producer_westley_init( profile, type, id, arg );
-       if ( !strcmp( id, "westley-xml" ) )
-               return producer_westley_init( profile, type, id, arg );
-       return NULL;
+       MLT_REGISTER( consumer_type, "westley", consumer_westley_init );
+       MLT_REGISTER( producer_type, "westley", producer_westley_init );
+       MLT_REGISTER( producer_type, "westley-xml", producer_westley_init );
 }
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "westley" ) )
-               return consumer_westley_init( profile, type, id, arg );
-       return NULL;
-}
-
index d321129..f7b80d2 100755 (executable)
@@ -7,12 +7,11 @@ then
        grep mmx /proc/cpuinfo > /dev/null 2>&1
        disable_xine=$?
 
-       if [ "$disable_xine" = "0" ]
+       if [ "$disable_xine" != "0" ]
        then
-               echo "deinterlace               libmltxine$LIBSUF" >> ../filters.dat
-       else
                echo "- MMX Capabalities not found: disabling xine deinterlacing module"
                touch ../disable-xine
        fi
+       exit 0
 fi
 
index bdcf50d..11d2c15 100644 (file)
 
 extern mlt_filter filter_deinterlace_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg );
 
-void *mlt_create_producer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
+MLT_REPOSITORY
 {
-       return NULL;
-}
-
-void *mlt_create_filter( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       if ( !strcmp( id, "deinterlace" ) )
-               return filter_deinterlace_init( profile, type, id, arg );
-       return NULL;
-}
-
-void *mlt_create_transition( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
-}
-
-void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const char *id, char *arg )
-{
-       return NULL;
+       MLT_REGISTER( filter_type, "deinterlace", filter_deinterlace_init );
 }