// Color the image
rgba_color color = parse_color( mlt_properties_get( producer_props, "resource" ) );
uint8_t y, u, v;
- int i;
+ int i = 0;
RGB2YUV( color.r, color.g, color.b, y, u, v );
- color.r = y;
- color.g = u;
- color.b = y;
- color.a = v;
- for ( i = 0; i < size; i += 4 )
- memcpy( &image[ i ], &color, 4 );
+
+ while ( i < size )
+ {
+ image[ i ++ ] = y;
+ image[ i ++ ] = u;
+ image[ i ++ ] = y;
+ image[ i ++ ] = v;
+ }
}
// Update the frame
// Obtain properties of producer
mlt_properties producer_props = mlt_producer_properties( producer );
+ // Determine if we're producing PAL or NTSC
+ int is_pal = mlt_properties_get_double( producer_props, "fps" ) == 25.0;
+
// Set the producer on the frame properties
mlt_properties_set_data( properties, "producer_colour", producer, 0, NULL, NULL );
// Set producer-specific frame properties
mlt_properties_set_int( properties, "progressive", 1 );
+ mlt_properties_set_double( properties, "aspect_ratio", is_pal ? 128.0/117.0 : 72.0/79.0 );
// colour is an alias for resource
if ( mlt_properties_get( producer_props, "colour" ) != NULL )
mlt_producer_close( producer );
free( producer );
}
-