X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Ffrei0r%2Ffrei0r_helper.c;h=e42b06e301afa7c668357a62bac113d29b215e41;hb=bb2674a23b551cbc146d40ff7a122c87856b49ff;hp=4bcaf305ec6d29a2d9eb356421f51bfea0387e2d;hpb=c079de116b132025ee09e8766d773424f17605e9;p=melted diff --git a/src/modules/frei0r/frei0r_helper.c b/src/modules/frei0r/frei0r_helper.c index 4bcaf30..e42b06e 100644 --- a/src/modules/frei0r/frei0r_helper.c +++ b/src/modules/frei0r/frei0r_helper.c @@ -19,28 +19,39 @@ #include "frei0r_helper.h" #include #include +#include + +static void parse_color( int color, f0r_param_color_t *fcolor ) +{ + fcolor->r = ( color >> 24 ) & 0xff; + fcolor->r /= 255; + fcolor->g = ( color >> 16 ) & 0xff; + fcolor->g /= 255; + fcolor->b = ( color >> 8 ) & 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 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 +69,80 @@ for (i=0;i