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);
// Get the frame position
mlt_position position = mlt_frame_get_position( 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);
// Producers may start with blank footage, by default we will skip, oh, 5 frames unless overridden
int skip = mlt_properties_get_int( properties, "skip");
+ mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
+
// The result
mlt_geometry_item bounds = mlt_properties_get_data( properties, "bounds", NULL );
/* inject into frame */
mlt_properties_set_data( MLT_FRAME_PROPERTIES(this), "bounds", bounds, sizeof( struct mlt_geometry_item_s ), NULL, NULL );
+ mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
+
return error;
}
// Get the filter
mlt_filter filter = mlt_frame_pop_service( frame );
+ mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
+
// Get the motion_est context object
struct motion_est_context_s *c = mlt_properties_get_data( MLT_FILTER_PROPERTIES( filter ), "context", NULL);
-
// Get the new image and frame number
*format = mlt_image_yuv422;
int error = mlt_frame_get_image( frame, image, format, width, height, 1 );
// Remember which frame this is
c->former_frame_position = c->current_frame_position;
-
mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "motion_est.macroblock_width", c->mb_w );
mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "motion_est.macroblock_height", c->mb_h );
mlt_properties_set_int( MLT_FRAME_PROPERTIES( frame ), "motion_est.left_mb", c->left_mb );
fprintf(stderr, " in frame %d:%d usec\n", c->current_frame_position, difference);
#endif
+ mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
return error;
}
int samplemax = (1 << (bytes_per_samp * 8 - 1)) - 1;
int samplemin = -samplemax - 1;
+ mlt_service_lock( MLT_FILTER_SERVICE( this ) );
+
if ( normalise )
{
int window = mlt_properties_get_int( filter_props, "window" );
mlt_properties_set_double( filter_props, "_previous_gain", gain );
mlt_properties_set_position( filter_props, "_last_position", current_position );
+ mlt_service_unlock( MLT_FILTER_SERVICE( this ) );
+
// Ramp from the previous gain to the current
gain = previous_gain;
return 0;
srand(position*10000);
+ mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
+
int im=rand()%maxcount;
int piccount=mlt_properties_count(direntries);
while (im-- && piccount){
overlay_image ( *image , *width, *height , luma_image , dx , mlt_properties_get_int ( properties , cachedy ) , alpha , x1 , y1 , updown , mirror );
}
}
+
+ mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
+
if (piccount>0 )
return 0;
if ( error == 0 && *image )
if (!width_line)
return 0;
+ mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
+
while (num--){
int type=(rand()%3)+1;
int x1=(double)w*rand()/RAND_MAX;
mlt_properties_set_int(MLT_FILTER_PROPERTIES( filter ),buf,x1);
}
mlt_properties_set_double(MLT_FILTER_PROPERTIES( filter ),"last_oldfilm_line_pos",position);
+ mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
}
return error;
// Only process if we have no error and a valid colour space
if ( error == 0 )
{
+ mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
mlt_producer producer = mlt_properties_get_data( properties, "producer", NULL );
mlt_transition transition = mlt_properties_get_data( properties, "transition", NULL );
mlt_frame a_frame = NULL;
mlt_properties_set_data( frame_properties, "image", *image, *width * *height * 4, NULL, NULL );
mlt_properties_set_data( frame_properties, "alpha", mlt_frame_get_alpha_mask( a_frame ), *width * *height, NULL, NULL );
}
+ mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
}
return error;
mlt_frame_get_image( a_frame, image, format, width, height, 1 );
// Calculate the region now
+ mlt_service_lock( MLT_TRANSITION_SERVICE( this ) );
composite_calculate( this, &result, normalised_width, normalised_height, ( float )position );
+ mlt_service_unlock( MLT_TRANSITION_SERVICE( this ) );
// Fetch the b frame image
result.w = ( result.w * *width / normalised_width );
/* Allocate the image */
int size = *width * ( *height ) * 4;
+ mlt_service_lock( MLT_PRODUCER_SERVICE( &this->parent ) );
+
/* Allocate the image */
*format = mlt_image_rgb24a;
mlt_position time = mlt_producer_position( &this->parent ) + mlt_producer_get_in( &this->parent );
mlt_log_debug( MLT_PRODUCER_SERVICE( &this->parent ), "width:%d height:%d %s\n", *width, *height, mlt_image_format_name( *format ) );
}
+ mlt_service_unlock( MLT_PRODUCER_SERVICE( &this->parent ) );
+
return 0;
}
*width = mlt_properties_get_int( properties, "rescale_width" );
*height = mlt_properties_get_int( properties, "rescale_height" );
+ mlt_service_lock( MLT_PRODUCER_SERVICE( &this->parent ) );
+
// Refresh the image
refresh_qimage( this, frame, *width, *height );
// Release references and locks
pthread_mutex_unlock( &this->mutex );
mlt_cache_item_close( this->image_cache );
+ mlt_service_unlock( MLT_PRODUCER_SERVICE( &this->parent ) );
return error;
}
// Get the filter properties
mlt_properties filter_properties = MLT_FILTER_PROPERTIES( filter );
+ mlt_service_lock( MLT_FILTER_SERVICE( filter ) );
+
// Get the properties
st_sample_t *input_buffer;// = mlt_properties_get_data( filter_properties, "input_buffer", NULL );
st_sample_t *output_buffer = mlt_properties_get_data( filter_properties, "output_buffer", NULL );
}
}
+ mlt_service_unlock( MLT_FILTER_SERVICE( filter ) );
+
return 0;
}
// Get the producer properties
mlt_properties properties = MLT_PRODUCER_PROPERTIES( this );
+ mlt_service_lock( MLT_PRODUCER_SERVICE( this ) );
+
// Get the ogg vorbis file
OggVorbis_File *ov = mlt_properties_get_data( properties, "ogg_vorbis_file", NULL );
// Regardless of speed, we expect to get the next frame (cos we ain't too bright)
mlt_properties_set_position( properties, "audio_expected", position + 1 );
+ mlt_service_unlock( MLT_PRODUCER_SERVICE( this ) );
+
return 0;
}