filter_dust.yml: apply description fix patch from Mads Dydensborg.
[melted] / src / modules / frei0r / frei0r_helper.c
index 4bcaf30..8b21d8f 100644 (file)
@@ -21,7 +21,7 @@
 #include <string.h>
 
  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);
                for (i=0;i<info.num_params;i++){
                        f0r_param_info_t pinfo;
                        f0r_get_param_info(&pinfo,i);
-                               //set param if found
-                       if (pinfo.type==F0R_PARAM_DOUBLE || pinfo.type==F0R_PARAM_BOOL){
-                               double t=0.0;
-                               f0r_get_param_value(inst,&t,i);
-       
-                               if (mlt_properties_get( prop , pinfo.name ) !=NULL ){
-                                       t=mlt_properties_get_double( prop , pinfo.name );
-                                       f0r_set_param_value(inst,&t,i);
+                       mlt_geometry geom=mlt_geometry_init();
+                       struct mlt_geometry_item_s item;
+                       //set param if found
+                       
+                       double t=0.0;
+                       f0r_get_param_value(inst,&t,i);
+                       char *val;
+                       if (mlt_properties_get( prop , pinfo.name ) !=NULL ){
+                               switch (pinfo.type) {
+                                       case F0R_PARAM_DOUBLE:
+                                       case F0R_PARAM_BOOL:
+                                               val=mlt_properties_get(prop, pinfo.name );
+                                               mlt_geometry_parse(geom,val,-1,-1,-1);
+                                               mlt_geometry_fetch(geom,&item,position);
+                                               t=item.x;
+                                               f0r_set_param_value(inst,&t,i);
+                                               break;
+                                       //case F0R_PARAM_COLOR:
+                                       //      t=mlt_properties_get_double( prop , pinfo.name );       
+                                       
                                }
-                       }       
+                       }
+                       
+                       mlt_geometry_close(geom);
                }
        }
        
                
                mlt_convert_yuv422_to_rgb24a ( image[0] , (uint8_t *)img_a , video_area );
                mlt_convert_yuv422_to_rgb24a ( image[1] , (uint8_t *)img_b , video_area );
-               uint8_t* yuv = mlt_pool_alloc( video_area * 3 );
                f0r_update2 ( inst , position , img_a , img_b , NULL , result );
-               mlt_convert_rgb24a_to_yuv422((uint8_t *)result, *width, *height, *width * sizeof(uint32_t), 
-                                                                                               yuv, NULL );
-               image[2]=yuv;
+               
+               uint8_t * image_ptr=mlt_properties_get_data(MLT_FRAME_PROPERTIES(this), "image", NULL );
+               if (image_ptr)
+                   mlt_convert_rgb24a_to_yuv422((uint8_t *)result, *width, *height, *width * sizeof(uint32_t), image_ptr , NULL );
+               
+               mlt_pool_release(result);
        }
        mlt_pool_release(img_a);
        mlt_pool_release(img_b);