[{"id":1481,"web_url":"https://patchwork.libcamera.org/comment/1481/","msgid":"<20190419103804.krmhxbgxivqay2aj@uno.localdomain>","date":"2019-04-19T10:38:04","subject":"Re: [libcamera-devel] [PATCH v2 2/4] libcamera: pipeline: rkisp1:\n\tDon't hardcode NV12 in configureStreams()","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"I Laurent,\n\nOn Fri, Apr 19, 2019 at 01:28:42PM +0300, Laurent Pinchart wrote:\n> Use the pixel format requested by the application in the\n> RkISP1PipelineHandler::configureStreams() method instead of hardcoding\n> NV12. The streamsConfiguration() method still proposes NV12 by default.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 8ed0ba84780a..51f00fb68402 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -223,7 +223,7 @@ int PipelineHandlerRkISP1::configureStreams(Camera *camera,\n>  \tV4L2DeviceFormat outputFormat = {};\n>  \toutputFormat.width = cfg.width;\n>  \toutputFormat.height = cfg.height;\n> -\toutputFormat.fourcc = V4L2_PIX_FMT_NV12;\n> +\toutputFormat.fourcc = cfg.pixelFormat;\n>  \toutputFormat.planesCount = 2;\n>\n>  \tret = video_->setFormat(&outputFormat);\n> @@ -232,12 +232,12 @@ int PipelineHandlerRkISP1::configureStreams(Camera *camera,\n>\n>  \tif (outputFormat.width != cfg.width ||\n>  \t    outputFormat.height != cfg.height ||\n> -\t    outputFormat.fourcc != V4L2_PIX_FMT_NV12) {\n> +\t    outputFormat.fourcc != cfg.pixelFormat) {\n>  \t\tLOG(RkISP1, Error)\n>  \t\t\t<< \"Unable to configure capture in \" << cfg.width\n>  \t\t\t<< \"x\" << cfg.height << \"-0x\"\n>  \t\t\t<< std::hex << std::setfill('0') << std::setw(8)\n> -\t\t\t<< V4L2_PIX_FMT_NV12;\n> +\t\t\t<< cfg.pixelFormat;\n\nAfter the offline clarification on validating the received\npixelFormat, this seems fine to me. Not supported formats will be\ncatched by this check, so we're good!\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n>  \t\treturn -EINVAL;\n>  \t}\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 60D8060004\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 19 Apr 2019 12:37:11 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id D4E51100002;\n\tFri, 19 Apr 2019 10:37:10 +0000 (UTC)"],"Date":"Fri, 19 Apr 2019 12:38:04 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190419103804.krmhxbgxivqay2aj@uno.localdomain>","References":"<20190419102844.6838-1-laurent.pinchart@ideasonboard.com>\n\t<20190419102844.6838-2-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"rvnaex5sb5awradl\"","Content-Disposition":"inline","In-Reply-To":"<20190419102844.6838-2-laurent.pinchart@ideasonboard.com>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH v2 2/4] libcamera: pipeline: rkisp1:\n\tDon't hardcode NV12 in configureStreams()","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Fri, 19 Apr 2019 10:37:11 -0000"}}]