diff options
author | Shubhanshu Saxena <shubhanshu.e01@gmail.com> | 2021-06-05 23:38:06 +0530 |
---|---|---|
committer | Guo Yejun <yejun.guo@intel.com> | 2021-06-12 15:18:58 +0800 |
commit | 55092358189b98682d133c7b05bfcbb7ab6c750f (patch) | |
tree | cd5b0409a2ebcf54a8399354f62eea0abc7a8eb2 /libavfilter/dnn/dnn_backend_openvino.c | |
parent | 6b961f74096aff114d32480670943ce4d6d66826 (diff) |
lavfi/dnn: Fill Task using Common Function
This commit adds a common function for filling the TaskItems
in all three backends.
Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
Diffstat (limited to 'libavfilter/dnn/dnn_backend_openvino.c')
-rw-r--r-- | libavfilter/dnn/dnn_backend_openvino.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c index c2487c35be..709a772a4d 100644 --- a/libavfilter/dnn/dnn_backend_openvino.c +++ b/libavfilter/dnn/dnn_backend_openvino.c @@ -793,14 +793,9 @@ DNNReturnType ff_dnn_execute_model_ov(const DNNModel *model, DNNExecBaseParams * } } - task.do_ioproc = 1; - task.async = 0; - task.input_name = exec_params->input_name; - task.in_frame = exec_params->in_frame; - task.output_names = &exec_params->output_names[0]; - task.out_frame = exec_params->out_frame ? exec_params->out_frame : exec_params->in_frame; - task.nb_output = exec_params->nb_output; - task.model = ov_model; + if (ff_dnn_fill_task(&task, exec_params, ov_model, 0, 1) != DNN_SUCCESS) { + return DNN_ERROR; + } if (extract_inference_from_task(ov_model->model->func_type, &task, ov_model->inference_queue, exec_params) != DNN_SUCCESS) { av_log(ctx, AV_LOG_ERROR, "unable to extract inference from task.\n"); @@ -841,14 +836,10 @@ DNNReturnType ff_dnn_execute_model_async_ov(const DNNModel *model, DNNExecBasePa return DNN_ERROR; } - task->do_ioproc = 1; - task->async = 1; - task->input_name = exec_params->input_name; - task->in_frame = exec_params->in_frame; - task->output_names = &exec_params->output_names[0]; - task->out_frame = exec_params->out_frame ? exec_params->out_frame : exec_params->in_frame; - task->nb_output = exec_params->nb_output; - task->model = ov_model; + if (ff_dnn_fill_task(task, exec_params, ov_model, 1, 1) != DNN_SUCCESS) { + return DNN_ERROR; + } + if (ff_queue_push_back(ov_model->task_queue, task) < 0) { av_freep(&task); av_log(ctx, AV_LOG_ERROR, "unable to push back task_queue.\n"); |