diff options
author | Shubhanshu Saxena <shubhanshu.e01@gmail.com> | 2022-03-02 23:35:49 +0530 |
---|---|---|
committer | Guo Yejun <yejun.guo@intel.com> | 2022-03-12 15:10:28 +0800 |
commit | e5ce6a60708fb9cd2ec46f6302c3bc943e330f16 (patch) | |
tree | 7b777915b5957b3f2547fe27c0268bbd4860ddb7 /libavfilter/vf_sr.c | |
parent | e7caa18b4a3344b90a0574591fd86158458b7e9f (diff) |
libavfilter: Prepare to handle specific error codes in DNN Filters
This commit prepares the filter side to handle specific error codes
from the DNN backends instead of current DNN_ERROR.
Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
Diffstat (limited to 'libavfilter/vf_sr.c')
-rw-r--r-- | libavfilter/vf_sr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavfilter/vf_sr.c b/libavfilter/vf_sr.c index b07335bc30..02d9452681 100644 --- a/libavfilter/vf_sr.c +++ b/libavfilter/vf_sr.c @@ -76,7 +76,7 @@ static int config_output(AVFilterLink *outlink) { AVFilterContext *context = outlink->src; SRContext *ctx = context->priv; - DNNReturnType result; + int result; AVFilterLink *inlink = context->inputs[0]; int out_width, out_height; @@ -84,7 +84,7 @@ static int config_output(AVFilterLink *outlink) result = ff_dnn_get_output(&ctx->dnnctx, inlink->w, inlink->h, &out_width, &out_height); if (result != DNN_SUCCESS) { av_log(ctx, AV_LOG_ERROR, "could not get output from the model\n"); - return AVERROR(EIO); + return result; } if (inlink->w != out_width || inlink->h != out_height) { @@ -121,7 +121,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) SRContext *ctx = context->priv; AVFilterLink *outlink = context->outputs[0]; AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h); - DNNReturnType dnn_result; + int dnn_result; if (!out){ av_log(context, AV_LOG_ERROR, "could not allocate memory for output frame\n"); @@ -143,7 +143,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) av_log(ctx, AV_LOG_ERROR, "failed to execute loaded model\n"); av_frame_free(&in); av_frame_free(&out); - return AVERROR(EIO); + return dnn_result; } do { |