@ -98,6 +98,7 @@ const HWAccel hwaccels[] = {
} ;
} ;
int hwaccel_lax_profile_check = 0 ;
int hwaccel_lax_profile_check = 0 ;
AVBufferRef * hw_device_ctx ;
AVBufferRef * hw_device_ctx ;
HWDevice * filter_hw_device ;
char * vstats_filename ;
char * vstats_filename ;
char * sdp_filename ;
char * sdp_filename ;
@ -495,6 +496,20 @@ static int opt_init_hw_device(void *optctx, const char *opt, const char *arg)
}
}
}
}
static int opt_filter_hw_device ( void * optctx , const char * opt , const char * arg )
{
if ( filter_hw_device ) {
av_log ( NULL , AV_LOG_ERROR , " Only one filter device can be used. \n " ) ;
return AVERROR ( EINVAL ) ;
}
filter_hw_device = hw_device_get_by_name ( arg ) ;
if ( ! filter_hw_device ) {
av_log ( NULL , AV_LOG_ERROR , " Invalid filter device %s. \n " , arg ) ;
return AVERROR ( EINVAL ) ;
}
return 0 ;
}
/**
/**
* Parse a metadata specifier passed as ' arg ' parameter .
* Parse a metadata specifier passed as ' arg ' parameter .
* @ param arg metadata string to parse
* @ param arg metadata string to parse
@ -3708,6 +3723,8 @@ const OptionDef options[] = {
{ " init_hw_device " , HAS_ARG | OPT_EXPERT , { . func_arg = opt_init_hw_device } ,
{ " init_hw_device " , HAS_ARG | OPT_EXPERT , { . func_arg = opt_init_hw_device } ,
" initialise hardware device " , " args " } ,
" initialise hardware device " , " args " } ,
{ " filter_hw_device " , HAS_ARG | OPT_EXPERT , { . func_arg = opt_filter_hw_device } ,
" set hardware device used when filtering " , " device " } ,
{ NULL , } ,
{ NULL , } ,
} ;
} ;