Commit bf1945b884cc37cb77978d45d6170506ccfda0a1
1 parent
61e306c1
修复resize会崩溃的问题
Showing
2 changed files
with
5 additions
and
1 deletions
src/decoder/dvpp/VpcUtils.cpp
@@ -182,6 +182,8 @@ DvppDataMemory* VpcUtils::convert2bgr(DvppDataMemory* inMem){ | @@ -182,6 +182,8 @@ DvppDataMemory* VpcUtils::convert2bgr(DvppDataMemory* inMem){ | ||
182 | 182 | ||
183 | DvppDataMemory* VpcUtils::resize(acldvppPicDesc *inputDesc_, int out_width, int out_height){ | 183 | DvppDataMemory* VpcUtils::resize(acldvppPicDesc *inputDesc_, int out_width, int out_height){ |
184 | 184 | ||
185 | + std::lock_guard<std::mutex> l(m_resize_mtx); | ||
186 | + | ||
185 | ACL_CHECK_AND_ABORT(aclrtSetCurrentContext(context_), "aclrtSetCurrentContext failed !"); | 187 | ACL_CHECK_AND_ABORT(aclrtSetCurrentContext(context_), "aclrtSetCurrentContext failed !"); |
186 | 188 | ||
187 | int out_buf_width = ALIGN_UP(out_width, 16); | 189 | int out_buf_width = ALIGN_UP(out_width, 16); |
src/decoder/dvpp/VpcUtils.h
1 | #include "dvpp_headers.h" | 1 | #include "dvpp_headers.h" |
2 | #include "depend_headers.h" | 2 | #include "depend_headers.h" |
3 | #include "DvppDataMemory.hpp" | 3 | #include "DvppDataMemory.hpp" |
4 | - | 4 | +#include <mutex> |
5 | 5 | ||
6 | class VpcUtils{ | 6 | class VpcUtils{ |
7 | public: | 7 | public: |
@@ -30,4 +30,6 @@ private: | @@ -30,4 +30,6 @@ private: | ||
30 | int m_devId; | 30 | int m_devId; |
31 | acldvppChannelDesc *dvppChannelDesc_ {nullptr}; | 31 | acldvppChannelDesc *dvppChannelDesc_ {nullptr}; |
32 | string m_dec_name; | 32 | string m_dec_name; |
33 | + | ||
34 | + std::mutex m_resize_mtx; | ||
33 | }; | 35 | }; |
34 | \ No newline at end of file | 36 | \ No newline at end of file |