[FFmpeg-devel] [PATCH v2] libavfilter/dnn: fix openvino async mode
Guo, Yejun
yejun.guo at intel.com
Fri Dec 16 13:02:04 EET 2022
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of
> Saliev, Rafik F
> Sent: Friday, December 16, 2022 6:35 PM
> To: ffmpeg-devel at ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH v2] libavfilter/dnn: fix openvino async mode
>
> Bugfix: The OpenVino DNN backend in the 'async' mode sets 'task-
> >inference_done' to 'complete' prior to data copy from OpenVino output
> buffer to task's output frame.
> This order causes task destroy in ff_dnn_get_result_common() prior to model
> output processing.
>
> Signed-off-by: Rafik Saliev <rafik.f.saliev at intel.com>
> ---
> libavfilter/dnn/dnn_backend_openvino.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavfilter/dnn/dnn_backend_openvino.c
> b/libavfilter/dnn/dnn_backend_openvino.c
> index b494f26f55..b67f288336 100644
> --- a/libavfilter/dnn/dnn_backend_openvino.c
> +++ b/libavfilter/dnn/dnn_backend_openvino.c
> @@ -244,7 +244,6 @@ static void infer_completion_callback(void *args)
> av_assert0(request->lltask_count >= 1);
> for (int i = 0; i < request->lltask_count; ++i) {
> task = request->lltasks[i]->task;
> - task->inference_done++;
>
> switch (ov_model->model->func_type) {
> case DFT_PROCESS_FRAME:
> @@ -278,6 +277,7 @@ static void infer_completion_callback(void *args)
> break;
> }
>
> + task->inference_done++;
> av_freep(&request->lltasks[i]);
> output.data = (uint8_t *)output.data
> + output.width * output.height * output.channels *
> get_datatype_size(output.dt);
> --
LGTM, will push soon, thanks.
More information about the ffmpeg-devel
mailing list