X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Ffilter_luma.c;h=f2e11567097ea915aff94c5f2a260b5c0e93eadf;hb=8c69000b4c4a8423a5025f0463805da562714eaa;hp=f981efdaece721a4ef2f664ce22c4d9bcbcb4c31;hpb=bf3264b9e340ba5c11cbf59835a8af3db94e0cc2;p=melted diff --git a/src/modules/core/filter_luma.c b/src/modules/core/filter_luma.c index f981efd..f2e1156 100644 --- a/src/modules/core/filter_luma.c +++ b/src/modules/core/filter_luma.c @@ -18,8 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "filter_luma.h" - +#include #include #include #include @@ -39,6 +38,7 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * mlt_properties properties = MLT_FILTER_PROPERTIES( filter ); mlt_transition luma = mlt_properties_get_data( properties, "luma", NULL ); mlt_frame b_frame = mlt_properties_get_data( properties, "frame", NULL ); + mlt_properties b_frame_props = b_frame ? MLT_FRAME_PROPERTIES( b_frame ) : NULL; int out = mlt_properties_get_int( properties, "period" ); if ( out == 0 ) @@ -47,7 +47,8 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * if ( luma == NULL ) { char *resource = mlt_properties_get( properties, "resource" ); - luma = mlt_factory_transition( "luma", resource ); + mlt_profile profile = mlt_service_profile( MLT_FILTER_SERVICE( filter ) ); + luma = mlt_factory_transition( profile, "luma", resource ); if ( luma != NULL ) { mlt_properties luma_properties = MLT_TRANSITION_PROPERTIES( luma ); @@ -58,9 +59,9 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * } } - if ( b_frame == NULL || mlt_properties_get_int( b_frame, "width" ) != *width || mlt_properties_get_int( b_frame, "height" ) != *height ) + if ( b_frame == NULL || mlt_properties_get_int( b_frame_props, "width" ) != *width || mlt_properties_get_int( b_frame_props, "height" ) != *height ) { - b_frame = mlt_frame_init( ); + b_frame = mlt_frame_init( MLT_FILTER_SERVICE( filter ) ); mlt_properties_set_data( properties, "frame", b_frame, 0, ( mlt_destructor )mlt_frame_close, NULL ); } @@ -113,7 +114,7 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) /** Constructor for the filter. */ -mlt_filter filter_luma_init( void *arg ) +mlt_filter filter_luma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { mlt_filter this = mlt_filter_new( ); if ( this != NULL )