#include "filter_glsl_manager.h"
#include <movit/deconvolution_sharpen_effect.h>
+using namespace movit;
+
static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
{
mlt_filter filter = (mlt_filter) mlt_frame_pop_service( frame );
GlslManager::get_instance()->lock_service( frame );
mlt_position position = mlt_filter_get_position( filter, frame );
mlt_position length = mlt_filter_get_length2( filter, frame );
- mlt_properties_set_int( properties, "movit.parms.int.matrix_size",
- mlt_properties_anim_get_int( properties, "matrix_size", position, length ) );
- mlt_properties_set_double( properties, "movit.parms.float.circle_radius",
+ int matrix_size = mlt_properties_anim_get_int( properties, "matrix_size", position, length );
+ mlt_properties_set_int( properties, "_movit.parms.int.matrix_size", matrix_size );
+ mlt_properties_set_double( properties, "_movit.parms.float.circle_radius",
mlt_properties_anim_get_double( properties, "circle_radius", position, length ) );
- mlt_properties_set_double( properties, "movit.parms.float.gaussian_radius",
+ mlt_properties_set_double( properties, "_movit.parms.float.gaussian_radius",
mlt_properties_anim_get_double( properties, "gaussian_radius", position, length ) );
- mlt_properties_set_double( properties, "movit.parms.float.correlation",
+ mlt_properties_set_double( properties, "_movit.parms.float.correlation",
mlt_properties_anim_get_double( properties, "correlation", position, length ) );
- mlt_properties_set_double( properties, "movit.parms.float.noise",
+ mlt_properties_set_double( properties, "_movit.parms.float.noise",
mlt_properties_anim_get_double( properties, "noise", position, length ) );
+
+ // DeconvolutionSharpenEffect compiles the matrix size into the shader,
+ // so we need to regenerate the chain if this changes.
+ char fingerprint[256];
+ snprintf( fingerprint, sizeof( fingerprint ), "s=%d", matrix_size );
+ mlt_properties_set( properties, "_movit fingerprint", fingerprint );
+
GlslManager::get_instance()->unlock_service( frame );
*format = mlt_image_glsl;
int error = mlt_frame_get_image( frame, image, format, width, height, writable );
if ( glsl && ( filter = mlt_filter_new() ) ) {
mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
+ glsl->add_ref( properties );
mlt_properties_set_int( properties, "matrix_size", 5 );
mlt_properties_set_double( properties, "circle_radius", 2.0 );
mlt_properties_set_double( properties, "gaussian_radius", 0.0 );