}
rgba_color color = parse_color( now, mlt_properties_get_int( producer_props, "resource" ) );
+ // Choose suitable out values if nothing specific requested
+ if ( *format == mlt_image_none )
+ *format = mlt_image_rgb24a;
+ if ( *width <= 0 )
+ *width = mlt_service_profile( MLT_PRODUCER_SERVICE(producer) )->width;
+ if ( *height <= 0 )
+ *height = mlt_service_profile( MLT_PRODUCER_SERVICE(producer) )->height;
+
// See if we need to regenerate
if ( strcmp( now, then ) || *width != current_width || *height != current_height || *format != current_format )
{
*p ++ = color.b;
}
break;
- case mlt_image_rgb24a:
- case mlt_image_opengl:
+ default:
while ( --i )
{
*p ++ = color.r;
*p ++ = color.a;
}
break;
- default:
- break;
}
}
else
static int producer_get_image( mlt_frame frame, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable )
{
+ // Choose suitable out values if nothing specific requested
+ if ( *width <= 0 )
+ *width = mlt_service_profile( MLT_PRODUCER_SERVICE( mlt_frame_get_original_producer( frame ) ) )->width;
+ if ( *height <= 0 )
+ *height = mlt_service_profile( MLT_PRODUCER_SERVICE( mlt_frame_get_original_producer( frame ) ) )->height;
+
// Calculate the size of the image
int size = *width * *height * 2;
*height = dv_data[ 3 ] & 0x80 ? 576 : 480;
// Extract an image of the format requested
- if ( *format == mlt_image_yuv422 || *format == mlt_image_yuv420p )
+ if ( *format != mlt_image_rgb24 )
{
// Allocate an image
uint8_t *image = mlt_pool_alloc( *width * ( *height + 1 ) * 2 );
// 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 ) * 4;
// Get width and height
*width = this->width;
*height = this->height;
+ *format = mlt_image_rgb24a;
// Always clone here to allow 'animated' text
if ( this->pixbuf )
// Now update properties so we free the copy after
mlt_frame_set_image( frame, *buffer, image_size, mlt_pool_release );
- *format = mlt_image_rgb24a;
}
else
{
// Get width and height (may have changed during the refresh)
*width = this->width;
*height = this->height;
+ *format = this->alpha ? mlt_image_rgb24a : mlt_image_rgb24;
// NB: Cloning is necessary with this producer (due to processing of images ahead of use)
// The fault is not in the design of mlt, but in the implementation of the pixbuf producer...
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;
mlt_log_debug( MLT_PRODUCER_SERVICE( &this->parent ), "%dx%d (%s)\n",
this->width, this->height, mlt_image_format_name( *format ) );
}
// Get width and height (may have changed during the refresh)
*width = mlt_properties_get_int( properties, "width" );
*height = mlt_properties_get_int( properties, "height" );
+ *format = this->has_alpha ? mlt_image_rgb24a : mlt_image_rgb24;
// NB: Cloning is necessary with this producer (due to processing of images ahead of use)
// The fault is not in the design of mlt, but in the implementation of the qimage producer...
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;
mlt_log_debug( MLT_PRODUCER_SERVICE( &this->parent ), "%dx%d (%s)\n",
this->current_width, this->current_height, mlt_image_format_name( *format ) );
}
*image = mlt_pool_alloc( image_size );
memcpy( *image, surface->pixels, image_size );
break;
- case 24:
+ default:
*format = mlt_image_rgb24;
*image = mlt_pool_alloc( image_size );
memcpy( *image, surface->pixels, image_size );
break;
- default:
- *image = mlt_pool_alloc( image_size );
- memcpy( *image, converted->pixels, image_size );
- break;
}
if ( converted )