From ec331f4e4ce5578e5f277dbe71c4a3fba362e1e9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 5 May 2021 11:14:35 +0200 Subject: [PATCH] gst: enable DMABUF explicitly to avoid mmap issues PipeWire does not give DMABUF anymore to clients unless they explicitly ask for it. This results in v4l2 sending an fd and the mmapoffset + size fields in the buffer. GStreamer does not handle the mmapoffset in the fd allocator and thus runs into mmap problems when using the memory. Enable DMABuf explicitly to work around the problem until GStreamer is fixed. Fixes #1115 --- src/gst/gstpipewiresink.c | 4 ++++ src/gst/gstpipewiresrc.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c index 3e142507d..966b12c7a 100644 --- a/src/gst/gstpipewiresink.c +++ b/src/gst/gstpipewiresink.c @@ -255,6 +255,10 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink) SPA_MAX(MIN_BUFFERS, min_buffers), max_buffers ? max_buffers : INT32_MAX), SPA_PARAM_BUFFERS_align, SPA_POD_Int(16), + SPA_PARAM_BUFFERS_dataType, SPA_POD_CHOICE_FLAGS_Int( + (1<