mlt_properties frame_properties = MLT_FRAME_PROPERTIES(frame);
// Get the frame position
- mlt_position position = mlt_frame_get_position( frame );
+ mlt_position position = mlt_filter_get_position( filter, frame );
// Get the new image
int error = mlt_frame_get_image( frame, image, format, width, height, 1 );
if( error != 0 )
mlt_properties_debug( frame_properties, "error after mlt_frame_get_image() in autotrack_rectangle", stderr );
+ mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
+
// Get the geometry object
mlt_geometry geometry = mlt_properties_get_data(filter_properties, "filter_geometry", NULL);
mlt_geometry_insert(geometry, &boundry);
}
- if( mlt_properties_get_int( filter_properties, "debug" ) == 1 )
+ mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
+
+ if( mlt_properties_get_int( filter_properties, "debug" ) == 1 )
{
init_arrows( format, *width, *height );
draw_rectangle_outline(*image, boundry.x, boundry.y, boundry.w, boundry.h, 100);
// Because filter_obscure needs to be rewritten to use mlt_geometry
char geom[100];
- sprintf( geom, "%d,%d:%dx%d", (int)boundry.x, (int)boundry.y, (int)boundry.w, (int)boundry.h );
+ sprintf( geom, "%d/%d:%dx%d", (int)boundry.x, (int)boundry.y, (int)boundry.w, (int)boundry.h );
mlt_properties_set( MLT_FILTER_PROPERTIES( obscure ), "start", geom );
mlt_properties_set( MLT_FILTER_PROPERTIES( obscure ), "end", geom );
}
mlt_properties frame_properties = MLT_FRAME_PROPERTIES(frame);
// Get the frame position
- mlt_position position = mlt_frame_get_position( frame );
+ mlt_position position = mlt_filter_get_position( filter, frame );
+ mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
+
// Get the geometry object
mlt_geometry geometry = mlt_properties_get_data(filter_properties, "filter_geometry", NULL);
if (geometry == NULL) {
geometry = mlt_properties_get_data(filter_properties, "filter_geometry", NULL);
}
+ mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
+
// Get the current geometry item
mlt_geometry_item geometry_item = mlt_pool_alloc( sizeof( struct mlt_geometry_item_s ) );
mlt_geometry_fetch(geometry, geometry_item, position);
if( arg != NULL )
mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "geometry", arg );
else
- mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "geometry", "100,100:100x100" );
+ mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "geometry", "100/100:100x100" );
// create an instance of the motion_est and obscure filter
mlt_filter motion_est = mlt_factory_filter( profile, "motion_est", NULL );