]> git.sesse.net Git - mlt/blobdiff - src/modules/opengl/filter_movit_resample.cpp
Change get_effect/add_effect to take in mlt_service.
[mlt] / src / modules / opengl / filter_movit_resample.cpp
index 5ecdfbbd17bf6991b9a9c714266600caff18a54b..93e7b6ce19d07f92a0fd2fdfdc1cc038de4916a5 100644 (file)
@@ -21,7 +21,7 @@
 #include <string.h>
 #include <assert.h>
 
-#include "glsl_manager.h"
+#include "filter_glsl_manager.h"
 #include <movit/resample_effect.h>
 
 static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
@@ -65,7 +65,8 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format
                *format = mlt_image_glsl;
        error = mlt_frame_get_image( frame, image, format, &iwidth, &iheight, writable );
        if ( !error ) {
-               Effect* effect = GlslManager::get_effect( filter, frame );
+               GlslManager::get_instance()->lock_service( frame );
+               Effect* effect = GlslManager::get_effect( MLT_FILTER_SERVICE( filter ), frame );
                if ( effect ) {
                        bool ok = effect->set_int( "width", owidth );
                        ok |= effect->set_int( "height", oheight );
@@ -73,6 +74,7 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format
                        *width = owidth;
                        *height = oheight;
                }
+               GlslManager::get_instance()->unlock_service( frame );
        }
 
        return error;
@@ -80,8 +82,8 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format
 
 static mlt_frame process( mlt_filter filter, mlt_frame frame )
 {
-       if ( !GlslManager::get_effect( filter, frame ) )
-               GlslManager::add_effect( filter, frame, new ResampleEffect );
+       if ( !GlslManager::get_effect( MLT_FILTER_SERVICE( filter ), frame ) )
+               GlslManager::add_effect( MLT_FILTER_SERVICE( filter ), frame, new ResampleEffect );
        mlt_frame_push_service( frame, filter );
        mlt_frame_push_get_image( frame, get_image );
        return frame;