diff mbox series

[FFmpeg-devel,2/6] libavfilter/dnn: use avpriv_report_missing_feature for unsupported features

Message ID 20210118125200.27329-1-yejun.guo@intel.com
State Accepted
Commit 2d6af4a501d0563268580740c5a51073382ad045
Headers show
Series [FFmpeg-devel,1/6] dnn_backend_openvino.c: add version mismatch reminder
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Guo, Yejun Jan. 18, 2021, 12:52 p.m. UTC
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
---
 libavfilter/dnn/dnn_backend_native.c   |  2 +-
 libavfilter/dnn/dnn_backend_openvino.c |  4 ++--
 libavfilter/dnn/dnn_backend_tf.c       |  4 ++--
 libavfilter/dnn/dnn_io_proc.c          | 10 ++++------
 libavfilter/vf_dnn_processing.c        |  4 ++--
 5 files changed, 11 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/dnn/dnn_backend_native.c b/libavfilter/dnn/dnn_backend_native.c
index 5e7fc0f10c..2700251ee6 100644
--- a/libavfilter/dnn/dnn_backend_native.c
+++ b/libavfilter/dnn/dnn_backend_native.c
@@ -327,7 +327,7 @@  static DNNReturnType execute_model_native(const DNNModel *model, const char *inp
     if (nb_output != 1) {
         // currently, the filter does not need multiple outputs,
         // so we just pending the support until we really need it.
-        av_log(ctx, AV_LOG_ERROR, "do not support multiple outputs\n");
+        avpriv_report_missing_feature(ctx, "multiple outputs");
         return DNN_ERROR;
     }
 
diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c
index bb4ef3958f..5820afbcfd 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -588,12 +588,12 @@  DNNReturnType ff_dnn_execute_model_ov(const DNNModel *model, const char *input_n
     if (nb_output != 1) {
         // currently, the filter does not need multiple outputs,
         // so we just pending the support until we really need it.
-        av_log(ctx, AV_LOG_ERROR, "do not support multiple outputs\n");
+        avpriv_report_missing_feature(ctx, "multiple outputs");
         return DNN_ERROR;
     }
 
     if (ctx->options.batch_size > 1) {
-        av_log(ctx, AV_LOG_ERROR, "do not support batch mode for sync execution.\n");
+        avpriv_report_missing_feature(ctx, "batch mode for sync execution");
         return DNN_ERROR;
     }
 
diff --git a/libavfilter/dnn/dnn_backend_tf.c b/libavfilter/dnn/dnn_backend_tf.c
index b9fe01693b..cbe83741f6 100644
--- a/libavfilter/dnn/dnn_backend_tf.c
+++ b/libavfilter/dnn/dnn_backend_tf.c
@@ -424,7 +424,7 @@  static DNNReturnType add_conv_layer(TFModel *tf_model, TF_Operation *transpose_o
         op_desc = TF_NewOperation(tf_model->graph, "Sigmoid", name_buffer);
         break;
     default:
-        av_log(ctx, AV_LOG_ERROR, "Unsupported convolutional activation function\n");
+        avpriv_report_missing_feature(ctx, "convolutional activation function %d", params->activation);
         return DNN_ERROR;
     }
     input.oper = *cur_op;
@@ -750,7 +750,7 @@  static DNNReturnType execute_model_tf(const DNNModel *model, const char *input_n
     if (nb_output != 1) {
         // currently, the filter does not need multiple outputs,
         // so we just pending the support until we really need it.
-        av_log(ctx, AV_LOG_ERROR, "do not support multiple outputs\n");
+        avpriv_report_missing_feature(ctx, "multiple outputs");
         return DNN_ERROR;
     }
 
diff --git a/libavfilter/dnn/dnn_io_proc.c b/libavfilter/dnn/dnn_io_proc.c
index 2744cb6502..193e5bd9cc 100644
--- a/libavfilter/dnn/dnn_io_proc.c
+++ b/libavfilter/dnn/dnn_io_proc.c
@@ -27,7 +27,7 @@  DNNReturnType proc_from_dnn_to_frame(AVFrame *frame, DNNData *output, void *log_
     struct SwsContext *sws_ctx;
     int bytewidth = av_image_get_linesize(frame->format, frame->width, 0);
     if (output->dt != DNN_FLOAT) {
-        av_log(log_ctx, AV_LOG_ERROR, "do not support data type rather than DNN_FLOAT\n");
+        avpriv_report_missing_feature(log_ctx, "data type rather than DNN_FLOAT");
         return DNN_ERROR;
     }
 
@@ -85,8 +85,7 @@  DNNReturnType proc_from_dnn_to_frame(AVFrame *frame, DNNData *output, void *log_
         sws_freeContext(sws_ctx);
         return DNN_SUCCESS;
     default:
-        av_log(log_ctx, AV_LOG_ERROR, "do not support frame format %s\n",
-               av_get_pix_fmt_name(frame->format));
+        avpriv_report_missing_feature(log_ctx, "%s", av_get_pix_fmt_name(frame->format));
         return DNN_ERROR;
     }
 
@@ -98,7 +97,7 @@  DNNReturnType proc_from_frame_to_dnn(AVFrame *frame, DNNData *input, void *log_c
     struct SwsContext *sws_ctx;
     int bytewidth = av_image_get_linesize(frame->format, frame->width, 0);
     if (input->dt != DNN_FLOAT) {
-        av_log(log_ctx, AV_LOG_ERROR, "do not support data type rather than DNN_FLOAT\n");
+        avpriv_report_missing_feature(log_ctx, "data type rather than DNN_FLOAT");
         return DNN_ERROR;
     }
 
@@ -158,8 +157,7 @@  DNNReturnType proc_from_frame_to_dnn(AVFrame *frame, DNNData *input, void *log_c
         sws_freeContext(sws_ctx);
         break;
     default:
-        av_log(log_ctx, AV_LOG_ERROR, "do not support frame format %s\n",
-               av_get_pix_fmt_name(frame->format));
+        avpriv_report_missing_feature(log_ctx, "%s", av_get_pix_fmt_name(frame->format));
         return DNN_ERROR;
     }
 
diff --git a/libavfilter/vf_dnn_processing.c b/libavfilter/vf_dnn_processing.c
index 240614fe65..09e1699b9e 100644
--- a/libavfilter/vf_dnn_processing.c
+++ b/libavfilter/vf_dnn_processing.c
@@ -159,7 +159,7 @@  static int check_modelinput_inlink(const DNNData *model_input, const AVFilterLin
         return AVERROR(EIO);
     }
     if (model_input->dt != DNN_FLOAT) {
-        av_log(ctx, AV_LOG_ERROR, "only support dnn models with input data type as float32.\n");
+        avpriv_report_missing_feature(ctx, "data type rather than DNN_FLOAT");
         return AVERROR(EIO);
     }
 
@@ -184,7 +184,7 @@  static int check_modelinput_inlink(const DNNData *model_input, const AVFilterLin
         }
         return 0;
     default:
-        av_log(ctx, AV_LOG_ERROR, "%s not supported.\n", av_get_pix_fmt_name(fmt));
+        avpriv_report_missing_feature(ctx, "%s", av_get_pix_fmt_name(fmt));
         return AVERROR(EIO);
     }