From bf1945b884cc37cb77978d45d6170506ccfda0a1 Mon Sep 17 00:00:00 2001 From: cmhu <2657262686@qq.com> Date: Mon, 25 Nov 2024 15:02:45 +0800 Subject: [PATCH] 修复resize会崩溃的问题 --- src/decoder/dvpp/VpcUtils.cpp | 2 ++ src/decoder/dvpp/VpcUtils.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/decoder/dvpp/VpcUtils.cpp b/src/decoder/dvpp/VpcUtils.cpp index d972079..0b96cc3 100644 --- a/src/decoder/dvpp/VpcUtils.cpp +++ b/src/decoder/dvpp/VpcUtils.cpp @@ -182,6 +182,8 @@ DvppDataMemory* VpcUtils::convert2bgr(DvppDataMemory* inMem){ DvppDataMemory* VpcUtils::resize(acldvppPicDesc *inputDesc_, int out_width, int out_height){ + std::lock_guard l(m_resize_mtx); + ACL_CHECK_AND_ABORT(aclrtSetCurrentContext(context_), "aclrtSetCurrentContext failed !"); int out_buf_width = ALIGN_UP(out_width, 16); diff --git a/src/decoder/dvpp/VpcUtils.h b/src/decoder/dvpp/VpcUtils.h index 49523be..a6e2d75 100644 --- a/src/decoder/dvpp/VpcUtils.h +++ b/src/decoder/dvpp/VpcUtils.h @@ -1,7 +1,7 @@ #include "dvpp_headers.h" #include "depend_headers.h" #include "DvppDataMemory.hpp" - +#include class VpcUtils{ public: @@ -30,4 +30,6 @@ private: int m_devId; acldvppChannelDesc *dvppChannelDesc_ {nullptr}; string m_dec_name; + + std::mutex m_resize_mtx; }; \ No newline at end of file -- libgit2 0.21.4