From: Seungha Yang Date: Fri, 25 Mar 2022 12:13:22 +0000 (+0900) Subject: qsv: Fix mfxFrameAllocator::Lock for encoder X-Git-Tag: 1.22.0~2004 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1a7b23dc020a85db6cd7da7926578982e5f971c3;p=platform%2Fupstream%2Fgstreamer.git qsv: Fix mfxFrameAllocator::Lock for encoder Only read map is possible for encoder input system memory Part-of: --- diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvallocator.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvallocator.cpp index aa41702..fb32027 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvallocator.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvallocator.cpp @@ -391,7 +391,7 @@ gst_qsv_allocator_lock (mfxHDL pthis, mfxMemId mid, mfxFrameData * ptr) if (frame->map_count == 0) { gst_video_frame_map (&frame->frame, &frame->info, frame->buffer, - (GstMapFlags) GST_MAP_READWRITE); + frame->map_flags); } frame->map_count++; @@ -653,6 +653,8 @@ gst_qsv_allocator_acquire_frame (GstQsvAllocator * allocator, "Unknown read/write access for video memory"); return nullptr; } + } else if ((mem_type & GST_QSV_ENCODER_IN_MEMORY) != 0) { + map_flags = GST_MAP_READ; } else { map_flags = GST_MAP_READWRITE; }