From patchwork Tue Sep 7 07:13:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13711 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 44992BDC71 for ; Tue, 7 Sep 2021 07:13:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0A60C6916D; Tue, 7 Sep 2021 09:13:39 +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="or3QhuXg"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1061169166 for ; Tue, 7 Sep 2021 09:13:37 +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 A5101499; Tue, 7 Sep 2021 09:13:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1630998816; bh=+6RIBBoMEsm7LU3qKz/TkP18HIpGVnXNmg0WJj+ascA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=or3QhuXgHgyD7AayaYSxkVc04hXH734AxdCJbT7mHjho1UN/xbRoQ7VfDa/mkd1VS ksrq0ksnMy1QmPC5a6f34YE4oKvlHfvWnQfNbcM5eas5Sq22xiD4r++aVrfTj3AKMD tLDAft1l/8i1EiCyhC78bJjGbZOGjEAKfYF2m46o= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 7 Sep 2021 16:13:11 +0900 Message-Id: <20210907071311.3364713-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210907071311.3364713-1-paul.elder@ideasonboard.com> References: <20210907071311.3364713-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] v4l2: v4l2_camera_proxy: Report the proper format name in enum_fmt 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" Now that libcamera has the V4L2 format names, retrive and report those names in ENUM_FMT. While at it, refactor the code slightly with PixelFormatInfo. This fixes the test failures on v4l2-compliance with the v4l2 compatilibity layer that were observed in version v4l2-compliance version 1.21.0-4838. Signed-off-by: Paul Elder --- src/v4l2/v4l2_camera_proxy.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 07b1a90a..ec335ce2 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -270,13 +270,13 @@ int V4L2CameraProxy::vidioc_enum_fmt(V4L2CameraFile *file, struct v4l2_fmtdesc * return -EINVAL; PixelFormat format = streamConfig_.formats().pixelformats()[arg->index]; + PixelFormatInfo info = PixelFormatInfo::info(format); /* \todo Set V4L2_FMT_FLAG_COMPRESSED for compressed formats. */ arg->flags = 0; - /* \todo Add map from format to description. */ utils::strlcpy(reinterpret_cast(arg->description), - "Video Format Description", sizeof(arg->description)); - arg->pixelformat = PixelFormatInfo::info(format).v4l2Format; + info.v4l2Name, sizeof(arg->description)); + arg->pixelformat = info.v4l2Format; memset(arg->reserved, 0, sizeof(arg->reserved));