tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
v4l2loopback: unstable-2022-08-05 -> unstable-2023-02-19
betaboon
2 years ago
fc6c5c71
e3802695
+63
-3
2 changed files
expand all
collapse all
unified
split
pkgs
os-specific
linux
v4l2loopback
default.nix
revert-pr518.patch
+8
-3
pkgs/os-specific/linux/v4l2loopback/default.nix
···
2
2
3
3
stdenv.mkDerivation rec {
4
4
pname = "v4l2loopback";
5
5
-
version = "unstable-2022-08-05-${kernel.version}";
5
5
+
version = "unstable-2023-02-19-${kernel.version}";
6
6
7
7
src = fetchFromGitHub {
8
8
owner = "umlaeute";
9
9
repo = "v4l2loopback";
10
10
-
rev = "76434ab6f71d5ecbff8a218ff6bed91ea2bf73b8";
11
11
-
sha256 = "sha256-TdZacRkFAO2HAEbljzXeJ241VcDqSwBECq3bnn7yvBY=";
10
10
+
rev = "fb410fc7af40e972058809a191fae9517b9313af";
11
11
+
hash = "sha256-gLFtR7s+3LUQ0BZxHbmaArHbufuphbtAX99nxJU3c84=";
12
12
};
13
13
+
14
14
+
patches = [
15
15
+
# fix bug https://github.com/umlaeute/v4l2loopback/issues/535
16
16
+
./revert-pr518.patch
17
17
+
];
13
18
14
19
hardeningDisable = [ "format" "pic" ];
15
20
+55
pkgs/os-specific/linux/v4l2loopback/revert-pr518.patch
···
1
1
+
diff --git a/v4l2loopback.c b/v4l2loopback.c
2
2
+
index 2ab1f76..2514f09 100644
3
3
+
--- a/v4l2loopback.c
4
4
+
+++ b/v4l2loopback.c
5
5
+
@@ -92,17 +92,6 @@ MODULE_LICENSE("GPL");
6
6
+
} \
7
7
+
} while (0)
8
8
+
9
9
+
-/* TODO: Make sure that function is never interrupted. */
10
10
+
-static inline int mod_inc(int *number, int mod)
11
11
+
-{
12
12
+
- int result;
13
13
+
- result = (*number + 1) % mod;
14
14
+
- if (unlikely(result < 0))
15
15
+
- result += mod;
16
16
+
- *number = result;
17
17
+
- return result;
18
18
+
-}
19
19
+
-
20
20
+
static inline void v4l2l_get_timestamp(struct v4l2_buffer *b)
21
21
+
{
22
22
+
/* ktime_get_ts is considered deprecated, so use ktime_get_ts64 if possible */
23
23
+
@@ -1424,8 +1413,9 @@ static int vidioc_reqbufs(struct file *file, void *fh,
24
24
+
i = dev->write_position;
25
25
+
list_for_each_entry(pos, &dev->outbufs_list,
26
26
+
list_head) {
27
27
+
- dev->bufpos2index[mod_inc(&i, b->count)] =
28
28
+
+ dev->bufpos2index[i % b->count] =
29
29
+
pos->buffer.index;
30
30
+
+ ++i;
31
31
+
}
32
32
+
}
33
33
+
34
34
+
@@ -1489,9 +1479,10 @@ static void buffer_written(struct v4l2_loopback_device *dev,
35
35
+
del_timer_sync(&dev->timeout_timer);
36
36
+
spin_lock_bh(&dev->lock);
37
37
+
38
38
+
- dev->bufpos2index[mod_inc(&dev->write_position, dev->used_buffers)] =
39
39
+
+ dev->bufpos2index[dev->write_position % dev->used_buffers] =
40
40
+
buf->buffer.index;
41
41
+
list_move_tail(&buf->list_head, &dev->outbufs_list);
42
42
+
+ ++dev->write_position;
43
43
+
dev->reread_count = 0;
44
44
+
45
45
+
check_timers(dev);
46
46
+
@@ -1586,7 +1577,8 @@ static int get_capture_buffer(struct file *file)
47
47
+
if (dev->write_position >
48
48
+
opener->read_position + dev->used_buffers)
49
49
+
opener->read_position = dev->write_position - 1;
50
50
+
- pos = mod_inc(&opener->read_position, dev->used_buffers);
51
51
+
+ pos = opener->read_position % dev->used_buffers;
52
52
+
+ ++opener->read_position;
53
53
+
}
54
54
+
timeout_happened = dev->timeout_happened;
55
55
+
dev->timeout_happened = 0;