// Obtain properties of producer
mlt_properties producer_props = MLT_PRODUCER_PROPERTIES( producer );
+ // Choose suitable out values if nothing specific requested
+ if ( *width <= 0 )
+ *width = mlt_service_profile( MLT_PRODUCER_SERVICE(producer) )->width;
+ if ( *height <= 0 )
+ *height = mlt_service_profile( MLT_PRODUCER_SERVICE(producer) )->height;
+
// Allocate the image
- int size = *width * ( *height + 1 ) * 2;
+ int size = *width * ( *height + 1 ) * 4;
// Allocate the image
*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_yuv422;
+ *format = mlt_image_rgb24a;
if ( *buffer != NULL )
{
- mlt_position in = mlt_producer_get_in( producer );
- mlt_position out = mlt_producer_get_out( producer );
- mlt_position time = mlt_frame_get_position( frame );
- double position = ( double )( time - in ) / ( double )( out - in + 1 );
- process_frei0r_item( producer_type , position, producer_props, frame , buffer, format , width , height , writable );
+ double position = mlt_frame_get_position( frame );
+ mlt_profile profile = mlt_service_profile( MLT_PRODUCER_SERVICE( producer ) );
+ double time = position / mlt_profile_fps( profile );
+ process_frei0r_item( MLT_PRODUCER_SERVICE(producer), position, time, producer_props, frame, buffer, width, height );
}
return 0;
// Set producer-specific frame properties
mlt_properties_set_int( properties, "progressive", 1 );
- mlt_properties_set_double( properties, "aspect_ratio", mlt_properties_get_double( producer_props, "aspect_ratio" ) );
+ mlt_profile profile = mlt_service_profile( MLT_PRODUCER_SERVICE( producer ) );
+ mlt_properties_set_double( properties, "aspect_ratio", mlt_profile_sar( profile ) );
// Push the get_image method
mlt_frame_push_get_image( *frame, producer_get_image );