int index = ( int )mlt_frame_pop_service( this );
mlt_properties properties = MLT_PRODUCER_PROPERTIES( producer );
+ mlt_service_lock( MLT_PRODUCER_SERVICE( producer ) );
+
// Frame properties objects
mlt_properties frame_properties = MLT_FRAME_PROPERTIES( this );
mlt_frame first_frame = mlt_properties_get_data( properties, "first_frame", NULL );
// 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" );
*format = mlt_properties_get_int( properties, "_output_format" );
+ mlt_service_unlock( MLT_PRODUCER_SERVICE( producer ) );
return 0;
}
int error = mlt_frame_get_image( first_frame, &first_image, format, width, height, writable );
if ( error != 0 ) {
- fprintf(stderr, "first_image == NULL get image died\n");
+ mlt_log_error( MLT_PRODUCER_SERVICE( producer ), "first_image == NULL get image died\n" );
+ mlt_service_unlock( MLT_PRODUCER_SERVICE( producer ) );
return error;
}
output = mlt_pool_alloc( size );
mlt_properties_set_int( properties, "_output_format", *format );
}
+ mlt_service_unlock( MLT_PRODUCER_SERVICE( producer ) );
// Create a copy
uint8_t *image_copy = mlt_pool_alloc( size );
// 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;
}
mlt_frame_push_service( *frame, this );
mlt_frame_push_service( *frame, framebuffer_get_image );
- mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
- mlt_properties frame_properties = MLT_FRAME_PROPERTIES(*frame);
-
- double force_aspect_ratio = mlt_properties_get_double( properties, "force_aspect_ratio" );
- if ( force_aspect_ratio <= 0.0 ) force_aspect_ratio = mlt_properties_get_double( properties, "aspect_ratio" );
- mlt_properties_set_double( frame_properties, "aspect_ratio", force_aspect_ratio );
+ mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
+ mlt_properties frame_properties = MLT_FRAME_PROPERTIES(*frame);
+
+ double force_aspect_ratio = mlt_properties_get_double( properties, "force_aspect_ratio" );
+ if ( force_aspect_ratio <= 0.0 ) force_aspect_ratio = mlt_properties_get_double( properties, "aspect_ratio" );
+ mlt_properties_set_double( frame_properties, "aspect_ratio", force_aspect_ratio );
// Give the returned frame temporal identity
mlt_frame_set_position( *frame, mlt_producer_position( this ) );