From patchwork Thu Sep 9 08:09:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 13776 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 8025CBDC71 for ; Thu, 9 Sep 2021 08:09:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3F23869177; Thu, 9 Sep 2021 10:09:25 +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="DAs6J6So"; 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 4B9506916A for ; Thu, 9 Sep 2021 10:09:23 +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 C905D883; Thu, 9 Sep 2021 10:09:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1631174963; bh=QysgIK5Sl6jafgrOuXAafwucD89COeuu3iCcGYtJ2kM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DAs6J6SozbNQgeDKPpOwTPLPdaOFd7iXvyFnAkCipluunRJ748HGS+FWAXJD6ztTY UWFiIQDpWZHRUMjudSGgK8E0XKD2Kw2s8MxAQQzTjoLooYnt4+8teV9k3wunSNPs31 pNsx/K5TnqJxpN5vx46P+WMKQ19F+o6wkdVGdSWA= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 9 Sep 2021 17:09:00 +0900 Message-Id: <20210909080902.239533-6-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210909080902.239533-1-paul.elder@ideasonboard.com> References: <20210909080902.239533-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 Reviewed-by: Jean-Michel Hautbois --- 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..abb30820 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]; + 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.description(), sizeof(arg->description)); + arg->pixelformat = v4l2Format; memset(arg->reserved, 0, sizeof(arg->reserved));