From patchwork Fri Jul 30 10:35:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13161 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 77C86C322E for ; Fri, 30 Jul 2021 10:35:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 33D32687C5; Fri, 30 Jul 2021 12:35:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="CDFZ3dIr"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 858F4687C5 for ; Fri, 30 Jul 2021 12:35:52 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 74B8A89B; Fri, 30 Jul 2021 12:35:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1627641352; bh=p8G1JKPuNPdvaenXuSuSXd6bmEPidMoekfecbNAVe0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CDFZ3dIr+SotljuDZItQJwkeeoXeM1bRTgjdLSvm6y3mmDtLVJbZ9u2mFT2burUau a8yV9eQym9sc2YLQ/tz2473ABSEFyHCQ7BASwCFyB9aH3YYB2ti0W3WLynqe+UDDgl MZtW4qTqWXAKiuiAGVjMuo9i9phJmnPkrxlKlF5M= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 30 Jul 2021 19:35:30 +0900 Message-Id: <20210730103536.81117-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210730103536.81117-1-paul.elder@ideasonboard.com> References: <20210730103536.81117-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 3/9] android: metadata: Fix addEntry template type 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" Since we set entries with android tags directly, which are enums and not arithmetic types, the addEntry template fails to match. Fix this by also allowing enum values in addEntry. Signed-off-by: Paul Elder Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- New in v4 --- src/android/camera_metadata.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h index 03b3e701..60be416c 100644 --- a/src/android/camera_metadata.h +++ b/src/android/camera_metadata.h @@ -34,7 +34,8 @@ public: bool hasEntry(uint32_t tag) const; template> * = nullptr> + std::enable_if_t || + std::is_enum_v> * = nullptr> bool addEntry(uint32_t tag, const T &data) { return addEntry(tag, &data, 1, sizeof(T));