[FFmpeg-devel] [PATCH v2 1/2] dnn_backend_native.c: parse options in native backend

Guo, Yejun yejun.guo at intel.com
Fri Sep 4 16:32:15 EEST 2020



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> xujunzz at sjtu.edu.cn
> Sent: 2020年9月4日 20:46
> To: ffmpeg-devel at ffmpeg.org
> Cc: xujunzz at sjtu.edu.cn
> Subject: [FFmpeg-devel] [PATCH v2 1/2] dnn_backend_native.c: parse options in
> native backend
> 
> From: Xu Jun <xujunzz at sjtu.edu.cn>
> 
> v2: use av_opt_set_from_string instead of function dnn_parse_option().
> 
> Signed-off-by: Xu Jun <xujunzz at sjtu.edu.cn>
> ---

please add your v2/v3 comments here, so it will not be shown in commit log.

>  libavfilter/dnn/dnn_backend_native.c | 19 ++++++++++---------
> libavfilter/dnn/dnn_backend_native.h | 21 +++++++++++++++++++++
>  2 files changed, 31 insertions(+), 9 deletions(-)
> 
> diff --git a/libavfilter/dnn/dnn_backend_native.c
> b/libavfilter/dnn/dnn_backend_native.c
> index a8fe6b94eb..b1ee6fb399 100644
> --- a/libavfilter/dnn/dnn_backend_native.c
> +++ b/libavfilter/dnn/dnn_backend_native.c
> @@ -28,14 +28,6 @@
>  #include "dnn_backend_native_layer_conv2d.h"
>  #include "dnn_backend_native_layers.h"
> 
> -static const AVClass dnn_native_class = {
> -    .class_name = "dnn_native",
> -    .item_name  = av_default_item_name,
> -    .option     = NULL,
> -    .version    = LIBAVUTIL_VERSION_INT,
> -    .category   = AV_CLASS_CATEGORY_FILTER,
> -};
> -
>  static DNNReturnType get_input_native(void *model, DNNData *input, const
> char *input_name)  {
>      NativeModel *native_model = (NativeModel *)model; @@ -174,8
> +166,18 @@ DNNModel *ff_dnn_load_model_native(const char
> *model_filename, const char *optio
>      }
> 
>      native_model->ctx.class = &dnn_native_class;
> +    model->options = options;
> +    if (av_opt_set_from_string(&native_model->ctx, model->options,
> "conv2d_threads", "=", "&") < 0)

should be  if (av_opt_set_from_string(&native_model->ctx, model->options, NULL, "=", "&") < 0) , 
so all the options are supported, not just conv2d_threads, and it also fixed the build warning.



More information about the ffmpeg-devel mailing list