From 00170557040957d088ea127bdd38d6d16a533550 Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Fri, 31 Dec 2004 08:40:16 +0000 Subject: [PATCH] Sundry minor updates git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@593 d19143bc-622f-0410-bfdd-b5b2a6649095 --- src/modules/core/filter_data_feed.c | 3 +++ src/modules/core/filter_data_show.c | 22 ++++++++++++++++------ src/modules/core/filter_watermark.c | 7 +++++-- src/modules/core/transition_composite.c | 12 ++++++++++-- src/modules/inigo/producer_inigo.c | 6 +++++- 5 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/modules/core/filter_data_feed.c b/src/modules/core/filter_data_feed.c index 3f70a132..4cf0e732 100644 --- a/src/modules/core/filter_data_feed.c +++ b/src/modules/core/filter_data_feed.c @@ -115,6 +115,9 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) // Push it on to the queue mlt_deque_push_back( data_queue, feed ); + + // Make sure this attribute only gets processed once + mlt_properties_set_int( frame_properties, name, 0 ); } } } diff --git a/src/modules/core/filter_data_show.c b/src/modules/core/filter_data_show.c index b16f8fe4..4387ae21 100644 --- a/src/modules/core/filter_data_show.c +++ b/src/modules/core/filter_data_show.c @@ -100,9 +100,6 @@ static int process_feed( mlt_properties feed, mlt_filter filter, mlt_frame frame // Fetch the filter associated to this type mlt_filter requested = mlt_properties_get_data( filter_properties, type, NULL ); - // Calculate the length of the feed - int length = mlt_properties_get_int( feed, "out" ) - mlt_properties_get_int( feed, "in" ) + 1; - // If it doesn't exist, then create it now if ( requested == NULL ) { @@ -121,6 +118,18 @@ static int process_feed( mlt_properties feed, mlt_filter filter, mlt_frame frame static char *prefix = "properties."; int len = strlen( prefix ); + // Determine if this is an absolute or relative feed + int absolute = mlt_properties_get_int( feed, "absolute" ); + + // Make do with what we have + int length = !absolute ? + mlt_properties_get_int( feed, "out" ) - mlt_properties_get_int( feed, "in" ) + 1 : + mlt_properties_get_int( feed, "out" ) + 1; + + // Repeat period + int period = mlt_properties_get_int( properties, "period" ); + period = period == 0 ? 1 : period; + // Pass properties from feed into requested for ( i = 0; i < mlt_properties_count( properties ); i ++ ) { @@ -130,8 +139,6 @@ static int process_feed( mlt_properties feed, mlt_filter filter, mlt_frame frame { if ( !strncmp( name + len, "length[", 7 ) ) { - int period = mlt_properties_get_int( properties, "period" ); - period = period == 0 ? 1 : period; mlt_properties_set_position( properties, key, length / period ); } else @@ -144,7 +151,10 @@ static int process_feed( mlt_properties feed, mlt_filter filter, mlt_frame frame } // Set the original position on the frame - mlt_frame_set_position( frame, mlt_properties_get_int( feed, "position" ) - mlt_properties_get_int( feed, "in" ) ); + if ( absolute == 0 ) + mlt_frame_set_position( frame, mlt_properties_get_int( feed, "position" ) - mlt_properties_get_int( feed, "in" ) ); + else + mlt_frame_set_position( frame, mlt_properties_get_int( feed, "position" ) ); // Process the filter mlt_filter_process( requested, frame ); diff --git a/src/modules/core/filter_watermark.c b/src/modules/core/filter_watermark.c index 8bd237a2..b4bd6a70 100644 --- a/src/modules/core/filter_watermark.c +++ b/src/modules/core/filter_watermark.c @@ -170,12 +170,15 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format char temp[ 132 ]; int count = 0; uint8_t *alpha = NULL; + char *rescale = mlt_properties_get( a_props, "rescale.interp" ); + if ( rescale == NULL || !strcmp( rescale, "none" ) ) + rescale = "hyper"; mlt_transition_process( composite, b_frame, frame ); mlt_properties_set_double( b_props, "consumer_aspect_ratio", mlt_properties_get_int( a_props, "consumer_aspect_ratio" ) ); mlt_properties_set_int( a_props, "consumer_deinterlace", 1 ); mlt_properties_set_int( b_props, "consumer_deinterlace", 1 ); - mlt_properties_set( a_props, "rescale.interp", "nearest" ); - mlt_properties_set( b_props, "rescale.interp", "nearest" ); + mlt_properties_set( a_props, "rescale.interp", rescale ); + mlt_properties_set( b_props, "rescale.interp", rescale ); mlt_service_apply_filters( MLT_FILTER_SERVICE( this ), b_frame, 0 ); error = mlt_frame_get_image( b_frame, image, format, width, height, 1 ); alpha = mlt_frame_get_alpha_mask( b_frame ); diff --git a/src/modules/core/transition_composite.c b/src/modules/core/transition_composite.c index bd224a21..ed2436fa 100644 --- a/src/modules/core/transition_composite.c +++ b/src/modules/core/transition_composite.c @@ -103,12 +103,17 @@ static mlt_geometry transition_parse_keys( mlt_transition this, int normalised_w // Get the in and out position mlt_position in = mlt_transition_get_in( this ); mlt_position out = mlt_transition_get_out( this ); + int length = out - in + 1; // Get the new style geometry string char *property = mlt_properties_get( properties, "geometry" ); + // Allow a geometry repeat cycle + if ( mlt_properties_get_int( properties, "cycle" ) ) + length = mlt_properties_get_int( properties, "cycle" ); + // Parse the geometry if we have one - mlt_geometry_parse( geometry, property, out - in + 1, normalised_width, normalised_height ); + mlt_geometry_parse( geometry, property, length, normalised_width, normalised_height ); // Check if we're using the old style geometry if ( property == NULL ) @@ -458,7 +463,6 @@ static int composite_yuv( uint8_t *p_dest, int width_dest, int height_dest, uint // field 1 = upper field and y should be even. if ( ( field > -1 ) && ( y % 2 == field ) ) { - //fprintf( stderr, "field %d y %d\n", field, y ); if ( ( field == 1 && y < height_dest - 1 ) || ( field == 0 && y == 0 ) ) p_dest += stride_dest; else @@ -689,6 +693,8 @@ static int get_b_frame_image( mlt_transition this, mlt_frame b_frame, uint8_t ** scaled_height = normalised_height; } + // Honour the fill request - this will scale the image to fill width or height while maintaining a/r + // ????: Shouln't this be the default behaviour? if ( mlt_properties_get_int( properties, "fill" ) ) { if ( scaled_height < normalised_height && scaled_width * normalised_height / scaled_height < normalised_width ) @@ -768,6 +774,8 @@ static mlt_geometry composite_calculate( mlt_transition this, struct geometry_s else { int length = mlt_transition_get_out( this ) - mlt_transition_get_in( this ) + 1; + if ( mlt_properties_get_int( properties, "cycle" ) ) + length = mlt_properties_get_int( properties, "cycle" ); mlt_geometry_refresh( start, mlt_properties_get( properties, "geometry" ), length, normalised_width, normalised_height ); } diff --git a/src/modules/inigo/producer_inigo.c b/src/modules/inigo/producer_inigo.c index 2a46fed0..1a1e7d65 100644 --- a/src/modules/inigo/producer_inigo.c +++ b/src/modules/inigo/producer_inigo.c @@ -251,7 +251,11 @@ mlt_producer producer_inigo_init( char **argv ) if ( mlt_playlist_count( playlist ) > 0 ) { mlt_playlist_clip_info info; - mlt_playlist_join( playlist, mlt_playlist_count( playlist ) - clips - 1, clips, 0 ); + int clip = clips <= 0 ? 0 : mlt_playlist_count( playlist ) - clips - 1; + if ( clip < 0 ) clip = 0; + if ( clip >= mlt_playlist_count( playlist ) ) clip = mlt_playlist_count( playlist ) - 2; + if ( clips < 0 ) clips = mlt_playlist_count( playlist ) - 1; + mlt_playlist_join( playlist, clip, clips, 0 ); mlt_playlist_get_clip_info( playlist, &info, mlt_playlist_count( playlist ) - 1 ); producer = info.cut; properties = MLT_PRODUCER_PROPERTIES( producer ); -- 2.39.2