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 );
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;
}
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;
}
}
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 )
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];
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 );
}
}
/** 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;
// 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;
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;
|| ( !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 )
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 )
{
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
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;
}
}
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;
}
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 );
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 );
}
// 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;
}
}
// 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 );
}
}
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 )
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;
}
}
// 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 );
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 );
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 );
// 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;
{
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;
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
{
// 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 );
}
*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 )
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 );
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 );
*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;
// 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++ )
{
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;
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;
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);
*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 )
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;
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;
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
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 );
}
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;
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;
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 );
}
}
// 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" );
// 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;
}
}
*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" );
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
{
*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;
*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 */
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 ) );
}
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;
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;
}
*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" );
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;
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;
}
}