From f00b75bde4ca63a6324fc1c41e3afe4960592452 Mon Sep 17 00:00:00 2001 From: ChenSiyong Date: Tue, 3 Nov 2015 01:30:44 +0000 Subject: [PATCH] [h265d]: output all frame when reset avoid frame buffer no free [codec_thread]:add hal lock when put processing task to task list avoid hal thread can't wake up at wait signal git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@445 6e48237b-75ef-9749-8fc9-41990f28c85a --- mpp/codec/dec/h265/h265d_parser.c | 4 ++++ mpp/codec/mpp_dec.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/mpp/codec/dec/h265/h265d_parser.c b/mpp/codec/dec/h265/h265d_parser.c index 3c8bfd18..ebaf67f7 100644 --- a/mpp/codec/dec/h265/h265d_parser.c +++ b/mpp/codec/dec/h265/h265d_parser.c @@ -1857,6 +1857,10 @@ MPP_RET h265d_reset(void *ctx) { H265dContext_t *h265dctx = (H265dContext_t *)ctx; HEVCContext *s = (HEVCContext *)h265dctx->priv_data; + RK_S32 ret = 0; + do { + ret = mpp_hevc_output_frame(ctx, 1); + } while (ret); mpp_hevc_flush_dpb(s); h265d_split_reset(h265dctx->split_cxt); s->max_ra = INT_MAX; diff --git a/mpp/codec/mpp_dec.cpp b/mpp/codec/mpp_dec.cpp index 387d1f5d..bffe1abe 100644 --- a/mpp/codec/mpp_dec.cpp +++ b/mpp/codec/mpp_dec.cpp @@ -352,7 +352,9 @@ static MPP_RET try_proc_dec_task(Mpp *mpp, DecTask *task) if (!task->status.info_task_gen_rdy) { task_dec->flags.info_change = 1; hal_task_hnd_set_info(task->hnd, &task->info); + mpp->mThreadHal->lock(); hal_task_hnd_set_status(task->hnd, TASK_PROCESSING); + mpp->mThreadHal->unlock(); mpp->mThreadHal->signal(); mpp->mTaskPutCount++; task->hnd = NULL; @@ -445,7 +447,9 @@ static MPP_RET try_proc_dec_task(Mpp *mpp, DecTask *task) * combinate video codec dxva output and buffer information */ hal_task_hnd_set_info(task->hnd, &task->info); + mpp->mThreadHal->lock(); hal_task_hnd_set_status(task->hnd, TASK_PROCESSING); + mpp->mThreadHal->unlock(); mpp->mThreadHal->signal(); mpp->mTaskPutCount++;