From owner-dev-commits-ports-all@freebsd.org Wed Apr 21 15:54:01 2021 Return-Path: Delivered-To: dev-commits-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF00B5E9E87; Wed, 21 Apr 2021 15:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FQQ8T5YP7z3kTZ; Wed, 21 Apr 2021 15:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A80EFE15; Wed, 21 Apr 2021 15:54:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13LFs1Au057238; Wed, 21 Apr 2021 15:54:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13LFs1oo057237; Wed, 21 Apr 2021 15:54:01 GMT (envelope-from git) Date: Wed, 21 Apr 2021 15:54:01 GMT Message-Id: <202104211554.13LFs1oo057237@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 3a28080660e5 - main - multimedia/libv4l: Add upstream patch to make the v4l2-ctl utility more useful. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a28080660e54a820fd7eedfae8ec768945d223c Auto-Submitted: auto-generated X-BeenThere: dev-commits-ports-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the ports repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2021 15:54:01 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/ports/commit/?id=3a28080660e54a820fd7eedfae8ec768945d223c commit 3a28080660e54a820fd7eedfae8ec768945d223c Author: Hans Petter Selasky AuthorDate: 2021-04-21 15:49:00 +0000 Commit: Hans Petter Selasky CommitDate: 2021-04-21 15:51:47 +0000 multimedia/libv4l: Add upstream patch to make the v4l2-ctl utility more useful. Submitted by: Trenton Schulz Approved by: pi (implicit) --- multimedia/libv4l/Makefile | 1 + .../libv4l/files/patch-utils_common_media-info.cpp | 46 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/multimedia/libv4l/Makefile b/multimedia/libv4l/Makefile index f89b670b9516..e24c4033c92c 100644 --- a/multimedia/libv4l/Makefile +++ b/multimedia/libv4l/Makefile @@ -3,6 +3,7 @@ PORTNAME?= libv4l PORTVERSION= 1.20.0 +PORTREVISION= 1 DISTVERSIONPREFIX= v4l-utils- CATEGORIES= multimedia diff --git a/multimedia/libv4l/files/patch-utils_common_media-info.cpp b/multimedia/libv4l/files/patch-utils_common_media-info.cpp new file mode 100644 index 000000000000..f4c3dc6a306d --- /dev/null +++ b/multimedia/libv4l/files/patch-utils_common_media-info.cpp @@ -0,0 +1,46 @@ +--- utils/common/media-info.cpp.orig 2020-05-21 11:22:05 UTC ++++ utils/common/media-info.cpp +@@ -24,6 +24,10 @@ + #include + #include + #include ++#ifndef __linux__ ++#include ++#include ++#endif + + static std::string num2s(unsigned num, bool is_hex = true) + { +@@ -61,7 +65,7 @@ media_type mi_media_detect_type(const char *device) + + if (stat(device, &sb) == -1) + return MEDIA_TYPE_CANT_STAT; +- ++#ifdef __linux__ + std::string uevent_path("/sys/dev/char/"); + + uevent_path += num2s(major(sb.st_rdev), false) + ":" + +@@ -97,6 +101,23 @@ media_type mi_media_detect_type(const char *device) + } + + uevent_file.close(); ++#else // Not Linux ++ int fd = open(device, O_RDONLY); ++ if (fd >= 0) { ++ struct v4l2_capability caps; ++ int error = ioctl(fd, VIDIOC_QUERYCAP, &caps); ++ close(fd); ++ if (error == 0) { ++ if (caps.device_caps & V4L2_CAP_VIDEO_CAPTURE) { ++ return MEDIA_TYPE_VIDEO; ++ } else if (caps.device_caps & V4L2_CAP_VBI_CAPTURE) { ++ return MEDIA_TYPE_VBI; ++ } else if (caps.device_caps & V4L2_CAP_RADIO) { ++ return MEDIA_TYPE_RADIO; ++ } ++ } ++ } ++#endif + return MEDIA_TYPE_UNKNOWN; + } +