diff -Nru v4l2loopback-0.12.3/debian/changelog v4l2loopback-0.12.3/debian/changelog --- v4l2loopback-0.12.3/debian/changelog 2019-12-07 18:26:02.000000000 +0000 +++ v4l2loopback-0.12.3/debian/changelog 2021-04-29 15:09:12.000000000 +0000 @@ -1,3 +1,31 @@ +v4l2loopback (0.12.3-1ubuntu0.4) focal; urgency=medium + + * No change rebuild in security pocket. LP: #1914279. + + -- Dimitri John Ledkov Thu, 29 Apr 2021 16:09:12 +0100 + +v4l2loopback (0.12.3-1ubuntu0.3) focal; urgency=medium + + * Linux 5.7 compatibility (LP: #1900997) + - debian/patches/0001-linux-5.7-compatibility.patch + + -- Andrea Righi Thu, 22 Oct 2020 10:34:52 +0000 + +v4l2loopback (0.12.3-1ubuntu0.2) focal; urgency=medium + + * Update patch to fix kernel warnings to match what was done in 0.12.5-1. + This avoids hiding capabilities in the vdev->device_caps structure which + caused any other apps than Chromium to no longer detect the loopback + device (LP: #1901491). + + -- Stefan Bader Tue, 03 Nov 2020 10:16:04 +0100 + +v4l2loopback (0.12.3-1ubuntu0.1) focal; urgency=medium + + * Fix kernel warnings triggered by vidioc_querycap (LP: #1899633). + + -- Stefan Bader Tue, 13 Oct 2020 15:07:55 +0200 + v4l2loopback (0.12.3-1) unstable; urgency=medium * New upstream version 0.12.3 diff -Nru v4l2loopback-0.12.3/debian/control v4l2loopback-0.12.3/debian/control --- v4l2loopback-0.12.3/debian/control 2019-12-07 18:26:02.000000000 +0000 +++ v4l2loopback-0.12.3/debian/control 2020-10-13 13:07:55.000000000 +0000 @@ -1,7 +1,8 @@ Source: v4l2loopback Section: kernel Priority: optional -Maintainer: IOhannes m zmölnig (Debian/GNU) +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: IOhannes m zmölnig (Debian/GNU) Build-Depends: debhelper-compat (= 12), licensecheck, help2man, diff -Nru v4l2loopback-0.12.3/debian/patches/0001-linux-5.7-compatibility.patch v4l2loopback-0.12.3/debian/patches/0001-linux-5.7-compatibility.patch --- v4l2loopback-0.12.3/debian/patches/0001-linux-5.7-compatibility.patch 1970-01-01 00:00:00.000000000 +0000 +++ v4l2loopback-0.12.3/debian/patches/0001-linux-5.7-compatibility.patch 2020-10-22 10:34:52.000000000 +0000 @@ -0,0 +1,79 @@ +Index: v4l2loopback-0.12.3/v4l2loopback.c +=================================================================== +--- v4l2loopback-0.12.3.orig/v4l2loopback.c ++++ v4l2loopback-0.12.3/v4l2loopback.c +@@ -41,6 +41,9 @@ + #endif + + #define V4L2LOOPBACK_VERSION_CODE KERNEL_VERSION(0, 12, 3) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 7, 0) ++# define VFL_TYPE_VIDEO VFL_TYPE_GRABBER ++#endif + + MODULE_DESCRIPTION("V4L2 loopback video device"); + MODULE_AUTHOR("Vasily Levin, " \ +@@ -134,7 +137,7 @@ void *v4l2l_vzalloc(unsigned long size) + # define v4l2l_vzalloc vzalloc + #endif + +-static inline void v4l2l_get_timestamp(struct timeval *tv) { ++static inline void v4l2l_get_timestamp(struct v4l2_buffer *b) { + /* ktime_get_ts is considered deprecated, so use ktime_get_ts64 if possible */ + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) + struct timespec ts; +@@ -144,8 +147,8 @@ static inline void v4l2l_get_timestamp(s + ktime_get_ts64(&ts); + #endif + +- tv->tv_sec = (time_t)ts.tv_sec; +- tv->tv_usec = (suseconds_t)(ts.tv_nsec / NSEC_PER_USEC); ++ b->timestamp.tv_sec = ts.tv_sec; ++ b->timestamp.tv_usec = (ts.tv_nsec / NSEC_PER_USEC); + } + + +@@ -1520,7 +1523,7 @@ static int vidioc_qbuf(struct file *file + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + dprintkrw("output QBUF pos: %d index: %d\n", dev->write_position, index); + if (buf->timestamp.tv_sec == 0 && buf->timestamp.tv_usec == 0) +- v4l2l_get_timestamp(&b->buffer.timestamp); ++ v4l2l_get_timestamp(&b->buffer); + else + b->buffer.timestamp = buf->timestamp; + b->buffer.bytesused = buf->bytesused; +@@ -1947,7 +1950,7 @@ static ssize_t v4l2_loopback_write(struc + count); + return -EFAULT; + } +- v4l2l_get_timestamp(&b->timestamp); ++ v4l2l_get_timestamp(b); + b->bytesused = count; + b->sequence = dev->write_position; + buffer_written(dev, &dev->buffers[write_index]); +@@ -2052,7 +2055,7 @@ static void init_buffers(struct v4l2_loo + b->timestamp.tv_usec = 0; + b->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + +- v4l2l_get_timestamp(&b->timestamp); ++ v4l2l_get_timestamp(b); + } + dev->timeout_image_buffer = dev->buffers[0]; + dev->timeout_image_buffer.buffer.m.offset = MAX_BUFFERS * buffer_size; +@@ -2083,7 +2086,7 @@ static void init_vdev(struct video_devic + vdev->tvnorms = V4L2_STD_ALL; + #endif /* V4L2LOOPBACK_WITH_STD */ + +- vdev->vfl_type = VFL_TYPE_GRABBER; ++ vdev->vfl_type = VFL_TYPE_VIDEO; + vdev->fops = &v4l2_loopback_fops; + vdev->ioctl_ops = &v4l2_loopback_ioctl_ops; + vdev->release = &video_device_release; +@@ -2432,7 +2435,7 @@ static int __init v4l2loopback_init_modu + return ret; + } + /* register the device -> it creates /dev/video* */ +- if (video_register_device(devs[i]->vdev, VFL_TYPE_GRABBER, video_nr[i]) < 0) { ++ if (video_register_device(devs[i]->vdev, VFL_TYPE_VIDEO, video_nr[i]) < 0) { + video_device_release(devs[i]->vdev); + printk(KERN_ERR "v4l2loopback: failed video_register_device()\n"); + free_devices(); diff -Nru v4l2loopback-0.12.3/debian/patches/compat-5.4/0001-fix-querycaps.patch v4l2loopback-0.12.3/debian/patches/compat-5.4/0001-fix-querycaps.patch --- v4l2loopback-0.12.3/debian/patches/compat-5.4/0001-fix-querycaps.patch 1970-01-01 00:00:00.000000000 +0000 +++ v4l2loopback-0.12.3/debian/patches/compat-5.4/0001-fix-querycaps.patch 2020-10-22 10:34:52.000000000 +0000 @@ -0,0 +1,73 @@ +Description: Fix kernel v5.4 warnings produced in v4l_querycap() + Since kernel version 5.4 the v4l2-core checks whether a driver modifies + the device_caps in capabilities. Those have to be set once and not modified + later. Also the returned capabilities is required to be a superset of the + device_caps. + The patch is now updated to match what v4l2loopback 0.12.5-1 does in that + area. Which is practically avoiding the warnings by modifying not only the + bitsets of the IOCTL structure but also overwriting the in-kernel video + device structure bits. Not quite sure that really was the intention of the + kernel devs but at least it gets the older version in sync with the more + recent one. +Author: Stefan Bader +Ubuntu-Bug: https://bugs.launchpad.net/bugs/1899633 +Ubuntu-Bug: https://bugs.launchpad.net/bugs/1901491 +Upstream: no (resolved by bigger code re-work) +Last-Update: 2020-11-03 + +Index: v4l2loopback-0.12.3/v4l2loopback.c +=================================================================== +--- v4l2loopback-0.12.3.orig/v4l2loopback.c ++++ v4l2loopback-0.12.3/v4l2loopback.c +@@ -667,43 +667,36 @@ static int vidioc_querycap(struct file * + { + struct v4l2_loopback_device *dev = v4l2loopback_getdevice(file); + int devnr = ((struct v4l2loopback_private *)video_get_drvdata(dev->vdev))->devicenr; ++ __u32 capabilities = V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; + + strlcpy(cap->driver, "v4l2 loopback", sizeof(cap->driver)); +- + vidioc_fill_name(cap->card, sizeof(cap->card), devnr); +- + snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:v4l2loopback-%03d", devnr); + + #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0) + /* since 3.1.0, the v4l2-core system is supposed to set the version */ + cap->version = V4L2LOOPBACK_VERSION_CODE; + #endif +- cap->capabilities = +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) +- V4L2_CAP_DEVICE_CAPS | +-#endif +- V4L2_CAP_STREAMING | V4L2_CAP_READWRITE; + + #ifdef V4L2_CAP_VIDEO_M2M +- cap->capabilities |= V4L2_CAP_VIDEO_M2M; ++ capabilities |= V4L2_CAP_VIDEO_M2M; + #endif /* V4L2_CAP_VIDEO_M2M */ ++ + if (dev->announce_all_caps) { +- cap->capabilities |= V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT; ++ capabilities |= V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT; + } else { + + if (dev->ready_for_capture) { +- cap->capabilities |= V4L2_CAP_VIDEO_CAPTURE; ++ capabilities |= V4L2_CAP_VIDEO_CAPTURE; + } + if (dev->ready_for_output) { +- cap->capabilities |= V4L2_CAP_VIDEO_OUTPUT; ++ capabilities |= V4L2_CAP_VIDEO_OUTPUT; + } + } +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) +- cap->device_caps = (cap->capabilities & ~V4L2_CAP_DEVICE_CAPS); +-#endif ++ ++ dev->vdev->device_caps = cap->device_caps = cap->capabilities = capabilities; + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) +- cap->device_caps = cap->capabilities; + cap->capabilities |= V4L2_CAP_DEVICE_CAPS; + #endif + diff -Nru v4l2loopback-0.12.3/debian/patches/series v4l2loopback-0.12.3/debian/patches/series --- v4l2loopback-0.12.3/debian/patches/series 2019-12-07 18:26:02.000000000 +0000 +++ v4l2loopback-0.12.3/debian/patches/series 2020-10-22 10:34:52.000000000 +0000 @@ -0,0 +1,2 @@ +0001-linux-5.7-compatibility.patch +compat-5.4/0001-fix-querycaps.patch