{"id":4051,"url":"https://patchwork.libcamera.org/api/patches/4051/?format=json","web_url":"https://patchwork.libcamera.org/patch/4051/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200616131244.70308-8-paul.elder@ideasonboard.com>","date":"2020-06-16T13:12:36","name":"[libcamera-devel,07/15] v4l2: v4l2_camera_proxy: Fix v4l2-compliance format tests","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"43437a282654108be9a89e056b2c948ebcac2f66","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/4051/mbox/","series":[{"id":1006,"url":"https://patchwork.libcamera.org/api/series/1006/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1006","date":"2020-06-16T13:12:29","name":"Support v4l2-compliance","version":1,"mbox":"https://patchwork.libcamera.org/series/1006/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/4051/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/4051/checks/","tags":{},"headers":{"Return-Path":"<paul.elder@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 907A1603C1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Jun 2020 15:13:13 +0200 (CEST)","from jade.flets-east.jp (unknown\n\t[IPv6:2400:4051:61:600:2807:bdfa:f6a:8e53])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 23A3427B;\n\tTue, 16 Jun 2020 15:13:11 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"T1jkgizz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1592313193;\n\tbh=qL9mHOTkjqrNC+F0L1UKd3hnhH93GVHRsF3LET6gRk0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=T1jkgizzQwBBCsfYsJJmcGzDj/eJOuD4blSc+L1o4TKKCfcYiIS6zoGBDxxWcrv2U\n\tlmwl+9slGTEqOqVejj+ktM13NDySBBDdbCLrzFfVgziW1G2/3ZkNEU4U3BGSJejK4e\n\taN1gHQ2meVnX/pgm2nR1vao4K5JdfKWWhZedbH+s=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 16 Jun 2020 22:12:36 +0900","Message-Id":"<20200616131244.70308-8-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20200616131244.70308-1-paul.elder@ideasonboard.com>","References":"<20200616131244.70308-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 07/15] v4l2: v4l2_camera_proxy: Fix\n\tv4l2-compliance format tests","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>","X-List-Received-Date":"Tue, 16 Jun 2020 13:13:13 -0000"},"content":"Fix v4l2-compliance format tests, for enum_fmt, try_fmt, and g/s_fmt.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/v4l2/v4l2_camera_proxy.cpp | 14 ++++++++++++--\n 1 file changed, 12 insertions(+), 2 deletions(-)","diff":"diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex a5fa478..fd2785f 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -179,6 +179,9 @@ void V4L2CameraProxy::setFmtFromConfig(StreamConfiguration &streamConfig)\n \t\t\t  curV4L2Format_.fmt.pix.width,\n \t\t\t  curV4L2Format_.fmt.pix.height);\n \tcurV4L2Format_.fmt.pix.colorspace = V4L2_COLORSPACE_SRGB;\n+\tcurV4L2Format_.fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;\n+\tcurV4L2Format_.fmt.pix.ycbcr_enc = V4L2_YCBCR_ENC_601;\n+\tcurV4L2Format_.fmt.pix.quantization = V4L2_QUANTIZATION_LIM_RANGE;\n }\n \n unsigned int V4L2CameraProxy::calculateSizeImage(StreamConfiguration &streamConfig)\n@@ -283,11 +286,15 @@ int V4L2CameraProxy::vidioc_enum_fmt(int fd, struct v4l2_fmtdesc *arg)\n \t    arg->index >= streamConfig_.formats().pixelformats().size())\n \t\treturn -EINVAL;\n \n+\t/* \\todo Set V4L2_FMT_FLAG_COMPRESSED for compressed formats. */\n+\targ->flags = 0;\n \t/* \\todo Add map from format to description. */\n-\tutils::strlcpy(reinterpret_cast<char *>(arg->description), \"Video Format Description\",\n-\t\t       sizeof(arg->description));\n+\tutils::strlcpy(reinterpret_cast<char *>(arg->description),\n+\t\t       \"Video Format Description\", sizeof(arg->description));\n \targ->pixelformat = drmToV4L2(streamConfig_.formats().pixelformats()[arg->index]);\n \n+\tmemset(arg->reserved, 0, sizeof(arg->reserved));\n+\n \treturn 0;\n }\n \n@@ -330,6 +337,9 @@ void V4L2CameraProxy::tryFormat(struct v4l2_format *arg)\n \t\t\t\t\t      arg->fmt.pix.width,\n \t\t\t\t\t      arg->fmt.pix.height);\n \targ->fmt.pix.colorspace   = V4L2_COLORSPACE_SRGB;\n+\targ->fmt.pix.priv         = V4L2_PIX_FMT_PRIV_MAGIC;\n+\targ->fmt.pix.ycbcr_enc    = V4L2_YCBCR_ENC_601;\n+\targ->fmt.pix.quantization = V4L2_QUANTIZATION_LIM_RANGE;\n }\n \n int V4L2CameraProxy::vidioc_s_fmt(int fd, struct v4l2_format *arg)\n","prefixes":["libcamera-devel","07/15"]}