X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmodules%2Fopengl%2Ffilter_movit_convert.cpp;h=c35b546dcbfb366c65b53e082445c99eab305a5c;hb=2c046e968db474d1eafbcf77b119495bf89e6ae5;hp=3e61dffcba6b1a846f81c6906e171d9ec640a46a;hpb=6005571e839b74e9019f8f43b4ef4ff76f793780;p=mlt diff --git a/src/modules/opengl/filter_movit_convert.cpp b/src/modules/opengl/filter_movit_convert.cpp index 3e61dffc..c35b546d 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,17 @@ 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" ); + + const char* effect_fingerprint = mlt_properties_get( MLT_SERVICE_PROPERTIES( service ), "_movit fingerprint" ); + if ( effect_fingerprint ) { + fingerprint->push_back( '[' ); + fingerprint->append( effect_fingerprint ); + fingerprint->push_back( ']' ); + } + + 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( ')' ); } @@ -202,13 +210,14 @@ static void finalize_movit_chain( mlt_service leaf_service, mlt_frame frame ) // Build the chain if needed. if ( !chain || new_fingerprint != chain->fingerprint ) { - printf("=== CREATING NEW CHAIN (old chain=%p, leaf=%p, fingerprint=%s) ===\n", chain, leaf_service, new_fingerprint.c_str()); + mlt_log_debug( leaf_service, "=== CREATING NEW CHAIN (old chain=%p, leaf=%p, fingerprint=%s) ===\n", chain, leaf_service, new_fingerprint.c_str() ); mlt_profile profile = mlt_service_profile( leaf_service ); chain = new GlslChain; chain->effect_chain = new EffectChain( profile->display_aspect_num, profile->display_aspect_den ); 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 +432,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 );