From patchwork Wed Sep 8 08:14:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13764 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 7D2FBBDB1D for ; Wed, 8 Sep 2021 08:15:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4B06269175; Wed, 8 Sep 2021 10:15:03 +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="f3GqtZFA"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0395169171 for ; Wed, 8 Sep 2021 10:15:00 +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 917EC993; Wed, 8 Sep 2021 10:14:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1631088899; bh=8UMiSso+TIGsQVLvS4U0pKDQ0qeqUdJY4845Olf00d0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f3GqtZFAoUtmfcpjMwQpZetxQyOzIZmi0GV8iq3e7le4AAVJN56mqtMetjYXIgrSP eebrHaqB45prCA9er++8b1GD0sV4HmkMNmA23hORTFkScmOLmCp6WetfR5wGHZZDA4 QeIyMdMEJpI5DxS3hXlvdsFAAhaekG9TNm6iFH8w= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Wed, 8 Sep 2021 17:14:35 +0900 Message-Id: <20210908081437.4022697-6-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210908081437.4022697-1-paul.elder@ideasonboard.com> References: <20210908081437.4022697-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 5/7] 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 Reviewed-by: Laurent Pinchart --- 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 aeffef26..5fbfcdd7 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -274,13 +274,13 @@ int V4L2CameraProxy::vidioc_enum_fmt(V4L2CameraFile *file, struct v4l2_fmtdesc * return -EINVAL; PixelFormat format = streamConfig_.formats().pixelformats()[arg->index]; + const V4L2PixelFormat &v4l2Format = V4L2PixelFormat::fromPixelFormat(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 = V4L2PixelFormat::fromPixelFormat(format); + v4l2Format.toDescription(), sizeof(arg->description)); + arg->pixelformat = v4l2Format; memset(arg->reserved, 0, sizeof(arg->reserved));