diff --git a/anda/fusion/v4l2-relayd/0000-set-new-offset.patch b/anda/fusion/v4l2-relayd/0000-set-new-offset.patch new file mode 100644 index 0000000000..effcaeb267 --- /dev/null +++ b/anda/fusion/v4l2-relayd/0000-set-new-offset.patch @@ -0,0 +1,34 @@ +From 1be2bafe7a9aabf0389da9e685051859c56e64ce Mon Sep 17 00:00:00 2001 +From: Kate Hsuan +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 +--- + 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 + #include + +-#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/anda/fusion/v4l2-relayd/anda.hcl b/anda/fusion/v4l2-relayd/anda.hcl new file mode 100644 index 0000000000..febd3dbe1f --- /dev/null +++ b/anda/fusion/v4l2-relayd/anda.hcl @@ -0,0 +1,8 @@ +project pkg { + rpm { + spec = "v4l2-relayd.spec" + } + labels { + weekly = 1 + } +} diff --git a/anda/fusion/v4l2-relayd/update.rhai b/anda/fusion/v4l2-relayd/update.rhai new file mode 100644 index 0000000000..97d355cb4e --- /dev/null +++ b/anda/fusion/v4l2-relayd/update.rhai @@ -0,0 +1 @@ +rpm.version(gitlab("24306684")); diff --git a/anda/fusion/v4l2-relayd/v4l2-relayd.preset b/anda/fusion/v4l2-relayd/v4l2-relayd.preset new file mode 100644 index 0000000000..cd0a1709e9 --- /dev/null +++ b/anda/fusion/v4l2-relayd/v4l2-relayd.preset @@ -0,0 +1 @@ +enable v4l2-relayd.service \ No newline at end of file diff --git a/anda/fusion/v4l2-relayd/v4l2-relayd.spec b/anda/fusion/v4l2-relayd/v4l2-relayd.spec new file mode 100644 index 0000000000..17f0e794cf --- /dev/null +++ b/anda/fusion/v4l2-relayd/v4l2-relayd.spec @@ -0,0 +1,63 @@ +%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: %{commitdate}.%{shortcommit} +Release: 1%{?dist} +License: GPL-2.0-only +Source0: https://gitlab.com/vicamo/v4l2-relayd//-/archive/%{commit}/%{name}-%{shortcommit}.tar.gz +Source1: v4l2-relayd.preset +### RPM Fusion | [v4l2-relayd] Set output stream to I420 +## https://lists.rpmfusion.org/archives/list/rpmfusion-commits@lists.rpmfusion.org/thread/VUMAJABDYISF3UVOSESSFYQBAMQK7VKY/ +Patch0: 0000-set-new-offset.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 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 +%autochangelog