diff mbox series

[FFmpeg-devel,V2,3/5] lavfi/dnn: Add nb_output to TaskItem

Message ID 20210605180806.65831-3-shubhanshu.e01@gmail.com
State New
Headers show
Series [FFmpeg-devel,V2,1/5] lavfi/dnn: Extract TaskItem and InferenceItem from OpenVino Backend
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

Shubhanshu Saxena June 5, 2021, 6:08 p.m. UTC
Add nb_output property to TaskItem for use in TensorFlow backend
and Native backend.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
---
 libavfilter/dnn/dnn_backend_common.h   | 1 +
 libavfilter/dnn/dnn_backend_openvino.c | 3 +++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/libavfilter/dnn/dnn_backend_common.h b/libavfilter/dnn/dnn_backend_common.h
index f76a05026d..704cf921f1 100644
--- a/libavfilter/dnn/dnn_backend_common.h
+++ b/libavfilter/dnn/dnn_backend_common.h
@@ -35,6 +35,7 @@  typedef struct TaskItem {
     const char **output_names;
     int async;
     int do_ioproc;
+    uint32_t nb_output;
     uint32_t inference_todo;
     uint32_t inference_done;
 } TaskItem;
diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c
index 0f3b235820..c2487c35be 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -678,6 +678,7 @@  static DNNReturnType get_output_ov(void *model, const char *input_name, int inpu
     task.in_frame = in_frame;
     task.output_names = &output_name;
     task.out_frame = out_frame;
+    task.nb_output = 1;
     task.model = ov_model;
 
     if (extract_inference_from_task(ov_model->model->func_type, &task, ov_model->inference_queue, NULL) != DNN_SUCCESS) {
@@ -798,6 +799,7 @@  DNNReturnType ff_dnn_execute_model_ov(const DNNModel *model, DNNExecBaseParams *
     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 (extract_inference_from_task(ov_model->model->func_type, &task, ov_model->inference_queue, exec_params) != DNN_SUCCESS) {
@@ -845,6 +847,7 @@  DNNReturnType ff_dnn_execute_model_async_ov(const DNNModel *model, DNNExecBasePa
     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_queue_push_back(ov_model->task_queue, task) < 0) {
         av_freep(&task);