You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
lavfi/dnn_backend_ov: Rename RequestItem to OVRequestItem
Rename RequestItem to OVRequestItem in the OpenVINO backend to avoid confusion. Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
This commit is contained in:
committed by
Guo Yejun
parent
429954822c
commit
0bc7ddc460
@@ -54,18 +54,18 @@ typedef struct OVModel{
|
|||||||
ie_core_t *core;
|
ie_core_t *core;
|
||||||
ie_network_t *network;
|
ie_network_t *network;
|
||||||
ie_executable_network_t *exe_network;
|
ie_executable_network_t *exe_network;
|
||||||
SafeQueue *request_queue; // holds RequestItem
|
SafeQueue *request_queue; // holds OVRequestItem
|
||||||
Queue *task_queue; // holds TaskItem
|
Queue *task_queue; // holds TaskItem
|
||||||
Queue *inference_queue; // holds InferenceItem
|
Queue *inference_queue; // holds InferenceItem
|
||||||
} OVModel;
|
} OVModel;
|
||||||
|
|
||||||
// one request for one call to openvino
|
// one request for one call to openvino
|
||||||
typedef struct RequestItem {
|
typedef struct OVRequestItem {
|
||||||
ie_infer_request_t *infer_request;
|
ie_infer_request_t *infer_request;
|
||||||
InferenceItem **inferences;
|
InferenceItem **inferences;
|
||||||
uint32_t inference_count;
|
uint32_t inference_count;
|
||||||
ie_complete_call_back_t callback;
|
ie_complete_call_back_t callback;
|
||||||
} RequestItem;
|
} OVRequestItem;
|
||||||
|
|
||||||
#define APPEND_STRING(generated_string, iterate_string) \
|
#define APPEND_STRING(generated_string, iterate_string) \
|
||||||
generated_string = generated_string ? av_asprintf("%s %s", generated_string, iterate_string) : \
|
generated_string = generated_string ? av_asprintf("%s %s", generated_string, iterate_string) : \
|
||||||
@@ -111,7 +111,7 @@ static int get_datatype_size(DNNDataType dt)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static DNNReturnType fill_model_input_ov(OVModel *ov_model, RequestItem *request)
|
static DNNReturnType fill_model_input_ov(OVModel *ov_model, OVRequestItem *request)
|
||||||
{
|
{
|
||||||
dimensions_t dims;
|
dimensions_t dims;
|
||||||
precision_e precision;
|
precision_e precision;
|
||||||
@@ -198,7 +198,7 @@ static void infer_completion_callback(void *args)
|
|||||||
dimensions_t dims;
|
dimensions_t dims;
|
||||||
precision_e precision;
|
precision_e precision;
|
||||||
IEStatusCode status;
|
IEStatusCode status;
|
||||||
RequestItem *request = args;
|
OVRequestItem *request = args;
|
||||||
InferenceItem *inference = request->inferences[0];
|
InferenceItem *inference = request->inferences[0];
|
||||||
TaskItem *task = inference->task;
|
TaskItem *task = inference->task;
|
||||||
OVModel *ov_model = task->model;
|
OVModel *ov_model = task->model;
|
||||||
@@ -381,7 +381,7 @@ static DNNReturnType init_model_ov(OVModel *ov_model, const char *input_name, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < ctx->options.nireq; i++) {
|
for (int i = 0; i < ctx->options.nireq; i++) {
|
||||||
RequestItem *item = av_mallocz(sizeof(*item));
|
OVRequestItem *item = av_mallocz(sizeof(*item));
|
||||||
if (!item) {
|
if (!item) {
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
@@ -422,7 +422,7 @@ err:
|
|||||||
return DNN_ERROR;
|
return DNN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DNNReturnType execute_model_ov(RequestItem *request, Queue *inferenceq)
|
static DNNReturnType execute_model_ov(OVRequestItem *request, Queue *inferenceq)
|
||||||
{
|
{
|
||||||
IEStatusCode status;
|
IEStatusCode status;
|
||||||
DNNReturnType ret;
|
DNNReturnType ret;
|
||||||
@@ -639,7 +639,7 @@ static DNNReturnType get_output_ov(void *model, const char *input_name, int inpu
|
|||||||
OVModel *ov_model = model;
|
OVModel *ov_model = model;
|
||||||
OVContext *ctx = &ov_model->ctx;
|
OVContext *ctx = &ov_model->ctx;
|
||||||
TaskItem task;
|
TaskItem task;
|
||||||
RequestItem *request;
|
OVRequestItem *request;
|
||||||
AVFrame *in_frame = NULL;
|
AVFrame *in_frame = NULL;
|
||||||
AVFrame *out_frame = NULL;
|
AVFrame *out_frame = NULL;
|
||||||
IEStatusCode status;
|
IEStatusCode status;
|
||||||
@@ -779,7 +779,7 @@ DNNReturnType ff_dnn_execute_model_ov(const DNNModel *model, DNNExecBaseParams *
|
|||||||
OVModel *ov_model = model->model;
|
OVModel *ov_model = model->model;
|
||||||
OVContext *ctx = &ov_model->ctx;
|
OVContext *ctx = &ov_model->ctx;
|
||||||
TaskItem task;
|
TaskItem task;
|
||||||
RequestItem *request;
|
OVRequestItem *request;
|
||||||
|
|
||||||
if (ff_check_exec_params(ctx, DNN_OV, model->func_type, exec_params) != 0) {
|
if (ff_check_exec_params(ctx, DNN_OV, model->func_type, exec_params) != 0) {
|
||||||
return DNN_ERROR;
|
return DNN_ERROR;
|
||||||
@@ -827,7 +827,7 @@ DNNReturnType ff_dnn_execute_model_async_ov(const DNNModel *model, DNNExecBasePa
|
|||||||
{
|
{
|
||||||
OVModel *ov_model = model->model;
|
OVModel *ov_model = model->model;
|
||||||
OVContext *ctx = &ov_model->ctx;
|
OVContext *ctx = &ov_model->ctx;
|
||||||
RequestItem *request;
|
OVRequestItem *request;
|
||||||
TaskItem *task;
|
TaskItem *task;
|
||||||
DNNReturnType ret;
|
DNNReturnType ret;
|
||||||
|
|
||||||
@@ -904,7 +904,7 @@ DNNReturnType ff_dnn_flush_ov(const DNNModel *model)
|
|||||||
{
|
{
|
||||||
OVModel *ov_model = model->model;
|
OVModel *ov_model = model->model;
|
||||||
OVContext *ctx = &ov_model->ctx;
|
OVContext *ctx = &ov_model->ctx;
|
||||||
RequestItem *request;
|
OVRequestItem *request;
|
||||||
IEStatusCode status;
|
IEStatusCode status;
|
||||||
DNNReturnType ret;
|
DNNReturnType ret;
|
||||||
|
|
||||||
@@ -943,7 +943,7 @@ void ff_dnn_free_model_ov(DNNModel **model)
|
|||||||
if (*model){
|
if (*model){
|
||||||
OVModel *ov_model = (*model)->model;
|
OVModel *ov_model = (*model)->model;
|
||||||
while (ff_safe_queue_size(ov_model->request_queue) != 0) {
|
while (ff_safe_queue_size(ov_model->request_queue) != 0) {
|
||||||
RequestItem *item = ff_safe_queue_pop_front(ov_model->request_queue);
|
OVRequestItem *item = ff_safe_queue_pop_front(ov_model->request_queue);
|
||||||
if (item && item->infer_request) {
|
if (item && item->infer_request) {
|
||||||
ie_infer_request_free(&item->infer_request);
|
ie_infer_request_free(&item->infer_request);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user