]> git.sesse.net Git - mlt/blobdiff - src/modules/gtk2/factory.c
Avoid unnecessary compilation when running "./configure; make; make install" multiple...
[mlt] / src / modules / gtk2 / factory.c
index 8b5e1123002c225a83c9f2100c2a877223b02e9d..7016602b5deb9e81305e281b9ad8f77b88b419ea 100644 (file)
@@ -18,7 +18,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "config.h"
 #include <string.h>
 #include <framework/mlt.h>
 #include <gdk/gdk.h>
@@ -46,7 +45,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 +59,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 +72,22 @@ void *mlt_create_consumer( mlt_profile profile, mlt_service_type type, const cha
        return NULL;
 }
 
+static mlt_properties metadata( mlt_service_type type, const char *id, void *data )
+{
+       char file[ PATH_MAX ];
+       snprintf( file, PATH_MAX, "%s/gtk2/%s", mlt_environment( "MLT_DATA" ), (char*) data );
+       return mlt_properties_parse_yaml( file );
+}
+
+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 );
+
+       MLT_REGISTER_METADATA( consumer_type, "gtk2_preview", metadata, "consumer_gtk2_preview.yml" );
+       MLT_REGISTER_METADATA( filter_type, "gtkrescale", metadata, "filter_rescale.yml" );
+       MLT_REGISTER_METADATA( producer_type, "pango", metadata, "producer_pango.yml" );
+       MLT_REGISTER_METADATA( producer_type, "pixbuf", metadata, "producer_pixbuf.yml" );
+}