- QPainterPath* qPath = static_cast<QPainterPath*>( mlt_properties_get_data( producer_properties, "_qpath", NULL ) );
- mlt_color bg_color = mlt_properties_get_color( producer_properties, "_bgcolour" );
- mlt_color fg_color = mlt_properties_get_color( producer_properties, "_fgcolour" );
- mlt_color ol_color = mlt_properties_get_color( producer_properties, "_olcolour" );
- int outline = mlt_properties_get_int( producer_properties, "_outline" );
- QSize native_size( mlt_properties_get_int( producer_properties, "meta.media.width" ),
- mlt_properties_get_int( producer_properties, "meta.media.height" ) );
+ QSize target_size( mlt_properties_get_int( frame_properties, "rescale_width" ),
+ mlt_properties_get_int( frame_properties, "rescale_height" ) );
+ QSize native_size( mlt_properties_get_int( frame_properties, "meta.media.width" ),
+ mlt_properties_get_int( frame_properties, "meta.media.height" ) );
+
+ // Check if the last image signature is different from the path signature
+ // for this frame.
+ char* last_img_sig = mlt_properties_get( producer_properties, "_img_sig" );
+ char* path_sig = mlt_properties_get( frame_properties, "_path_sig" );
+
+ if( !last_img_sig || strcmp( path_sig, last_img_sig ) )
+ {
+ mlt_properties_set( producer_properties, "_img_sig", path_sig );
+ return true;
+ }
+
+ // Check if the last image size matches the requested image size
+ QSize output_size = target_size;
+ if( output_size.isEmpty() )
+ {
+ output_size = native_size;
+ }
+ if( output_size != qImg->size() )
+ {
+ return true;
+ }
+
+ return false;
+}
+
+static void generate_qimage( mlt_properties frame_properties )
+{
+ mlt_producer producer = static_cast<mlt_producer>( mlt_properties_get_data( frame_properties, "_producer_qtext", NULL ) );
+ mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( producer );
+ QImage* qImg = static_cast<QImage*>( mlt_properties_get_data( producer_properties, "_qimg", NULL ) );
+ QSize target_size( mlt_properties_get_int( frame_properties, "rescale_width" ),
+ mlt_properties_get_int( frame_properties, "rescale_height" ) );
+ QSize native_size( mlt_properties_get_int( frame_properties, "meta.media.width" ),
+ mlt_properties_get_int( frame_properties, "meta.media.height" ) );
+ QPainterPath* qPath = static_cast<QPainterPath*>( mlt_properties_get_data( frame_properties, "_qpath", NULL ) );
+ mlt_color bg_color = mlt_properties_get_color( frame_properties, "_bgcolour" );
+ mlt_color fg_color = mlt_properties_get_color( frame_properties, "_fgcolour" );
+ mlt_color ol_color = mlt_properties_get_color( frame_properties, "_olcolour" );
+ int outline = mlt_properties_get_int( frame_properties, "_outline" );