X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_filter.c;h=6e82f5ea688c33522189d97e199a8644e6ee3b84;hb=4a27595beb7047b430cc2df49865e269c0a0eef4;hp=95dfc5aa8759a1faebc9374eaccbe255135d3524;hpb=05ddafbb9518251a354d2d947cf5c8d109c76909;p=melted diff --git a/src/framework/mlt_filter.c b/src/framework/mlt_filter.c index 95dfc5a..6e82f5e 100644 --- a/src/framework/mlt_filter.c +++ b/src/framework/mlt_filter.c @@ -48,13 +48,23 @@ int mlt_filter_init( mlt_filter this, void *child ) mlt_properties_set_position( properties, "in", 0 ); mlt_properties_set_position( properties, "out", 0 ); mlt_properties_set_int( properties, "track", 0 ); - mlt_properties_set( properties, "resource", "" ); return 0; } return 1; } +/** Create a new filter. +*/ + +mlt_filter mlt_filter_new( ) +{ + mlt_filter this = calloc( 1, sizeof( struct mlt_filter_s ) ); + if ( this != NULL ) + mlt_filter_init( this, NULL ); + return this; +} + /** Get the service associated to this filter */ @@ -63,6 +73,9 @@ mlt_service mlt_filter_service( mlt_filter this ) return &this->parent; } +/** Get the properties associated to this filter. +*/ + mlt_properties mlt_filter_properties( mlt_filter this ) { return mlt_service_properties( mlt_filter_service( this ) ); @@ -129,7 +142,7 @@ mlt_position mlt_filter_get_out( mlt_filter this ) /** Process the frame. */ -static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) +mlt_frame mlt_filter_process( mlt_filter this, mlt_frame frame ) { if ( this->process == NULL ) return frame; @@ -156,8 +169,8 @@ static int filter_get_frame( mlt_service service, mlt_frame_ptr frame, int index if ( ret == 0 ) { mlt_position position = mlt_frame_get_position( *frame ); - if ( position >= in && ( out == 0 || position < out ) ) - *frame = filter_process( this, *frame ); + if ( position >= in && ( out == 0 || position <= out ) ) + *frame = mlt_filter_process( this, *frame ); return 0; } else @@ -181,5 +194,5 @@ void mlt_filter_close( mlt_filter this ) this->close( this ); else mlt_service_close( &this->parent ); + free( this ); } -