// Get the width and height
int width = mlt_properties_get_int( properties, "width" );
int height = mlt_properties_get_int( properties, "height" );
+ int format = this->format;
// See if video is turned off
int video_off = mlt_properties_get_int( properties, "video_off" );
uint8_t *image = NULL;
if ( preview_off && preview_format != 0 )
- this->format = preview_format;
+ format = preview_format;
// Get the first frame from the work queue
pthread_mutex_lock( &this->frame_queue_mutex );
if ( !video_off )
{
mlt_events_fire( MLT_CONSUMER_PROPERTIES( this ), "consumer-frame-render", frame, NULL );
- mlt_frame_get_image( frame, &image, &this->format, &width, &height, 0 );
+ mlt_frame_get_image( frame, &image, &format, &width, &height, 0 );
}
if ( !audio_off )
if ( !video_off )
{
mlt_events_fire( MLT_CONSUMER_PROPERTIES( this ), "consumer-frame-render", frame, NULL );
- mlt_frame_get_image( frame, &image, &this->format, &width, &height, 0 );
+ mlt_frame_get_image( frame, &image, &format, &width, &height, 0 );
}
mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "rendered", 1 );
{
mlt_properties_set_int( properties, "width", *width );
mlt_properties_set_int( properties, "height", *height );
- mlt_properties_set_int( properties, "format", *format );
- if ( this->convert_image )
+ if ( this->convert_image && *buffer )
this->convert_image( this, buffer, format, requested_format );
+ mlt_properties_set_int( properties, "format", *format );
}
else
{
*width = mlt_properties_get_int( properties, "width" );
*height = mlt_properties_get_int( properties, "height" );
if ( this->convert_image && *buffer )
+ {
this->convert_image( this, buffer, format, requested_format );
+ mlt_properties_set_int( properties, "format", *format );
+ }
}
else if ( producer )
{
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 );
+ this->convert_image = frame->convert_image;
+ this->convert_audio = frame->convert_audio;
return 0;
}
error = 1;
}
}
- if ( !error )
- mlt_properties_set_int( properties, "format", *format );
return error;
}
{
// Get the image, width and height
mlt_frame_get_image( frame, &image, &vfmt, &width, &height, 0 );
- mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "format", vfmt );
void *pool = mlt_cocoa_autorelease_init();
vfmt = preview_format == mlt_image_none ? mlt_image_rgb24a : preview_format;
if ( !video_off )
mlt_frame_get_image( frame, &image, &vfmt, &width, &height, 0 );
- mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "format", vfmt );
mlt_events_fire( properties, "consumer-frame-show", frame, NULL );
}