Hello community,

here is the log from the commit of package v4l2loopback for openSUSE:Leap:15.2 
checked in at 2020-04-12 15:38:47
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/v4l2loopback (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.v4l2loopback.new.3248 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "v4l2loopback"

Sun Apr 12 15:38:47 2020 rev:17 rq:792997 version:0.12.4

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/v4l2loopback/v4l2loopback.changes      
2020-02-29 17:16:34.245058130 +0100
+++ /work/SRC/openSUSE:Leap:15.2/.v4l2loopback.new.3248/v4l2loopback.changes    
2020-04-12 15:38:50.722032752 +0200
@@ -1,0 +2,19 @@
+Thu Apr  9 20:38:07 UTC 2020 - Luigi Baldoni <[email protected]>
+
+- Update to version 0.12.4
+  * Explain what exclusive_caps does instead of referring to a
+    closed ticket
+  * Use "Chrome" rather than "Chromium"
+  * Mention exclusive_caps mode option
+  * Add linebreaks to fix markdown
+  * Set the default number of buffers to 2 
+  * instruction on obtaining yuv files
+  * infinite loop over yuv frames
+  * Drop cast to (time_t) 
+  * print "SUCCESS" message on installation success 
+  * use v4l2_buffer ptr instead of timeval 
+
+- Dropped v4l2loopback-dont_use_timeval.patch and
+  v4l2loopback-drop_cast_to_time_t.patch (merged upstream)
+
+-------------------------------------------------------------------

Old:
----
  v4l2loopback-0.12.3.tar.gz
  v4l2loopback-dont_use_timeval.patch
  v4l2loopback-drop_cast_to_time_t.patch

New:
----
  v4l2loopback-0.12.4.tar.gz

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

Other differences:
------------------
++++++ v4l2loopback.spec ++++++
--- /var/tmp/diff_new_pack.cOruoa/_old  2020-04-12 15:38:51.002032965 +0200
+++ /var/tmp/diff_new_pack.cOruoa/_new  2020-04-12 15:38:51.006032967 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           v4l2loopback
-Version:        0.12.3
+Version:        0.12.4
 Release:        0
 Summary:        A kernel module to create V4L2 loopback devices
 License:        GPL-2.0-or-later
@@ -26,10 +26,6 @@
 Source1:        preamble
 #PATCH-FIX-OPENSUSE v4l2loopback-include_header.patch
 Patch0:         v4l2loopback-include_header.patch
-#PATCH-FIX-UPSTREAM v4l2loopback-dont_use_timeval.patch -- fixes build with 
kernel 5.6
-Patch1:         v4l2loopback-dont_use_timeval.patch
-#PATCH-FIX-UPSTREAM v4l2loopback-drop_cast_to_time_t.patch -- fixes build with 
kernel 5.6
-Patch2:         v4l2loopback-drop_cast_to_time_t.patch
 BuildRequires:  %{kernel_module_package_buildreqs}
 BuildRequires:  help2man
 Requires:       v4l-utils

++++++ v4l2loopback-0.12.3.tar.gz -> v4l2loopback-0.12.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/v4l2loopback-0.12.3/.gitignore 
new/v4l2loopback-0.12.4/.gitignore
--- old/v4l2loopback-0.12.3/.gitignore  2019-12-06 18:31:21.000000000 +0100
+++ new/v4l2loopback-0.12.4/.gitignore  2020-04-09 22:14:30.000000000 +0200
@@ -1,5 +1,6 @@
 .tmp_versions/
 *.cmd
+*.yuv
 Module.symvers
 modules.order
 v4l2loopback.ko
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/v4l2loopback-0.12.3/ChangeLog 
new/v4l2loopback-0.12.4/ChangeLog
--- old/v4l2loopback-0.12.3/ChangeLog   2019-12-06 18:31:21.000000000 +0100
+++ new/v4l2loopback-0.12.4/ChangeLog   2020-04-09 22:14:30.000000000 +0200
@@ -1,3 +1,22 @@
+v4l2loopback (0.12.4) unstable; urgency=medium
+
+  [ Alex Xu (Hello71) ]
+  * Use v4l2_buffer ptr instead of timeval (Compat with linux-5.6)
+
+  [ tongdaxu ]
+  * Add example that loops over YUV frames infinitely
+
+  [ Thomas Hutterer ]
+  * Document 'exclusive_caps' mode option (and some markdown fixes)
+
+  [ IOhannes m zmölnig ]
+  * Set the default number of buffers to 2
+  * Print "SUCCESS" message on installation success
+  * Drop cast to (time_t)
+  * Document 'exclusive_caps' mode option (and some more markdown fixes)
+
+ -- IOhannes m zmölnig (Debian/GNU) <[email protected]>  Thu, 09 Apr 2020 
22:09:28 +0200
+
 v4l2loopback (0.12.3) unstable; urgency=medium
 
   [ Ricardo Ribalda Delgado ]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/v4l2loopback-0.12.3/Makefile 
new/v4l2loopback-0.12.4/Makefile
--- old/v4l2loopback-0.12.3/Makefile    2019-12-06 18:31:21.000000000 +0100
+++ new/v4l2loopback-0.12.4/Makefile    2020-04-09 22:14:30.000000000 +0200
@@ -45,6 +45,9 @@
 install-all: install install-utils install-man
 install:
        $(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules_install
+       @echo ""
+       @echo "SUCCESS (if you got 'SSL errors' above, you can safely ignore 
them)"
+       @echo ""
 
 install-utils: utils/v4l2loopback-ctl
        $(INSTALL_DIR) "$(DESTDIR)$(BINDIR)"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/v4l2loopback-0.12.3/README.md 
new/v4l2loopback-0.12.4/README.md
--- old/v4l2loopback-0.12.3/README.md   2019-12-06 18:31:21.000000000 +0100
+++ new/v4l2loopback-0.12.4/README.md   2020-04-09 22:14:30.000000000 +0200
@@ -91,6 +91,7 @@
     # modprobe v4l2loopback devices=4
 
 will give you 4 loopback devices (e.g. `/dev/video1` ... `/dev/video5`)
+
 you can also specify the device IDs manually; e.g.
 
     # modprobe v4l2loopback video_nr=3,4,7
@@ -104,6 +105,17 @@
 - `/dev/video4` -> *the number four*
 - `/dev/video7` -> *the last one*
 
+
+if you encounter problems detecting your device with Chrome/WebRTC you can try 
'exclusive_caps' mode:
+
+    # modprobe v4l2loopback exclusive_caps=1
+    
+will enable 'exclusive_caps' mode that only reports CAPTURE/OUTPUT 
capabilities exclusively.
+the newly created device will announce OUTPUT capabilities only (so ordinary 
webcam applications
+(including Chrome) won't see it). as soon as you have attached a producer to 
the device, it will
+start announcing CAPTURE capabilities only (so applications that refuse to 
open devices that have
+other capabilities apart from capturing can open it too.)
+   
 # ATTRIBUTES
 you can set and/or query some per-device attributes via sysfs, in a human
 readable format. see `/sys/devices/virtual/video4linux/video*/`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/v4l2loopback-0.12.3/dkms.conf 
new/v4l2loopback-0.12.4/dkms.conf
--- old/v4l2loopback-0.12.3/dkms.conf   2019-12-06 18:31:21.000000000 +0100
+++ new/v4l2loopback-0.12.4/dkms.conf   2020-04-09 22:14:30.000000000 +0200
@@ -1,5 +1,5 @@
 PACKAGE_NAME="v4l2loopback"
-PACKAGE_VERSION="0.12.3"
+PACKAGE_VERSION="0.12.4"
 
 # Items below here should not have to change with each driver version
 MAKE[0]="make KERNEL_DIR=${kernel_source_dir} all"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/v4l2loopback-0.12.3/examples/Makefile 
new/v4l2loopback-0.12.4/examples/Makefile
--- old/v4l2loopback-0.12.3/examples/Makefile   2019-12-06 18:31:21.000000000 
+0100
+++ new/v4l2loopback-0.12.4/examples/Makefile   2020-04-09 22:14:30.000000000 
+0200
@@ -1,4 +1,4 @@
-TARGETS=test yuv4mpeg_to_v4l2 ondemandcam
+TARGETS=test yuv4mpeg_to_v4l2 ondemandcam yuv420_infiniteloop
 
 .PHONY: all clean
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/v4l2loopback-0.12.3/examples/README 
new/v4l2loopback-0.12.4/examples/README
--- old/v4l2loopback-0.12.3/examples/README     2019-12-06 18:31:21.000000000 
+0100
+++ new/v4l2loopback-0.12.4/examples/README     2020-04-09 22:14:30.000000000 
+0200
@@ -18,7 +18,6 @@
 if you want to use another device you need to modify the VIDEO_DEVICE define at
 the beginning of the code and recompile.
 
-
 yuv4mpeg_to_v4l2
 ----------------
 Copyright (C) 2011  Eric C. Cooper <[email protected]>
@@ -44,3 +43,30 @@
 It can be viewed with:
 
 $ vlc v4l2:///dev/videoX # X is same device as above
+
+yuv420_infiniteloop
+-------------------
+
+A simple example for looping over frames of a raw yuv420 video file without 
+bothering other video players. Download and unzip an example sequence 
+akiyo_qcif.yuv from [here](http://trace.eas.asu.edu/yuv/akiyo/akiyo_qcif.7z).
+
+Usage
+$ make yuv420_infiniteloop
+$ ./yuv420_infiniteloop devicename yuvpath width height fps
+
+Example with akiyo_qcif.yuv, width 176, height 144 and fps 30:
+
+$ make yuv420_infiniteloop
+$ ./yuv420_infiniteloop /dev/video1 akiyo_qcif.yuv 176 144 30
+
+It can be viewed with:
+$ ffplay devicename
+
+The YUV format is for raw sequences, more samples can be obtained 
+from [here](http://trace.eas.asu.edu/yuv/). And they can be created using 
+ffmpeg like this:
+
+$ ffmpeg -i inputfile.mp4 -c:v rawvideo outputfile.yuv
+
+More details can be found in [ffmpeg 
wiki](https://github.com/stoyanovgeorge/ffmpeg/wiki/Encode-Raw-Video).
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/v4l2loopback-0.12.3/examples/yuv420_infiniteloop.c 
new/v4l2loopback-0.12.4/examples/yuv420_infiniteloop.c
--- old/v4l2loopback-0.12.3/examples/yuv420_infiniteloop.c      1970-01-01 
01:00:00.000000000 +0100
+++ new/v4l2loopback-0.12.4/examples/yuv420_infiniteloop.c      2020-04-09 
22:14:30.000000000 +0200
@@ -0,0 +1,121 @@
+/* Read a yuv file directly and play with infinte loop
+ *
+ * Example:
+ * $ ./yuv420_infiniteloop /dev/video1 akiyo_qcif.yuv 176 144 30
+
+ * This will loop a yuv file named akiyo_qcif.yuv over video 1
+ * 
+ * Modified by T. Xu <[email protected]> from yuv4mpeg_to_v4l2 example, 
+ * original Copyright (C) 2011  Eric C. Cooper <[email protected]>
+ * Released under the GNU General Public License
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <linux/videodev2.h>
+
+char *prog;
+
+struct yuv_setup {
+       char *device;
+       char *file_name;
+       int frame_width;
+       int frame_height;
+       int frame_bytes;
+       float fps;
+};
+
+void
+fail(char *msg)
+{
+       fprintf(stderr, "%s: %s\n", prog, msg);
+       exit(1);
+}
+
+struct yuv_setup 
+process_args(int argc, char **argv)
+{
+       prog = argv[0];
+       struct yuv_setup setup; 
+       if (argc != 6){
+               fail("invalid argument");
+       } else {
+               setup.device = argv[1];
+               setup.file_name = argv[2];
+               setup.frame_width = atoi(argv[3]);
+               setup.frame_height = atoi(argv[4]);
+               setup.frame_bytes = 3 * setup.frame_height * setup.frame_width 
/ 2;
+               setup.fps = atof(argv[5]);
+       }
+       return setup;
+}
+
+void
+copy_frames(struct yuv_setup setup, int dev_fd)
+{      
+
+       FILE * yuv_file = fopen (setup.file_name,"rb");
+       if (yuv_file == NULL){
+               fail("can not open yuv file");
+       }
+
+       char *frame = malloc(setup.frame_bytes);
+
+       if (frame == NULL) {
+               fail("cannot malloc frame");
+       }
+
+       while (1) {
+               int read_size = fread(frame, 1, setup.frame_bytes, yuv_file);
+               usleep(1.0f/setup.fps * 1000000.0f);
+               if (read_size == setup.frame_bytes){
+                       write(dev_fd, frame, setup.frame_bytes);
+               } else if (read_size == 0){
+                       fclose(yuv_file);
+                       yuv_file = fopen (setup.file_name,"rb");
+               } else {
+                       free(frame);
+                       fail("invalid frame size or file ending");
+               }
+       }
+
+  free(frame);
+}
+
+int
+open_video(struct yuv_setup setup)
+{
+       struct v4l2_format v;
+
+       int dev_fd = open(setup.device, O_RDWR);
+       if (dev_fd == -1) {
+               fail("cannot open video device");
+       }
+       v.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
+       if (ioctl(dev_fd, VIDIOC_G_FMT, &v) == -1){
+               fail("cannot setup video device");
+       }
+       v.fmt.pix.width = setup.frame_width;
+       v.fmt.pix.height = setup.frame_height;
+       v.fmt.pix.pixelformat = V4L2_PIX_FMT_YUV420;
+       v.fmt.pix.sizeimage = setup.frame_bytes;
+       v.fmt.pix.field = V4L2_FIELD_NONE;
+       if (ioctl(dev_fd, VIDIOC_S_FMT, &v) == -1){
+               fail("cannot setup video device");
+       }
+
+       return dev_fd;
+}
+
+int
+main(int argc, char **argv)
+{
+       struct yuv_setup loc_setup = process_args(argc, argv);
+       int loc_dev = open_video(loc_setup);
+       copy_frames(loc_setup, loc_dev);
+       return 0;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/v4l2loopback-0.12.3/v4l2loopback.c 
new/v4l2loopback-0.12.4/v4l2loopback.c
--- old/v4l2loopback-0.12.3/v4l2loopback.c      2019-12-06 18:31:21.000000000 
+0100
+++ new/v4l2loopback-0.12.4/v4l2loopback.c      2020-04-09 22:14:30.000000000 
+0200
@@ -40,7 +40,7 @@
 #define HAVE_TIMER_SETUP
 #endif
 
-#define V4L2LOOPBACK_VERSION_CODE KERNEL_VERSION(0, 12, 3)
+#define V4L2LOOPBACK_VERSION_CODE KERNEL_VERSION(0, 12, 4)
 
 MODULE_DESCRIPTION("V4L2 loopback video device");
 MODULE_AUTHOR("Vasily Levin, " \
@@ -134,7 +134,7 @@
 # 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 +144,8 @@
        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);
 }
 
 
@@ -176,7 +176,7 @@
 module_param(debug, int, S_IRUGO | S_IWUSR);
 MODULE_PARM_DESC(debug, "debugging level (higher values == more verbose)");
 
-static int max_buffers = 8;
+static int max_buffers = 2;
 module_param(max_buffers, int, S_IRUGO);
 MODULE_PARM_DESC(max_buffers, "how many buffers should be allocated");
 
@@ -1520,7 +1520,7 @@
        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 +1947,7 @@
                        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 +2052,7 @@
                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;


Reply via email to