From cf32c96d4278365e1be8ed75d9863ccf29c2b974 Mon Sep 17 00:00:00 2001 From: Herman Chen Date: Wed, 22 Jun 2022 09:57:11 +0800 Subject: [PATCH] [mpp_enc]: Encoder async IO mode add 10ms timeout Change-Id: I7477a32080c19bb05c1a9d9d7596925ed9ffbbaa Signed-off-by: Herman Chen --- mpp/codec/mpp_enc_impl.cpp | 1 + mpp/mpp.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mpp/codec/mpp_enc_impl.cpp b/mpp/codec/mpp_enc_impl.cpp index 63fce3fa..5e26a7e6 100644 --- a/mpp/codec/mpp_enc_impl.cpp +++ b/mpp/codec/mpp_enc_impl.cpp @@ -2489,6 +2489,7 @@ static MPP_RET try_get_async_task(MppEncImpl *enc, EncAsyncWait *wait) if (frm_in->list_size()) { frm_in->del_at_head(&frame, sizeof(frame)); + frm_in->signal(); mpp->mFrameGetCount++; mpp_assert(frame); diff --git a/mpp/mpp.cpp b/mpp/mpp.cpp index 0dd7074c..f229c6d4 100644 --- a/mpp/mpp.cpp +++ b/mpp/mpp.cpp @@ -679,7 +679,7 @@ MPP_RET Mpp::put_frame_async(MppFrame frame) return MPP_NOK; /* NOTE: the max input queue length is 2 */ - if (mFrmIn->list_size() >= 2) { + if (mFrmIn->wait_le(10, 1)) { mFrmIn->unlock(); return MPP_NOK; }