From patchwork Thu Apr 15 03:07:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11933 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id E8743BD1F6 for ; Thu, 15 Apr 2021 03:07:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2D39A68814; Thu, 15 Apr 2021 05:07:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="A86ud08a"; dkim-atps=neutral Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C732602C7 for ; Thu, 15 Apr 2021 05:07:38 +0200 (CEST) Received: by mail-pj1-x1036.google.com with SMTP id u11so7640617pjr.0 for ; Wed, 14 Apr 2021 20:07:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xxHXmNvqriXhnctuLhKbwN7na7hwdG2MLtzqw0zr1D0=; b=A86ud08aGJNqqJueDTaQbkYTOv80AGj+wPPIdJqppRJBzo3rGPi0cxDIOeQc5q0nRi uH6k6H0Z2xDnyz19vLWjfcJ9/AF4oTpbQYbYBfBWAomMq4zPJNj7tYusFZ+oqcxCRYDo IUOhR3ipbLniQnD4lufg+3CmMwB7GK/nHRfvk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xxHXmNvqriXhnctuLhKbwN7na7hwdG2MLtzqw0zr1D0=; b=ohaefxOb/N4k6BFNEySOQTOJP46AHR3Ac8CAx1puUh0F0BLbjcsMaTeiwcTlkbU04D v+IH5BQkR/J03GJquT/YSAYnolqSg2oow7wu6E/68Gqn8livx8Zh4qGHP30Bas7nInOe H+V1UZX2MNRYY0uD6wsfe8JCGddoTPQ1GsGLIEn/wcW1jB2K9KFDsrhBa5Cx3LMbC4XO /5KQJBzjPR2MQMx7ULKz4DCTQu5VFUZ3vOMk8W2NSgsczNW+vlORC5z1R8qGCSmTfW8Y bDDYAH9bIbfOf427cYTnYvRT6SUpYMo0+vn0a5IZzWjdvd49d939ddvzD2VhDyCX0hvU dyKA== X-Gm-Message-State: AOAM532QqjiqOI9nlZipCH/MT4V8BdPARdHd1zFqiuuY5XqRatU14z7y NWoGJRG8bVzfxUBDEUbh+2NneimkHbuBig== X-Google-Smtp-Source: ABdhPJxgdIz390tNdM16BAY0zxOPkDSXNb8Rgc4Lp/LzB54ZB6xFsdvysvFn2MctZhQE35aMqVg/5g== X-Received: by 2002:a17:902:dacd:b029:e5:cf71:3901 with SMTP id q13-20020a170902dacdb02900e5cf713901mr1349207plx.23.1618456056402; Wed, 14 Apr 2021 20:07:36 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:84f5:7981:dfbe:8f02]) by smtp.gmail.com with ESMTPSA id 33sm779651pgq.21.2021.04.14.20.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Apr 2021 20:07:35 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Thu, 15 Apr 2021 12:07:30 +0900 Message-Id: <20210415030730.3333809-1-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: V4L2Device: Return the requested Controls in getContrls() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Originally V4L2Device::getControls() returns all the available controls while requested control values are acquired by VIDIOC_G_EXT_CTRLS. V4L2Device::getControls() should rather return the request controls only. This fixes the bug. Signed-off-by: Hirokazu Honda --- src/libcamera/v4l2_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index decd19ef..d4a9bb75 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -177,7 +177,7 @@ ControlList V4L2Device::getControls(const std::vector &ids) if (count == 0) return {}; - ControlList ctrls{ controls_ }; + ControlList ctrls; /* * Start by filling the ControlList. This can't be combined with filling