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;
// 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;