mlt_properties b_props = MLT_FRAME_PROPERTIES( b_frame );
mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
uint8_t resize_alpha = mlt_properties_get_int( b_props, "resize_alpha" );
+ double consumer_ar = mlt_profile_sar( mlt_service_profile( MLT_TRANSITION_SERVICE(this) ) );
// Do not scale if we are cropping - the compositing rectangle can crop the b image
// TODO: Use the animatable w and h of the crop geometry to scale independently of crop rectangle
int real_width = get_value( b_props, "real_width", "width" );
int real_height = get_value( b_props, "real_height", "height" );
double input_ar = mlt_properties_get_double( b_props, "aspect_ratio" );
- double consumer_ar = mlt_properties_get_double( b_props, "consumer_aspect_ratio" );
double background_ar = mlt_properties_get_double( b_props, "output_ratio" );
double output_ar = background_ar != 0.0 ? background_ar : consumer_ar;
int scaled_width = rint( ( input_ar == 0.0 ? output_ar : input_ar ) / output_ar * real_width );
int real_width = get_value( b_props, "real_width", "width" );
int real_height = get_value( b_props, "real_height", "height" );
double input_ar = mlt_properties_get_double( b_props, "aspect_ratio" );
- double consumer_ar = mlt_properties_get_double( b_props, "consumer_aspect_ratio" );
double background_ar = mlt_properties_get_double( b_props, "output_ratio" );
double output_ar = background_ar != 0.0 ? background_ar : consumer_ar;
int scaled_width = rint( ( input_ar == 0.0 ? output_ar : input_ar ) / output_ar * real_width );
uint8_t *alpha_a = NULL;
uint8_t *alpha_b = NULL;
- // Composites always need scaling... defaulting to lowest
- const char *rescale = mlt_properties_get( a_props, "rescale.interp" );
- if ( rescale == NULL || !strcmp( rescale, "none" ) )
- rescale = "nearest";
- mlt_properties_set( a_props, "rescale.interp", rescale );
- mlt_properties_set( b_props, "rescale.interp", rescale );
-
// Do the calculation
// NB: Locks needed here since the properties are being modified
int invert = mlt_properties_get_int( properties, "invert" );
composite_calculate( this, &result, invert ? b_frame : a_frame, position );
mlt_service_unlock( MLT_TRANSITION_SERVICE( this ) );
- // Since we are the consumer of the b_frame, we must pass along these
- // consumer properties from the a_frame
- mlt_properties_set_int( b_props, "consumer_deinterlace", mlt_properties_get_int( a_props, "consumer_deinterlace" ) || mlt_properties_get_int( properties, "deinterlace" ) );
- mlt_properties_set( b_props, "consumer_deinterlace_method", mlt_properties_get( a_props, "consumer_deinterlace_method" ) );
- mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
+ // Manual option to deinterlace
+ if ( mlt_properties_get_int( properties, "deinterlace" ) )
+ {
+ mlt_properties_set_int( a_props, "consumer_deinterlace", 1 );
+ mlt_properties_set_int( a_props, "consumer_deinterlace", 1 );
+ }
// TODO: Dangerous/temporary optimisation - if nothing to do, then do nothing
if ( mlt_properties_get_int( properties, "no_alpha" ) &&
if ( mlt_properties_get( &this->parent, "distort" ) )
mlt_properties_set( &that->parent, "distort", mlt_properties_get( &this->parent, "distort" ) );
- mlt_properties_set_int( &that->parent, "consumer_deinterlace", mlt_properties_get_int( &this->parent, "consumer_deinterlace" ) );
mlt_frame_get_image( this, &p_dest, &format, &width, &height, 1 );
alpha_dst = mlt_frame_get_alpha_mask( this );
mlt_frame_get_image( that, &p_src, &format, &width_src, &height_src, 0 );
if ( mlt_properties_get( &a_frame->parent, "distort" ) )
mlt_properties_set( &b_frame->parent, "distort", mlt_properties_get( &a_frame->parent, "distort" ) );
- mlt_properties_set_int( &b_frame->parent, "consumer_deinterlace", mlt_properties_get_int( &a_frame->parent, "consumer_deinterlace" ) );
mlt_frame_get_image( a_frame, &p_dest, &format_dest, &width_dest, &height_dest, 1 );
mlt_frame_get_image( b_frame, &p_src, &format_src, &width_src, &height_src, 0 );
int reverse = mlt_properties_get_int( properties, "reverse" );
int invert = mlt_properties_get_int( properties, "invert" );
- if ( mlt_properties_get( a_props, "rescale.interp" ) == NULL || !strcmp( mlt_properties_get( a_props, "rescale.interp" ), "none" ) )
- mlt_properties_set( a_props, "rescale.interp", "nearest" );
-
- // Since we are the consumer of the b_frame, we must pass along this
- // consumer property from the a_frame
- if ( mlt_properties_get_double( a_props, "aspect_ratio" ) == 0.0 )
- mlt_properties_set_double( a_props, "aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
- if ( mlt_properties_get_double( b_props, "aspect_ratio" ) == 0.0 )
- mlt_properties_set_double( b_props, "aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
- mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
-
// Honour the reverse here
if ( mix >= 1.0 )
mix -= floor( mix );
- // Ensure we get scaling on the b_frame
- if ( mlt_properties_get( b_props, "rescale.interp" ) == NULL || !strcmp( mlt_properties_get( b_props, "rescale.interp" ), "none" ) )
- mlt_properties_set( b_props, "rescale.interp", mlt_properties_get( a_props, "rescale.interp" ) );
-
- if ( invert )
- mlt_properties_set_int( b_props, "consumer_deinterlace", mlt_properties_get_int( a_props, "consumer_deinterlace") );
-
if ( mlt_properties_get( properties, "fixed" ) )
mix = mlt_properties_get_double( properties, "fixed" );
int invert = mlt_properties_get_int( properties, "invert" );
- if ( mlt_properties_get( a_props, "rescale.interp" ) == NULL || !strcmp( mlt_properties_get( a_props, "rescale.interp" ), "none" ) )
- mlt_properties_set( a_props, "rescale.interp", "nearest" );
-
- // set consumer_aspect_ratio for a and b frame
- if ( mlt_properties_get_double( a_props, "aspect_ratio" ) == 0.0 )
- mlt_properties_set_double( a_props, "aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
- if ( mlt_properties_get_double( b_props, "aspect_ratio" ) == 0.0 )
- mlt_properties_set_double( b_props, "aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
- mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
-
- if ( mlt_properties_get( b_props, "rescale.interp" ) == NULL || !strcmp( mlt_properties_get( b_props, "rescale.interp" ), "none" ) )
- mlt_properties_set( b_props, "rescale.interp", mlt_properties_get( a_props, "rescale.interp" ) );
-
uint8_t *images[]={NULL,NULL,NULL};
*format = mlt_image_rgb24a;
mlt_properties_set_int( b_props, "rescale_height", b_height );
// Suppress padding and aspect normalization.
- char *interps = mlt_properties_get( b_props, "rescale.interp" );
+ char *interps = mlt_properties_get( a_props, "rescale.interp" );
if ( interps )
interps = strdup( interps );
mlt_properties_set( b_props, "rescale.interp", "none" );
- if ( mlt_properties_get_double( b_props, "aspect_ratio" ) == 0.0 )
- mlt_properties_set_double( b_props, "aspect_ratio", consumer_ar );
// This is not a field-aware transform.
mlt_properties_set_int( b_props, "consumer_deinterlace", 1 );