]> git.sesse.net Git - mlt/commitdiff
Mutable properties
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 26 Jul 2004 15:45:23 +0000 (15:45 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 26 Jul 2004 15:45:23 +0000 (15:45 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@342 d19143bc-622f-0410-bfdd-b5b2a6649095

src/modules/core/filter_luma.c
src/modules/core/filter_mirror.c
src/modules/core/transition_composite.c
src/modules/core/transition_region.c

index 62277a4b0ca4f7d0974705096fb857f177e40804..ef5043e329dea6eccbd394bc26765b4f8fa60da4 100644 (file)
@@ -54,7 +54,6 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
                        mlt_properties_set_int( luma_properties, "in", 0 );
                        mlt_properties_set_int( luma_properties, "out", out );
                        mlt_properties_set_int( luma_properties, "reverse", 1 );
-                       mlt_properties_pass( luma_properties, properties, "luma." );
                        mlt_properties_set_data( properties, "luma", luma, 0, ( mlt_destructor )mlt_transition_close, NULL );
                }
        }
@@ -68,7 +67,11 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format *
        if ( luma != NULL && 
                ( mlt_properties_get( properties, "blur" ) != NULL || 
                  mlt_frame_get_position( this ) % ( out + 1 ) != out ) )
+       {
+               mlt_properties luma_properties = mlt_transition_properties( luma );
+               mlt_properties_pass( luma_properties, properties, "luma." );
                mlt_transition_process( luma, this, b_frame );
+       }
 
        error = mlt_frame_get_image( this, image, format, width, height, 1 );
 
index e007ac2a06818758c152b3a0e97ece1afafe5eb9..66b88720ac43aeed4773c6ea3b2fa0eaba7247d0 100644 (file)
@@ -63,7 +63,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                                q = p + *width * 2;
                                if ( !reverse )
                                {
-                                       while ( p != q )
+                                       while ( p < q )
                                        {
                                                *p ++ = *( q - 2 );
                                                *p ++ = *( q - 3 );
@@ -74,7 +74,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                                }
                                else
                                {
-                                       while ( p != q )
+                                       while ( p < q )
                                        {
                                                *( q - 2 ) = *p ++;
                                                *( q - 3 ) = *p ++;
@@ -95,7 +95,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                        for ( i = 0; i < hh; i ++ )
                        {
                                p = ( uint16_t * )*image + i * *width;
-                               q = end - i * *width;
+                               q = end - ( i + 1 ) * *width;
                                j = *width;
                                if ( !reverse )
                                {
@@ -191,7 +191,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                        {
                                p = ( uint8_t * )*image + i * *width * 2;
                                q = p + *width * 2;
-                               while ( p != q )
+                               while ( p < q )
                                {
                                        t[ 0 ] = p[ 0 ];
                                        t[ 1 ] = p[ 1 ];
@@ -219,7 +219,7 @@ static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format
                        for ( i = 0; i < hh; i ++ )
                        {
                                p = ( uint16_t * )*image + i * *width;
-                               q = end - i * *width;
+                               q = end - ( i + 1 ) * *width;
                                j = *width;
                                while ( j -- )
                                {
index 174d53258abe83c3121ac802a3fb32556a4a460d..5a0db4ddb0d544b94c4bddaefbc5d9bea9d3ba06 100644 (file)
@@ -275,9 +275,6 @@ static struct geometry_s *transition_parse_keys( mlt_transition this,  int norma
        else
                end->position = 1;
 
-       // Assign to properties to ensure we get destroyed
-       mlt_properties_set_data( properties, "geometries", start, 0, transition_destroy_keys, NULL );
-
        return start;
 }
 
@@ -863,7 +860,7 @@ static int get_b_frame_image( mlt_transition this, mlt_frame b_frame, uint8_t **
 }
 
 
-struct geometry_s *composite_calculate( struct geometry_s *result, mlt_transition this, mlt_frame a_frame, float position )
+static struct geometry_s *composite_calculate( struct geometry_s *result, mlt_transition this, mlt_frame a_frame, float position )
 {
        // Get the properties from the transition
        mlt_properties properties = mlt_transition_properties( this );
@@ -875,7 +872,7 @@ struct geometry_s *composite_calculate( struct geometry_s *result, mlt_transitio
        struct geometry_s *start = mlt_properties_get_data( properties, "geometries", NULL );
 
        // Now parse the geometries
-       if ( start == NULL )
+       if ( start == NULL || mlt_properties_get_int( properties, "refresh" ) )
        {
                // Obtain the normalised width and height from the a_frame
                int normalised_width = mlt_properties_get_int( a_props, "normalised_width" );
@@ -883,6 +880,10 @@ struct geometry_s *composite_calculate( struct geometry_s *result, mlt_transitio
 
                // Parse the transitions properties
                start = transition_parse_keys( this, normalised_width, normalised_height );
+
+               // Assign to properties to ensure we get destroyed
+               mlt_properties_set_data( properties, "geometries", start, 0, transition_destroy_keys, NULL );
+               mlt_properties_set_int( properties, "refresh", 0 );
        }
 
        // Do the calculation
@@ -941,7 +942,7 @@ mlt_frame composite_copy_region( mlt_transition this, mlt_frame a_frame, mlt_pos
        h = result.h * height / result.nh;
 
        x &= 0xfffffffe;
-       //w &= 0xfffffffe;
+       w &= 0xfffffffe;
 
        // Now we need to create a new destination image
        dest = mlt_pool_alloc( w * h * 2 );
@@ -1010,10 +1011,7 @@ static int transition_get_image( mlt_frame a_frame, uint8_t **image, mlt_image_f
                
                // Optimisation - no compositing required
                if ( result.mix == 0 || ( result.w == 0 && result.h == 0 ) )
-               {
-                       mlt_properties_set_data( properties, "geometries", NULL, 0, NULL, NULL );
                        return 0;
-               }
 
                // Since we are the consumer of the b_frame, we must pass along these
                // consumer properties from the a_frame
@@ -1056,9 +1054,6 @@ 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 d24def91c65ab4ade47948e4fdeb25d4296d1a0b..a4b4cab23f0321446cd7cc9b917cda916a69f39f 100644 (file)
@@ -265,7 +265,8 @@ static int transition_get_image( mlt_frame frame, uint8_t **image, mlt_image_for
                while ( filter != NULL )
                {
                        // Stack this filter
-                       mlt_filter_process( filter, b_frame );
+                       if ( mlt_properties_get_int( mlt_filter_properties( filter ), "off" ) == 0 )
+                               mlt_filter_process( filter, b_frame );
 
                        // Generate the key for the next
                        sprintf( id, "_filter_%d", ++ i );