From: Steinar H. Gunderson Date: Thu, 16 Jan 2014 18:35:34 +0000 (+0100) Subject: Stop special-casing the disable parameter for setting. X-Git-Url: https://git.sesse.net/?p=mlt;a=commitdiff_plain;h=b686ca6e91eef8f36ebedcb9a57cf74da1da23a3 Stop special-casing the disable parameter for setting. There are more parameters then just 'disable' that should be set before chain finalization; in particular, DeconvolutionSharpenEffect compiles the matrix size into the shader. Instead, just set all the parameters once right after the chain has been built, which includes the disable parameter. --- diff --git a/src/modules/opengl/filter_movit_convert.cpp b/src/modules/opengl/filter_movit_convert.cpp index 056a4f38..2b9a39db 100644 --- a/src/modules/opengl/filter_movit_convert.cpp +++ b/src/modules/opengl/filter_movit_convert.cpp @@ -30,6 +30,8 @@ #include #include "mlt_flip_effect.h" +static void set_movit_parameters( GlslChain *chain, mlt_service service, mlt_frame frame ); + static void yuv422_to_yuv422p( uint8_t *yuv422, uint8_t *yuv422p, int width, int height ) { uint8_t *Y = yuv422p; @@ -129,11 +131,9 @@ static void build_fingerprint( mlt_service service, mlt_frame frame, std::string fingerprint->push_back( '(' ); fingerprint->append( mlt_properties_get( MLT_SERVICE_PROPERTIES( service ), "_unique_id" ) ); - bool disable = mlt_properties_get_int( MLT_SERVICE_PROPERTIES( service ), "movit.disable" ); + bool disable = mlt_properties_get_int( MLT_SERVICE_PROPERTIES( service ), "movit.parms.int.disable" ); if ( disable ) { fingerprint->push_back( 'd' ); - bool ok = effect->set_int( "disable", 1 ); - assert(ok); } fingerprint->push_back( ')' ); } @@ -209,6 +209,7 @@ static void finalize_movit_chain( mlt_service leaf_service, mlt_frame frame ) chain->fingerprint = new_fingerprint; build_movit_chain( leaf_service, frame, chain ); + set_movit_parameters( chain, leaf_service, frame ); chain->effect_chain->add_effect( new Mlt::VerticalFlip ); ImageFormat output_format; @@ -423,6 +424,7 @@ static int convert_image( mlt_frame frame, uint8_t **image, mlt_image_format *fo finalize_movit_chain( leaf_service, frame ); // Set per-frame parameters now that we know which Effect instances to set them on. + // (finalize_movit_chain may already have done this, though, but twice doesn't hurt.) GlslChain *chain = GlslManager::get_chain( leaf_service ); set_movit_parameters( chain, leaf_service, frame ); diff --git a/src/modules/opengl/filter_movit_crop.cpp b/src/modules/opengl/filter_movit_crop.cpp index 53367350..7f5381ec 100644 --- a/src/modules/opengl/filter_movit_crop.cpp +++ b/src/modules/opengl/filter_movit_crop.cpp @@ -85,7 +85,7 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format mlt_properties_set_double( properties, "movit.parms.float.top", -top ); bool disable = ( *width == owidth && *height == oheight ); - mlt_properties_set_int( properties, "movit.disable", disable ); + mlt_properties_set_int( properties, "movit.parms.int.disable", disable ); GlslManager::get_instance()->unlock_service( frame ); } diff --git a/src/modules/opengl/filter_movit_resample.cpp b/src/modules/opengl/filter_movit_resample.cpp index 1b76339e..ea6df48f 100644 --- a/src/modules/opengl/filter_movit_resample.cpp +++ b/src/modules/opengl/filter_movit_resample.cpp @@ -65,7 +65,7 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format mlt_properties_set_int( filter_properties, "movit.parms.int.height", oheight ); bool disable = ( iwidth == owidth && iheight == oheight ); - mlt_properties_set_int( filter_properties, "movit.disable", disable ); + mlt_properties_set_int( filter_properties, "movit.parms.int.disable", disable ); *width = owidth; *height = oheight; diff --git a/src/modules/opengl/filter_movit_resize.cpp b/src/modules/opengl/filter_movit_resize.cpp index 04953d9c..15480d12 100644 --- a/src/modules/opengl/filter_movit_resize.cpp +++ b/src/modules/opengl/filter_movit_resize.cpp @@ -165,7 +165,7 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format mlt_properties_set_double( filter_properties, "movit.parms.float.top", rect.y ); bool disable = ( *width == owidth && *height == oheight ); - mlt_properties_set_int( filter_properties, "movit.disable", disable ); + mlt_properties_set_int( filter_properties, "movit.parms.int.disable", disable ); GlslManager::get_instance()->unlock_service( frame );