#include "mlt_parser.h"
#include "mlt_geometry.h"
#include "mlt_profile.h"
+#include "mlt_repository.h"
#ifdef __cplusplus
}
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;
/** 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 )
// 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 );
}
- return 0;
+ return repository;
}
/** Fetch the events object.
// 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 )
{
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 );
}
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 );
}
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 );
}
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( );
#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 );
{
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 );
}
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 );
}
-
-
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 );
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 ] ; \
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
}
}
-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
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;
-}
-
[ "$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 "$@"
# 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
+++ /dev/null
-#!/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
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 );
}
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
#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;
-}
-
+++ /dev/null
-#!/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
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 );
}
+++ /dev/null
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../producers.dat
-fezzik libmltfezzik$LIBSUF
-hold libmltfezzik$LIBSUF
-EOF
-
-fi
-
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;
-}
-
[ "$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
}
}
-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( );
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 );
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 );
+}
+++ /dev/null
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../producers.dat
-inigo libmltinigo$LIBSUF
-inigo_file libmltinigo$LIBSUF
-EOF
-
-fi
-
#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;
-}
-
#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 );
}
}
- mlt_producer result = producer_inigo_init( profile, args );
+ mlt_producer result = producer_inigo_init( profile, type, id, args );
if ( result != NULL )
{
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;
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
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 );
}
+++ /dev/null
-#!/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
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 );
}
[ "$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
-
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;
-}
-
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
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 );
}
+++ /dev/null
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../filters.dat
-volume libmltnormalize$LIBSUF
-EOF
-
-fi
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 );
}
+++ /dev/null
-#!/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
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 );
}
+++ /dev/null
-#!/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
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 );
}
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
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;
-}
-
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
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;
-}
-
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
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;
-}
-
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
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
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 );
}
+++ /dev/null
-#!/bin/sh
-
-if [ "$help" != "1" ]
-then
-
-cat << EOF >> ../consumers.dat
-valerie libmltvalerie$LIBSUF
-EOF
-
-fi
-
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;
-}
-
+++ /dev/null
-#!/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
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 );
}
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
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;
-}
-
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
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;
-}
-
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
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 );
}