+ Attempt to make all frames have the correct aspect_ratio (works in many but not all cases)
src/framework/mlt_frame.h
+ Provide macro access to the video and image RPN queues
src/framework/mlt_tractor.c
+ Provides orphaned filters
src/modules/core/producer_noise.c
- remove specification of aspect ratio
src/modules/core/filter_watermark.c
src/modules/core/transition_composite.c
src/modules/core/transition_luma.c
src/modules/plus/filter_affine.c
src/modules/plus/transition_affine.c
+ Corrections for frames with an aspect ratio = 0 (supplement to mlt_consumer mod)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@737
d19143bc-622f-0410-bfdd-
b5b2a6649095
#define MLT_FRAME_PROPERTIES( frame ) ( &( frame )->parent )
#define MLT_FRAME_SERVICE_STACK( frame ) ( ( frame )->stack_service )
+#define MLT_FRAME_IMAGE_STACK( frame ) ( ( frame )->stack_image )
+#define MLT_FRAME_AUDIO_STACK( frame ) ( ( frame )->stack_audio )
extern mlt_frame mlt_frame_init( );
extern mlt_properties mlt_frame_properties( mlt_frame self );
// Check for last track
done = mlt_properties_get_int( temp_properties, "last_track" );
+ // Handle fx only tracks
+ if ( mlt_properties_get_int( temp_properties, "meta.fx_cut" ) )
+ {
+ // Take all but the first placeholding producer and dump on to the image stack
+ if ( video )
+ {
+ void *p = mlt_deque_pop_front( MLT_FRAME_IMAGE_STACK( temp ) );
+ while ( ( p = mlt_deque_pop_front( MLT_FRAME_IMAGE_STACK( temp ) ) ) != NULL )
+ mlt_deque_push_back( MLT_FRAME_IMAGE_STACK( video ), p );
+ }
+
+ // Take all but the first placeholding producer and dump on to the audio stack
+ if ( audio )
+ {
+ void *p = mlt_deque_pop_front( MLT_FRAME_AUDIO_STACK( temp ) );
+ while ( ( p = mlt_deque_pop_front( MLT_FRAME_AUDIO_STACK( temp ) ) ) != NULL )
+ mlt_deque_push_back( MLT_FRAME_AUDIO_STACK( audio ), p );
+ }
+
+ // Ensure everything is hidden
+ mlt_properties_set_int( temp_properties, "hide", 3 );
+ }
+
// We store all frames with a destructor on the output frame
sprintf( label, "_%s_%d", id, count ++ );
mlt_properties_set_data( frame_properties, label, temp, 0, ( mlt_destructor )mlt_frame_close, NULL );
mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
mlt_properties_set_int( b_props, "consumer_deinterlace", mlt_properties_get_double( a_props, "consumer_deinterlace" ) );
+ // Check for the special case - no aspect ratio means no problem :-)
+ if ( mlt_frame_get_aspect_ratio( b_frame ) == 0 )
+ mlt_properties_set_double( b_props, "aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
+ if ( mlt_frame_get_aspect_ratio( frame ) == 0 )
+ mlt_properties_set_double( a_props, "aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
+
mlt_properties_set_int( b_props, "normalised_width", mlt_properties_get_int( a_props, "normalised_width" ) );
mlt_properties_set_int( b_props, "normalised_height", mlt_properties_get_int( a_props, "normalised_height" ) );
// Initialise the producer
if ( this != NULL )
{
- int is_pal = mlt_properties_get_int( MLT_PRODUCER_PROPERTIES( this ), "normalised_height" ) == 576;
-
- // Synthetic - aspect ratio of 1
- mlt_properties_set_double( MLT_PRODUCER_PROPERTIES( this ), "aspect_ratio", is_pal ? 59.0/54.0 : 10.0/11.0 );
-
// Callback registration
this->get_frame = producer_get_frame;
this->close = ( mlt_destructor )producer_close;
int real_height = get_value( b_props, "real_height", "height" );
double input_ar = mlt_frame_get_aspect_ratio( b_frame );
double output_ar = mlt_properties_get_double( b_props, "consumer_aspect_ratio" );
+ if ( input_ar == 0.0 ) input_ar = output_ar;
int scaled_width = input_ar / output_ar * real_width;
int scaled_height = real_height;
// 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" ) );
if ( !strcmp( mlt_properties_get( a_props, "rescale.interp" ), "none" ) )
mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "aspect_ratio" ) );
else
char *name = mlt_properties_get( properties, "_unique_id" );
mlt_position position = mlt_properties_get_position( MLT_FRAME_PROPERTIES( this ), name );
mlt_properties frame_properties = MLT_FRAME_PROPERTIES( this );
+ double consumer_ar = mlt_properties_get_double( frame_properties, "consumer_aspect_ratio" );
mlt_properties_set_position( MLT_TRANSITION_PROPERTIES( transition ), "in", mlt_filter_get_in( filter ) );
mlt_properties_set_position( MLT_TRANSITION_PROPERTIES( transition ), "out", mlt_filter_get_out( filter ) );
mlt_producer_seek( producer, position );
mlt_service_get_frame( MLT_PRODUCER_SERVICE( producer ), &a_frame, 0 );
mlt_properties_set( MLT_FRAME_PROPERTIES( a_frame ), "rescale.interp", "nearest" );
mlt_properties_set_int( MLT_FRAME_PROPERTIES( a_frame ), "distort", 1 );
- mlt_properties_set_double( MLT_FRAME_PROPERTIES( a_frame ), "consumer_aspect_ratio",
- mlt_properties_get_double( frame_properties, "consumer_aspect_ratio" ) );
+
+ // Special case - aspect_ratio = 0
+ if ( mlt_properties_get_double( frame_properties, "aspect_ratio" ) == 0 )
+ mlt_properties_set_double( frame_properties, "aspect_ratio", consumer_ar );
+ if ( mlt_properties_get_double( MLT_FRAME_PROPERTIES( a_frame ), "aspect_ratio" ) == 0 )
+ mlt_properties_set_double( MLT_FRAME_PROPERTIES( a_frame ), "aspect_ratio", consumer_ar );
+ mlt_properties_set_double( MLT_FRAME_PROPERTIES( a_frame ), "consumer_aspect_ratio", consumer_ar );
+
mlt_transition_process( transition, a_frame, this );
mlt_frame_get_image( a_frame, image, format, width, height, writable );
mlt_properties_set_data( frame_properties, "affine_frame", a_frame, 0, (mlt_destructor)mlt_frame_close, NULL );
int normalised_width = mlt_properties_get_int( a_props, "normalised_width" );
int normalised_height = mlt_properties_get_int( a_props, "normalised_height" );
+ double consumer_ar = mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) ;
+
// Structures for geometry
struct mlt_geometry_item_s result;
b_width = result.w;
b_height = result.h;
+ if ( mlt_properties_get_double( b_props, "aspect_ratio" ) == 0.0 )
+ mlt_properties_set_double( b_props, "aspect_ratio", consumer_ar );
+
if ( !strcmp( mlt_properties_get( a_props, "rescale.interp" ), "none" ) )
{
mlt_properties_set( b_props, "rescale.interp", "nearest" );
- mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "aspect_ratio" ) );
+ mlt_properties_set_double( b_props, "consumer_aspect_ratio", consumer_ar );
}
else
{
mlt_properties_set( b_props, "rescale.interp", mlt_properties_get( a_props, "rescale.interp" ) );
- mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_double( a_props, "consumer_aspect_ratio" ) );
+ mlt_properties_set_double( b_props, "consumer_aspect_ratio", consumer_ar );
}
mlt_properties_set_int( b_props, "distort", mlt_properties_get_int( properties, "distort" ) );