commit 8fae227fc8d9f5314c448a1fdb385b7c3a3afb26
Author: Kate Hsuan <hpa(a)redhat.com>
Date: Wed May 3 14:04:57 2023 +0800
Set output stream to I420
.gitignore | 1 +
...Set-a-new-ID-offset-for-the-private-event.patch | 34 ++++++++
sources | 1 +
v4l2-relayd.preset | 1 +
v4l2-relayd.spec | 98 ++++++++++++++++++++++
5 files changed, 135 insertions(+)
---
diff --git a/.gitignore b/.gitignore
index e69de29..af96c6d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/v4l2-relayd-2e4d5c9.tar.gz
diff --git a/0001-Set-a-new-ID-offset-for-the-private-event.patch
b/0001-Set-a-new-ID-offset-for-the-private-event.patch
new file mode 100644
index 0000000..effcaeb
--- /dev/null
+++ b/0001-Set-a-new-ID-offset-for-the-private-event.patch
@@ -0,0 +1,34 @@
+From 1be2bafe7a9aabf0389da9e685051859c56e64ce Mon Sep 17 00:00:00 2001
+From: Kate Hsuan <hpa(a)redhat.com>
+Date: Thu, 9 Feb 2023 15:26:37 +0800
+Subject: [PATCH] Set a new ID offset for the private event
+
+According to the v4l2loopback, the private event ID should be
+start from V4L2_EVENT_PRIVATE_START+0x08E00000. Therefore, the
+V4L2_EVENT_PRI_CLIENT_USAGE is V4L2_EVENT_PRIVATE_START+
+0x08E00000+1
+
+Signed-off-by: Kate Hsuan <hpa(a)redhat.com>
+---
+ src/v4l2-relayd.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/v4l2-relayd.c b/src/v4l2-relayd.c
+index 21bb0d5..d731af0 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_OFFSET 0x08E00000
++#define V4L2_EVENT_PRI_CLIENT_USAGE (V4L2_EVENT_PRIVATE_START+\
++ V4L2LOOPBACK_EVENT_OFFSET+\
++ 1)
+
+ struct v4l2_event_client_usage {
+ __u32 count;
+--
+2.39.2
+
diff --git a/sources b/sources
index e69de29..6fc25da 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (v4l2-relayd-2e4d5c9.tar.gz) =
0da6e425cf054b81286496ee755820b0eafff74df83956627a417a2616df9febfdd329631f6b81662ce57d846253cf19534bcdad1fd4233c29bb9cd923e2b7f2
diff --git a/v4l2-relayd.preset b/v4l2-relayd.preset
new file mode 100644
index 0000000..cd0a170
--- /dev/null
+++ b/v4l2-relayd.preset
@@ -0,0 +1 @@
+enable v4l2-relayd.service
\ No newline at end of file
diff --git a/v4l2-relayd.spec b/v4l2-relayd.spec
new file mode 100644
index 0000000..860366f
--- /dev/null
+++ b/v4l2-relayd.spec
@@ -0,0 +1,98 @@
+%global commit 2e4d5c9ba53bfe8cfe16ea91932c8e5ecb090a87
+%global commitdate 20220126
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+
+Name: v4l2-relayd
+Summary: Utils for relaying the video stream between two video devices
+Version: 0.1.2
+Release: 10.%{commitdate}git%{shortcommit}%{?dist}
+License: GPL-2.0-only
+
+Source0:
https://gitlab.com/vicamo/v4l2-relayd//-/archive/%{commit}/%{name}-%{shor...
+Source1: v4l2-relayd.preset
+
+Patch0: 0001-Set-a-new-ID-offset-for-the-private-event.patch
+
+BuildRequires: systemd-rpm-macros
+BuildRequires: gcc
+BuildRequires: g++
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: libtool
+BuildRequires: glib2-devel
+BuildRequires: gstreamer1-devel
+BuildRequires: gstreamer1-plugins-base-devel
+BuildRequires: systemd
+
+Requires: v4l2loopback
+
+%description
+This is used to relay the input GStreamer source to an output GStreamer
+source or a V4L2 device.
+
+%prep
+%autosetup -p1 -n %{name}-%{commit}
+autoreconf --force --install --verbose
+
+%build
+%configure
+%make_build
+
+%install
+%make_install modprobedir=%{_modprobedir}
+sed -i '/^EnvironmentFile=\/etc\/default\/v4l2-relayd/a
EnvironmentFile=-\/run\/v4l2-relayd' %{buildroot}%{_unitdir}/v4l2-relayd.service
+sed -i 's/videoconvert/videoconvert ! video\/x-raw,format=I420/g'
%{buildroot}%{_unitdir}/v4l2-relayd.service
+install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_presetdir}/95-v4l2-relayd.preset
+
+%post
+%systemd_post v4l2-relayd.service
+
+%preun
+%systemd_preun v4l2-relayd.service
+
+%postun
+%systemd_postun_with_restart v4l2-relayd.service
+
+%files
+%license LICENSE
+%{_bindir}/v4l2-relayd
+%{_sysconfdir}/default/v4l2-relayd
+%{_modprobedir}/v4l2-relayd.conf
+%{_modulesloaddir}/v4l2-relayd.conf
+%{_unitdir}/v4l2-relayd.service
+%{_presetdir}/95-v4l2-relayd.preset
+
+%changelog
+* Wed May 3 2023 Kate Hsuan <hpa(a)redhat.com> - 0.1.2-10.20220126git2e4d5c9
+- Set output stream to I420
+
+* Fri Apr 7 2023 Kate Hsuan <hpa(a)redhat.com> - 0.1.2-9.20220126git2e4d5c9
+- Removed unnecessary install command
+
+* Thu Mar 23 2023 Kate Hsuan <hpa(a)redhat.com> - 0.1.2-8.20220126git2e4d5c9
+- Drop the symbolic link of the environment file
+- Add EnvironmentFile setting for /run/v4l2-relayd
+
+* Wed Mar 22 2023 Kate Hsuan <hpa(a)redhat.com> - 0.1.2-7.20220126git2e4d5c9
+- systemd post scripts
+- removed configuration examples
+
+* Mon Mar 20 2023 Kate Hsuan <hpa(a)redhat.com> - 0.1.2-6.20220126git2e4d5c9
+- remove udev rules
+
+* Tue Mar 14 2023 Kate Hsuan <hpa(a)redhat.com> - 0.1.2-5.20220126git2e4d5c9
+- Configuration files for Tiger and Alder lake platforms
+- udev rules for config file selection
+
+* Tue Feb 21 2023 Kate Hsuan <hpa(a)redhat.com> - 0.1.2-4.20220126git2e4d5c9
+- New private event ID
+
+* Thu Feb 16 2023 Kate Hsuan <hpa(a)redhat.com> - 0.1.2-3.20220126git2e4d5c9
+- Update build and installation scripts
+
+* Thu Jan 12 2023 Kate Hsuan <hpa(a)redhat.com> - 0.1.2-2.20220126git2e4d5c9
+- Add "Requires: v4l2loopback"
+
+* Thu Dec 15 2022 Kate Hsuan <hpa(a)redhat.com> - 0.1.2-1.20220126git2e4d5c9
+- First commit
+