@ -261,19 +261,25 @@ static av_cold int dilate_init(AVFilterContext *ctx, const char *args)
OCVContext * s = ctx - > priv ;
OCVContext * s = ctx - > priv ;
DilateContext * dilate = s - > priv ;
DilateContext * dilate = s - > priv ;
char default_kernel_str [ ] = " 3x3+0x0/rect " ;
char default_kernel_str [ ] = " 3x3+0x0/rect " ;
char * kernel_str ;
char * kernel_str = NULL ;
const char * buf = args ;
const char * buf = args ;
int ret ;
int ret ;
dilate - > nb_iterations = 1 ;
dilate - > nb_iterations = 1 ;
if ( args )
if ( args ) {
kernel_str = av_get_token ( & buf , " | " ) ;
kernel_str = av_get_token ( & buf , " | " ) ;
if ( ( ret = parse_iplconvkernel ( & dilate - > kernel ,
if ( ! kernel_str )
* kernel_str ? kernel_str : default_kernel_str ,
return AVERROR ( ENOMEM ) ;
ctx ) ) < 0 )
}
return ret ;
ret = parse_iplconvkernel ( & dilate - > kernel ,
( ! kernel_str | | ! * kernel_str ) ? default_kernel_str
: kernel_str ,
ctx ) ;
av_free ( kernel_str ) ;
av_free ( kernel_str ) ;
if ( ret < 0 )
return ret ;
sscanf ( buf , " |%d " , & dilate - > nb_iterations ) ;
sscanf ( buf , " |%d " , & dilate - > nb_iterations ) ;
av_log ( ctx , AV_LOG_VERBOSE , " iterations_nb:%d \n " , dilate - > nb_iterations ) ;
av_log ( ctx , AV_LOG_VERBOSE , " iterations_nb:%d \n " , dilate - > nb_iterations ) ;