]> git.sesse.net Git - mlt/commitdiff
Refactor to use mlt_frame_set_image/_alpha.
authorDan Dennedy <dan@dennedy.org>
Mon, 7 Mar 2011 05:09:33 +0000 (21:09 -0800)
committerDan Dennedy <dan@dennedy.org>
Mon, 7 Mar 2011 05:09:33 +0000 (21:09 -0800)
37 files changed:
src/framework/mlt_tractor.c
src/modules/avformat/filter_avcolour_space.c
src/modules/avformat/filter_swscale.c
src/modules/avformat/producer_avformat.c
src/modules/core/filter_audiowave.c
src/modules/core/filter_crop.c
src/modules/core/filter_imageconvert.c
src/modules/core/filter_luma.c
src/modules/core/filter_rescale.c
src/modules/core/filter_resize.c
src/modules/core/filter_watermark.c
src/modules/core/producer_colour.c
src/modules/core/producer_consumer.c
src/modules/core/producer_hold.c
src/modules/core/producer_noise.c
src/modules/core/producer_ppm.c
src/modules/core/transition_composite.c
src/modules/core/transition_region.c
src/modules/dgraft/filter_telecide.c
src/modules/dv/producer_libdv.c
src/modules/frei0r/frei0r_helper.c
src/modules/frei0r/producer_frei0r.c
src/modules/gtk2/filter_rescale.c
src/modules/gtk2/producer_pango.c
src/modules/gtk2/producer_pixbuf.c
src/modules/kdenlive/filter_freeze.c
src/modules/kdenlive/filter_wave.c
src/modules/kdenlive/producer_framebuffer.c
src/modules/motion_est/producer_slowmotion.c
src/modules/plus/filter_affine.c
src/modules/plus/filter_charcoal.c
src/modules/qimage/producer_kdenlivetitle.c
src/modules/qimage/producer_qimage.c
src/modules/sdl/producer_sdl_image.c
src/modules/swfdec/producer_swfdec.c
src/modules/vmfx/producer_pgm.c
src/modules/xine/filter_deinterlace.c

index 235bbe016f9dcf0ae7ff7828633247c6fb7b29bb..e509fe2795cdda99c918a03180b75810414c91f9 100644 (file)
@@ -273,7 +273,7 @@ static int producer_get_image( mlt_frame self, uint8_t **buffer, mlt_image_forma
        mlt_properties_set_int( frame_properties, "normalised_width", mlt_properties_get_int( properties, "normalised_width" ) );
        mlt_properties_set_int( frame_properties, "normalised_height", mlt_properties_get_int( properties, "normalised_height" ) );
        mlt_frame_get_image( frame, buffer, format, width, height, writable );
-       mlt_properties_set_data( properties, "image", *buffer, 0, NULL, NULL );
+       mlt_frame_set_image( self, *buffer, 0, NULL );
        mlt_properties_set_int( properties, "width", *width );
        mlt_properties_set_int( properties, "height", *height );
        mlt_properties_set_int( properties, "format", *format );
@@ -284,7 +284,7 @@ static int producer_get_image( mlt_frame self, uint8_t **buffer, mlt_image_forma
        mlt_properties_set_int( properties, "force_full_luma", mlt_properties_get_int( frame_properties, "force_full_luma" ) );
        data = mlt_frame_get_alpha_mask( frame );
        mlt_properties_get_data( frame_properties, "alpha", &size );
-       mlt_properties_set_data( properties, "alpha", data, size, NULL, NULL );
+       mlt_frame_set_alpha( self, data, size, NULL );
        self->convert_image = frame->convert_image;
        self->convert_audio = frame->convert_audio;
        return 0;
index 72177f7ce42a0070b30dae316ca3512755ef5be3..77c2fee0e034ec5b803fddbaa555f27ff44b5301 100644 (file)
@@ -190,7 +190,7 @@ static int convert_image( mlt_frame frame, uint8_t **image, mlt_image_format *fo
                                                        }
                                                        while ( --n > 0 );
                                }
-                               mlt_properties_set_data( properties, "alpha", alpha, len, mlt_pool_release, NULL );
+                               mlt_frame_set_alpha( frame, alpha, len, mlt_pool_release );
                                frame->get_alpha_mask = NULL;
                        }
                }
@@ -208,7 +208,7 @@ static int convert_image( mlt_frame frame, uint8_t **image, mlt_image_format *fo
                av_convert_image( output, *image, out_fmt, in_fmt, width, height, colorspace, force_full_luma );
                *image = output;
                *format = output_format;
-               mlt_properties_set_data( properties, "image", output, size, mlt_pool_release, NULL );
+               mlt_frame_set_image( frame, output, size, mlt_pool_release );
                mlt_properties_set_int( properties, "format", output_format );
 
                if ( output_format == mlt_image_rgb24a || output_format == mlt_image_opengl )
index aa2f362fa28ae00aebab7dba6e4522b1cb763310..5bbe85c0eb1625c0b5743573b5c81e0b4d9c7971 100644 (file)
@@ -146,9 +146,7 @@ static int filter_scale( mlt_frame frame, uint8_t **image, mlt_image_format *for
                sws_freeContext( context );
        
                // Now update the frame
-               mlt_properties_set_data( properties, "image", output.data[0], owidth * ( oheight + 1 ) * bpp, ( mlt_destructor )mlt_pool_release, NULL );
-               mlt_properties_set_int( properties, "width", owidth );
-               mlt_properties_set_int( properties, "height", oheight );
+               mlt_frame_set_image( frame, output.data[0], owidth * ( oheight + 1 ) * bpp, mlt_pool_release );
        
                // Return the output
                *image = output.data[0];
@@ -173,7 +171,7 @@ static int filter_scale( mlt_frame frame, uint8_t **image, mlt_image_format *for
                                sws_freeContext( context );
        
                                // Set it back on the frame
-                               mlt_properties_set_data( MLT_FRAME_PROPERTIES( frame ), "alpha", output.data[0], owidth * oheight, mlt_pool_release, NULL );
+                               mlt_frame_set_alpha( frame, output.data[0], owidth * oheight, mlt_pool_release );
                        }
                }
        
index eb3850d80230d1a452a601fcd9479d0f94d447df..d5ffd0969980861f554e8b0ef50ccb990062d2da 100644 (file)
@@ -941,7 +941,7 @@ static inline void convert_image( AVFrame *frame, uint8_t *buffer, int pix_fmt,
 /** Allocate the image buffer and set it on the frame.
 */
 
-static int allocate_buffer( mlt_properties frame_properties, AVCodecContext *codec_context, uint8_t **buffer, mlt_image_format *format, int *width, int *height )
+static int allocate_buffer( mlt_frame frame, AVCodecContext *codec_context, uint8_t **buffer, mlt_image_format *format, int *width, int *height )
 {
        int size = 0;
 
@@ -974,7 +974,7 @@ static int allocate_buffer( mlt_properties frame_properties, AVCodecContext *cod
        // Construct the output image
        *buffer = mlt_pool_alloc( size );
        if ( *buffer )
-               mlt_properties_set_data( frame_properties, "image", *buffer, size, mlt_pool_release, NULL );
+               mlt_frame_set_image( frame, *buffer, size, mlt_pool_release );
        else
                size = 0;
 
@@ -1046,7 +1046,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                                        break;
                        }
                        mlt_properties_set_data( frame_properties, "avformat.image_cache", item, 0, ( mlt_destructor )mlt_cache_item_close, NULL );
-                       mlt_properties_set_data( frame_properties, "image", *buffer, size, NULL, NULL );
+                       mlt_frame_set_image( frame, *buffer, size, NULL );
                        // self->top_field_first = mlt_properties_get_int( frame_properties, "top_field_first" );
                        self->got_picture = 1;
 
@@ -1206,7 +1206,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                          || ( !use_new_seek && self->current_position > req_position ) ) )
        {
                // Duplicate it
-               if ( ( image_size = allocate_buffer( frame_properties, codec_context, buffer, format, width, height ) ) )
+               if ( ( image_size = allocate_buffer( frame, codec_context, buffer, format, width, height ) ) )
                {
                        // Workaround 1088 encodings missing cropping info.
                        if ( *height == 1088 && mlt_profile_dar( mlt_service_profile( MLT_PRODUCER_SERVICE( producer ) ) ) == 16.0/9.0 )
index 08d848f6701b58eb3a909865b90b0a5617ad8571..5d1798076668ea1cf256194c193f90944c0e4cda 100644 (file)
@@ -32,7 +32,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
        int size = *width * *height * 2;
        *format = mlt_image_yuv422;
        *image = mlt_pool_alloc( size );
-       mlt_properties_set_data( MLT_FRAME_PROPERTIES(this), "image", *image, size, mlt_pool_release, NULL );
+       mlt_frame_set_image( this, *image, size, mlt_pool_release );
        uint8_t *wave = mlt_frame_get_waveform( this, *width, *height );
        if ( wave )
        {
index cac0d85c685cfac61288ea2d6241b30cc2b16b60..4477b156d9d1399c6596f0d1fda93a130fedc68c 100644 (file)
@@ -129,10 +129,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        crop( *image, output, bpp, *width, *height, left, right, top, bottom );
 
                        // Now update the frame
+                       mlt_frame_set_image( this, output, owidth * ( oheight + 1 ) * bpp, mlt_pool_release );
                        *image = output;
-                       mlt_properties_set_data( properties, "image", output, owidth * ( oheight + 1 ) * bpp, ( mlt_destructor )mlt_pool_release, NULL );
-                       mlt_properties_set_int( properties, "width", owidth );
-                       mlt_properties_set_int( properties, "height", oheight );
                }
 
                // We should resize the alpha too
@@ -145,7 +143,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        if ( newalpha )
                        {
                                crop( alpha, newalpha, 1, *width, *height, left, right, top, bottom );
-                               mlt_properties_set_data( properties, "alpha", newalpha, owidth * oheight, ( mlt_destructor )mlt_pool_release, NULL );
+                               mlt_frame_set_alpha( this, newalpha, owidth * oheight, mlt_pool_release );
                                this->get_alpha_mask = NULL;
                        }
                }
index 5c2ffdf6c46167dba3942c496001821a3e7bb9bd..1dfc8b9c90bbb37ee761ed5f1b0e90dcdcf4875b 100644 (file)
@@ -343,9 +343,9 @@ static int convert_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *f
 
                        if ( !( error = converter( *buffer, image, alpha, width, height ) ) )
                        {
-                               mlt_properties_set_data( properties, "image", image, size, mlt_pool_release, NULL );
+                               mlt_frame_set_image( frame, image, size, mlt_pool_release );
                                if ( alpha && ( *format == mlt_image_rgb24a || *format == mlt_image_opengl ) )
-                                       mlt_properties_set_data( properties, "alpha", alpha, alpha_size, mlt_pool_release, NULL );
+                                       mlt_frame_set_alpha( frame, alpha, alpha_size, mlt_pool_release );
                                *buffer = image;
                                *format = requested_format;
                        }
index 0a146bebfce49d5aeba678f190a5b4abe70efe6f..a44416b2a480e9de5dbbd6967b0b46455fe4de0b 100644 (file)
@@ -107,7 +107,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        mlt_log_debug( MLT_FILTER_SERVICE(filter), "copying frame %d\n", modulo_pos );
                        mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
                        memcpy( dst, src, size );
-                       mlt_properties_set_data( b_props, "image", dst, size, mlt_pool_release, NULL );
+                       mlt_frame_set_image( b_frame, dst, size, mlt_pool_release );
                        mlt_properties_set_int( b_props, "width", *width );
                        mlt_properties_set_int( b_props, "height", *height );
                        mlt_properties_set_int( b_props, "format", *format );
index 152c7624a75db16a480d9c8db2ae73b807ce8149..b0cd765712b3997b7142d90708f343ba3ab79ad7 100644 (file)
@@ -41,9 +41,6 @@ typedef int ( *image_scaler )( mlt_frame this, uint8_t **image, mlt_image_format
 
 static int filter_scale( mlt_frame this, uint8_t **image, mlt_image_format *format, int iwidth, int iheight, int owidth, int oheight )
 {
-       // Get the properties
-       mlt_properties properties = MLT_FRAME_PROPERTIES( this );
-
        // Create the output image
        uint8_t *output = mlt_pool_alloc( owidth * ( oheight + 1 ) * 2 );
 
@@ -106,11 +103,9 @@ static int filter_scale( mlt_frame this, uint8_t **image, mlt_image_format *form
        }
  
        // Now update the frame
-       mlt_properties_set_data( properties, "image", output, owidth * ( oheight + 1 ) * 2, ( mlt_destructor ) mlt_pool_release, NULL );
-       mlt_properties_set_int( properties, "width", owidth );
-       mlt_properties_set_int( properties, "height", oheight );
-
+       mlt_frame_set_image( this, output, owidth * ( oheight + 1 ) * 2, mlt_pool_release );
        *image = output;
+
        return 0;
 }
 
@@ -139,7 +134,7 @@ static void scale_alpha( mlt_frame this, int iwidth, int iheight, int owidth, in
                }
 
                // Set it back on the frame
-               mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "alpha", output, owidth * oheight, mlt_pool_release, NULL );
+               mlt_frame_set_alpha( this, output, owidth * oheight, mlt_pool_release );
        }
 }
 
index 6013bd69c9723f0bd1852562fad2a7c5830d8f25..bb61e849fce8f2fb3f33d1b872c982a9105128f3 100644 (file)
@@ -158,9 +158,7 @@ static uint8_t *frame_resize_image( mlt_frame this, int owidth, int oheight, int
                resize_image( output, owidth, oheight, input, iwidth, iheight, bpp );
 
                // Now update the frame
-               mlt_properties_set_data( properties, "image", output, owidth * ( oheight + 1 ) * bpp, ( mlt_destructor )mlt_pool_release, NULL );
-               mlt_properties_set_int( properties, "width", owidth );
-               mlt_properties_set_int( properties, "height", oheight );
+               mlt_frame_set_image( this, output, owidth * ( oheight + 1 ) * bpp, mlt_pool_release );
 
                // We should resize the alpha too
                if ( alpha && alpha_size >= iwidth * iheight )
@@ -168,7 +166,7 @@ static uint8_t *frame_resize_image( mlt_frame this, int owidth, int oheight, int
                        alpha = resize_alpha( alpha, owidth, oheight, iwidth, iheight, alpha_value );
                        if ( alpha )
                        {
-                               mlt_properties_set_data( properties, "alpha", alpha, owidth * oheight, ( mlt_destructor )mlt_pool_release, NULL );
+                               mlt_frame_set_alpha( this, alpha, owidth * oheight, mlt_pool_release );
                                this->get_alpha_mask = NULL;
                        }
                }
@@ -301,7 +299,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        // Get the input image, width and height
                        int size = owidth * oheight * bpp;
                        uint8_t *new_image = mlt_pool_alloc( size );
-                       mlt_properties_set_data( properties, "image", new_image, size, ( mlt_destructor )mlt_pool_release, NULL );
+                       mlt_frame_set_image( this, new_image, size, mlt_pool_release );
                        uint8_t *ptr = new_image + owidth * bpp;
                        memcpy( new_image, *image, owidth * bpp );
                        memcpy( ptr, *image, size - owidth * bpp );
index bb9ffd889ac7924d68fbb3f8a7819d65e5ee3dc3..bf2b87d99a8d7ded70a8ea5bb1c09d6d5c5105a0 100644 (file)
@@ -197,8 +197,8 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                                mlt_service_apply_filters( MLT_FILTER_SERVICE( this ), b_frame, 0 );
                                error = mlt_frame_get_image( b_frame, image, format, width, height, 1 );
                                alpha = mlt_frame_get_alpha_mask( b_frame );
-                               mlt_properties_set_data( a_props, "image", *image, *width * *height * 2, NULL, NULL );
-                               mlt_properties_set_data( a_props, "alpha", alpha, *width * *height, NULL, NULL );
+                               mlt_frame_set_image( frame, *image, *width * *height * 2, NULL );
+                               mlt_frame_set_alpha( frame, alpha, *width * *height, NULL );
                                mlt_properties_set_int( a_props, "width", *width );
                                mlt_properties_set_int( a_props, "height", *height );
                                mlt_properties_set_int( a_props, "progressive", 1 );
index 7c1e19f7d83b1dcd48e446b8b3e10ab9e390e3ab..03c41a2b6404595c92e345292e54a41444941cf7 100644 (file)
@@ -226,8 +226,8 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        memcpy( *buffer, image, size );
 
        // Now update properties so we free the copy after
-       mlt_properties_set_data( properties, "image", *buffer, size, mlt_pool_release, NULL );
-       mlt_properties_set_data( properties, "alpha", alpha, alpha_size, mlt_pool_release, NULL );
+       mlt_frame_set_image( frame, *buffer, size, mlt_pool_release );
+       mlt_frame_set_alpha( frame, alpha, alpha_size, mlt_pool_release );
        mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_props, "aspect_ratio" ) );
        mlt_properties_set_int( properties, "real_width", *width );
        mlt_properties_set_int( properties, "real_height", *height );
index ba61f33e6723db0c28d21adea0ca8261e9f84c3a..22bb23220aa8d47c6be1479c2c1257d12e15b817 100644 (file)
@@ -52,7 +52,7 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format
 
        // Update the frame
        mlt_properties properties = mlt_frame_properties( frame );
-       mlt_properties_set_data( properties, "image", new_image, size, mlt_pool_release, NULL );
+       mlt_frame_set_image( frame, new_image, size, mlt_pool_release );
        memcpy( new_image, *image, size );
        mlt_properties_set( properties, "progressive", mlt_properties_get( MLT_FRAME_PROPERTIES(nested_frame), "progressive" ) );
        *image = new_image;
@@ -63,7 +63,7 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format
        {
                new_image = mlt_pool_alloc( size );
                memcpy( new_image, alpha, size );
-               mlt_properties_set_data( properties, "alpha", new_image, size, mlt_pool_release, NULL );
+               mlt_frame_set_alpha( frame, new_image, size, mlt_pool_release );
        }
 
        return result;
index acd39ef80bd9007fecd9576acbeae95e982d7752..da8a438fd94d0fe5611423cb84460a390f770489 100644 (file)
@@ -119,12 +119,12 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                uint8_t *image = mlt_pool_alloc( size );
                memcpy( image, *buffer, size );
                *buffer = image;
-               mlt_properties_set_data( properties, "image", *buffer, size, mlt_pool_release, NULL );
+               mlt_frame_set_image( frame, *buffer, size, mlt_pool_release );
        }
        else
        {
                // Pass the current image as is
-               mlt_properties_set_data( properties, "image", *buffer, size, NULL, NULL );
+               mlt_frame_set_image( frame, *buffer, size, NULL );
        }
 
        // Make sure that no further scaling is done
@@ -171,7 +171,7 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index
                {
                        // Temporary fix - ensure that we aren't seen as a test frame
                        int8_t *image = mlt_properties_get_data( MLT_FRAME_PROPERTIES( real_frame ), "image", NULL );
-                       mlt_properties_set_data( MLT_FRAME_PROPERTIES( *frame ), "image", image, 0, NULL, NULL );
+                       mlt_frame_set_image( *frame, image, 0, NULL );
                        mlt_properties_set_int( MLT_FRAME_PROPERTIES( *frame ), "test_image", 0 );
                }
 
index ae0dc21b8dd1f3560fafec3ed4070424562f486c..3c7a699ead8cc35e34927f2a2d39904c4d0019d1 100644 (file)
@@ -78,9 +78,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        *buffer = mlt_pool_alloc( size );
 
        // Update the frame
-       mlt_properties_set_data( properties, "image", *buffer, size, mlt_pool_release, NULL );
-       mlt_properties_set_int( properties, "width", *width );
-       mlt_properties_set_int( properties, "height", *height );
+       mlt_frame_set_image( frame, *buffer, size, mlt_pool_release );
 
        // Before we write to the image, make sure we have one
        if ( *buffer != NULL )
index faa279266d6f839a934fadb8bc2f7a00e22f4fbd..aeb3591256cebe347fc0cc7ed2afb698879326ba 100644 (file)
@@ -214,7 +214,7 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
                fread( image, width * height * 3, 1, video );
 
                // Pass the data on the frame properties
-               mlt_properties_set_data( properties, "image", image, width * ( height + 1 ) * 3, ( mlt_destructor )mlt_pool_release, NULL );
+               mlt_frame_set_image( *frame, image, width * ( height + 1 ) * 3, mlt_pool_release );
                mlt_properties_set_int( properties, "width", width );
                mlt_properties_set_int( properties, "height", height );
                mlt_properties_set_int( properties, "has_image", 1 );
index c8f92df639d465b6528785423bc14fb97612ea96..ccceb5131c164c94d49fda57eda084061afedb43 100644 (file)
@@ -1048,7 +1048,7 @@ mlt_frame composite_copy_region( mlt_transition this, mlt_frame a_frame, mlt_pos
        dest = mlt_pool_alloc( w * h * 2 );
 
        // Assign to the new frame
-       mlt_properties_set_data( b_props, "image", dest, w * h * 2, mlt_pool_release, NULL );
+       mlt_frame_set_image( b_frame, dest, w * h * 2, mlt_pool_release );
        mlt_properties_set_int( b_props, "width", w );
        mlt_properties_set_int( b_props, "height", h );
        mlt_properties_set_int( b_props, "format", format );
index 9524dfc9556aef4cc6aefb1cfa144126f32d082e..404faf1bd54b9c60eee209ff788441482c70ca5b 100644 (file)
@@ -123,11 +123,11 @@ static uint8_t *filter_get_alpha_mask( mlt_frame this )
                        *p ++ = ( int )( ( ( *image ++ - 16 ) * 299 ) / 255 );
                        image ++;
                }
-               mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "alpha", alpha, region_width * region_height, mlt_pool_release, NULL );
+               mlt_frame_set_alpha( this, alpha, region_width * region_height, mlt_pool_release );
        }
        else
        {
-               mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "alpha", alpha, region_width * region_height, NULL, NULL );
+               mlt_frame_set_alpha( this, alpha, region_width * region_height, NULL );
        }
 
        this->get_alpha_mask = NULL;
index 152683fbd5d9bf6e9e0590122cd5aa1cc5042405..d76f45eabb4c6df14fa0349a15392ce0204912a4 100644 (file)
@@ -1062,7 +1062,7 @@ static int get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format
                                        // Do first and last lines.
                                        uint8_t *final = mlt_pool_alloc( image_size );
                                        cx->finalp = final;
-                                       mlt_properties_set_data( frame_properties, "image", final, image_size, (mlt_destructor)mlt_pool_release, NULL );
+                                       mlt_frame_set_image( frame, final, image_size, mlt_pool_release );
                                        dstpn = cx->dstp + cx->dpitch;
                                        for ( cx->x = 0; cx->x < cx->w; cx->x++ )
                                        {
index 80c713c786862239ccef84f8ba793a1b183517b6..3d9eaf4edfc261d241510880e0701d19e56d2dab 100644 (file)
@@ -326,7 +326,7 @@ static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_forma
                uint8_t *image = mlt_pool_alloc( *width * ( *height + 1 ) * 2 );
 
                // Pass to properties for clean up
-               mlt_properties_set_data( properties, "image", image, *width * ( *height + 1 ) * 2, ( mlt_destructor )mlt_pool_release, NULL );
+               mlt_frame_set_image( this, image, *width * ( *height + 1 ) * 2, mlt_pool_release );
 
                // Decode the image
                pitches[ 0 ] = *width * 2;
@@ -343,7 +343,7 @@ static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_forma
                uint8_t *image = mlt_pool_alloc( *width * ( *height + 1 ) * 3 );
 
                // Pass to properties for clean up
-               mlt_properties_set_data( properties, "image", image, *width * ( *height + 1 ) * 3, ( mlt_destructor )mlt_pool_release, NULL );
+               mlt_frame_set_image( this, image, *width * ( *height + 1 ) * 3, mlt_pool_release );
 
                // Decode the frame
                pitches[ 0 ] = 720 * 3;
index bbc08cea18cd574c45b4f1a431db599f97ae1ddd..f4a02984dd2370d1339d64326eac8b795e81fca6 100644 (file)
@@ -155,7 +155,7 @@ int process_frei0r_item( mlt_service service, double position, mlt_properties pr
                rgba_bgra((uint8_t*) dest, (uint8_t*) result, *width, *height);
        }
        *image = (uint8_t*) result;
-       mlt_properties_set_data(MLT_FRAME_PROPERTIES(this), "image", result, video_area * sizeof(uint32_t), mlt_pool_release, NULL);
+       mlt_frame_set_image(this, (uint8_t*) result, video_area * sizeof(uint32_t), mlt_pool_release);
        if (extra)
                mlt_pool_release(extra);
 
index dc8b0a1ed345741518caa0691e99a94f503465a1..47e36cdf57b29cf6f57cdc8034ced5a925057458 100644 (file)
@@ -43,9 +43,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        *buffer = mlt_pool_alloc( size );
 
        // Update the frame
-       mlt_properties_set_data( properties, "image", *buffer, size, mlt_pool_release, NULL );
-       mlt_properties_set_int( properties, "width", *width );
-       mlt_properties_set_int( properties, "height", *height );
+       mlt_frame_set_image( frame, *buffer, size, mlt_pool_release );
 
        *format = mlt_image_rgb24a;
        if ( *buffer != NULL )
index 7639b05bed9141d3fe268e5c512a64da290868a9..e4aa1b8cb4d133be485e0808d019534fe1d53f98 100644 (file)
@@ -62,9 +62,7 @@ static int filter_scale( mlt_frame this, uint8_t **image, mlt_image_format *form
                yuv422_scale_simple( output, owidth, oheight, ostride, *image, iwidth, iheight, istride, interp );
                
                // Now update the frame
-               mlt_properties_set_data( properties, "image", output, owidth * ( oheight + 1 ) * 2, ( mlt_destructor )mlt_pool_release, NULL );
-               mlt_properties_set_int( properties, "width", owidth );
-               mlt_properties_set_int( properties, "height", oheight );
+               mlt_frame_set_image( this, output, owidth * ( oheight + 1 ) * 2, mlt_pool_release );
 
                // Return the output
                *image = output;
@@ -109,9 +107,7 @@ static int filter_scale( mlt_frame this, uint8_t **image, mlt_image_format *form
                        g_object_unref( scaled );
 
                        // Now update the frame
-                       mlt_properties_set_data( properties, "image", output, owidth * ( oheight + 1 ) * bpp, ( mlt_destructor )mlt_pool_release, NULL );
-                       mlt_properties_set_int( properties, "width", owidth );
-                       mlt_properties_set_int( properties, "height", oheight );
+                       mlt_frame_set_image( this, output, owidth * ( oheight + 1 ) * bpp, mlt_pool_release );
        
                        // Return the output
                        *image = output;
index 74c0d464b9b207c457c885d51899ed165f9a7398..2e4de19245eb63cc4ebc1aecfb39101b626abd3e 100644 (file)
@@ -485,7 +485,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                memcpy( *buffer, gdk_pixbuf_get_pixels( this->pixbuf ), image_size );
 
                // Now update properties so we free the copy after
-               mlt_properties_set_data( properties, "image", *buffer, image_size, mlt_pool_release, NULL );
+               mlt_frame_set_image( frame, *buffer, image_size, mlt_pool_release );
                *format = mlt_image_rgb24a;
        }
        else
index e839df20ee68b8b4f85afb73f9a592f3a13bf9a9..b12d7811b7412a8f12af802924d86fd5a9d02604 100644 (file)
@@ -443,7 +443,7 @@ static void refresh_image( producer_pixbuf this, mlt_frame frame, int width, int
                mlt_properties_set_int( cached_props, "height", this->height );
                mlt_properties_set_int( cached_props, "real_width", mlt_properties_get_int( producer_props, "_real_width" ) );
                mlt_properties_set_int( cached_props, "real_height", mlt_properties_get_int( producer_props, "_real_height" ) );
-               mlt_properties_set_data( cached_props, "image", this->image, this->width * ( this->alpha ? 4 : 3 ) * this->height, mlt_pool_release, NULL );
+               mlt_frame_set_image( cached, this->image, this->width * ( this->alpha ? 4 : 3 ) * this->height, mlt_pool_release );
                mlt_properties_set_int( cached_props, "alpha", this->alpha );
                mlt_properties_set_data( cache, image_key, cached, 0, ( mlt_destructor )mlt_frame_close, NULL );
        }
@@ -482,7 +482,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                uint8_t *image_copy = mlt_pool_alloc( image_size );
                memcpy( image_copy, this->image, image_size );
                // Now update properties so we free the copy after
-               mlt_properties_set_data( properties, "image", image_copy, image_size, mlt_pool_release, NULL );
+               mlt_frame_set_image( frame, image_copy, image_size, mlt_pool_release );
                // We're going to pass the copy on
                *buffer = image_copy;
                *format = this->alpha ? mlt_image_rgb24a : mlt_image_rgb24;
index c4768e27e074d2df89059b40996a61979debfe38..28feb895975ab53beae1022fe6b175a9a455c0cd 100755 (executable)
@@ -99,7 +99,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                uint8_t *image_copy = mlt_pool_alloc( size );
                memcpy( image_copy, buffer, size );
                *image = image_copy;
-               mlt_properties_set_data( props, "image", *image, size, ( mlt_destructor ) mlt_pool_release, NULL );
+               mlt_frame_set_image( this, *image, size, mlt_pool_release );
                mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
 
                return error;
index 2e655f4c622deb7af9d193f659999122a986e164..10811866219f29f390d2bbf387bbef169d6b12b6 100644 (file)
@@ -81,7 +81,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                        uint8_t *dst = mlt_pool_alloc (image_size);
                        DoWave(*image, *width, (*height), dst, position, speed, factor, deformX, deformY);
                        *image = dst;
-                       mlt_properties_set_data( MLT_FRAME_PROPERTIES( frame ), "image", *image, image_size, mlt_pool_release, NULL );
+                       mlt_frame_set_image( frame, *image, image_size, mlt_pool_release );
                }
        }
 
index 7248786690b091f714fb95e2030d03ce64752ca4..6ec1740a1bf6d4f661aa67f5fe6502addcf97803 100644 (file)
@@ -132,7 +132,7 @@ static int framebuffer_get_image( mlt_frame this, uint8_t **image, mlt_image_for
 
                // Set the output image
                *image = image_copy;
-               mlt_properties_set_data( frame_properties, "image", image_copy, size, ( mlt_destructor )mlt_pool_release, NULL );
+               mlt_frame_set_image( this, image_copy, size, mlt_pool_release );
 
                *width = mlt_properties_get_int( properties, "_output_width" );
                *height = mlt_properties_get_int( properties, "_output_height" );
@@ -191,7 +191,7 @@ static int framebuffer_get_image( mlt_frame this, uint8_t **image, mlt_image_for
 
        // Set the output image
        *image = image_copy;
-       mlt_properties_set_data( frame_properties, "image", *image, size, ( mlt_destructor )mlt_pool_release, NULL );
+       mlt_frame_set_image( this, *image, size, mlt_pool_release );
 
        return 0;
 }
index 1e4ba0c54db8dff47ef60aa2883759a9de59e2d4..7e3a4cfffe3e1e8ec7922d5e5292d86e0ccad017 100644 (file)
@@ -261,7 +261,7 @@ static int slowmotion_get_image( mlt_frame this, uint8_t **image, mlt_image_form
        }
 
        *image = output;
-       mlt_properties_set_data( frame_properties, "image", output, size, NULL, NULL );
+       mlt_frame_set_image( this, output, size, NULL );
 
        // Make sure that no further scaling is done
        mlt_properties_set( frame_properties, "rescale.interps", "none" );
index f8c21e2c619876e76322e9df960d9c87280e328c..1318b2814f1a66cfa6dc412293c5cdf6c571ea60 100644 (file)
@@ -105,8 +105,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        
                        mlt_frame_get_image( a_frame, image, format, width, height, writable );
                        mlt_properties_set_data( frame_properties, "affine_frame", a_frame, 0, (mlt_destructor)mlt_frame_close, NULL );
-                       mlt_properties_set_data( frame_properties, "image", *image, *width * *height * 4, NULL, NULL );
-                       mlt_properties_set_data( frame_properties, "alpha", mlt_frame_get_alpha_mask( a_frame ), *width * *height, NULL, NULL );
+                       mlt_frame_set_image( this, *image, *width * *height * 4, NULL );
+                       mlt_frame_set_alpha( this, mlt_frame_get_alpha_mask( a_frame ), *width * *height, NULL );
                }
                else
                {
index 3c7c22cd74f9baca6d291ac401939323b87e84b9..703b32249c17d8b8f47bb748758d2cb7bc5c7a34 100644 (file)
@@ -138,7 +138,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                *image = temp;
 
                // Store new and destroy old
-               mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "image", *image, *width * *height * 2, mlt_pool_release, NULL );
+               mlt_frame_set_image( this, *image, *width * *height * 2, mlt_pool_release );
        }
 
        return error;
index 6a90abde67730964e9d57492e3ee5fdc49848e2c..5c37d3a348f4d9994ef5d8b46b0fdf27998129b6 100644 (file)
@@ -60,9 +60,6 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
        *width = mlt_properties_get_int( properties, "rescale_width" );
        *height = mlt_properties_get_int( properties, "rescale_height" );
        
-       /* Allocate the image */
-       int size = *width * ( *height ) * 4;
-
        mlt_service_lock( MLT_PRODUCER_SERVICE( &this->parent ) );
 
        /* Allocate the image */
@@ -86,12 +83,9 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                uint8_t *image_copy = mlt_pool_alloc( image_size );
                memcpy( image_copy, this->current_image, image_size );
                // Now update properties so we free the copy after
-               mlt_properties_set_data( properties, "image", image_copy, image_size, mlt_pool_release, NULL );
+               mlt_frame_set_image( frame, image_copy, image_size, mlt_pool_release );
                // We're going to pass the copy on
                *buffer = image_copy;           
-               
-               /* Update the frame */
-               mlt_properties_set_data( properties, "image", *buffer, size, mlt_pool_release, NULL );
 
                mlt_log_debug( MLT_PRODUCER_SERVICE( &this->parent ), "width:%d height:%d %s\n", *width, *height, mlt_image_format_name( *format ) );
        }
index 561eef9f58187892397eb228245352a065c070f6..7ad5a435e4b4462f54ec6f438e37d7398c07b04c 100644 (file)
@@ -179,7 +179,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_form
                uint8_t *image_copy = mlt_pool_alloc( image_size );
                memcpy( image_copy, this->current_image, image_size );
                // Now update properties so we free the copy after
-               mlt_properties_set_data( properties, "image", image_copy, image_size, mlt_pool_release, NULL );
+               mlt_frame_set_image( frame, image_copy, image_size, mlt_pool_release );
                // We're going to pass the copy on
                *buffer = image_copy;
                *format = this->has_alpha ? mlt_image_rgb24a : mlt_image_rgb24;
index 0d6246643488e79289e86df0cf250976e3471e2b..bb7bdfba049c32a34251787b3d638ff70b675d6d 100644 (file)
@@ -80,9 +80,7 @@ static int producer_get_image( mlt_frame frame, uint8_t **image, mlt_image_forma
                SDL_FreeSurface( converted );
 
        // Update the frame
-       mlt_properties_set_data( properties, "image", *image, image_size, mlt_pool_release, NULL );
-       mlt_properties_set_int( properties, "width", *width );
-       mlt_properties_set_int( properties, "height", *height );
+       mlt_frame_set_image( frame, *image, image_size, mlt_pool_release );
 
        return 0;
 }
index 8f0d7008b4b45baebc20e1f0b1dd2c1d6f31a553..a58d48c7927aa66d1f2beff1fb483438b3c4c991 100644 (file)
@@ -125,7 +125,7 @@ static int get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *forma
        *format = mlt_image_rgb24a;
 
        *buffer = mlt_pool_alloc( *width * ( *height + 1 ) * 4 );
-       mlt_properties_set_data( properties, "image", *buffer, *width * ( *height + 1 ) * 4, (mlt_destructor) mlt_pool_release, NULL );
+       mlt_frame_set_image( frame, *buffer, *width * ( *height + 1 ) * 4, mlt_pool_release );
 
        // Seek
        mlt_position pos = mlt_properties_get_position( properties, "swfdec.position" );
index 6713317cff4a1de08aac8922c40f1f9cb0a75abe..3988da64c1cc102d190d4be28a4b1fc3092e24be 100644 (file)
@@ -161,7 +161,7 @@ static int producer_get_image( mlt_frame this, uint8_t **buffer, mlt_image_forma
        uint8_t *image = mlt_pool_alloc( size * 2 );
        uint8_t *source = mlt_properties_get_data( MLT_PRODUCER_PROPERTIES( producer ), "image", NULL );
 
-       mlt_properties_set_data( MLT_FRAME_PROPERTIES( this ), "image", image, size * 2, mlt_pool_release, NULL );
+       mlt_frame_set_image( this, image, size * 2, mlt_pool_release );
 
        *width = real_width;
        *height = real_height;
index e864c80569385df0172a49a821145b856877a575..c028da916b9870baf7599a81e33d03742a1895f9 100644 (file)
@@ -247,7 +247,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                                uint8_t *new_image = mlt_pool_alloc( image_size );
 
                                deinterlace_yuv( new_image, image, *width * 2, *height, method );
-                               mlt_properties_set_data( properties, "image", new_image, image_size, mlt_pool_release, NULL );
+                               mlt_frame_set_image( this, new_image, image_size, mlt_pool_release );
                                *image = new_image;
                        }
                }