From 1a7b23dc020a85db6cd7da7926578982e5f971c3 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Fri, 25 Mar 2022 21:13:22 +0900 Subject: [PATCH] qsv: Fix mfxFrameAllocator::Lock for encoder Only read map is possible for encoder input system memory Part-of: --- subprojects/gst-plugins-bad/sys/qsv/gstqsvallocator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.7.4