summaryrefslogtreecommitdiff
path: root/libavfilter/dnn_interface.h
diff options
context:
space:
mode:
authorGuo, Yejun <yejun.guo@intel.com>2020-11-18 14:28:06 +0800
committerGuo, Yejun <yejun.guo@intel.com>2020-12-29 09:31:06 +0800
commit39f5cb4bd1bbb12632baac24dd7b9bb5a68bef8d (patch)
tree77ba13840a36ce9db189e195f003bd70d89ca2d7 /libavfilter/dnn_interface.h
parent38089925fa41d0b767e8c47fb236dec390ec38ac (diff)
dnn_interface: add interface to support async execution
Signed-off-by: Xie, Lin <lin.xie@intel.com> Signed-off-by: Wu Zhiwen <zhiwen.wu@intel.com> Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Diffstat (limited to 'libavfilter/dnn_interface.h')
-rw-r--r--libavfilter/dnn_interface.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavfilter/dnn_interface.h b/libavfilter/dnn_interface.h
index 2f129d535e..9e54b91d19 100644
--- a/libavfilter/dnn_interface.h
+++ b/libavfilter/dnn_interface.h
@@ -35,6 +35,13 @@ typedef enum {DNN_NATIVE, DNN_TF, DNN_OV} DNNBackendType;
typedef enum {DNN_FLOAT = 1, DNN_UINT8 = 4} DNNDataType;
+typedef enum {
+ DAST_FAIL, // something wrong
+ DAST_EMPTY_QUEUE, // no more inference result to get
+ DAST_NOT_READY, // all queued inferences are not finished
+ DAST_SUCCESS // got a result frame successfully
+} DNNAsyncStatusType;
+
typedef struct DNNData{
void *data;
DNNDataType dt;
@@ -69,6 +76,11 @@ typedef struct DNNModule{
// Executes model with specified input and output. Returns DNN_ERROR otherwise.
DNNReturnType (*execute_model)(const DNNModel *model, const char *input_name, AVFrame *in_frame,
const char **output_names, uint32_t nb_output, AVFrame *out_frame);
+ // Executes model with specified input and output asynchronously. Returns DNN_ERROR otherwise.
+ DNNReturnType (*execute_model_async)(const DNNModel *model, const char *input_name, AVFrame *in_frame,
+ const char **output_names, uint32_t nb_output, AVFrame *out_frame);
+ // Retrieve inference result.
+ DNNAsyncStatusType (*get_async_result)(const DNNModel *model, AVFrame **out);
// Frees memory allocated for model.
void (*free_model)(DNNModel **model);
} DNNModule;