output->mix = out->mix;
output->distort = out->distort;
}
-
- // Definitely incorrect...
-#if 0
- if ( ( int )output->x & 1 && ( int )output->w & 1 )
- {
- output->x -= 1.0;
- output->w += 1.0;
- }
- else if ( ( int )output->x & 1 )
- {
- output->x += 1.0;
- }
- else if ( ( int )output->w & 1 )
- {
- output->w += 1.0;
- }
-#endif
}
static void transition_destroy_keys( void *arg )
static void alignment_calculate( struct geometry_s *geometry )
{
geometry->x += ( geometry->w - geometry->sw ) * geometry->halign / 2;
- geometry->y += ( geometry->h - geometry->sh ) * geometry->valign;
+ geometry->y += ( geometry->h - geometry->sh ) * geometry->valign / 2;
}
/** Calculate the position for this frame.
mlt_properties b_props = mlt_frame_properties( b_frame );
mlt_properties properties = mlt_transition_properties( this );
- if ( mlt_properties_get( properties, "distort" ) == NULL && geometry->distort == 0 )
+ if ( mlt_properties_get( properties, "distort" ) == NULL && mlt_properties_get( b_props, "distort" ) == NULL && geometry->distort == 0 )
{
// Adjust b_frame pixel aspect
int normalised_width = geometry->w;
if ( y + h > height )
h = height - y;
- //x = ( x | 1 ) ^ 1;
- //w = ( w | 1 ) ^ 1;
+ x = ( x | 1 ) ^ 1;
+ w = ( w | 1 ) ^ 1;
// Now we need to create a new destination image
dest = mlt_pool_alloc( w * h * 2 );
// Assign this position to the b frame
mlt_frame_set_position( b_frame, frame_position );
+ mlt_properties_set( b_props, "distort", "true" );
// Return the frame
return b_frame;
// Do the calculation
struct geometry_s *start = composite_calculate( &result, this, a_frame, position );
-
+
+ // Get the image from the b frame
+ uint8_t *image_b = NULL;
+ int width_b = *width;
+ int height_b = *height;
+
// Optimisation - no compositing required
if ( result.mix == 0 || ( result.w == 0 && result.h == 0 ) )
return 0;
+ // Need to keep the width/height of the a_frame on the b_frame for titling
+ if ( mlt_properties_get( a_props, "dest_width" ) == NULL )
+ {
+ mlt_properties_set_int( a_props, "dest_width", *width );
+ mlt_properties_set_int( a_props, "dest_height", *height );
+ mlt_properties_set_int( b_props, "dest_width", *width );
+ mlt_properties_set_int( b_props, "dest_height", *height );
+ }
+ else
+ {
+ mlt_properties_set_int( b_props, "dest_width", mlt_properties_get_int( a_props, "dest_width" ) );
+ mlt_properties_set_int( b_props, "dest_height", mlt_properties_get_int( a_props, "dest_height" ) );
+ }
+
// Since we are the consumer of the b_frame, we must pass along these
// consumer properties from the a_frame
+ mlt_properties_set_double( b_props, "consumer_deinterlace", mlt_properties_get_double( a_props, "consumer_deinterlace" ) );
mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
- // Get the image from the b frame
- uint8_t *image_b = NULL;
- int width_b = *width;
- int height_b = *height;
-
+ // Special case for titling...
+ if ( mlt_properties_get_int( properties, "titles" ) )
+ {
+ if ( mlt_properties_get( b_props, "rescale.interp" ) == NULL )
+ mlt_properties_set( b_props, "rescale.interp", "nearest" );
+ mlt_properties_set( properties, "fill", NULL );
+ width_b = mlt_properties_get_int( a_props, "dest_width" );
+ height_b = mlt_properties_get_int( a_props, "dest_height" );
+ }
+
if ( get_b_frame_image( this, b_frame, &image_b, &width_b, &height_b, &result ) == 0 )
{
uint8_t *dest = *image;
uint8_t *src = image_b;
uint8_t *alpha = mlt_frame_get_alpha_mask( b_frame );
int progressive =
- mlt_properties_get_int( a_props, "consumer_progressive" ) ||
+ mlt_properties_get_int( a_props, "consumer_deinterlace" ) ||
mlt_properties_get_int( properties, "progressive" );
int field;