]> git.sesse.net Git - mlt/blobdiff - src/modules/opengl/filter_movit_convert.cpp
Move burningtv into plusgpl module.
[mlt] / src / modules / opengl / filter_movit_convert.cpp
index 3f7b587976eb5220773120bdd6d8f24beaf97d4a..5d40f34bc14e0cc05a6b7827e83a8475d0f9471e 100644 (file)
@@ -30,6 +30,8 @@
 #include <mlt++/MltProducer.h>
 #include "mlt_flip_effect.h"
 
+using namespace movit;
+
 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 )
@@ -152,9 +154,9 @@ static Effect* build_movit_chain( mlt_service service, mlt_frame frame, GlslChai
                mlt_producer producer = mlt_producer_cut_parent( mlt_frame_get_original_producer( frame ) );
                MltInput* input = GlslManager::get_input( producer, frame );
                GlslManager::set_input( producer, frame, NULL );
-               chain->effect_chain->add_input( input );
-               chain->effects.insert(std::make_pair( MLT_SERVICE( producer ), input ) );
-               return input;
+               chain->effect_chain->add_input( input->get_input() );
+               chain->inputs.insert(std::make_pair( producer, input ) );
+               return input->get_input();
        }
 
        Effect* effect = GlslManager::get_effect( service, frame );
@@ -242,7 +244,7 @@ static void set_movit_parameters( GlslChain *chain, mlt_service service, mlt_fra
 {
        if ( service == (mlt_service) -1 ) {
                mlt_producer producer = mlt_producer_cut_parent( mlt_frame_get_original_producer( frame ) );
-               MltInput* input = (MltInput *) chain->effects[ MLT_PRODUCER_SERVICE( producer ) ];
+               MltInput* input = chain->inputs[ producer ];
                input->set_pixel_data( GlslManager::get_input_pixel_pointer( producer, frame ) );
                return;
        }
@@ -311,7 +313,7 @@ static void dispose_pixel_pointers( GlslChain *chain, mlt_service service, mlt_f
 {
        if ( service == (mlt_service) -1 ) {
                mlt_producer producer = mlt_producer_cut_parent( mlt_frame_get_original_producer( frame ) );
-               MltInput* input = (MltInput *) chain->effects[ MLT_PRODUCER_SERVICE( producer ) ];
+               MltInput* input = chain->inputs[ producer ];
                input->invalidate_pixel_data();
                mlt_pool_release( GlslManager::get_input_pixel_pointer( producer, frame ) );
                return;
@@ -348,7 +350,7 @@ static int movit_render( EffectChain *chain, mlt_frame frame, mlt_image_format *
 // Create an MltInput for an image with the given format and dimensions.
 static MltInput* create_input( mlt_properties properties, mlt_image_format format, int aspect_width, int aspect_height, int width, int height )
 {
-       MltInput* input = new MltInput( aspect_width, aspect_height );
+       MltInput* input = new MltInput();
        if ( format == mlt_image_rgb24a || format == mlt_image_opengl ) {
                // TODO: Get the color space if available.
                input->useFlatInput( FORMAT_RGBA_POSTMULTIPLIED_ALPHA, width, height );
@@ -470,7 +472,7 @@ static int convert_image( mlt_frame frame, uint8_t **image, mlt_image_format *fo
                        if ( !chain || !input || width != w || height != h || *format != f ) {
                                chain = new EffectChain( width, height );
                                input = create_input( properties, *format, width, height, width, height );
-                               chain->add_input( input );
+                               chain->add_input( input->get_input() );
                                chain->add_effect( new Mlt::VerticalFlip() );
                                ImageFormat movit_output_format;
                                movit_output_format.color_space = COLORSPACE_sRGB;