qsv: Fix mfxFrameAllocator::Lock for encoder

Only read map is possible for encoder input system memory

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2039>
This commit is contained in:
Seungha Yang 2022-03-25 21:13:22 +09:00 committed by GStreamer Marge Bot
parent 761f26080a
commit 1a7b23dc02

View file

@ -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;
}