X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Ffrei0r%2Ffrei0r_helper.c;h=dd7db7513469f794a924ab180fb4d981b2082c58;hb=b9402bbbbcc5c6569d55700564275f59cd9e2242;hp=4bcaf305ec6d29a2d9eb356421f51bfea0387e2d;hpb=c079de116b132025ee09e8766d773424f17605e9;p=melted diff --git a/src/modules/frei0r/frei0r_helper.c b/src/modules/frei0r/frei0r_helper.c index 4bcaf30..dd7db75 100644 --- a/src/modules/frei0r/frei0r_helper.c +++ b/src/modules/frei0r/frei0r_helper.c @@ -19,28 +19,44 @@ #include "frei0r_helper.h" #include #include +#include + + +static void parse_color( char *color, f0r_param_color_t *fcolor ) +{ + unsigned int temp = strtoul( color, &color, 0 ); + if ( strlen( color ) > 6 ) + temp >>= 8; + fcolor->r = ( temp >> 16 ) & 0xff; + fcolor->r /= 255; + fcolor->g = ( temp >> 8 ) & 0xff; + fcolor->g /= 255; + fcolor->b = ( temp >> 0 ) & 0xff; + fcolor->b /= 255; +} + int process_frei0r_item( mlt_service_type type, double position , mlt_properties prop , mlt_frame this, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ){ - + int i=0; f0r_instance_t ( *f0r_construct ) ( unsigned int , unsigned int ) = mlt_properties_get_data( prop , "f0r_construct" ,NULL); void (*f0r_update)(f0r_instance_t instance, double time, const uint32_t* inframe, uint32_t* outframe)=mlt_properties_get_data( prop , "f0r_update" ,NULL); void (*f0r_destruct)(f0r_instance_t instance)=mlt_properties_get_data( prop , "f0r_destruct" ,NULL); - + void (*f0r_get_plugin_info)(f0r_plugin_info_t*)=mlt_properties_get_data( prop, "f0r_get_plugin_info" ,NULL); void (*f0r_get_param_info)(f0r_param_info_t* info, int param_index)=mlt_properties_get_data( prop , "f0r_get_param_info" ,NULL); void (*f0r_set_param_value)(f0r_instance_t instance, f0r_param_t param, int param_index)=mlt_properties_get_data( prop , "f0r_set_param_value" ,NULL); void (*f0r_get_param_value)(f0r_instance_t instance, f0r_param_t param, int param_index)=mlt_properties_get_data( prop , "f0r_get_param_value" ,NULL); void (*f0r_update2) (f0r_instance_t instance, double time, const uint32_t* inframe1,const uint32_t* inframe2,const uint32_t* inframe3, - uint32_t* outframe)=mlt_properties_get_data( prop , "f0r_update2" ,NULL); - - + uint32_t* outframe)=mlt_properties_get_data( prop , "f0r_update2" ,NULL); + + //use as name the width and height f0r_instance_t inst; char ctorname[1024]=""; sprintf(ctorname,"ctor-%dx%d",*width,*height); - + void* neu=mlt_properties_get_data( prop , ctorname ,NULL ); if (!f0r_construct){ //printf("no ctor\n"); @@ -58,54 +74,75 @@ for (i=0;i