]> git.sesse.net Git - mlt/commitdiff
Allows runtime modifications to region fx
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 23 Jul 2004 08:18:52 +0000 (08:18 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Fri, 23 Jul 2004 08:18:52 +0000 (08:18 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@339 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/core/filter_region.c
src/modules/core/transition_composite.c
src/modules/core/transition_region.c

index b47eb37c183fedb35b544f8e995eede4c1d0a3b6..635b3907e85600c111326b3525f18522a98f4221 100644 (file)
@@ -44,13 +44,13 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame )
                // Create the transition
                transition = mlt_factory_transition( "region", NULL );
 
-               // Pass all properties down
-               mlt_properties_pass( mlt_transition_properties( transition ), properties, "" );
-
                // Register with the filter
                mlt_properties_set_data( properties, "_transition", transition, 0, ( mlt_destructor )mlt_transition_close, NULL );
        }
 
+       // Pass all properties down
+       mlt_properties_pass( mlt_transition_properties( transition ), properties, "" );
+
        // Process the frame
        return mlt_transition_process( transition, frame, NULL );
 }
index 0119380ee906d8fb9a6c4bf20e7394cca3d7ae09..2d4535cb6af0f5b7581d61113605fe4d9153d416 100644 (file)
@@ -987,6 +987,9 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
        // Get the image from the a frame
        mlt_frame_get_image( a_frame, image, format, width, height, 1 );
 
+       // Get the properties from the transition
+       mlt_properties properties = mlt_transition_properties( this );
+
        if ( b_frame != NULL )
        {
                // Get the properties of the a frame
@@ -995,9 +998,6 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                // Get the properties of the b frame
                mlt_properties b_props = mlt_frame_properties( b_frame );
 
-               // Get the properties from the transition
-               mlt_properties properties = mlt_transition_properties( this );
-
                // Structures for geometry
                struct geometry_s result;
 
@@ -1053,6 +1053,9 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                }
        }
 
+       // Force geometries to be recalculated
+       mlt_properties_set_data( properties, "geometries", NULL, 0, NULL, NULL );
+
        return 0;
 }
 
index 41fce2fd087a9951d38df4ed287763f290e11289..d24def91c65ab4ade47948e4fdeb25d4296d1a0b 100644 (file)
@@ -162,6 +162,12 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
                        mlt_properties_set_data( properties, "composite", composite, 0, ( mlt_destructor )mlt_transition_close, NULL );
                }
        }
+       else
+       {
+               // Pass all current properties down
+               mlt_properties composite_properties = mlt_transition_properties( composite );
+               mlt_properties_pass( composite_properties, properties, "composite." );
+       }
 
        // Create filters
        if ( filter == NULL )
@@ -190,6 +196,45 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
                        }
                }
        }
+       else
+       {
+               // Pass all properties down
+               mlt_filter temp = NULL;
+
+               // Loop Variable
+               int i = 0;
+
+               // Number of filters found
+               int count = 0;
+
+               // Loop for all properties
+               for ( i = 0; i < mlt_properties_count( properties ); i ++ )
+               {
+                       // Get the name of this property
+                       char *name = mlt_properties_get_name( properties, i );
+
+                       // If the name does not contain a . and matches filter
+                       if ( strchr( name, '.' ) == NULL && !strncmp( name, "filter", 6 ) )
+                       {
+                               // Strings to hold the id and pass down key
+                               char id[ 256 ];
+                               char key[ 256 ];
+
+                               // Construct id and key
+                               sprintf( id, "_filter_%d", count );
+                               sprintf( key, "%s.", name );
+
+                               // Get the filter
+                               temp = mlt_properties_get_data( properties, id, NULL );
+
+                               if ( temp != NULL )
+                               {
+                                       mlt_properties_pass( mlt_filter_properties( temp ), properties, key );
+                                       count ++;
+                               }
+                       }
+               }
+       }
 
        // Get the image
        error = mlt_frame_get_image( frame, image, format, width, height, 1 );