Hello community,

here is the log from the commit of package v4l2loopback for openSUSE:Factory 
checked in at 2019-05-24 11:33:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/v4l2loopback (Old)
 and      /work/SRC/openSUSE:Factory/.v4l2loopback.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "v4l2loopback"

Fri May 24 11:33:06 2019 rev:6 rq:705074 version:0.12.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/v4l2loopback/v4l2loopback.changes        
2019-01-24 14:15:37.711208975 +0100
+++ /work/SRC/openSUSE:Factory/.v4l2loopback.new.5148/v4l2loopback.changes      
2019-05-24 11:33:08.165372507 +0200
@@ -1,0 +2,6 @@
+Thu May 23 16:51:39 UTC 2019 - Luigi Baldoni <[email protected]>
+
+- Added v4l2loopback-no_deprecated_function.patch (fix build with
+  newer kernels)
+
+-------------------------------------------------------------------

New:
----
  v4l2loopback-no_deprecated_function.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ v4l2loopback.spec ++++++
--- /var/tmp/diff_new_pack.T4IfMg/_old  2019-05-24 11:33:08.905372224 +0200
+++ /var/tmp/diff_new_pack.T4IfMg/_new  2019-05-24 11:33:08.909372222 +0200
@@ -25,6 +25,8 @@
 URL:            https://github.com/umlaeute/v4l2loopback
 Source:         
https://github.com/umlaeute/v4l2loopback/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Source1:        preamble
+# PATCH-FIX-UPSTREAM v4l2loopback-no_deprecated_function.patch
+Patch0:         v4l2loopback-no_deprecated_function.patch
 BuildRequires:  %{kernel_module_package_buildreqs}
 BuildRequires:  gcc
 BuildRequires:  help2man
@@ -47,6 +49,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 set -- *
 mkdir source
 mv "$@" source/

++++++ v4l2loopback-no_deprecated_function.patch ++++++
>From 0b8feb80fdef9a415d8250bca1790b3ff23e8391 Mon Sep 17 00:00:00 2001
From: Theodore Cipicchio <[email protected]>
Date: Thu, 25 Apr 2019 21:51:11 -0700
Subject: [PATCH] Replace v4l2_get_timestamp with ktime_get_ts(64)

v4l2_get_timestamp is being removed in Linux 5.1. This replaces its use
with equivalent code (ktime_get_ts64 is used in favor of ktime_get_ts
with supported kernel versions, as the latter is considered deprecated).

Closes: https://github.com/umlaeute/v4l2loopback/issues/214
---
 v4l2loopback.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/v4l2loopback.c b/v4l2loopback.c
index 322ce17..42d611f 100644
--- a/v4l2loopback.c
+++ b/v4l2loopback.c
@@ -134,6 +134,20 @@ void *v4l2l_vzalloc(unsigned long size)
 # define v4l2l_vzalloc vzalloc
 #endif
 
+static inline void v4l2l_get_timestamp(struct timeval *tv) {
+       /* 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;
+       ktime_get_ts(&ts);
+#else
+       struct timespec64 ts;
+       ktime_get_ts64(&ts);
+#endif
+
+       tv->tv_sec = (time_t)ts.tv_sec;
+       tv->tv_usec = (suseconds_t)(ts.tv_nsec / NSEC_PER_USEC);
+}
+
 
 /* module constants
  *  can be overridden during he build process using something like
@@ -1506,7 +1520,7 @@ static int vidioc_qbuf(struct file *file, void 
*private_data, struct v4l2_buffer
        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)
-                       v4l2_get_timestamp(&b->buffer.timestamp);
+                       v4l2l_get_timestamp(&b->buffer.timestamp);
                else
                        b->buffer.timestamp = buf->timestamp;
                b->buffer.bytesused = buf->bytesused;
@@ -1933,7 +1947,7 @@ static ssize_t v4l2_loopback_write(struct file *file,
                        count);
                return -EFAULT;
        }
-       v4l2_get_timestamp(&b->timestamp);
+       v4l2l_get_timestamp(&b->timestamp);
        b->bytesused = count;
        b->sequence = dev->write_position;
        buffer_written(dev, &dev->buffers[write_index]);
@@ -2038,7 +2052,7 @@ static void init_buffers(struct v4l2_loopback_device *dev)
                b->timestamp.tv_usec = 0;
                b->type              = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 
-               v4l2_get_timestamp(&b->timestamp);
+               v4l2l_get_timestamp(&b->timestamp);
        }
        dev->timeout_image_buffer = dev->buffers[0];
        dev->timeout_image_buffer.buffer.m.offset = MAX_BUFFERS * buffer_size;

Reply via email to