-static struct mlt_geometry_item_s get_geometry( mlt_profile profile, mlt_filter filter, mlt_frame frame )
-{
- mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
- mlt_properties filter_props = MLT_FILTER_PROPERTIES( filter );
- struct mlt_geometry_item_s item;
- mlt_geometry geometry = (mlt_geometry) mlt_properties_get_data( filter_props, "geometry", NULL );
- char *string = mlt_properties_get( properties, "resize.geometry" );
- int length = mlt_filter_get_length2( filter, frame );
-
- if ( !geometry ) {
- geometry = mlt_geometry_init();
- mlt_properties_set_data( filter_props, "geometry", geometry, 0,
- (mlt_destructor) mlt_geometry_close, NULL );
- mlt_geometry_parse( geometry, string, length, profile->width, profile->height );
- } else {
- mlt_geometry_refresh( geometry, string, length, profile->width, profile->height );
- }
-
- mlt_geometry_fetch( geometry, &item, mlt_filter_get_position( filter, frame ) );
-
- if ( !mlt_properties_get_int( properties, "resize.fill" ) ) {
- int x = mlt_properties_get_int( properties, "meta.media.width" );
- item.w = item.w > x ? x : item.w;
- x = mlt_properties_get_int( properties, "meta.media.height" );
- item.h = item.h > x ? x : item.h;
- }
-
- return item;
-}
-