X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fvmfx%2Ffilter_chroma.c;h=f13838ba7aea8eb17f436aa96c1d57201547c25f;hb=f13ee0890b643f2c2eb220290f8374c80605a505;hp=f857f00585be5f4382156dee24cfd7515a0a1e3b;hpb=6fbad87cfc97a367c4e47216b83c9e433253aa9e;p=melted diff --git a/src/modules/vmfx/filter_chroma.c b/src/modules/vmfx/filter_chroma.c index f857f00..f13838b 100644 --- a/src/modules/vmfx/filter_chroma.c +++ b/src/modules/vmfx/filter_chroma.c @@ -18,7 +18,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "filter_chroma.h" +#include #include #include #include @@ -45,12 +45,11 @@ static inline uint8_t alpha_value( uint8_t a, uint8_t *p, uint8_t u, uint8_t v, static int filter_get_image( mlt_frame frame, uint8_t **image, mlt_image_format *format, int *width, int *height, int writable ) { mlt_filter this = mlt_frame_pop_service( frame ); - char *key = mlt_properties_get( MLT_FILTER_PROPERTIES( this ), "key" ); int variance = 200 * mlt_properties_get_double( MLT_FILTER_PROPERTIES( this ), "variance" ); - int32_t key_val = strtol( key, &key, 0 ); - uint8_t b = key_val & 0xff; - uint8_t g = ( key_val >> 8 ) & 0xff; - uint8_t r = ( key_val >> 16 ) & 0xff; + int32_t key_val = mlt_properties_get_int( MLT_FILTER_PROPERTIES( this ), "key" ); + uint8_t r = ( key_val >> 24 ) & 0xff; + uint8_t g = ( key_val >> 16 ) & 0xff; + uint8_t b = ( key_val >> 8 ) & 0xff; uint8_t y, u, v; RGB2YUV( r, g, b, y, u, v ); @@ -86,12 +85,12 @@ static mlt_frame filter_process( mlt_filter this, mlt_frame frame ) /** Constructor for the filter. */ -mlt_filter filter_chroma_init( char *arg ) +mlt_filter filter_chroma_init( mlt_profile profile, mlt_service_type type, const char *id, char *arg ) { mlt_filter this = mlt_filter_new( ); if ( this != NULL ) { - mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "key", arg == NULL ? "0x0000ff" : arg ); + mlt_properties_set( MLT_FILTER_PROPERTIES( this ), "key", arg == NULL ? "0x0000ff00" : arg ); mlt_properties_set_double( MLT_FILTER_PROPERTIES( this ), "variance", 0.15 ); this->process = filter_process; }