Compare commits

...
Sign in to create a new pull request.

95 commits

Author SHA1 Message Date
Gwyn Ciesla
257ee58d88 Rebuild for Python 3.15.0b4 2026-08-04 14:27:07 -05:00
Michal Schorm
6c6747c812 Remove stale 'xmlto' BuildRequires
Man pages have been pre-built in the upstream tarball since the
initial packaging (525f75c, 2009). A stamp file prevents
regeneration during the build.

Related: rhbz#2503124

Co-Authored-By: Claude AI <noreply@anthropic.com>
2026-07-21 07:40:31 +02:00
Fedora Release Engineering
ce2f2dbd06 Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild 2026-07-17 09:39:04 +00:00
Python Maint
13577c08e5 Rebuilt for Python 3.15 2026-06-03 23:53:33 +02:00
Simone Caronni
a1e97927fd Fix FTBFS 2026-02-02 13:35:52 +01:00
Fedora Release Engineering
9796c95d23 Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild 2026-01-17 21:06:31 +00:00
Yaakov Selkowitz
3b470a2d65 Fix Qt overlinking
This was causing Qt5 to be linked into every binary in zbar, where it is only
needed for the Qt bindings (which already specify QT_CFLAGS, QT_LIBS, etc).
2025-09-05 11:08:42 -04:00
Fedora Release Engineering
bb34380f84 Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild 2025-07-25 21:16:33 +00:00
Python Maint
d99b509668 Rebuilt for Python 3.14 2025-06-03 14:09:04 +02:00
Fedora Release Engineering
85f877885c Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild 2025-01-19 16:42:27 +00:00
Fedora Release Engineering
8b34b04285 Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild 2024-07-20 10:49:18 +00:00
Python Maint
84f4d66df0 Rebuilt for Python 3.13 2024-06-07 14:12:34 +02:00
Gwyn Ciesla
f07fb24c88 Update python3-gobject BuildRequires 2024-04-15 15:41:43 -05:00
Fedora Release Engineering
228839a243 Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild 2024-01-27 11:00:53 +00:00
Yaakov Selkowitz
dec080b68c Use default java-devel
The JNI bindings were introduced with 1.8.0 was still the default JDK,
so 11 was intended to select the newer version.  The default JDK is now
17, and there is no reason to continue to use what is now an older
version.
2024-01-11 23:48:02 -05:00
Gwyn Ciesla
23ba05b98d 0.23.93 2024-01-09 10:07:01 -06:00
Florian Weimer
107c91c11f Add missing Py_SIZE to py311.patch 2024-01-05 12:52:10 +01:00
Fedora Release Engineering
8304c4ae98 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-22 19:38:07 +00:00
d5b34494c9 Fix FTBFS with python 3.12 (rhbz#2220630) 2023-07-07 11:37:10 +02:00
Python Maint
267ec547c2 Rebuilt for Python 3.12 2023-06-15 17:00:48 +02:00
Yaakov Selkowitz
50012aaeef Fix flatpak build
Flatpaks are built in /app prefix instead of /usr.
2023-04-30 21:27:19 -04:00
Gwyn Ciesla
ee527c1110 migrated to SPDX license 2023-03-01 12:37:28 -06:00
Fedora Release Engineering
d9ab6bd465 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-21 08:12:47 +00:00
Gwyn Ciesla
239937f7f0 Bump Release 2022-12-21 11:16:10 -06:00
Gwyn Ciesla
76753c237f BR setuptools. 2022-12-21 11:15:25 -06:00
Kalev Lember
1d27d2f2d2 Misc packaging cleanup 2022-08-26 16:12:00 +02:00
Kalev Lember
3382cddf1b Use make_build and make_install macros 2022-08-26 16:09:08 +02:00
Kalev Lember
a7acfe6d3d Rename zbar-python3 to python3-zbar as per latest Python guidelines 2022-08-26 16:09:08 +02:00
Kalev Lember
888b226546 Drop manual requires on pkgconfig and rely on rpm dep extractor 2022-08-26 16:08:34 +02:00
Kalev Lember
ce06971a59 Tighten subpackage deps with %%{_isa} 2022-08-26 16:08:34 +02:00
Kalev Lember
5db803bc6f Split libzbar out to zbar-libs subpackage
This allows other apps that link with libzbar, such as GNOME
authenticator to not have to pull in GraphicsMagick that
/usr/bin/zbarimg depends on.
2022-08-26 16:08:34 +02:00
Kalev Lember
a8a6072c5d Move GObject Introspection bindings to -gtk and -gtk-devel subpackages
... so it's packaged the same way as we package all of GNOME libraries.
2022-08-26 15:48:01 +02:00
Kalev Lember
1eb32e16c5 Sort BuildRequires and Requires and split them out one per line 2022-08-26 15:43:36 +02:00
Gwyn Ciesla
4da8028c1a Only build java on supported platforms 2022-08-01 15:38:10 -05:00
Fedora Release Engineering
9cdd221147 Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-07-23 13:52:13 +00:00
Python Maint
1ec754dc2c Rebuilt for Python 3.11 2022-06-13 21:00:09 +02:00
Gwyn Ciesla
cd9eddb418 0.23.90, enable pdf417 2022-05-31 14:28:55 -05:00
Jiri
5fad1e4a16 Rebuilt for java-17-openjdk as system jdk
https://fedoraproject.org/wiki/Changes/Java17
2022-02-06 00:53:55 +01:00
Fedora Release Engineering
cf8c7c0020 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2022-01-22 05:48:53 +00:00
Gwyn Ciesla
8a571d93a8 Fix 3.11 FTBFS. 2022-01-12 11:08:15 -06:00
Fedora Release Engineering
cc085ac4be - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 22:15:15 +00:00
Python Maint
38751c3a39 Rebuilt for Python 3.10 2021-06-04 21:20:46 +02:00
Gwyn Ciesla
932f44b9f7 Fix FTBFS. 2021-03-25 14:25:48 -05:00
Fedora Release Engineering
cbd438c1d3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-01-28 00:39:37 +00:00
Tom Stellard
4271d86619 Add BuildRequires: make
https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot
2021-01-09 01:51:07 +00:00
Fedora Release Engineering
180f278751 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-07-29 15:20:34 +00:00
Gwyn Ciesla
65b1326e59 Several fixes. 2020-07-20 13:05:26 -05:00
Miro Hrončok
1bd23d395d Rebuilt for Python 3.9 2020-05-26 03:55:45 +02:00
Fedora Release Engineering
de7a7a2177 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2020-01-31 05:15:54 +00:00
Miro Hrončok
f804e4f3cc Rebuilt for Python 3.8 2019-08-19 11:10:07 +02:00
32cda90a06
Drop obsolete Group tag
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-08-13 12:27:57 +02:00
Fedora Release Engineering
366530f9ae - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-27 04:57:22 +00:00
Mauro Carvalho Chehab
665880f68b Bump to version 0.23
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-23 18:17:14 -03:00
Mauro Carvalho Chehab
f0cd33a9e4 Bump to the third release candidate for 0.23
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-14 07:28:04 -03:00
Mauro Carvalho Chehab
883b7ce619 Add missing script
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-11 17:23:59 -03:00
Mauro Carvalho Chehab
6deccd757c Bump to 0.22.91
Has some build fixes. While here, enable python3 bindings build.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-11 17:06:08 -03:00
Mauro Carvalho Chehab
c9fd939c01 Update to 0.23 release candidate package (0.22.90)
This Release Candidate brings support for Gtk3 and GIR.

Add support for it and create an extra package for GIR.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-11 11:58:33 -03:00
Mauro Carvalho Chehab
7adb3c8dcb Make rpmlint happy
Use tab instead of spaces at the java dependency line
and use the 0.22.2 source that was uploaded to linuxtv.org,
instead of the previous version I used locally in order to
test if Java sources were being packaged with make dist
inside ZBar.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-04-30 09:40:44 -03:00
Mauro Carvalho Chehab
3912a5c736 Build a package with ZBar java JNI and jar library
Add an extra ZBar package with java libraries, just in case
someone wants to use it inside a Java application.

While here, change config to prefer using ImageMagick instead
of GraphicsMagick, as this is the recommended conversion library.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-04-30 09:32:43 -03:00
Mauro Carvalho Chehab
02a23e52f1 Update to version 0.22.2, with supports Java 11
The Java library require some different logic in order to build
with Java 11. While I'm not sure when Fedora will migrate to
it, it seems worth to be able to support it now that we added
support for it upstream, as openjdk maintainers can migrate
ZBar to Java 11 smoothless.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-04-29 10:19:11 -03:00
Mauro Carvalho Chehab
e0125b27b6 Update ZBar sources
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-02-20 07:14:39 -03:00
Mauro Carvalho Chehab
1aa537a68e Bump to version 0.22
The main focus of this version is to make zbarcam-qt a
full-featured application, allowing to use all ZBar library
features with a GUI interface.

It also comes with an optional new feature to allow inverting
the colors when parsing images. That's specially useful for
QR codes, as it seems that several such barcodes come inverted.

There are also some bug fixes on it.

Sumary of changes:

  * zbarcam-qt: allow changing resolutions in real time
  * zbarcam-qt: better support ZBar options
  * zbarcam-qt: do several visual improvements
  * zbarcam-qt: make it remember the geometry
  * zbarcam-qt: allow show/hide control and options bars
  * zbarcam-qt: remember lastly used settings and camera controls
  * zbarcam-qt: allow changing ZBar decode options via GUI
  * Add API to allow get/set resolutions
  * img_scanner: add handler for color-inverted codes
  * img_scanner: fix get_config parameter validation
  * scan_video: improve logic to remove duplicated/invalid devnodes
  * symbol.c: fix symbol hash logic (prevents crash with QR options)
  * configure.ac: fix an error at libv4l2 package check
  * fix some typos
  * exit gracefully when decoding split QR codes

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-02-20 07:06:43 -03:00
Mauro Carvalho Chehab
a426834d7f zbar.spec: add dbus-devel dependency
This is needed in order to build ZBar with d-bus support.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-02-12 13:26:17 -02:00
Mauro Carvalho Chehab
6a7663d714 Bump to version 0.21
* zbarcam-qt: allow selecting codes via GUI interface
  * When both enabled, ISBN-13 has precedence over ISBN-10
  * ZBar is now using Travis CI for continuous integration tests
  * Convert INSTALL and README to markdown and update them
  * Improve ZBar testing code and make easier to run the tests
  * Fix build with Clang
  * Add simple dbus IPC API to zbarcam.
  * zbarimg: display only the compiled symbologies
  * v4l2: make ZBar build and run on Kernels < 3.16
  * configure.ac: The pdf417 code is incomplete. Warn about that
  * Add Debian packaging and Travis CI configuration
  * Add barcode examples for different supported symbologies
  * Several improvements at the building system
  * Add support for SQ code symbology
  * v4l2: add fallback for systems without v4l2_ext_controls which field
  * v4l2: use device_caps instead of capabilities
  * v4l2: make v4l2_request_buffers() more generic
  * release video buffers after probing and request them again when needed
  * Ignore ENOTTY errors when calling VIDIOC_S_CROP
  * doc/Makefile.am.inc: clean html generated files
  * Add --disable-doc configure option to disable building docs
  * Fix function protoype to be compatible with recent libjpeg
  * Wrap logical not operations into parentheses
  * INSTALL: warn that autoconf should be called before configure
  * code128: fix error logic
  * convert: ensure that it will not use a freed value
  * zbar: use g_thread_new() instead of g_tread_create()
  * zbargtk: add a missing break
  * gtk/zbargtk: add a missing check if zbar->window is not null

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-02-12 12:24:54 -02:00
Fedora Release Engineering
9e88a5e49f - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-03 13:08:39 +00:00
5dbc4944f4 Remove obsolete Group tag
References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag
2019-01-28 20:24:56 +01:00
Mauro Carvalho Chehab
b0a327b728 Increase Fedora packaging number and add a change description
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-01-07 12:12:15 -02:00
Mauro Carvalho Chehab
97f8445ae5 Disable build for pygtk2 module
The pygtk2 module is orphaned and will be retired from Fedora.
Also, there is a binding for zbar that claims to support both
python2 and python3:
	https://github.com/zplab/zbar-py

Ok, this is currently not packaged on Fedora, but it should be
easy to install it via pip. So, it may not make much sense to
change zbar to have a pygtk3 binding.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-01-07 11:31:42 -02:00
Hans de Goede
60e4c2b86f Drop zbar_fedora29_hack_for_codegen_to_work.patch now that pygobject2 is
fixed (rhbz# 1606784)
Use %ldconfig_scriptlets so that we don't unnecessarily run ldconfig on F28+
2018-08-09 13:12:38 +02:00
Mauro Carvalho Chehab
ff4c638d36 Re-enable python 2 bindings
Now that it builds with python2, re-enable its bindings.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-08 10:30:18 -03:00
Mauro Carvalho Chehab
1c1368e0a4 Add requirement for python2-pillow
Some of zbar's python scripts require python2-pillow, in order
to display images.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-08 10:17:39 -03:00
Mauro Carvalho Chehab
3353f69d9d Bump to version 0.20.1
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-08 10:15:04 -03:00
Mauro Carvalho Chehab
76f84ecfb5 Fix calls to env at python scripts
Remove an extra space introduced by a bad sed expression.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-07 17:31:47 -03:00
Mauro Carvalho Chehab
1a52ec8524 Fix date to allow builds
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-07 17:20:57 -03:00
Mauro Carvalho Chehab
c3e7934c3e zbar: fix build with Fedora 29
There is a bug at pygobject-codegen-2.0 related to its dependency
on having a working /usr/bin/python with prevents zbar to be built.

Add a hack to make it work.

While here, update it to reflect the latest changes at zbar
upstream.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-07 17:19:15 -03:00
Mauro Carvalho Chehab
b61f85891f Get rid of old patches that aren't needed anymore
None of those patches are needed, as they got merged at the
zbar 0.20 version.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-07 16:27:14 -03:00
Mauro Carvalho Chehab
9c48b8c57a Set python via env
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-07 15:06:35 -03:00
53f2cbce7a
%{python_sitearch} → %{python2_sitearch}
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-07-30 00:22:29 +02:00
Fedora Release Engineering
8f63028ae5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-14 09:48:35 +00:00
Jason Tibbitts
1b7ace63be Remove needless use of %defattr 2018-07-09 23:14:27 -05:00
Adam Jackson
cc5b455a31 Only build pygtk support on Fedora 2018-05-24 12:50:53 -04:00
Iryna Shcherbina
564f374561 Update Python 2 dependency declarations to new packaging standards 2018-02-14 17:28:07 +01:00
9e080c57c0
Remove %clean section
None of currently supported distributions need that.
Last one was EL5 which is EOL for a while.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 09:02:50 +01:00
08e8c3cb2f Remove BuildRoot definition
None of currently supported distributions need that.
It was needed last for EL5 which is EOL now

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-14 00:52:35 +01:00
Fedora Release Engineering
b2260ef693 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-09 22:25:11 +00:00
Fedora Release Engineering
7877cf2706 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-03 11:09:35 +00:00
Fedora Release Engineering
2896e09513 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-27 22:41:07 +00:00
Mauro Carvalho Chehab
9dc8307e57 Make rpmlint happy
- Remove weird white spaces;
- don't mix tabs with white spaces;
- Use "bar code" instead of: "barcode".
- Use "e. g." instead of "eg".

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-11 15:04:46 -03:00
Mauro Carvalho Chehab
befb620030 Use the right source file
There was a problem with the older tarball upstream, causing it
to increment version number on a wrong way. This was fixed, but
the new tarball need to be used.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-11 14:59:07 -03:00
Mauro Carvalho Chehab
658da81130 Bump to version 0.20
Point to the new place where we're storing zbar tarballs
and bump it to version 0.20.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-11 14:03:39 -03:00
Mauro Carvalho Chehab
ff06c02600 zbar.spec: add qt5-qtx11extras-devel dependency
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-03 21:09:18 -03:00
Mauro Carvalho Chehab
8793112f34 Fix qt5 dependencies
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-03 17:50:50 -03:00
Mauro Carvalho Chehab
f637bc2280 Generate qt and gtk zbarcam applications
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-03-26 10:19:21 -03:00
Mauro Carvalho Chehab
7715ab8df2 make zbar-qt to use Qt5
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-03-26 08:42:45 -03:00
Fedora Release Engineering
8588580711 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-11 18:22:55 +00:00
10 changed files with 352 additions and 36214 deletions

12
.gitignore vendored
View file

@ -1,2 +1,14 @@
zbar-0.10.tar.bz2
/zbar-0.10.tar.bz2
/zbar-0.20.tar.bz2
/zbar-0.20.1.tar.bz2
/zbar-0.21.tar.bz2
/zbar-0.22.tar.bz2
/zbar-0.22.2.tar.gz
/zbar-0.22.2.tar.bz2
/zbar-0.22.90.tar.bz2
/zbar-0.22.91.tar.bz2
/zbar-0.22.92.tar.bz2
/zbar-0.23.tar.bz2
/zbar-0.23.90.tar.bz2
/zbar-0.23.93.tar.bz2

16
fix_qt_overlinking.patch Normal file
View file

@ -0,0 +1,16 @@
This was causing Qt5 to be linked into every binary in zbar, where it is only
needed for the Qt bindings (which already specify QT_CFLAGS, QT_LIBS, etc).
diff --git a/configure.ac b/configure.ac
index f0f9723..2a26973 100644
--- a/configure.ac
+++ b/configure.ac
@@ -689,8 +689,6 @@ AM_CONDITIONAL([HAVE_QT], [test "x$with_qt" = "xyes"])
AM_COND_IF([HAVE_QT],
[AC_MSG_NOTICE([using Qt version $QT_VERSION])
AC_MSG_NOTICE([using moc from $MOC])
- CPPFLAGS="$CPPFLAGS $QT_CPPFLAGS"
- LIBS="$LIBS $QT_LIBS"
AC_CONFIG_FILES([zbar-qt.pc:"${qt_pkgconfig_file}.in"])
#dnl -fPIC has no effect on Windows and breaks windres
AS_IF([test "x$win32" = "xno"], [CPPFLAGS="$CPPFLAGS -fPIC"])])

View file

@ -1 +1 @@
d8b9dddcf28d6603d8b066816941a9d2 zbar-0.10.tar.bz2
SHA512 (zbar-0.23.93.tar.bz2) = 8b1d57557cb1c425109b709f0cbe94830939cb4cd9a0cb505d44ba3c7cfb3522560c3bbf2a8b37985da4577b677ad675491f6ef0e9796749382079c0e844e21e

View file

@ -0,0 +1,10 @@
diff --git a/test/test_python.py b/test/test_python.py
index 252c51a97256..8388d9a5aa36 100755
--- a/test/test_python.py
+++ b/test/test_python.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#------------------------------------------------------------------------
# Copyright 2019 (c) Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
#

403
zbar.spec
View file

@ -1,148 +1,176 @@
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%ifarch %{java_arches}
%global JAVA 1
%else
%global JAVA 0
%endif
Name: zbar
Version: 0.10
Release: 27%{?dist}
Summary: Bar code reader
Name: zbar
Version: 0.23.93
Release: 13%{?dist}
Summary: Bar code reader
Group: User Interface/X Hardware Support
License: LGPLv2+
URL: http://zbar.sourceforge.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2
Patch0: zbar_update_to_hg.patch
Patch1: zbar_use_libv4l.patch
Patch2: zbar_choose_supported_format_first.patch
Patch3: zbar_use_REQBUFS_properly.patch
Patch4: zbar_configure_ac_use_m4_pattern_allow.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: autoconf automake libtool python-devel gettext-devel
BuildRequires: qt4-devel gtk2-devel pygtk2-devel GraphicsMagick-c++-devel
BuildRequires: libv4l-devel libXv-devel xmlto
License: LGPL-2.1-or-later
URL: http://zbar.sourceforge.net/
Source0: https://linuxtv.org/downloads/%{name}/%{name}-%{version}.tar.bz2
Patch0: use_python3_on_python_script.patch
Patch1: fix_qt_overlinking.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: dbus-devel
BuildRequires: gettext-devel
BuildRequires: GraphicsMagick-devel
BuildRequires: gtk3-devel
BuildRequires: libSM-devel
BuildRequires: libtool
BuildRequires: libv4l-devel
BuildRequires: libXv-devel
BuildRequires: make
BuildRequires: python3-gobject-devel
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qtx11extras-devel
%if %{JAVA}
BuildRequires: java-devel
%endif
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: xmlto
BuildRequires: gobject-introspection-devel
%description
A layered barcode scanning and decoding library. Supports EAN, UPC, Code 128,
Code 39 and Interleaved 2 of 5.
Includes applications for decoding captured barcode images and using a video
device (eg, webcam) as a barcode scanner.
ZBar Bar Code Reader is an open source software suite for reading bar
codes from various sources, such as video streams, image files and raw
intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128,
Code 93, Code 39, Codabar, Interleaved 2 of 5, QR Code and SQ Code.
%package devel
Group: Development/Libraries
Summary: Bar code library extra development files
Requires: pkgconfig, %{name} = %{version}-%{release}
Summary: Bar code reader library extra development files
Requires: %{name}-libs%{_isa} = %{version}-%{release}
%description devel
This package contains header files and additional libraries used for
developing applications that read bar codes with this library.
%package libs
Summary: Bar code reader library
%description libs
This package contains the ZBar Bar Code Reader library.
%package gtk
Group: Development/Libraries
Summary: Bar code reader GTK widget
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs%{_isa} = %{version}-%{release}
# Obsoleted in F37
Obsoletes: %{name}-gi < %{version}-%{release}
%description gtk
This package contains a bar code scanning widget for use with GUI
applications based on GTK+-2.0.
applications based on GTK 3.
%package gtk-devel
Group: Development/Libraries
Summary: Bar code reader GTK widget extra development files
Requires: pkgconfig, %{name}-gtk = %{version}-%{release}, %{name}-devel = %{version}-%{release}
Requires: %{name}-devel%{_isa} = %{version}-%{release}
Requires: %{name}-gtk%{_isa} = %{version}-%{release}
%description gtk-devel
This package contains header files and additional libraries used for
developing GUI applications based on GTK+-2.0 that include a bar code
developing GUI applications based on GTK 3 that include a bar code
scanning widget.
%package pygtk
Group: Development/Libraries
Summary: Bar code reader PyGTK widget
Requires: pygtk2, %{name}-gtk = %{version}-%{release}
%description pygtk
This package contains a bar code scanning widget for use in GUI
applications based on PyGTK.
%package qt
Group: Development/Libraries
Summary: Bar code reader Qt widget
Requires: %{name} = %{version}-%{release}
Requires: %{name}-libs%{_isa} = %{version}-%{release}
%description qt
This package contains a bar code scanning widget for use with GUI
applications based on Qt4.
%package qt-devel
Group: Development/Libraries
Summary: Bar code reader Qt widget extra development files
Requires: pkgconfig, %{name}-qt = %{version}-%{release}, %{name}-devel = %{version}-%{release}
Requires: %{name}-devel%{_isa} = %{version}-%{release}
Requires: %{name}-qt%{_isa} = %{version}-%{release}
%description qt-devel
This package contains header files and additional libraries used for
developing GUI applications based on Qt4 that include a bar code
developing GUI applications based on Qt5 that include a bar code
scanning widget.
%package -n python3-zbar
Summary: Bar code reader PyGTK widget
Requires: %{name}-libs%{_isa} = %{version}-%{release}
Requires: python3-pillow
# Renamed in F37
Obsoletes: %{name}-python3 < %{version}-%{release}
%description -n python3-zbar
This package contains a bar code scanning widget for use on
python applications that work with images.
%if %{JAVA}
%package java
Summary: Bar code reader Java library
Requires: %{name}-devel%{_isa} = %{version}-%{release}
Requires: %{name}-gtk%{_isa} = %{version}-%{release}
%description java
This package contains header files and additional libraries used for
on Java Native Interface (JNI) applications using ZBar.
%endif
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch 0 -p1
%patch 1 -p1
%build
autoreconf -vfi
%configure --with-graphicsmagick --docdir=%{_docdir}/%{name}-%{version}
autoreconf -fiv
%configure --with-python=python3 --with-gtk=auto --with-dbusconfdir=%{_sysconfdir} --docdir=%{_docdir}/%{name}-%{version} --with-graphicsmagick --without-xshm --without-xv --enable-codes=ean,databar,code128,code93,code39,codabar,i25,qrcode,sqcode,pdf417
# rpath
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%make_build
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p"
%make_install
%if %{JAVA}
install -d %{buildroot}%{_jnidir}
mv %{buildroot}%{_datadir}/zbar/lib/zbar.jar %{buildroot}%{_jnidir}
mv %{buildroot}%{_datadir}/zbar/lib/libzbarjni.so* %{buildroot}%{_libdir}
%endif
cp test/test_python.py %{buildroot}%{_docdir}
#Remove .la and .a files
find ${RPM_BUILD_ROOT} -name '*.la' -or -name '*.a' | xargs rm -f
# Remove installed doc
rm -rf $RPM_BUILD_ROOT/usr/share/doc/zbar-0.10/
rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/
%clean
rm -rf $RPM_BUILD_ROOT
%ldconfig_scriptlets
%post -p /sbin/ldconfig
%ldconfig_scriptlets devel
%post devel -p /sbin/ldconfig
%ldconfig_scriptlets gtk
%post gtk -p /sbin/ldconfig
%ldconfig_scriptlets qt
%post qt -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%postun devel -p /sbin/ldconfig
%postun gtk -p /sbin/ldconfig
%postun qt -p /sbin/ldconfig
%find_lang zbar
%files
%defattr(-,root,root,-)
%doc COPYING LICENSE NEWS
%doc NEWS.md README.md INSTALL.md
%{_bindir}/zbarimg
%{_bindir}/zbarcam
%{_libdir}/libzbar.so.*
%{_mandir}/man1/*
%{_sysconfdir}/dbus-1/system.d/org.linuxtv.Zbar.conf
%files libs -f zbar.lang
%license COPYING LICENSE.md
%{_libdir}/libzbar.so.0*
%{_libdir}/girepository-1.0/ZBar-1.0.typelib
%files devel
%defattr(-,root,root,-)
%doc HACKING TODO
%doc HACKING.md TODO.md
%{_libdir}/libzbar.so
%{_libdir}/pkgconfig/zbar.pc
%dir %{_includedir}/zbar
@ -156,33 +184,224 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/zbar/Video.h
%{_includedir}/zbar/Window.h
%{_includedir}/zbar/Processor.h
%{_datadir}/gir-1.0/ZBar-1.0.gir
%files gtk
%defattr(-,root,root,-)
%{_libdir}/libzbargtk.so.*
%{_bindir}/zbarcam-gtk
%files gtk-devel
%defattr(-,root,root,-)
%{_libdir}/libzbargtk.so
%{_libdir}/pkgconfig/zbar-gtk.pc
%{_includedir}/zbar/zbargtk.h
%files pygtk
%defattr(-,root,root,-)
%{python_sitearch}/zbarpygtk.so
%{python_sitearch}/zbar.so
%files qt
%defattr(-,root,root,-)
%{_libdir}/libzbarqt.so.*
%{_bindir}/zbarcam-qt
%files qt-devel
%defattr(-,root,root,-)
%{_libdir}/libzbarqt.so
%{_libdir}/pkgconfig/zbar-qt.pc
%{_includedir}/zbar/QZBar*.h
%if %{JAVA}
%files java
%{_jnidir}/zbar.jar
%{_libdir}/libzbarjni.so*
%endif
%files -n python3-zbar
%{python3_sitearch}/zbar.so
%{_docdir}/test_python.py
%changelog
* Tue Aug 04 2026 Gwyn Ciesla <gwync@protonmail.com> - 0.23.93-13
- Rebuild for Python 3.15.0b4
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.93-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
* Wed Jun 03 2026 Python Maint <python-maint@redhat.com> - 0.23.93-11
- Rebuilt for Python 3.15
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.93-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Fri Sep 05 2025 Yaakov Selkowitz <yselkowi@redhat.com> - 0.23.93-9
- Fix Qt overlinking
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.93-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Tue Jun 03 2025 Python Maint <python-maint@redhat.com> - 0.23.93-7
- Rebuilt for Python 3.14
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.93-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.93-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Fri Jun 07 2024 Python Maint <python-maint@redhat.com> - 0.23.93-4
- Rebuilt for Python 3.13
* Mon Apr 15 2024 Gwyn Ciesla <gwync@protonmail.com> - 0.23.93-3
- Update python3-gobject BuildRequires
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.93-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Tue Jan 09 2024 Gwyn Ciesla <gwync@protonmail.com> - 0.23.93-1
- 0.23.93
* Fri Jan 05 2024 Florian Weimer <fweimer@redhat.com> - 0.23.90-12
- Add missing Py_SIZE to py311.patch
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.90-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Jul 07 2023 Michael J Gruber <mjg@fedoraproject.org> - 0.23.90-10
- Fix FTBFS with python 3.12 (rhbz#2220630)
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 0.23.90-9
- Rebuilt for Python 3.12
* Wed Mar 01 2023 Gwyn Ciesla <gwync@protonmail.com> - 0.23.90-8
- migrated to SPDX license
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.90-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Dec 21 2022 Gwyn Ciesla <gwync@protonmail.com> - 0.23.90-6
- BR setuptools
* Fri Aug 26 2022 Kalev Lember <klember@redhat.com> - 0.23.90-5
- Misc packaging cleanup
- Sort BuildRequires and Requires and split them out one per line
- Move GObject Introspection bindings to -gtk and -gtk-devel subpackages
- Split libzbar out to zbar-libs subpackage
- Tighten subpackage deps with %%{_isa}
- Drop manual requires on pkgconfig and rely on rpm dep extractor
- Rename zbar-python3 to python3-zbar as per latest Python guidelines
- Use make_build and make_install macros
* Mon Aug 01 2022 Gwyn Ciesla <gwync@protonmail.com> - 0.23.90-4
- Only build Java on supported platforms.
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.23.90-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.23.90-2
- Rebuilt for Python 3.11
* Tue May 31 2022 Gwyn Ciesla <gwync@protonmail.com> - 0.23.90-1
- 0.23.90
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 0.23-14
- Rebuilt for java-17-openjdk as system jdk
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.23-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Wed Jan 12 2022 Gwyn Ciesla <gwync@protonmail.com> - 0.23-12
- Fix 3.11 FTBFS.
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.23-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.23-10
- Rebuilt for Python 3.10
* Thu Mar 25 2021 Gwyn Ciesla <gwync@protonmail.com> - 0.23-9
Fix FTBFS for autoconf 2.71.
* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.23-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.23-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 20 2020 Gwyn Ciesla <gwync@protonmail.com> - 0.23-6
- Update description.
- Patch for Python 3.9.
- Move back to GraphicsMagick.
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.23-5
- Rebuilt for Python 3.9
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.23-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.23-3
- Rebuilt for Python 3.8
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.23-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu May 23 2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.23-1
- Bump to release 0.23.
* Tue May 14 2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.22.92-1
- Third release candidate for 0.23.
* Fri May 10 2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.22.90-1
- Release candidate for 0.23. Support for Gtk3 and GObject Introspection (GIR)
* Mon Apr 29 2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.22.2-1
- Update to 0.22.2: added support for Java 11
* Wed Feb 20 2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.22-1
- Bump to version 0.22: zbarcam-qt is now a full-featured application
* Tue Feb 12 2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.21-1
- Bump to version 0.21: d-bus and SQ code support, improved zbarcam-qt
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.20.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Jan 7 2019 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.20.1-4
- Disable python2 bindings due to pygtk2 orphaned package
* Thu Aug 9 2018 Hans de Goede <hdegoede@redhat.com> - 0.20.1-3
- Drop zbar_fedora29_hack_for_codegen_to_work.patch now that pygobject2 is
fixed (rhbz# 1606784)
- Use %%ldconfig_scriptlets so that we don't unnecessarily run ldconfig on F28+
* Wed Aug 08 2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.20.1-2
- Re-enable python2 bindings
* Wed Aug 08 2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.20.1-1
- Bump version to 0.20.1
* Tue Aug 07 2018 Mauro Carvalho Chehab <mchehab+samsung@kernel.org> - 0.20-8
- Fix python 2 dependencies
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.20-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 14 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.20-6
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.20-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.20-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.20-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue Apr 11 2017 Mauro Carvalho Chehab <mchehab@s-opensource.com> - 0.20-1
- Update it to version 0.20 with brings V4L2 controls to zbarcam-qt
* Sun Mar 26 2017 Mauro Carvalho Chehab <mchehab@s-opensource.com> - 0.10-29
- Make zbar-qt to use Qt5 and generate gtk and qt applications
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.10-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10-27
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
@ -279,7 +498,7 @@ rm -rf $RPM_BUILD_ROOT
- Removed ldconfig calls to devel subpackages
- Fixed directory ownership issue -pygtk
- Added %%{name} to URL
- Added comment to rpath
- Added comment to rpath
- Improved comment for removing .la and .a files
* Mon Jul 27 2009 Douglas Schilling Landgraf <dougsland@redhat.com> - 0.8-4
@ -289,7 +508,7 @@ rm -rf $RPM_BUILD_ROOT
- Removed Provides for not included static libs
- Removed redundant requires to subpackages -qt and -gtk
- Removed redundant {name} = %%{version}-%%{release} from -pygtk
- Replaced macros from % to %% in changelog
- Replaced macros from % to %% in changelog
- Fixed ownership issue
- Added ldconfig call to devel, qt-devel and gtk-devel
@ -316,8 +535,8 @@ rm -rf $RPM_BUILD_ROOT
- Fixed rpath error
* Thu Jul 16 2009 Douglas Schilling Landgraf <dougsland@redhat.com> - 0.8-2
- Added pkgconfig to devel package
- Fixed syntax to ldconfig
- Added pkgconfig to devel package
- Fixed syntax to ldconfig
- Fixed warnings from rpmlint
- Fixed static path to docs

View file

@ -1,128 +0,0 @@
diff -r 60f92d860a1f zbar/convert.c
--- a/zbar/convert.c Sat Dec 25 08:29:33 2010 -0200
+++ b/zbar/convert.c Sat Dec 25 14:36:04 2010 -0200
@@ -1157,6 +1157,42 @@
break;
}
}
+ if(!min_fmt && vdo->emu_formats) {
+ /* As vdo->formats aren't compatible, just free them */
+ free(vdo->formats);
+ vdo->formats = vdo->emu_formats;
+ vdo->emu_formats = NULL;
+
+ /*
+ * Use the same cost algorithm to select emulated formats.
+ * This might select a sub-optimal conversion, but, in practice,
+ * it will select a conversion to YUV at libv4l, and a YUY->Y8
+ * in zbar, with it is OK. Yet, it is better to not select the
+ * most performatic conversion than to not support the webcam.
+ */
+ for(fmt = _zbar_formats; *fmt; fmt++) {
+ /* only consider formats supported by video device */
+ uint32_t win_fmt = 0;
+ int cost;
+ if(!has_format(*fmt, srcs))
+ continue;
+ cost = _zbar_best_format(*fmt, &win_fmt, dsts);
+ if(cost < 0) {
+ zprintf(4, "%.4s(%08" PRIx32 ") -> ? (unsupported)\n",
+ (char*)fmt, *fmt);
+ continue;
+ }
+ zprintf(4, "%.4s(%08" PRIx32 ") -> %.4s(%08" PRIx32 ") (%d)\n",
+ (char*)fmt, *fmt, (char*)&win_fmt, win_fmt, cost);
+ if(min_cost > cost) {
+ min_cost = cost;
+ min_fmt = *fmt;
+ if(!cost)
+ break;
+ }
+ }
+ }
+
if(win)
(void)window_unlock(win);
diff -r 60f92d860a1f zbar/video.c
--- a/zbar/video.c Sat Dec 25 08:29:33 2010 -0200
+++ b/zbar/video.c Sat Dec 25 14:36:04 2010 -0200
@@ -111,6 +111,9 @@
free(vdo->buf);
if(vdo->formats)
free(vdo->formats);
+ if(vdo->emu_formats)
+ free(vdo->emu_formats);
+
err_cleanup(&vdo->err);
_zbar_mutex_destroy(&vdo->qlock);
diff -r 60f92d860a1f zbar/video.h
--- a/zbar/video.h Sat Dec 25 08:29:33 2010 -0200
+++ b/zbar/video.h Sat Dec 25 14:36:04 2010 -0200
@@ -69,6 +69,7 @@
uint32_t format; /* selected fourcc */
unsigned palette; /* v4l1 format index corresponding to format */
uint32_t *formats; /* 0 terminated list of supported formats */
+ uint32_t *emu_formats; /* 0 terminated list of emulated formats */
unsigned long datalen; /* size of image data for selected format */
unsigned long buflen; /* total size of image data buffer */
diff -r 60f92d860a1f zbar/video/v4l2.c
--- a/zbar/video/v4l2.c Sat Dec 25 08:29:33 2010 -0200
+++ b/zbar/video/v4l2.c Sat Dec 25 14:36:04 2010 -0200
@@ -347,6 +347,8 @@
static inline int v4l2_probe_formats (zbar_video_t *vdo)
{
+ int n_formats = 0, n_emu_formats = 0;
+
zprintf(2, "enumerating supported formats:\n");
struct v4l2_fmtdesc desc;
memset(&desc, 0, sizeof(desc));
@@ -354,17 +356,39 @@
for(desc.index = 0; desc.index < V4L2_FORMATS_MAX; desc.index++) {
if(v4l2_ioctl(vdo->fd, VIDIOC_ENUM_FMT, &desc) < 0)
break;
- zprintf(2, " [%d] %.4s : %s%s\n",
+ zprintf(2, " [%d] %.4s : %s%s%s\n",
desc.index, (char*)&desc.pixelformat, desc.description,
- (desc.flags & V4L2_FMT_FLAG_COMPRESSED) ? " COMPRESSED" : "");
- vdo->formats = realloc(vdo->formats,
- (desc.index + 2) * sizeof(uint32_t));
- vdo->formats[desc.index] = desc.pixelformat;
+ (desc.flags & V4L2_FMT_FLAG_COMPRESSED) ? " COMPRESSED" : "",
+ (desc.flags & V4L2_FMT_FLAG_EMULATED) ? " EMULATED" : "");
+ if (desc.flags & V4L2_FMT_FLAG_EMULATED) {
+ vdo->emu_formats = realloc(vdo->emu_formats,
+ (n_emu_formats + 2) * sizeof(uint32_t));
+ vdo->emu_formats[n_emu_formats++] = desc.pixelformat;
+ } else {
+ vdo->formats = realloc(vdo->formats,
+ (n_formats + 2) * sizeof(uint32_t));
+ vdo->formats[n_formats++] = desc.pixelformat;
+ }
}
if(!desc.index)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"enumerating video formats (VIDIOC_ENUM_FMT)"));
- vdo->formats[desc.index] = 0;
+ if(vdo->formats)
+ vdo->formats[n_formats] = 0;
+ if(vdo->emu_formats)
+ vdo->emu_formats[n_emu_formats] = 0;
+ if(!vdo->formats && vdo->emu_formats) {
+ /*
+ * If only emu formats are available, just move them to vdo->formats.
+ * This happens when libv4l detects that the only available fourcc
+ * formats are webcam proprietary formats or bayer formats.
+ */
+ vdo->formats = vdo->emu_formats;
+ vdo->emu_formats = NULL;
+ }
+
+ zprintf(2, "Found %d formats and %d emulated formats.\n",
+ n_formats, n_emu_formats);
struct v4l2_format fmt;
struct v4l2_pix_format *pix = &fmt.fmt.pix;

View file

@ -1,11 +0,0 @@
--- a/configure.ac 2015-08-14 16:26:09.661856984 -0300
+++ b/configure.ac 2015-08-14 16:26:20.209851076 -0300
@@ -4,7 +4,7 @@
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
AM_INIT_AUTOMAKE([1.10 -Werror foreign subdir-objects std-options dist-bzip2])
-AM_PROG_AR
+m4_pattern_allow([AM_PROG_AR])
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_SRCDIR(zbar/scanner.c)
LT_PREREQ([2.2])

File diff suppressed because it is too large Load diff

View file

@ -1,124 +0,0 @@
From a8ed8c04c119e5a323a2c79fcd0d28b4d29fc28a Mon Sep 17 00:00:00 2001
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Date: Thu, 23 Apr 2015 22:56:09 -0300
Subject: [PATCH] v4l2: use REQBUFS properly
There are two issues on this driver with regards to buffer
request:
1) it is not calling VIDIOC_REQBUFS for USERPTR;
2) It is calling VIDIOC_REQBUFS at probe, to check the max
number of supported buffers, but it doesn't deallocate
the buffers at the end of the probe function.
Fix those issues. Also, improve the error/warning messages
associated with possible problems.
This is based on the issues detected by the patch proposed
to fix this bug:
https://bugs.archlinux.org/task/44091
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
diff --git a/zbar/video/v4l2.c b/zbar/video/v4l2.c
index aabd16643ddc..f6662d3707f9 100644
--- a/zbar/video/v4l2.c
+++ b/zbar/video/v4l2.c
@@ -201,21 +201,6 @@ static int v4l2_cleanup (zbar_video_t *vdo)
static int v4l2_mmap_buffers (zbar_video_t *vdo)
{
- struct v4l2_requestbuffers rb;
- memset(&rb, 0, sizeof(rb));
- rb.count = vdo->num_images;
- rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- rb.memory = V4L2_MEMORY_MMAP;
- if(v4l2_ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0)
- return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
- "requesting video frame buffers (VIDIOC_REQBUFS)"));
- zprintf(1, "mapping %u buffers (of %d requested)\n",
- rb.count, vdo->num_images);
- if(!rb.count)
- return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__,
- "driver returned 0 buffers"));
- if(vdo->num_images > rb.count)
- vdo->num_images = rb.count;
struct v4l2_buffer vbuf;
memset(&vbuf, 0, sizeof(vbuf));
@@ -313,8 +298,32 @@ static int v4l2_set_format (zbar_video_t *vdo,
static int v4l2_init (zbar_video_t *vdo,
uint32_t fmt)
{
+ struct v4l2_requestbuffers rb;
if(v4l2_set_format(vdo, fmt))
return(-1);
+
+ memset(&rb, 0, sizeof(rb));
+ rb.count = vdo->num_images;
+ rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if(vdo->iomode == VIDEO_MMAP)
+ rb.memory = V4L2_MEMORY_MMAP;
+ else
+ rb.memory = V4L2_MEMORY_USERPTR;
+
+ if(v4l2_ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0)
+ return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
+ "requesting video frame buffers (VIDIOC_REQBUFS)"));
+
+ if(!rb.count)
+ return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__,
+ "driver returned 0 buffers"));
+
+ if(vdo->num_images > rb.count)
+ vdo->num_images = rb.count;
+
+ zprintf(1, "using %u buffers (of %d requested)\n",
+ rb.count, vdo->num_images);
+
if(vdo->iomode == VIDEO_MMAP)
return(v4l2_mmap_buffers(vdo));
return(0);
@@ -324,7 +333,7 @@ static int v4l2_probe_iomode (zbar_video_t *vdo)
{
struct v4l2_requestbuffers rb;
memset(&rb, 0, sizeof(rb));
- rb.count = vdo->num_images; /* FIXME workaround broken drivers */
+ rb.count = vdo->num_images;
rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if(vdo->iomode == VIDEO_MMAP)
rb.memory = V4L2_MEMORY_MMAP;
@@ -340,14 +349,31 @@ static int v4l2_probe_iomode (zbar_video_t *vdo)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"querying streaming mode (VIDIOC_REQBUFS)"));
#ifdef HAVE_SYS_MMAN_H
+ err_capture(vdo, SEV_WARNING, ZBAR_ERR_SYSTEM, __func__,
+ "USERPTR failed. Falling back to mmap");
vdo->iomode = VIDEO_MMAP;
+#else
+ return err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
+ "Userptr not supported, and zbar was compiled without mmap support"));
#endif
}
else {
if(!vdo->iomode)
- vdo->iomode = VIDEO_USERPTR;
+ rb.memory = V4L2_MEMORY_USERPTR;
+ /* Update the num_images with the max supported by the driver */
if(rb.count)
vdo->num_images = rb.count;
+ else
+ err_capture(vdo, SEV_WARNING, ZBAR_ERR_SYSTEM, __func__,
+ "Something is wrong: number of buffers returned by REQBUF is zero!");
+
+ /* requesting 0 buffers
+ * This cleans up the buffers allocated previously on probe
+ */
+ rb.count = 0;
+ if(v4l2_ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0)
+ err_capture(vdo, SEV_WARNING, ZBAR_ERR_SYSTEM, __func__,
+ "releasing video frame buffers (VIDIOC_REQBUFS)");
}
return(0);
}

View file

@ -1,305 +0,0 @@
diff -r 38e78368283d configure.ac
--- a/configure.ac Sun Oct 14 23:02:08 2012 -0700
+++ b/configure.ac Fri Feb 22 10:04:52 2013 -0300
@@ -3,7 +3,8 @@
AC_INIT([zbar], [0.10], [spadix@users.sourceforge.net])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(config)
-AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects std-options dist-bzip2])
+AM_INIT_AUTOMAKE([1.10 -Werror foreign subdir-objects std-options dist-bzip2])
+AM_PROG_AR
AC_CONFIG_HEADERS([include/config.h])
AC_CONFIG_SRCDIR(zbar/scanner.c)
LT_PREREQ([2.2])
@@ -47,7 +48,7 @@
[Library revision])
AM_CPPFLAGS="-I$srcdir/include"
-AM_CFLAGS="-Wall -Wno-parentheses -Werror"
+AM_CFLAGS="-Wall -Wno-parentheses"
AM_CXXFLAGS="$AM_CFLAGS"
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_CFLAGS])
@@ -179,11 +180,13 @@
have_v4l1="no"
have_v4l2="no"
+have_libv4l="no"
AS_IF([test "x$enable_video" = "xno"],
[],
[test "x$win32" = "xno"],
[AC_CHECK_HEADERS([linux/videodev.h], [have_v4l1="yes"])
AC_CHECK_HEADERS([linux/videodev2.h], [have_v4l2="yes"])
+ AC_CHECK_HEADERS([libv4l2.h], [have_libv4l="yes"])
AS_IF([test "x$have_v4l2" = "xno" && test "x$have_v4l1" = "xno"],
[AC_MSG_FAILURE([test for video support failed!
rebuild your kernel to include video4linux support or
@@ -194,9 +197,15 @@
[AC_MSG_FAILURE([test for VfW video support failed!
configure --disable-video to skip building video support.])])])
+AS_IF([test "x$have_libv4l" = "xyes"],
+ AC_CHECK_LIB([v4l2], [v4l2_open], [],
+ [AC_MSG_FAILURE([unable to find libv4l.so])]),
+ [AC_MSG_WARN([libv4l not detected. Install it to support more cameras!])])
+
AM_CONDITIONAL([HAVE_VIDEO], [test "x$enable_video" != "xno"])
AM_CONDITIONAL([HAVE_V4L1], [test "x$have_v4l1" != "xno"])
AM_CONDITIONAL([HAVE_V4L2], [test "x$have_v4l2" != "xno"])
+AM_CONDITIONAL([HAVE_LIBV4L], [test "x$have_libv4l" != "xno"])
dnl X
AC_ARG_VAR([XSHM_LIBS], [linker flags for X shared memory extension])
@@ -571,6 +580,8 @@
echo "v4l --enable-video=$enable_video"
AS_IF([test "x$enable_video" != "xyes"],
[echo " => zbarcam video scanner will *NOT* be built"])
+AS_IF([test "x$have_libv4l" != "xyes"],
+ [echo " => libv4l will *NOT* be used"])
echo "jpeg --with-jpeg=$with_jpeg"
AS_IF([test "x$with_jpeg" != "xyes"],
[echo " => JPEG image conversions will *NOT* be supported"])
diff -r 38e78368283d zbar/video/v4l.c
--- a/zbar/video/v4l.c Sun Oct 14 23:02:08 2012 -0700
+++ b/zbar/video/v4l.c Fri Feb 22 10:04:52 2013 -0300
@@ -34,6 +34,13 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
+#ifdef HAVE_LIBV4L2_H
+# include <fcntl.h>
+# include <libv4l2.h>
+#else
+# define v4l2_open open
+# define v4l2_close close
+#endif
#include "video.h"
@@ -43,7 +50,7 @@
int _zbar_video_open (zbar_video_t *vdo,
const char *dev)
{
- vdo->fd = open(dev, O_RDWR);
+ vdo->fd = v4l2_open(dev, O_RDWR);
if(vdo->fd < 0)
return(err_capture_str(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"opening video device '%s'", dev));
@@ -60,7 +67,7 @@
#endif
if(rc && vdo->fd >= 0) {
- close(vdo->fd);
+ v4l2_close(vdo->fd);
vdo->fd = -1;
}
return(rc);
diff -r 38e78368283d zbar/video/v4l2.c
--- a/zbar/video/v4l2.c Sun Oct 14 23:02:08 2012 -0700
+++ b/zbar/video/v4l2.c Fri Feb 22 10:04:52 2013 -0300
@@ -38,6 +38,15 @@
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif
+#ifdef HAVE_LIBV4L2_H
+# include <fcntl.h>
+# include <libv4l2.h>
+#else
+# define v4l2_close close
+# define v4l2_ioctl ioctl
+# define v4l2_mmap mmap
+# define v4l2_munmap munmap
+#endif
#include <linux/videodev2.h>
#include "video.h"
@@ -67,7 +76,7 @@
vbuf.length = img->datalen;
vbuf.index = img->srcidx; /* FIXME workaround broken drivers */
}
- if(ioctl(vdo->fd, VIDIOC_QBUF, &vbuf) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_QBUF, &vbuf) < 0)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"queuing video buffer (VIDIOC_QBUF)"));
return(0);
@@ -91,7 +100,7 @@
else
vbuf.memory = V4L2_MEMORY_USERPTR;
- if(ioctl(fd, VIDIOC_DQBUF, &vbuf) < 0)
+ if(v4l2_ioctl(fd, VIDIOC_DQBUF, &vbuf) < 0)
return(NULL);
if(iomode == VIDEO_MMAP) {
@@ -132,7 +141,7 @@
return(0);
enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if(ioctl(vdo->fd, VIDIOC_STREAMON, &type) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_STREAMON, &type) < 0)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"starting video stream (VIDIOC_STREAMON)"));
return(0);
@@ -144,7 +153,7 @@
return(0);
enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if(ioctl(vdo->fd, VIDIOC_STREAMOFF, &type) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_STREAMOFF, &type) < 0)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"stopping video stream (VIDIOC_STREAMOFF)"));
return(0);
@@ -164,7 +173,7 @@
for(i = 0; i < vdo->num_images; i++) {
zbar_image_t *img = vdo->images[i];
if(img->data &&
- munmap((void*)img->data, img->datalen))
+ v4l2_munmap((void*)img->data, img->datalen))
err_capture(vdo, SEV_WARNING, ZBAR_ERR_SYSTEM, __func__,
"unmapping video frame buffers");
img->data = NULL;
@@ -177,14 +186,14 @@
/* requesting 0 buffers
* should implicitly disable streaming
*/
- if(ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0)
err_capture(vdo, SEV_WARNING, ZBAR_ERR_SYSTEM, __func__,
"releasing video frame buffers (VIDIOC_REQBUFS)");
- /* close open device */
+ /* v4l2_close v4l2_open device */
if(vdo->fd >= 0) {
- close(vdo->fd);
+ v4l2_close(vdo->fd);
vdo->fd = -1;
}
return(0);
@@ -197,7 +206,7 @@
rb.count = vdo->num_images;
rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
rb.memory = V4L2_MEMORY_MMAP;
- if(ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"requesting video frame buffers (VIDIOC_REQBUFS)"));
zprintf(1, "mapping %u buffers (of %d requested)\n",
@@ -216,7 +225,7 @@
int i;
for(i = 0; i < vdo->num_images; i++) {
vbuf.index = i;
- if(ioctl(vdo->fd, VIDIOC_QUERYBUF, &vbuf) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_QUERYBUF, &vbuf) < 0)
/* FIXME cleanup */
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"querying video buffer (VIDIOC_QUERYBUF)"));
@@ -229,7 +238,7 @@
zbar_image_t *img = vdo->images[i];
img->datalen = vbuf.length;
- img->data = mmap(NULL, vbuf.length, PROT_READ | PROT_WRITE, MAP_SHARED,
+ img->data = v4l2_mmap(NULL, vbuf.length, PROT_READ | PROT_WRITE, MAP_SHARED,
vdo->fd, vbuf.m.offset);
if(img->data == MAP_FAILED)
/* FIXME cleanup */
@@ -253,7 +262,7 @@
vpix->pixelformat = fmt;
vpix->field = V4L2_FIELD_NONE;
int rc = 0;
- if((rc = ioctl(vdo->fd, VIDIOC_S_FMT, &vfmt)) < 0) {
+ if((rc = v4l2_ioctl(vdo->fd, VIDIOC_S_FMT, &vfmt)) < 0) {
/* several broken drivers return an error if we request
* no interlacing (NB v4l2 spec violation)
* ...try again with an interlaced request
@@ -264,7 +273,7 @@
/* FIXME this might be _ANY once we can de-interlace */
vpix->field = V4L2_FIELD_INTERLACED;
- if(ioctl(vdo->fd, VIDIOC_S_FMT, &vfmt) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_S_FMT, &vfmt) < 0)
return(err_capture_int(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"setting format %x (VIDIOC_S_FMT)", fmt));
@@ -276,7 +285,7 @@
struct v4l2_pix_format *newpix = &newfmt.fmt.pix;
memset(&newfmt, 0, sizeof(newfmt));
newfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if(ioctl(vdo->fd, VIDIOC_G_FMT, &newfmt) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_G_FMT, &newfmt) < 0)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"querying format (VIDIOC_G_FMT)"));
@@ -322,7 +331,7 @@
else
rb.memory = V4L2_MEMORY_USERPTR;
- if(ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0) {
+ if(v4l2_ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0) {
if(vdo->iomode)
return(err_capture_int(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__,
"unsupported iomode requested (%d)",
@@ -350,7 +359,7 @@
memset(&desc, 0, sizeof(desc));
desc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
for(desc.index = 0; desc.index < V4L2_FORMATS_MAX; desc.index++) {
- if(ioctl(vdo->fd, VIDIOC_ENUM_FMT, &desc) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_ENUM_FMT, &desc) < 0)
break;
zprintf(2, " [%d] %.4s : %s%s\n",
desc.index, (char*)&desc.pixelformat, desc.description,
@@ -368,7 +377,7 @@
struct v4l2_pix_format *pix = &fmt.fmt.pix;
memset(&fmt, 0, sizeof(fmt));
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if(ioctl(vdo->fd, VIDIOC_G_FMT, &fmt) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_G_FMT, &fmt) < 0)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"querying current video format (VIDIO_G_FMT)"));
@@ -390,15 +399,15 @@
maxpix->height = vdo->height;
zprintf(1, "setting requested size: %d x %d\n", vdo->width, vdo->height);
- if(ioctl(vdo->fd, VIDIOC_S_FMT, &maxfmt) < 0) {
+ if(v4l2_ioctl(vdo->fd, VIDIOC_S_FMT, &maxfmt) < 0) {
zprintf(1, "set FAILED...trying to recover original format\n");
/* ignore errors (driver broken anyway) */
- ioctl(vdo->fd, VIDIOC_S_FMT, &fmt);
+ v4l2_ioctl(vdo->fd, VIDIOC_S_FMT, &fmt);
}
memset(&fmt, 0, sizeof(fmt));
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if(ioctl(vdo->fd, VIDIOC_G_FMT, &fmt) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_G_FMT, &fmt) < 0)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"querying current video format (VIDIOC_G_FMT)"));
@@ -420,7 +429,7 @@
struct v4l2_cropcap ccap;
memset(&ccap, 0, sizeof(ccap));
ccap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if(ioctl(vdo->fd, VIDIOC_CROPCAP, &ccap) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_CROPCAP, &ccap) < 0)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"querying crop support (VIDIOC_CROPCAP)"));
@@ -442,7 +451,7 @@
memset(&crop, 0, sizeof(crop));
crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
crop.c = ccap.defrect;
- if(ioctl(vdo->fd, VIDIOC_S_CROP, &crop) < 0 && errno != EINVAL)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_S_CROP, &crop) < 0 && errno != EINVAL)
return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
"setting default crop window (VIDIOC_S_CROP)"));
return(0);
@@ -453,7 +462,7 @@
/* check capabilities */
struct v4l2_capability vcap;
memset(&vcap, 0, sizeof(vcap));
- if(ioctl(vdo->fd, VIDIOC_QUERYCAP, &vcap) < 0)
+ if(v4l2_ioctl(vdo->fd, VIDIOC_QUERYCAP, &vcap) < 0)
return(err_capture(vdo, SEV_WARNING, ZBAR_ERR_UNSUPPORTED, __func__,
"video4linux version 2 not supported (VIDIOC_QUERYCAP)"));