[{"id":19498,"web_url":"https://patchwork.libcamera.org/comment/19498/","msgid":"<YTcrvW/f0ZfYV+lJ@pendragon.ideasonboard.com>","date":"2021-09-07T09:07:09","subject":"Re: [libcamera-devel] [PATCH 2/2] v4l2: v4l2_camera_proxy: Report\n\tthe proper format name in enum_fmt","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Paul,\n\nThank you for the patch.\n\nOn Tue, Sep 07, 2021 at 04:13:11PM +0900, Paul Elder wrote:\n> Now that libcamera has the V4L2 format names, retrive and report those\n\ns/retrive/retrieve/\n\n> names in ENUM_FMT. While at it, refactor the code slightly with\n> PixelFormatInfo.\n> \n> This fixes the test failures on v4l2-compliance with the v4l2\n> compatilibity layer that were observed in version v4l2-compliance\n> version 1.21.0-4838.\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> ---\n>  src/v4l2/v4l2_camera_proxy.cpp | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index 07b1a90a..ec335ce2 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -270,13 +270,13 @@ int V4L2CameraProxy::vidioc_enum_fmt(V4L2CameraFile *file, struct v4l2_fmtdesc *\n>  \t\treturn -EINVAL;\n>  \n>  \tPixelFormat format = streamConfig_.formats().pixelformats()[arg->index];\n> +\tPixelFormatInfo info = PixelFormatInfo::info(format);\n\nconst reference. I should make PixelFormatInfo non-copyable.\n\n>  \n>  \t/* \\todo Set V4L2_FMT_FLAG_COMPRESSED for compressed formats. */\n>  \targ->flags = 0;\n\nCould you add a patch to address this ? As we don't plan to support\nother compressed formats than MJPEG, it can be as simple as setting\nV4L2_FMT_FLAG_COMPRESSED iif the format is MJPEG.\n\n> -\t/* \\todo Add map from format to description. */\n>  \tutils::strlcpy(reinterpret_cast<char *>(arg->description),\n> -\t\t       \"Video Format Description\", sizeof(arg->description));\n> -\targ->pixelformat = PixelFormatInfo::info(format).v4l2Format;\n> +\t\t       info.v4l2Name, sizeof(arg->description));\n> +\targ->pixelformat = info.v4l2Format;\n>  \n>  \tmemset(arg->reserved, 0, sizeof(arg->reserved));\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 42AF9BE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Sep 2021 09:07:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BFDFA6916A;\n\tTue,  7 Sep 2021 11:07:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9B02869167\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Sep 2021 11:07:28 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1E05C499;\n\tTue,  7 Sep 2021 11:07:28 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"neRZZloP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1631005648;\n\tbh=JzUlrVf19lY39itp/Mi/R8av9LThbvk2gTzWsNf/USQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=neRZZloP5VDT472qoTATk2mJcWJ5I9kyzlapy0y8C7IvFlMeo/VhEZb5MGueERXQT\n\trY+hHXH2vBV+mRenXXx2SR8y+lzKc7KK46SO9jEyd1sR33XU3j5bWRoN4u/3EpxgJV\n\tk5+N0lPeDs7kVzOuPUj4XcFCLkWNOYgZYfZ5CBsw=","Date":"Tue, 7 Sep 2021 12:07:09 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Message-ID":"<YTcrvW/f0ZfYV+lJ@pendragon.ideasonboard.com>","References":"<20210907071311.3364713-1-paul.elder@ideasonboard.com>\n\t<20210907071311.3364713-2-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210907071311.3364713-2-paul.elder@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 2/2] v4l2: v4l2_camera_proxy: Report\n\tthe proper format name in enum_fmt","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]