From e615f175733cd3cad646e07fb4096288baad6ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 10 Nov 2025 23:38:18 +0100 Subject: [PATCH] examples/video-src-fixate: Fake DmaBuf fd with memfd Otherwise the stream will fail due to not being able to import fd. --- src/examples/video-src-fixate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/examples/video-src-fixate.c b/src/examples/video-src-fixate.c index 4e2fa959f..0620c4ceb 100644 --- a/src/examples/video-src-fixate.c +++ b/src/examples/video-src-fixate.c @@ -295,7 +295,11 @@ static void on_stream_add_buffer(void *_data, struct pw_buffer *buffer) if ((d[0].type & (1< 0) { printf("pretend to support dmabufs while setting the fd to -1\n"); d[0].type = SPA_DATA_DmaBuf; +#ifdef HAVE_MEMFD_CREATE + d[0].fd = memfd_create("video-src-fixate-fake-dmabuf", MFD_CLOEXEC | MFD_ALLOW_SEALING); +#else d[0].fd = -1; +#endif d[0].data = NULL; return; }