]> git.sesse.net Git - mlt/commitdiff
Sundry minor updates
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 31 Dec 2004 08:40:16 +0000 (08:40 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 31 Dec 2004 08:40:16 +0000 (08:40 +0000)
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
src/modules/core/filter_data_show.c
src/modules/core/filter_watermark.c
src/modules/core/transition_composite.c
src/modules/inigo/producer_inigo.c

index 3f70a1326d67bb9c63422285b2a4fb22516f6f03..4cf0e732b20fcea19086896619c1f0f2bfaa1183 100644 (file)
@@ -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 );
                        }
                }
        }
index b16f8fe40c33effe306e1ff0da7fe05c57789345..4387ae21b5cdec1673f0f39adb4fc7801b0c0c87 100644 (file)
@@ -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 );
index 8bd237a205377c7611b88fa51e42edcc69fdf69c..b4bd6a70b0999d306f553f66d12c4e9126b14eef 100644 (file)
@@ -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 );
index bd224a21dd76a27c954f133f22206924116430dd..ed2436fa50ee5a062e537048f38d19ecfaa346d0 100644 (file)
@@ -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 );
        }
 
index 2a46fed02730db9ec8e8a1e3f31785bef60964d3..1a1e7d651e9d726d5fffe7f75e79f3ff58f54174 100644 (file)
@@ -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 );