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;
}
}
-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 );
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" );
// 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
return start;
}
+static inline void inline_memcpy( uint8_t *dest, uint8_t *src, int length )
+{
+ uint8_t *end = src + length;
+ while ( src < end )
+ {
+ *dest ++ = *src ++;
+ *dest ++ = *src ++;
+ }
+}
+
mlt_frame composite_copy_region( mlt_transition this, mlt_frame a_frame, mlt_position frame_position )
{
// Create a frame to return
w = result.w * width / result.nw;
h = result.h * height / result.nh;
+ if ( y < 0 )
+ {
+ h = h + y;
+ y = 0;
+ }
+
+ if ( y + h > height )
+ h = height - y;
+
x &= 0xfffffffe;
- //w &= 0xfffffffe;
+ w &= 0xfffffffe;
// Now we need to create a new destination image
dest = mlt_pool_alloc( w * h * 2 );
while ( q < r )
{
- memcpy( q, p, w * 2 );
+ inline_memcpy( q, p, w * 2 );
q += w * 2;
p += width * 2;
}
// 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
}
}
- // Force geometries to be recalculated
- mlt_properties_set_data( properties, "geometries", NULL, 0, NULL, NULL );
-
return 0;
}