Switch to returning specific error codes or DNN_GENERIC_ERROR when an error is encountered. For OpenVINO API errors, currently DNN_GENERIC_ERROR is returned.
Showing the changes to libavfilter/dnn_interface.h (1 of 3 files). Show all
Unified · Split
| @@ -94,9 +94,9 @@ typedef struct DNNModel{ · 93 unmodified lines | ||
| 94 | 94 | DNNFunctionType func_type; |
| 95 | 95 | // Gets model input information |
| 96 | 96 | // Just reuse struct DNNData here, actually the DNNData.data field is not needed. |
| 97 | − DNNReturnType (*get_input)(void *model, DNNData *input, const char *input_name); | |
| 97 | + int (*get_input)(void *model, DNNData *input, const char *input_name); | |
| 98 | 98 | // Gets model output width/height with given input w/h |
| 99 | − DNNReturnType (*get_output)(void *model, const char *input_name, int input_width, int input_height, | |
| 99 | + int (*get_output)(void *model, const char *input_name, int input_width, int input_height, | |
| 100 | 100 | const char *output_name, int *output_width, int *output_height); |
| 101 | 101 | // set the pre process to transfer data from AVFrame to DNNData |
| 102 | 102 | // the default implementation within DNN is used if it is not provided by the filter |
| @@ -114,12 +114,12 @@ typedef struct DNNModel{ · 11 unmodified lines | ||
| 114 | 114 | typedef struct DNNModule{ |
| 115 | 115 | // Loads model and parameters from given file. Returns NULL if it is not possible. |
| 116 | 116 | DNNModel *(*load_model)(const char *model_filename, DNNFunctionType func_type, const char *options, AVFilterContext *filter_ctx); |
| 117 | − // Executes model with specified input and output. Returns DNN_ERROR otherwise. | |
| 118 | − DNNReturnType (*execute_model)(const DNNModel *model, DNNExecBaseParams *exec_params); | |
| 117 | + // Executes model with specified input and output. Returns the error code otherwise. | |
| 118 | + int (*execute_model)(const DNNModel *model, DNNExecBaseParams *exec_params); | |
| 119 | 119 | // Retrieve inference result. |
| 120 | 120 | DNNAsyncStatusType (*get_result)(const DNNModel *model, AVFrame **in, AVFrame **out); |
| 121 | 121 | // Flush all the pending tasks. |
| 122 | − DNNReturnType (*flush)(const DNNModel *model); | |
| 122 | + int (*flush)(const DNNModel *model); | |
| 123 | 123 | // Frees memory allocated for model. |
| 124 | 124 | void (*free_model)(DNNModel **model); |
| 125 | 125 | } DNNModule; |