Ejemplo n.º 1
0
static mlt_geometry composite_calculate( mlt_transition transition, struct mlt_geometry_item_s *result, int nw, int nh, double position )
{
	// Structures for geometry
	mlt_geometry start = transition_parse_keys( transition, "geometry", "geometries", nw, nh );

	// Do the calculation
	geometry_calculate( transition, "geometries", result, position );

	return start;
}
Ejemplo n.º 2
0
static inline float composite_calculate_key( mlt_transition transition, const char *name, const char *store, int norm, float position )
{
	// Struct for the result
	struct mlt_geometry_item_s result;

	// Structures for geometry
	transition_parse_keys( transition, name, store, norm, 0 );

	// Do the calculation
	geometry_calculate( transition, store, &result, position );

	return result.x;
}
Ejemplo n.º 3
0
static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable )
{
	// Pop the top of stack now
	mlt_filter filter = mlt_frame_pop_service( frame );

	// Get the image from the frame
	*format = mlt_image_yuv422;
	int error = mlt_frame_get_image( frame, image, format, width, height, 1 );

	// Get the image from the frame
	if ( error == 0 )
	{
		if ( filter != NULL )
		{
			// Get the filter properties
			mlt_properties properties = MLT_FILTER_PROPERTIES( filter );
			mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) );

			// Structures for geometry
			struct geometry_s result;
			struct geometry_s start;
			struct geometry_s end;

			// Retrieve the position
			float position = mlt_filter_get_progress( filter, frame );

			// Now parse the geometries
			geometry_parse( &start, NULL, mlt_properties_get( properties, "start" ), profile->width, profile->height );
			geometry_parse( &end, &start, mlt_properties_get( properties, "end" ), profile->width, profile->height );

			// Do the calculation
			geometry_calculate( &result, &start, &end, position, *width, *height );

			// Now actually render it
			obscure_render( *image, *width, *height, result );
		}
	}

	return error;
}