X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_factory.c;h=3045e968b96d4b9fddd333172e5d82299975a232;hb=c95736fd9ee742f5e6db06bbe579f23895f55eba;hp=8766fd6dfb0b21e41aecf6079b1d090a378fd15b;hpb=90da79f8e465d43102645de7323d15c12801515f;p=melted diff --git a/src/framework/mlt_factory.c b/src/framework/mlt_factory.c index 8766fd6..3045e96 100644 --- a/src/framework/mlt_factory.c +++ b/src/framework/mlt_factory.c @@ -57,7 +57,7 @@ static void mlt_factory_create_done( mlt_listener listener, mlt_properties owner /** Construct the factories. */ -int mlt_factory_init( char *prefix ) +int mlt_factory_init( const char *prefix ) { // Only initialise once if ( mlt_prefix == NULL ) @@ -90,10 +90,6 @@ int mlt_factory_init( char *prefix ) // Create the global properties global_properties = mlt_properties_new( ); - mlt_properties_set_or_default( global_properties, "MLT_NORMALISATION", getenv( "MLT_NORMALISATION" ), "PAL" ); - mlt_properties_set_or_default( global_properties, "MLT_PRODUCER", getenv( "MLT_PRODUCER" ), "fezzik" ); - mlt_properties_set_or_default( global_properties, "MLT_CONSUMER", getenv( "MLT_CONSUMER" ), "sdl" ); - mlt_properties_set( global_properties, "MLT_TEST_CARD", getenv( "MLT_TEST_CARD" ) ); // Create the object list. object_list = mlt_properties_new( ); @@ -108,6 +104,15 @@ int mlt_factory_init( char *prefix ) atexit( mlt_factory_close ); } + // Allow property refresh on a subsequent initialisation + if ( global_properties != NULL ) + { + mlt_properties_set_or_default( global_properties, "MLT_NORMALISATION", getenv( "MLT_NORMALISATION" ), "PAL" ); + mlt_properties_set_or_default( global_properties, "MLT_PRODUCER", getenv( "MLT_PRODUCER" ), "fezzik" ); + mlt_properties_set_or_default( global_properties, "MLT_CONSUMER", getenv( "MLT_CONSUMER" ), "sdl" ); + mlt_properties_set( global_properties, "MLT_TEST_CARD", getenv( "MLT_TEST_CARD" ) ); + } + return 0; } @@ -130,7 +135,7 @@ const char *mlt_factory_prefix( ) /** Get a value from the environment. */ -char *mlt_environment( char *name ) +char *mlt_environment( const char *name ) { return mlt_properties_get( global_properties, name ); } @@ -138,7 +143,7 @@ char *mlt_environment( char *name ) /** Fetch a producer from the repository. */ -mlt_producer mlt_factory_producer( char *service, void *input ) +mlt_producer mlt_factory_producer( const char *service, void *input ) { mlt_producer obj = NULL; @@ -156,7 +161,7 @@ mlt_producer mlt_factory_producer( char *service, void *input ) mlt_events_fire( event_object, "producer-create-done", service, input, obj, NULL ); if ( obj != NULL ) { - mlt_properties properties = mlt_producer_properties( obj ); + mlt_properties properties = MLT_PRODUCER_PROPERTIES( obj ); mlt_properties_set_int( properties, "_unique_id", ++ unique_id ); mlt_properties_set( properties, "mlt_type", "producer" ); if ( mlt_properties_get_int( properties, "_mlt_service_hidden" ) == 0 ) @@ -169,7 +174,7 @@ mlt_producer mlt_factory_producer( char *service, void *input ) /** Fetch a filter from the repository. */ -mlt_filter mlt_factory_filter( char *service, void *input ) +mlt_filter mlt_factory_filter( const char *service, void *input ) { mlt_filter obj = NULL; @@ -184,7 +189,7 @@ mlt_filter mlt_factory_filter( char *service, void *input ) if ( obj != NULL ) { - mlt_properties properties = mlt_filter_properties( obj ); + mlt_properties properties = MLT_FILTER_PROPERTIES( obj ); mlt_properties_set_int( properties, "_unique_id", ++ unique_id ); mlt_properties_set( properties, "mlt_type", "filter" ); mlt_properties_set( properties, "mlt_service", service ); @@ -195,7 +200,7 @@ mlt_filter mlt_factory_filter( char *service, void *input ) /** Fetch a transition from the repository. */ -mlt_transition mlt_factory_transition( char *service, void *input ) +mlt_transition mlt_factory_transition( const char *service, void *input ) { mlt_transition obj = NULL; @@ -210,7 +215,7 @@ mlt_transition mlt_factory_transition( char *service, void *input ) if ( obj != NULL ) { - mlt_properties properties = mlt_transition_properties( obj ); + mlt_properties properties = MLT_TRANSITION_PROPERTIES( obj ); mlt_properties_set_int( properties, "_unique_id", ++ unique_id ); mlt_properties_set( properties, "mlt_type", "transition" ); mlt_properties_set( properties, "mlt_service", service ); @@ -221,7 +226,7 @@ mlt_transition mlt_factory_transition( char *service, void *input ) /** Fetch a consumer from the repository */ -mlt_consumer mlt_factory_consumer( char *service, void *input ) +mlt_consumer mlt_factory_consumer( const char *service, void *input ) { mlt_consumer obj = NULL; @@ -240,11 +245,11 @@ mlt_consumer mlt_factory_consumer( char *service, void *input ) if ( obj != NULL ) { mlt_filter filter = mlt_factory_filter( "data_show", NULL ); - mlt_properties properties = mlt_consumer_properties( obj ); + mlt_properties properties = MLT_CONSUMER_PROPERTIES( obj ); mlt_properties_set_int( properties, "_unique_id", ++ unique_id ); mlt_properties_set( properties, "mlt_type", "consumer" ); mlt_properties_set( properties, "mlt_service", service ); - mlt_service_attach( mlt_consumer_service( obj ), filter ); + mlt_service_attach( MLT_CONSUMER_SERVICE( obj ), filter ); mlt_filter_close( filter ); } return obj;