[{"id":3200,"web_url":"https://patchwork.libcamera.org/comment/3200/","msgid":"<20191206220138.GO28879@bigcity.dyn.berto.se>","date":"2019-12-06T22:01:38","subject":"Re: [libcamera-devel] [PATCH v2 05/10] libcamera: v4l2_controls:\n\tStore default value","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOn 2019-12-05 21:43:45 +0100, Jacopo Mondi wrote:\n> Store the default value for V4L2 controls as reported by the kernel when\n> creating ControlRange instances using information coming from\n> v4l2_query_ext_ctrl.\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/v4l2_controls.cpp | 9 ++++++---\n>  1 file changed, 6 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp\n> index b6547a7c627c..7446c3880330 100644\n> --- a/src/libcamera/v4l2_controls.cpp\n> +++ b/src/libcamera/v4l2_controls.cpp\n> @@ -121,17 +121,20 @@ V4L2ControlRange::V4L2ControlRange(const struct v4l2_query_ext_ctrl &ctrl)\n>  \tswitch (ctrl.type) {\n>  \tcase V4L2_CTRL_TYPE_BOOLEAN:\n>  \t\tControlRange::operator=(ControlRange(static_cast<bool>(ctrl.minimum),\n> -\t\t\t\t\t\t     static_cast<bool>(ctrl.maximum)));\n> +\t\t\t\t\t\t     static_cast<bool>(ctrl.maximum),\n> +\t\t\t\t\t\t     static_cast<bool>(ctrl.default_value)));\n>  \t\tbreak;\n>  \n>  \tcase V4L2_CTRL_TYPE_INTEGER64:\n>  \t\tControlRange::operator=(ControlRange(static_cast<int64_t>(ctrl.minimum),\n> -\t\t\t\t\t\t     static_cast<int64_t>(ctrl.maximum)));\n> +\t\t\t\t\t\t     static_cast<int64_t>(ctrl.maximum),\n> +\t\t\t\t\t\t     static_cast<int64_t>(ctrl.default_value)));\n>  \t\tbreak;\n>  \n>  \tdefault:\n>  \t\tControlRange::operator=(ControlRange(static_cast<int32_t>(ctrl.minimum),\n> -\t\t\t\t\t\t     static_cast<int32_t>(ctrl.maximum)));\n> +\t\t\t\t\t\t     static_cast<int32_t>(ctrl.maximum),\n> +\t\t\t\t\t\t     static_cast<int32_t>(ctrl.default_value)));\n>  \t\tbreak;\n>  \t}\n>  }\n> -- \n> 2.23.0\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x143.google.com (mail-lf1-x143.google.com\n\t[IPv6:2a00:1450:4864:20::143])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 80AF960BBC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Dec 2019 23:01:40 +0100 (CET)","by mail-lf1-x143.google.com with SMTP id b15so6376194lfc.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 06 Dec 2019 14:01:40 -0800 (PST)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\th7sm7178029lfj.29.2019.12.06.14.01.39\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 06 Dec 2019 14:01:39 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=Y5saOxQWC2iNNkO9ER+NA1eOlcDus3zsAMQRvtNdB8k=;\n\tb=u4Mxu8ehuh7reFBoXYC3DZW8kVpCRujTan6UxsprB+FlSat+r1wJK4h31pTbGc7bAM\n\tUQGwc4/uCNY8sJie/RVFFqS/hQiXjoEqfhIwBri7rshk2So7UuJ1uEXmCDGVsq4GdUJg\n\tZaXnEImooxuoegflOZyJtlvbHCmSIDogjslr6rEvrkNDwD6/yBBvpwbL0CPZl1uYenbP\n\tRAthgivV+fvjslWJJurMa+zNZ4Hu139hse/bS8ioPzwPDz+ZgmaT6XuTbbqVJtyH9Zfg\n\tKMvPhqxKWz0oNAe9F4BbuhHP4v01UHJlOnYdbmj0or3rFLjXF2gt7/IDnAUxBsWi+y3p\n\tJc3A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=Y5saOxQWC2iNNkO9ER+NA1eOlcDus3zsAMQRvtNdB8k=;\n\tb=ppPMPSh1N2LXG8v9ONUOe2B759XqJEI7KNRIAUiusWPGdDmXGmJ4c3UmQ3rFfUQ+lY\n\td83vk8zJ0NRvyWpwg5/U51j3dGZRG/2VQWsQZW+LZx6k5iLxRd1KRJpVoj0smgkOFoQn\n\thvP9av2rW8KQZWRLbqREi74xhZ2R6nUlxFh+4niLSihzniIMuYQ0mXKHC+yvISlqorSy\n\t56EO7O6Q78S1h05p40SEBQ+Zp+9ugx+xHFG0FnM5+0mEzMSoTf+3nUFGyaLEarD0EEg4\n\tdOsQCdsEdGT3ZnY5o1Sx9ozeMeiooDcyDa4a+B7kDDGP0f/owOny4ydEfzb2hlanD5uc\n\ta2Dw==","X-Gm-Message-State":"APjAAAVG7gIY2IsHTTqQdH4zS6AeHvf2gjQk5V3LEHduK0+5PXYF2ef3\n\tqu1rmGpbn/zv9DAPu5Im6dyo2w==","X-Google-Smtp-Source":"APXvYqzzoL9XM28jVlMRXe51JVANIc7G1UhnQJ+DX12TS4yBgCiYmgSITuJZ4rwrifl24m06yRaqDQ==","X-Received":"by 2002:ac2:428d:: with SMTP id m13mr9487943lfh.64.1575669699922;\n\tFri, 06 Dec 2019 14:01:39 -0800 (PST)","Date":"Fri, 6 Dec 2019 23:01:38 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191206220138.GO28879@bigcity.dyn.berto.se>","References":"<20191205204350.28196-1-jacopo@jmondi.org>\n\t<20191205204350.28196-6-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20191205204350.28196-6-jacopo@jmondi.org>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH v2 05/10] libcamera: v4l2_controls:\n\tStore default value","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 06 Dec 2019 22:01:40 -0000"}}]