]> git.sesse.net Git - mlt/commitdiff
Stop special-casing the disable parameter for setting.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 16 Jan 2014 18:35:34 +0000 (19:35 +0100)
committerDan Dennedy <dan@dennedy.org>
Fri, 17 Jan 2014 03:27:07 +0000 (19:27 -0800)
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.

src/modules/opengl/filter_movit_convert.cpp
src/modules/opengl/filter_movit_crop.cpp
src/modules/opengl/filter_movit_resample.cpp
src/modules/opengl/filter_movit_resize.cpp

index 056a4f38728ac3015af3dedef5de17513342ee28..2b9a39dbc022f66dff306d27c64e3bf458bcd23d 100644 (file)
@@ -30,6 +30,8 @@
 #include <mlt++/MltProducer.h>
 #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 );
 
index 533673503316ef415f243fb70677f7e406b63ca7..7f5381ecac664b1d423929f71e220610fab24660 100644 (file)
@@ -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 );
        }
index 1b76339e1dcf076fdb329921f5c62878aed390fd..ea6df48f218ee734df7cd6cbd42058bcf6c5d857 100644 (file)
@@ -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;
index 04953d9ced500c7071bd8f0c58c829d6d7521421..15480d1208063003adce5325297ccdbc4a40a520 100644 (file)
@@ -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 );