Hello community,

here is the log from the commit of package camsource for openSUSE:Factory 
checked in at 2020-02-09 20:48:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/camsource (Old)
 and      /work/SRC/openSUSE:Factory/.camsource.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "camsource"

Sun Feb  9 20:48:43 2020 rev:24 rq:772316 version:0.7.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/camsource/camsource.changes      2015-07-14 
17:44:49.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.camsource.new.26092/camsource.changes   
2020-02-09 20:48:47.854888044 +0100
@@ -1,0 +2,15 @@
+Fri Feb  7 21:07:50 UTC 2020 - David Mair <[email protected]>
+
+- The camsource v4l1 module has logic errors opening the video
+  device that incorrectly perform a channel set when a grab window
+  set (frame size, fps, etc) is intended. The error handling from
+  the invalid channel set causes the configuration frame size and
+  fps settings to be discarded and replaced with the current
+  settings active on the video device. The result is that running a
+  v4l(1/2) application on a given camera before using camsource on
+  the same camera means camsource has the grab window attributes
+  from the other application not the one specified in camsource
+  configuration
+- camsource-v4l-conf-video_window-overwrite.patch
+
+-------------------------------------------------------------------

New:
----
  camsource-v4l-conf-video_window-overwrite.patch

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

Other differences:
------------------
++++++ camsource.spec ++++++
--- /var/tmp/diff_new_pack.B80dh1/_old  2020-02-09 20:48:48.742888551 +0100
+++ /var/tmp/diff_new_pack.B80dh1/_new  2020-02-09 20:48:48.746888554 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package camsource
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,7 +12,7 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
@@ -26,12 +26,13 @@
 Version:        0.7.1
 Release:        0
 Summary:        Camsource Grabs Images from a Video4Linux Device
-License:        GPL-2.0+
+License:        GPL-2.0-or-later
 Group:          Amusements/Toys/Graphics
-Url:            http://camsource.sourceforge.net
+URL:            http://camsource.sourceforge.net
 Source:         camsource-%{version}.tar.gz
 Source1:        camsource-rpmlintrc
 Patch0:         camsource-no_implicit_decls.diff
+Patch1:         camsource-v4l-conf-video_window-overwrite.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -53,6 +54,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 chmod ugo+x configure
 
 %build

++++++ camsource-v4l-conf-video_window-overwrite.patch ++++++
>From 03bfd892ee6a6454d92b10d1afd1f86fa0910fba Mon Sep 17 00:00:00 2001
From: David Mair <[email protected]>
Date: Fri, 7 Feb 2020 13:39:12 -0700
Subject: [PATCH] opendev() in input_v4l.c functional execution is not
 implemented as described by the output messages it can display. One result
 is that it reads the configuration width and height settings and prepares
 them as the video source settings. But, it makes two unrelated attempts to
 set the video device source channel and if the second one succeeds it reads
 the current device grab window settings into the same structure it used to
 load the configuration, overwriting and losing the configuration. It then
 sets the grab window using the value it just got from the same device, i.e.
 redundant set device grab window to current grab window. It has the effect
 that if:
 
 * Another video application is used before running camsource
  - for the device camsource will use
  - Uses frame resolution different from that in the camsource configuration
 * Then the other application exited
 * camsource started
 
 The frame resolution used by camsource will be that set by the other
 application and not that in the camsource configuration.
 
 When reading what can be output to the console from the second set channel
 it says the "set grab window failed: Trying _again_ without the
 fps option" and performs a "set grab window" operation as the supposed
 "again" of a set video channel operation (when a full set video channel was
 already performed earlier in the code anyway).
 
 I modified the logic to operate as the messaging describes:
 
 * Perform a "get grab window" before loading the configuration
 * Load the configuration over the get grab window result
 * Perform a "set grab window" with the fps option
 * If that "set grab window" fails:
  - Perform a "set grab window" _again_ but without the fps
  
 This matches the behavior described in the messaging and camsource no
 longer loses the settings loaded from configuration.

---
 src/input_v4l.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/input_v4l.c b/src/input_v4l.c
index efbd7b3..f247d9b 100644
--- a/src/input_v4l.c
+++ b/src/input_v4l.c
@@ -145,7 +145,9 @@ closenerr:
                        printf("ioctl \"set input channel\" failed, continuing 
anyway: %s\n", strerror(errno));
        }
 
-       memset(&vidwin, 0, sizeof(vidwin));
+       ret = v4l1_ioctl(newcamdev.fd, VIDIOCGWIN, &vidwin);
+       if (ret != 0)
+               memset(&vidwin, 0, sizeof(vidwin));
 
        newcamdev.autobrightness = autobrightness;
 
@@ -158,7 +160,7 @@ closenerr:
 
        vidwin.flags |= (fps & 0x3f) << 16;
 
-        ret = v4l1_ioctl(newcamdev.fd, VIDIOCSCHAN, &vidchan);
+       ret = v4l1_ioctl(newcamdev.fd, VIDIOCSWIN, &vidwin);
        if (ret != 0)
        {
                printf("ioctl \"set grab window\" failed: %s\n", 
strerror(errno));
@@ -180,11 +182,6 @@ closenerr:
                        printf("we will continue anyway and hope that 
everything goes ok.\n");
                }
        }
-       else {
-                ret = v4l1_ioctl(newcamdev.fd, VIDIOCGWIN, &vidwin);
-               if (!ret)
-                        v4l1_ioctl(newcamdev.fd, VIDIOCSWIN, &vidwin);
-       }
 
         ret = v4l1_ioctl(newcamdev.fd, VIDIOCGPICT, &newcamdev.vidpic);
        if (ret != 0)
-- 
2.25.0


Reply via email to