#include <stdlib.h>
#include <string.h>
+#ifdef WIN32
+#include <windows.h>
+/** the default subdirectory of the libdir for holding modules (plugins) */
+#define PREFIX_LIB "lib\\mlt"
+/** the default subdirectory of the install prefix for holding module (plugin) data */
+#define PREFIX_DATA "share\\mlt"
+#else
/** the default subdirectory of the libdir for holding modules (plugins) */
#define PREFIX_LIB LIBDIR "/mlt"
/** the default subdirectory of the install prefix for holding module (plugin) data */
#define PREFIX_DATA PREFIX "/share/mlt"
-
+#endif
/** holds the full path to the modules directory - initialized and retained for the entire session */
static char *mlt_directory = NULL;
/** Construct the repository and factories.
*
- * The environment variable MLT_PRODUCER is the name of a default producer often used by other services, defaults to "fezzil".
+ * The environment variable MLT_PRODUCER is the name of a default producer often used by other services, defaults to "loader".
*
* The environment variable MLT_CONSUMER is the name of a default consumer, defaults to "sdl".
*
mlt_repository mlt_factory_init( const char *directory )
{
+ if ( ! global_properties )
+ global_properties = mlt_properties_new( );
+
+ // Allow property refresh on a subsequent initialisation
+ if ( global_properties )
+ {
+ 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" ), "loader" );
+ 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" ) );
+ mlt_properties_set_or_default( global_properties, "MLT_PROFILE", getenv( "MLT_PROFILE" ), "dv_pal" );
+
+ mlt_properties_set_or_default( global_properties, "MLT_DATA", getenv( "MLT_DATA" ), PREFIX_DATA );
+ }
+
// Only initialise once
if ( mlt_directory == NULL )
{
mlt_events_register( event_object, "consumer-create-request", ( mlt_transmitter )mlt_factory_create_request );
mlt_events_register( event_object, "consumer-create-done", ( mlt_transmitter )mlt_factory_create_done );
- // Create the global properties
- global_properties = mlt_properties_new( );
-
// Create the repository of services
repository = mlt_repository_init( directory );
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" ) );
- mlt_properties_set_or_default( global_properties, "MLT_PROFILE", getenv( "MLT_PROFILE" ), "dv_pal" );
- mlt_properties_set_or_default( global_properties, "MLT_DATA", getenv( "MLT_DATA" ), PREFIX_DATA );
- }
-
-
return repository;
}
* \return a new producer
*/
-mlt_producer mlt_factory_producer( mlt_profile profile, const char *service, void *input )
+mlt_producer mlt_factory_producer( mlt_profile profile, const char *service, const void *input )
{
mlt_producer obj = NULL;
* \return a new filter
*/
-mlt_filter mlt_factory_filter( mlt_profile profile, const char *service, void *input )
+mlt_filter mlt_factory_filter( mlt_profile profile, const char *service, const void *input )
{
mlt_filter obj = NULL;
* \return a new transition
*/
-mlt_transition mlt_factory_transition( mlt_profile profile, const char *service, void *input )
+mlt_transition mlt_factory_transition( mlt_profile profile, const char *service, const void *input )
{
mlt_transition obj = NULL;
* \return a new consumer
*/
-mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *service, void *input )
+mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *service, const void *input )
{
mlt_consumer obj = NULL;
{
mlt_properties_close( event_object );
mlt_properties_close( global_properties );
- mlt_repository_close( repository );
+ if ( repository )
+ mlt_repository_close( repository );
free( mlt_directory );
mlt_directory = NULL;
mlt_pool_close( );
}
}
+
+mlt_properties mlt_global_properties( )
+{
+ return global_properties;
+}