]> git.sesse.net Git - mlt/commitdiff
cleanup some names since we are changing the interface
authorddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Thu, 7 Feb 2008 05:57:43 +0000 (05:57 +0000)
committerddennedy <ddennedy@d19143bc-622f-0410-bfdd-b5b2a6649095>
Thu, 7 Feb 2008 05:57:43 +0000 (05:57 +0000)
mlt_repository.[hc]: change mlt_repository_fetch to mlt_repository_create
mlt_factory.[hc]: change mlt_factory_prefix to mlt_factory_directory

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

src/framework/mlt_factory.c
src/framework/mlt_factory.h
src/framework/mlt_repository.c
src/framework/mlt_repository.h

index ec885b6e79478a732a7e4485a03600b0f7ad7aaf..d7c6f000254dccf53b7324b84057aa619d3bf6b6 100644 (file)
@@ -31,7 +31,7 @@
 /** Singleton repositories
 */
 
-static char *mlt_prefix = NULL;
+static char *mlt_directory = NULL;
 static mlt_properties global_properties = NULL;
 static mlt_repository repository = NULL;
 static mlt_properties event_object = NULL;
@@ -55,21 +55,21 @@ static void mlt_factory_create_done( mlt_listener listener, mlt_properties owner
 /** Construct the factories.
 */
 
-mlt_repository mlt_factory_init( const char *prefix )
+mlt_repository mlt_factory_init( const char *directory )
 {
        // Only initialise once
-       if ( mlt_prefix == NULL )
+       if ( mlt_directory == NULL )
        {
                // Allow user over rides
-               if ( prefix == NULL || !strcmp( prefix, "" ) )
-                       prefix = getenv( "MLT_REPOSITORY" );
+               if ( directory == NULL || !strcmp( directory, "" ) )
+                       directory = getenv( "MLT_REPOSITORY" );
 
                // If no directory is specified, default to install directory
-               if ( prefix == NULL )
-                       prefix = PREFIX_LIB;
+               if ( directory == NULL )
+                       directory = PREFIX_LIB;
 
                // Store the prefix for later retrieval
-               mlt_prefix = strdup( prefix );
+               mlt_directory = strdup( directory );
 
                // Initialise the pool
                mlt_pool_init( );
@@ -90,7 +90,7 @@ mlt_repository mlt_factory_init( const char *prefix )
                global_properties = mlt_properties_new( );
 
                // Create the repository of services
-               repository = mlt_repository_init( prefix );
+               repository = mlt_repository_init( directory );
 
                // Force a clean up when app closes
                atexit( mlt_factory_close );
@@ -119,12 +119,12 @@ mlt_properties mlt_factory_event_object( )
        return event_object;
 }
 
-/** Fetch the prefix used in this instance.
+/** Fetch the module directory used in this instance.
 */
 
-const char *mlt_factory_prefix( )
+const char *mlt_factory_directory( )
 {
-       return mlt_prefix;
+       return mlt_directory;
 }
 
 /** Get a value from the environment.
@@ -176,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( repository, profile, producer_type, service, input );
+               obj = mlt_repository_create( repository, profile, producer_type, service, input );
                mlt_events_fire( event_object, "producer-create-done", service, input, obj, NULL );
                if ( obj != NULL )
                {
@@ -199,7 +199,7 @@ mlt_filter mlt_factory_filter( mlt_profile profile, const char *service, void *i
 
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( repository, profile, filter_type, service, input );
+               obj = mlt_repository_create( repository, profile, filter_type, service, input );
                mlt_events_fire( event_object, "filter-create-done", service, input, obj, NULL );
        }
 
@@ -223,7 +223,7 @@ mlt_transition mlt_factory_transition( mlt_profile profile, const char *service,
 
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( repository, profile, transition_type, service, input );
+               obj = mlt_repository_create( repository, profile, transition_type, service, input );
                mlt_events_fire( event_object, "transition-create-done", service, input, obj, NULL );
        }
 
@@ -250,7 +250,7 @@ mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *service, voi
 
        if ( obj == NULL )
        {
-               obj = mlt_repository_fetch( repository, profile, consumer_type, service, input );
+               obj = mlt_repository_create( repository, profile, consumer_type, service, input );
                mlt_events_fire( event_object, "consumer-create-done", service, input, obj, NULL );
        }
 
@@ -277,13 +277,13 @@ void mlt_factory_register_for_clean_up( void *ptr, mlt_destructor destructor )
 
 void mlt_factory_close( )
 {
-       if ( mlt_prefix != NULL )
+       if ( mlt_directory != NULL )
        {
                mlt_properties_close( event_object );
                mlt_properties_close( global_properties );
                mlt_repository_close( repository );
-               free( mlt_prefix );
-               mlt_prefix = NULL;
+               free( mlt_directory );
+               mlt_directory = NULL;
                mlt_pool_close( );
        }
 }
index 82dc3ef0679d0eb1b43c504c6ff3ada6d1ca9a77..f2a9d22529b350a2764a6f76522c8150ebb26879 100644 (file)
@@ -25,8 +25,8 @@
 #include "mlt_profile.h"
 #include "mlt_repository.h"
 
-extern mlt_repository mlt_factory_init( const char *prefix );
-extern const char *mlt_factory_prefix( );
+extern mlt_repository mlt_factory_init( const char *directory );
+extern const char *mlt_factory_directory( );
 extern char *mlt_environment( const char *name );
 extern int mlt_environment_set( const char *name, const char *value );
 extern mlt_properties mlt_factory_event_object( );
index 7f474f33a8ff4c87e7f16b0f65545126757b1766..3ab95bed696fe384b960f6fa31b0d34f093e22aa 100644 (file)
@@ -35,8 +35,12 @@ struct mlt_repository_s
        mlt_properties transitions;
 };
 
-mlt_repository mlt_repository_init( const char *prefix )
+mlt_repository mlt_repository_init( const char *directory )
 {
+       // Safety check
+       if ( directory == NULL || strcmp( directory, "" ) == 0 )
+               return NULL;
+               
        // Construct the repository
        mlt_repository this = calloc( sizeof( struct mlt_repository_s ), 1 );
        mlt_properties_init( &this->parent, this );
@@ -44,10 +48,10 @@ mlt_repository mlt_repository_init( const char *prefix )
        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 count = mlt_properties_dir_list( dir, directory, NULL, 0 );
        int i;
        
        // Iterate over files
@@ -108,7 +112,7 @@ void mlt_repository_register( mlt_repository this, mlt_service_type service_type
        }
 }
 
-void *mlt_repository_fetch( mlt_repository this, mlt_profile profile, mlt_service_type type, const char *service, void *input )
+void *mlt_repository_create( mlt_repository this, mlt_profile profile, mlt_service_type type, const char *service, void *input )
 {
        void *( *symbol_ptr )( mlt_profile, mlt_service_type, const char *, void * ) = NULL;
 
index c4e41427fc15c38dacb2e37abef289b10b496857..d8d65b13f00d60bc42f2cb5d0a643fb77ba32365 100644 (file)
@@ -38,9 +38,9 @@ typedef struct mlt_repository_s *mlt_repository;
 /** Public functions.
 */
 
-extern mlt_repository mlt_repository_init( const char *prefix );
+extern mlt_repository mlt_repository_init( const char *directory );
 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_create( mlt_repository self, mlt_profile profile, mlt_service_type type, const char *service, void *arg );
 extern void mlt_repository_close( mlt_repository self );
 
 #endif