tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
v4l2-relayd: init at 0.1.3
betaboon
2 years ago
0bf0d21e
fc6c5c71
+104
3 changed files
expand all
collapse all
unified
split
pkgs
os-specific
linux
v4l2-relayd
default.nix
upstream-v4l2loopback-compatibility.patch
top-level
all-packages.nix
+81
pkgs/os-specific/linux/v4l2-relayd/default.nix
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
{ lib
2
+
, stdenv
3
+
, fetchgit
4
+
, autoreconfHook
5
+
, coreutils
6
+
, glib
7
+
, gnugrep
8
+
, gst_all_1
9
+
, icamerasrc
10
+
, libtool
11
+
, makeWrapper
12
+
, pkg-config
13
+
, which
14
+
}:
15
+
let
16
+
gst = [
17
+
gst_all_1.gstreamer.out
18
+
gst_all_1.gst-plugins-bad
19
+
gst_all_1.gst-plugins-base
20
+
gst_all_1.gst-plugins-good
21
+
icamerasrc
22
+
];
23
+
in
24
+
stdenv.mkDerivation rec {
25
+
pname = "v4l2-relayd-${icamerasrc.ipuVersion}";
26
+
version = "0.1.3";
27
+
28
+
src = fetchgit {
29
+
url = "https://git.launchpad.net/v4l2-relayd";
30
+
rev = "refs/tags/upstream/${version}";
31
+
hash = "sha256-oU6naDFZ0PQVHZ3brANfMULDqYMYxeJN+MCUCvN/DpU=";
32
+
};
33
+
34
+
patches = [
35
+
./upstream-v4l2loopback-compatibility.patch
36
+
];
37
+
38
+
nativeBuildInputs = [
39
+
autoreconfHook
40
+
libtool
41
+
makeWrapper
42
+
pkg-config
43
+
which
44
+
];
45
+
46
+
buildInputs = [
47
+
glib
48
+
] ++ gst;
49
+
50
+
preConfigure = "./autogen.sh --prefix=$out";
51
+
52
+
postInstall = ''
53
+
mkdir -p $out/lib/systemd/system $out/etc/default
54
+
cp data/systemd/v4l2-relayd.service $out/lib/systemd/system
55
+
cp data/etc/default/v4l2-relayd $out/etc/default
56
+
57
+
substituteInPlace $out/lib/systemd/system/v4l2-relayd.service \
58
+
--replace grep ${gnugrep}/bin/grep \
59
+
--replace cut ${coreutils}/bin/cut \
60
+
--replace /usr/bin/test ${coreutils}/bin/test \
61
+
--replace /usr/bin/v4l2-relayd $out/bin/v4l2-relayd \
62
+
--replace /etc/default $out/etc/default \
63
+
--replace "DeviceAllow=char-video4linux" ""
64
+
65
+
substituteInPlace $out/etc/default/v4l2-relayd \
66
+
--replace 'FORMAT=YUY2' 'FORMAT=NV12' \
67
+
--replace 'CARD_LABEL="Virtual Camera"' 'CARD_LABEL="Intel MIPI Camera"' \
68
+
--replace 'VIDEOSRC="videotestsrc"' 'VIDEOSRC="icamerasrc"'
69
+
70
+
wrapProgram $out/bin/v4l2-relayd \
71
+
--prefix GST_PLUGIN_PATH : ${lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" gst}
72
+
'';
73
+
74
+
meta = with lib; {
75
+
description = "Streaming relay for v4l2loopback using GStreamer";
76
+
homepage = "https://git.launchpad.net/v4l2-relayd";
77
+
license = licenses.gpl2;
78
+
maintainers = with maintainers; [ betaboon ];
79
+
platforms = [ "x86_64-linux" ];
80
+
};
81
+
}
+16
pkgs/os-specific/linux/v4l2-relayd/upstream-v4l2loopback-compatibility.patch
···
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
···
1
+
diff --git a/src/v4l2-relayd.c b/src/v4l2-relayd.c
2
+
index 21bb0d5..cfc9e27 100644
3
+
--- a/src/v4l2-relayd.c
4
+
+++ b/src/v4l2-relayd.c
5
+
@@ -27,7 +27,10 @@
6
+
#include <gst/app/gstappsrc.h>
7
+
#include <gst/video/video-info.h>
8
+
9
+
-#define V4L2_EVENT_PRI_CLIENT_USAGE V4L2_EVENT_PRIVATE_START
10
+
+#define V4L2LOOPBACK_EVENT_BASE (V4L2_EVENT_PRIVATE_START)
11
+
+#define V4L2LOOPBACK_EVENT_OFFSET 0x08E00000
12
+
+#define V4L2_EVENT_PRI_CLIENT_USAGE \
13
+
+ (V4L2LOOPBACK_EVENT_BASE + V4L2LOOPBACK_EVENT_OFFSET + 1)
14
+
15
+
struct v4l2_event_client_usage {
16
+
__u32 count;
+7
pkgs/top-level/all-packages.nix
···
27424
27425
v4l-utils = qt5.callPackage ../os-specific/linux/v4l-utils { };
27426
0
0
0
0
0
0
0
27427
vendir = callPackage ../development/tools/vendir { };
27428
27429
vndr = callPackage ../development/tools/vndr { };
···
27424
27425
v4l-utils = qt5.callPackage ../os-specific/linux/v4l-utils { };
27426
27427
+
v4l2-relayd-ipu6 = callPackage ../os-specific/linux/v4l2-relayd {
27428
+
icamerasrc = gst_all_1.icamerasrc-ipu6;
27429
+
};
27430
+
v4l2-relayd-ipu6ep = callPackage ../os-specific/linux/v4l2-relayd {
27431
+
icamerasrc = gst_all_1.icamerasrc-ipu6ep;
27432
+
};
27433
+
27434
vendir = callPackage ../development/tools/vendir { };
27435
27436
vndr = callPackage ../development/tools/vndr { };