X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fcore%2Ffilter_resize.c;h=4122d8f373a51d1ca091ac637d94aa229c2df26b;hb=00db7ed91dfa61f9e144b6d5548350a5954deb61;hp=a511eb222c009001cacf119b008b7e6f1eef1ae5;hpb=c56ed08b4a9f46677880cd7f550450eb41871565;p=melted diff --git a/src/modules/core/filter_resize.c b/src/modules/core/filter_resize.c index a511eb2..4122d8f 100644 --- a/src/modules/core/filter_resize.c +++ b/src/modules/core/filter_resize.c @@ -36,6 +36,9 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * // Get the properties from the frame mlt_properties properties = mlt_frame_properties( this ); + // Pop the top of stack now + mlt_filter filter = mlt_frame_pop_service( this ); + // Assign requested width/height from our subordinate int owidth = *width; int oheight = *height; @@ -82,6 +85,9 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * // We only know how to process yuv422 at the moment if ( error == 0 && *format == mlt_image_yuv422 ) { + // Get the requested scale operation + char *op = mlt_properties_get( mlt_filter_properties( filter ), "scale" ); + // Correct field order if needed if ( mlt_properties_get_int( properties, "top_field_first" ) == 1 ) { @@ -103,11 +109,11 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * mlt_properties_set_int( properties, "top_field_first", 0 ); } - if ( !strcmp( mlt_properties_get( properties, "resize.scale" ), "affine" ) ) + if ( !strcmp( op, "affine" ) ) { *image = mlt_frame_rescale_yuv422( this, *width, *height ); } - else if ( strcmp( mlt_properties_get( properties, "resize.scale" ), "none" ) != 0 ) + else if ( strcmp( op, "none" ) != 0 ) { *image = mlt_frame_resize_yuv422( this, *width, *height ); } @@ -126,8 +132,12 @@ static int filter_get_image( mlt_frame this, uint8_t **image, mlt_image_format * static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) { + // Push this on to the service stack + mlt_frame_push_service( frame, this ); + + // Push the get_image method on to the stack mlt_frame_push_get_image( frame, filter_get_image ); - mlt_properties_set( mlt_frame_properties( frame ), "resize.scale", mlt_properties_get( mlt_filter_properties( this ), "scale" ) ); + return frame; }