From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 591AF1386F2 for ; Mon, 10 Aug 2015 23:06:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A4CDB957D9; Mon, 10 Aug 2015 23:06:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3C28A957D9 for ; Mon, 10 Aug 2015 23:06:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0A22C340A67 for ; Mon, 10 Aug 2015 23:06:06 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8FBA112C for ; Mon, 10 Aug 2015 23:06:04 +0000 (UTC) From: "Michael Weber" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Weber" Message-ID: <1439247957.6bb3d1e8458fc0872b4d01349fcb8e74e02f3566.xmw@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/zbar/, media-gfx/zbar/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-gfx/zbar/files/zbar-0.10-v4l2-uvcvideo.patch media-gfx/zbar/zbar-0.10-r5.ebuild media-gfx/zbar/zbar-0.10_p20121015.ebuild X-VCS-Directories: media-gfx/zbar/files/ media-gfx/zbar/ X-VCS-Committer: xmw X-VCS-Committer-Name: Michael Weber X-VCS-Revision: 6bb3d1e8458fc0872b4d01349fcb8e74e02f3566 X-VCS-Branch: master Date: Mon, 10 Aug 2015 23:06:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 93c7f6e3-c5e8-435a-ab56-2b53dc65659b X-Archives-Hash: 8fba38285fc1c487502d1c0d6c88e344 commit: 6bb3d1e8458fc0872b4d01349fcb8e74e02f3566 Author: Michael Weber gentoo org> AuthorDate: Mon Aug 10 23:05:44 2015 +0000 Commit: Michael Weber gentoo org> CommitDate: Mon Aug 10 23:05:57 2015 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6bb3d1e8 media-gfx/zbar: fix UVC webcam compatibility (bug 548034, thanks Scott Alfter). Package-Manager: portage-2.2.20 media-gfx/zbar/files/zbar-0.10-v4l2-uvcvideo.patch | 49 ++++++++++++++++++++++ media-gfx/zbar/zbar-0.10-r5.ebuild | 7 ++-- media-gfx/zbar/zbar-0.10_p20121015.ebuild | 6 +-- 3 files changed, 56 insertions(+), 6 deletions(-) diff --git a/media-gfx/zbar/files/zbar-0.10-v4l2-uvcvideo.patch b/media-gfx/zbar/files/zbar-0.10-v4l2-uvcvideo.patch new file mode 100644 index 0000000..4fde95e --- /dev/null +++ b/media-gfx/zbar/files/zbar-0.10-v4l2-uvcvideo.patch @@ -0,0 +1,49 @@ +--- zbar-0.10/zbar/video/v4l2.c 2009-10-23 18:16:44.000000000 +0000 ++++ zbar-0.10/zbar/video/v4l2.c 2015-03-07 05:46:36.000000000 +0000 +@@ -241,6 +241,21 @@ + 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(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) + { +@@ -308,6 +323,8 @@ + return(-1); + if(vdo->iomode == VIDEO_MMAP) + return(v4l2_mmap_buffers(vdo)); ++ if(vdo->iomode == VIDEO_USERPTR) ++ return(v4l2_request_buffers(vdo)); + return(0); + } + +@@ -337,8 +354,13 @@ + else { + if(!vdo->iomode) + vdo->iomode = VIDEO_USERPTR; +- if(rb.count) +- vdo->num_images = rb.count; ++ /* releasing buffers ++ * lest the driver may later refuse to change format ++ */ ++ rb.count = 0; ++ if (ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0) ++ zprintf(0, "WARNING: releasing video buffers failed: error %d\n", ++ errno); + } + return(0); + } diff --git a/media-gfx/zbar/zbar-0.10-r5.ebuild b/media-gfx/zbar/zbar-0.10-r5.ebuild index 96d5787..c9873c2 100644 --- a/media-gfx/zbar/zbar-0.10-r5.ebuild +++ b/media-gfx/zbar/zbar-0.10-r5.ebuild @@ -38,9 +38,10 @@ pkg_setup() { } src_prepare() { - epatch "${FILESDIR}"/${P}-no-v4l1-check.patch - epatch "${FILESDIR}"/${P}-errors.patch - epatch "${FILESDIR}"/${P}-python-crash.patch + epatch "${FILESDIR}"/${P}-no-v4l1-check.patch \ + "${FILESDIR}"/${P}-errors.patch \ + "${FILESDIR}"/${P}-python-crash.patch \ + "${FILESDIR}"/${P}-v4l2-uvcvideo.patch use python && python_fix_shebang examples/upcrpc.py test/*.py diff --git a/media-gfx/zbar/zbar-0.10_p20121015.ebuild b/media-gfx/zbar/zbar-0.10_p20121015.ebuild index 7beedc9..c6f6de1 100644 --- a/media-gfx/zbar/zbar-0.10_p20121015.ebuild +++ b/media-gfx/zbar/zbar-0.10_p20121015.ebuild @@ -44,9 +44,9 @@ src_unpack() { } src_prepare() { - #epatch "${FILESDIR}"/${P}-no-v4l1-check.patch - epatch "${FILESDIR}"/${PN}-0.10-errors.patch - epatch "${FILESDIR}"/${PN}-0.10-python-crash.patch + epatch "${FILESDIR}"/${PN}-0.10-errors.patch \ + "${FILESDIR}"/${PN}-0.10-python-crash.patch \ + "${FILESDIR}"/${PN}-0.10-v4l2-uvcvideo.patch use python && python_fix_shebang examples/upcrpc.py test/*.py