Skip to content

Doesn't work with upstream v4l2loopback (fb410fc7af40e972058809a191fae9517b9313af)

Since upstream merged support for V4L2_EVENT_PRI_CLIENT_USAGE I decided to give it a try but I'm not able to get a video stream.

I tried the following rudimentary patch because upstream uses another ID for the event (V4L2_EVENT_PRIVATE_START+0x08E00000+1) and I thought it would suffice (but it could be wrong as I don't know what I'm doing.)

diff --git a/src/v4l2-relayd.c b/src/v4l2-relayd.c
index 21bb0d5..cfc9e27 100644
--- a/src/v4l2-relayd.c
+++ b/src/v4l2-relayd.c
@@ -27,7 +27,10 @@
 #include <gst/app/gstappsrc.h>
 #include <gst/video/video-info.h>
 
-#define V4L2_EVENT_PRI_CLIENT_USAGE  V4L2_EVENT_PRIVATE_START
+#define V4L2LOOPBACK_EVENT_BASE (V4L2_EVENT_PRIVATE_START)
+#define V4L2LOOPBACK_EVENT_OFFSET 0x08E00000
+#define V4L2_EVENT_PRI_CLIENT_USAGE \
+       (V4L2LOOPBACK_EVENT_BASE + V4L2LOOPBACK_EVENT_OFFSET + 1)
 
 struct v4l2_event_client_usage {
   __u32 count;

Could be that other upstream changes broke v4l2-relayd, but I haven't checked that yet.