From owner-svn-ports-all@FreeBSD.ORG Wed Mar 18 05:54:29 2015 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74BADA22; Wed, 18 Mar 2015 05:54:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56646DB4; Wed, 18 Mar 2015 05:54:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2I5sTgJ060598; Wed, 18 Mar 2015 05:54:29 GMT (envelope-from oliver@FreeBSD.org) Received: (from oliver@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2I5sTT1060597; Wed, 18 Mar 2015 05:54:29 GMT (envelope-from oliver@FreeBSD.org) Message-Id: <201503180554.t2I5sTT1060597@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: oliver set sender to oliver@FreeBSD.org using -f From: Oliver Lehmann Date: Wed, 18 Mar 2015 05:54:29 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r381524 - head/multimedia/v4l-utils/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2015 05:54:29 -0000 Author: oliver Date: Wed Mar 18 05:54:28 2015 New Revision: 381524 URL: https://svnweb.freebsd.org/changeset/ports/381524 QAT: https://qat.redports.org/buildarchive/r381524/ Log: Fix handling of getting and setting v4l2 controls. The unpatched implementation depends on a Linux specific behaviour of getsubopt(3): > If the first suboption in optionp is recognized, getsubopt() returns > the index of the matching suboption element in tokens. Otherwise, -1 > is returned and *valuep is the entire name[=value] string. The "Otherwise..." part is implemented differently on FreeBSD. The file gets now patched to use a local and reduced implementation of getsubopt(3) to fix this Approved by: nox Modified: head/multimedia/v4l-utils/files/patch-v4l2-ctl__v4l2-ctl.cpp Modified: head/multimedia/v4l-utils/files/patch-v4l2-ctl__v4l2-ctl.cpp ============================================================================== --- head/multimedia/v4l-utils/files/patch-v4l2-ctl__v4l2-ctl.cpp Tue Mar 17 22:05:36 2015 (r381523) +++ head/multimedia/v4l-utils/files/patch-v4l2-ctl__v4l2-ctl.cpp Wed Mar 18 05:54:28 2015 (r381524) @@ -1,5 +1,5 @@ ---- v4l2-ctl/v4l2-ctl.cpp.orig 2011-06-01 13:23:03.000000000 +0200 -+++ v4l2-ctl/v4l2-ctl.cpp 2011-06-04 10:03:21.000000000 +0200 +--- v4l2-ctl/v4l2-ctl.cpp.orig 2012-04-14 19:33:44.000000000 +0200 ++++ v4l2-ctl/v4l2-ctl.cpp 2015-03-17 21:05:27.176219337 +0100 @@ -21,7 +21,6 @@ */ @@ -16,7 +16,49 @@ #include #include -@@ -3279,6 +3277,7 @@ +@@ -1643,10 +1641,31 @@ + printf("%s\n", iter->second.c_str()); + } + } ++int ++my_getsubopt (char **optionp, char *const *tokens, char **valuep) ++{ ++ char *endp, *vstart; ++ int cnt; ++ ++ if (**optionp == '\0') ++ return -1; ++ ++ /* Find end of next token. */ ++ endp = strchrnul (*optionp, ','); ++ ++ /* The current suboption does not match any option. */ ++ *valuep = *optionp; ++ ++ if (*endp != '\0') ++ *endp++ = '\0'; ++ *optionp = endp; ++ ++ return -1; ++} + + static int parse_subopt(char **subs, const char * const *subopts, char **value) + { +- int opt = getsubopt(subs, (char * const *)subopts, value); ++ int opt = my_getsubopt(subs, (char * const *)subopts, value); + + if (opt == -1) { + fprintf(stderr, "Invalid suboptions specified\n"); +@@ -1667,7 +1686,7 @@ + static char *const subopts[] = { + NULL + }; +- int opt = getsubopt(subs, subopts, value); ++ int opt = my_getsubopt(subs, subopts, value); + + if (value == NULL) { + fprintf(stderr, "No value given to suboption <%s>\n", +@@ -3493,6 +3512,7 @@ static char buf[40960]; int len; @@ -24,7 +66,7 @@ if (doioctl(fd, VIDIOC_LOG_STATUS, NULL) == 0) { printf("\nStatus Log:\n\n"); len = klogctl(3, buf, sizeof(buf) - 1); -@@ -3300,6 +3299,7 @@ +@@ -3514,6 +3534,7 @@ } } }