Skip to contentSkip to conversation

Fix autoreconf by reducing the warning/error checking

PATCH Applied [email protected] 2 participants 8 messages Jan 13, 2019 – Jan 14, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 Fix autoreconf by reducing the warning/error checking

From: Thomas Petazzoni <[email protected]>

---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
index a03d10e..6476a20 100644
@@ -5,7 +5,7 @@ m4_ifndef([AC_LANG_DEFINES_PROVIDED],
           [m4_define([AC_LANG_DEFINES_PROVIDED])])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(config)
-AM_INIT_AUTOMAKE([1.13 -Werror foreign subdir-objects std-options dist-bzip2])
+AM_INIT_AUTOMAKE([1.13 foreign subdir-objects std-options dist-bzip2])
 m4_pattern_allow([AM_PROG_AR])
 AC_CONFIG_HEADERS([include/config.h])
 AC_CONFIG_SRCDIR(zbar/scanner.c)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/5 Fix function protoype to be compatible with recent libjpeg

From: Viacheslav Volkov <[email protected]>

---
 zbar/jpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
zbar/jpeg.c +1 -1
index 972bfea..fdd1619 100644
@@ -68,7 +68,7 @@ void init_source (j_decompress_ptr cinfo)
     cinfo->src->bytes_in_buffer = img->datalen;
 }
 
-int fill_input_buffer (j_decompress_ptr cinfo)
+boolean fill_input_buffer (j_decompress_ptr cinfo)
 {
     /* buffer underrun error case */
     cinfo->src->next_input_byte = fake_eoi;
Signature · 1 line
2.7.4
#2 lore raw

PATCH 3/5 Add --disable-doc configure option to disable building docs

In reply to [email protected]

From: James Hilliard <[email protected]>

---
 Makefile.am  |  2 ++
 configure.ac | 10 ++++++++++
 2 files changed, 12 insertions(+)
Makefile.am +2 -0
index df3d79d..b4cae8a 100644
@@ -45,7 +45,9 @@ if HAVE_NPAPI
 include $(srcdir)/plugin/Makefile.am.inc
 endif
 include $(srcdir)/test/Makefile.am.inc
+if HAVE_DOC
 include $(srcdir)/doc/Makefile.am.inc
+endif
 
 EXTRA_DIST += zbar.ico zbar.nsi
 
configure.ac +10 -0
index 6476a20..afccc3a 100644
@@ -177,6 +177,15 @@ or configure --disable-pthread to skip threaded support.])])
    AC_DEFINE([__USE_UNIX98], [1], [used only for pthread debug attributes])
 ])
 
+dnl doc
+AC_ARG_ENABLE([doc],
+  [AS_HELP_STRING([--disable-doc],
+    [disable building docs])],
+  [],
+  [enable_doc="yes"])
+
+AM_CONDITIONAL([HAVE_DOC], [test "x$enable_doc" != "xno"])
+
 dnl video
 AC_ARG_ENABLE([video],
   [AS_HELP_STRING([--disable-video],
@@ -602,6 +611,7 @@ echo "please verify that the detected configuration matches your expectations:"
 echo "------------------------------------------------------------------------"
 echo "X                 --with-x=$have_x"
 echo "pthreads          --enable-pthread=$enable_pthread"
+echo "doc               --enable-doc=$enable_doc"
 echo "v4l               --enable-video=$enable_video"
 AS_IF([test "x$enable_video" != "xyes"],
   [echo "        => zbarcam video scanner will *NOT* be built"])
Signature · 1 line
2.7.4
#3 lore raw

PATCH 4/5 Ignore ENOTTY errors when calling VIDIOC_S_CROP

In reply to [email protected]

From: James Hilliard <[email protected]>

Silences this error:
ERROR: zbar video in v4l2_reset_crop():
system error: setting default crop window (VIDIOC_S_CROP): Inappropriate ioctl for device (25)

---
 zbar/video/v4l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
zbar/video/v4l2.c +1 -1
index 1d685e9..ad6adf4 100644
@@ -569,7 +569,7 @@ static inline int v4l2_reset_crop (zbar_video_t *vdo)
     memset(&crop, 0, sizeof(crop));
     crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
     crop.c = ccap.defrect;
-    if(v4l2_ioctl(vdo->fd, VIDIOC_S_CROP, &crop) < 0 && errno != EINVAL)
+    if(v4l2_ioctl(vdo->fd, VIDIOC_S_CROP, &crop) < 0 && errno != EINVAL && errno != ENOTTY)
         return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__,
                            "setting default crop window (VIDIOC_S_CROP)"));
     return(0);
Signature · 1 line
2.7.4
#4 lore raw

PATCH 5/5 release video buffers after probing and request them again when needed

In reply to [email protected]

From: James Hilliard <[email protected]>

Patch adapted from https://bugs.archlinux.org/task/44091

---
 zbar/video/v4l2.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
zbar/video/v4l2.c +17 -0
index ad6adf4..ca52e4c 100644
@@ -243,6 +243,21 @@ static int v4l2_mmap_buffers (zbar_video_t *vdo)
     return(0);
 }
 
+static int v4l2_request_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_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)
+        vdo->num_images = rb.count;
+    return(0);
+}
+
 static int v4l2_set_format (zbar_video_t *vdo,
                             uint32_t fmt)
 {
@@ -334,6 +349,8 @@ static int v4l2_init (zbar_video_t *vdo,
 
     if(vdo->iomode == VIDEO_MMAP)
         return(v4l2_mmap_buffers(vdo));
+    if(vdo->iomode == VIDEO_USERPTR)
+        return(v4l2_request_buffers(vdo));
     return(0);
 }
 
Signature · 1 line
2.7.4
#5 lore raw
In reply to [email protected]

Hi James,

Em Mon, 14 Jan 2019 07:38:25 +0800
[email protected] escreveu:

Quoted 2 lines

From: Thomas Petazzoni <[email protected]>

Please add description to the patches. It helps reviewing them, and, if we need to revert it for whatever reason in the future, the git log will help to take into account the rationale about why the change was needed in the first place.

Quoted 11 lines
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +0 -0
index a03d10e..6476a20 100644

configure.ac m4_ifndef([AC_LANG_DEFINES_PROVIDED], · line 11

Quoted 8 lines
configure.ac +1 -1
@@ -5,7 +5,7 @@ m4_ifndef([AC_LANG_DEFINES_PROVIDED],
           [m4_define([AC_LANG_DEFINES_PROVIDED])])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(config)
-AM_INIT_AUTOMAKE([1.13 -Werror foreign subdir-objects std-options dist-bzip2])
+AM_INIT_AUTOMAKE([1.13 foreign subdir-objects std-options dist-bzip2])
 m4_pattern_allow([AM_PROG_AR])
 AC_CONFIG_HEADERS([include/config.h])
 AC_CONFIG_SRCDIR(zbar/scanner.c)

I applied patches 2 to 5 of this series, but I would prefer to keep the -Werror here, as it helps to identify and fix potential issues.

Here (Fedora 29), everything builds fine, but I haven't test on other distros that could have newer packages.

Why is this patch needed?

Regards,
Mauro

Thanks,
Mauro

#6 lore raw
Quoted 37 lines · Mauro Carvalho Chehab

Hi James,

Em Mon, 14 Jan 2019 07:38:25 +0800
[email protected] escreveu:

Quoted 2 lines

From: Thomas Petazzoni <[email protected]>

Please add description to the patches. It helps reviewing them, and, if we need to revert it for whatever reason in the future, the git log will help to take into account the rationale about why the change was needed in the first place.

Quoted 11 lines
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +0 -0
index a03d10e..6476a20 100644

configure.ac m4_ifndef([AC_LANG_DEFINES_PROVIDED], · line 11

Quoted 8 lines
configure.ac +1 -1
@@ -5,7 +5,7 @@ m4_ifndef([AC_LANG_DEFINES_PROVIDED],
           [m4_define([AC_LANG_DEFINES_PROVIDED])])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(config)
-AM_INIT_AUTOMAKE([1.13 -Werror foreign subdir-objects std-options dist-bzip2])
+AM_INIT_AUTOMAKE([1.13 foreign subdir-objects std-options dist-bzip2])
 m4_pattern_allow([AM_PROG_AR])
 AC_CONFIG_HEADERS([include/config.h])
 AC_CONFIG_SRCDIR(zbar/scanner.c)

I applied patches 2 to 5 of this series, but I would prefer to keep the -Werror here, as it helps to identify and fix potential issues.

Quoted 4 lines

Here (Fedora 29), everything builds fine, but I haven't test on other distros that could have newer packages.

Why is this patch needed?

It was part of buildroot's zbar patches, not sure if it's needed though anymore.

Quoted 6 lines

Regards,
Mauro

Thanks,
Mauro

#7 lore raw

Em Mon, 14 Jan 2019 05:26:42 -0700
James Hilliard <[email protected]> escreveu:

Quoted 39 lines
Quoted 37 lines · Mauro Carvalho Chehab

Hi James,

Em Mon, 14 Jan 2019 07:38:25 +0800
[email protected] escreveu:

Quoted 2 lines

From: Thomas Petazzoni <[email protected]>

Please add description to the patches. It helps reviewing them, and, if we need to revert it for whatever reason in the future, the git log will help to take into account the rationale about why the change was needed in the first place.

Quoted 11 lines
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +0 -0
index a03d10e..6476a20 100644

configure.ac m4_ifndef([AC_LANG_DEFINES_PROVIDED], · line 11

Quoted 8 lines
configure.ac +1 -1
@@ -5,7 +5,7 @@ m4_ifndef([AC_LANG_DEFINES_PROVIDED],
           [m4_define([AC_LANG_DEFINES_PROVIDED])])
 AC_CONFIG_AUX_DIR(config)
 AC_CONFIG_MACRO_DIR(config)
-AM_INIT_AUTOMAKE([1.13 -Werror foreign subdir-objects std-options dist-bzip2])
+AM_INIT_AUTOMAKE([1.13 foreign subdir-objects std-options dist-bzip2])
 m4_pattern_allow([AM_PROG_AR])
 AC_CONFIG_HEADERS([include/config.h])
 AC_CONFIG_SRCDIR(zbar/scanner.c)  

I applied patches 2 to 5 of this series, but I would prefer to keep the -Werror here, as it helps to identify and fix potential issues.

Quoted 5 lines
Quoted 4 lines

Here (Fedora 29), everything builds fine, but I haven't test on other distros that could have newer packages.

Why is this patch needed?

It was part of buildroot's zbar patches, not sure if it's needed though anymore.

Ok. Let's keep it without this patch. If you find any warning causing buildroot to fail, feel free to send us a patch fixing it.

Thanks!
Mauro