added release of copied buffers in host and hip (#126)
* added release of copied buffers in host and hip * address review comments * addressed review comment
This commit is contained in:
@@ -72,6 +72,22 @@ RocVideoDecoder::~RocVideoDecoder() {
|
||||
roc_decoder_ = nullptr;
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(mtx_vp_frame_);
|
||||
if (out_mem_type_ != OUT_SURFACE_MEM_DEV_INTERNAL) {
|
||||
for (auto &p_frame : vp_frames_) {
|
||||
if (p_frame.frame_ptr) {
|
||||
if (out_mem_type_ == OUT_SURFACE_MEM_DEV_COPIED) {
|
||||
hipError_t hip_status = hipFree(p_frame.frame_ptr);
|
||||
if (hip_status != hipSuccess) {
|
||||
std::cout << "ERROR: hipFree failed! (" << hip_status << ")" << std::endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
delete[] (p_frame.frame_ptr);
|
||||
p_frame.frame_ptr = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hip_stream_) {
|
||||
hipError_t hip_status = hipSuccess;
|
||||
hip_status = hipStreamDestroy(hip_stream_);
|
||||
|
||||
Reference in New Issue
Block a user