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