X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Ffrei0r%2Ffactory.c;h=4cd84853afc773d65ce3e5824873a6a3f86e4e67;hb=70933f360aa7d16e5140267ce2f716de924464c7;hp=e3e2fae16129631b944e63e0c071d66e9d1f567c;hpb=44b1a9af480b617d3ad42b032c47bce2e08cf8a1;p=melted diff --git a/src/modules/frei0r/factory.c b/src/modules/frei0r/factory.c index e3e2fae..4cd8485 100644 --- a/src/modules/frei0r/factory.c +++ b/src/modules/frei0r/factory.c @@ -23,10 +23,12 @@ #include #include +#include #include #include #include #include +#include extern mlt_filter filter_frei0r_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ); extern mlt_frame filter_process( mlt_filter this, mlt_frame frame ); @@ -36,6 +38,28 @@ extern mlt_frame transition_process( mlt_transition transition, mlt_frame a_fram static mlt_properties fill_param_info ( mlt_service_type type, const char *service_name, char *name ) { + char file[ PATH_MAX ]; + char servicetype[ 1024 ]=""; + struct stat stat_buff; + + switch ( type ) { + case filter_type: + strcpy ( servicetype , "filter" ); + break; + case transition_type: + strcpy ( servicetype , "transition" ) ; + break; + default: + strcpy ( servicetype , "" ); + }; + + snprintf( file, PATH_MAX, "%s/frei0r/%s_%s.yml", mlt_environment( "MLT_DATA" ), servicetype, service_name ); + stat(file,&stat_buff); + + if (S_ISREG(stat_buff.st_mode)){ + return mlt_properties_parse_yaml( file ); + } + void* handle=dlopen(name,RTLD_LAZY); if (!handle) return NULL; void (*plginfo)(f0r_plugin_info_t*)=dlsym(handle,"f0r_get_plugin_info"); @@ -51,6 +75,7 @@ static mlt_properties fill_param_info ( mlt_service_type type, const char *servi plginfo(&info); snprintf ( string, sizeof(string) , "%d.%d" , info.major_version , info.minor_version ); + mlt_properties_set ( metadata, "schema_version" , "0.1" ); mlt_properties_set ( metadata, "title" , info.name ); mlt_properties_set ( metadata, "version", string ); mlt_properties_set ( metadata, "identifier" , service_name ); @@ -83,9 +108,9 @@ static mlt_properties fill_param_info ( mlt_service_type type, const char *servi mlt_properties_set ( pnum , "title" , paraminfo.name ); mlt_properties_set ( pnum , "description" , paraminfo.explanation); if ( paraminfo.type == F0R_PARAM_DOUBLE ){ - mlt_properties_set ( pnum , "type" , "integer" ); + mlt_properties_set ( pnum , "type" , "float" ); mlt_properties_set ( pnum , "minimum" , "0" ); - mlt_properties_set ( pnum , "maximum" , "1000" ); + mlt_properties_set ( pnum , "maximum" , "1" ); mlt_properties_set ( pnum , "readonly" , "no" ); mlt_properties_set ( pnum , "widget" , "spinner" ); }else