[{"id":12515,"web_url":"https://patchwork.libcamera.org/comment/12515/","msgid":"<20200915013521.GZ15543@pendragon.ideasonboard.com>","date":"2020-09-15T01:35:21","subject":"Re: [libcamera-devel] [PATCH v2 13/13] libcamera: pipeline: rkisp1:\n\tExpose self path stream","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Mon, Sep 14, 2020 at 04:21:49PM +0200, Niklas Söderlund wrote:\n> Expose the self stream to applications and prefers it for the viewfinder\n> and video roles as it can produce RGB. Keep preferring the main path for\n> still capture as it could be extended to support RAW formats which makes\n> most sens for still capture.\n\ns/sens/sense/\n\n> With this change the self path becomes available to applications and a\n> camera backed by this pipeline can produce two streams simultaneously.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 44 ++++++++++++++++++------\n>  1 file changed, 34 insertions(+), 10 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 851ff68f138b98dd..1260ed947d385ca9 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -729,17 +729,38 @@ CameraConfiguration *PipelineHandlerRkISP1::generateConfiguration(Camera *camera\n>  \tif (roles.empty())\n>  \t\treturn config;\n>  \n> -\tstd::map<PixelFormat, std::vector<SizeRange>> streamFormats;\n> -\tfor (const PixelFormat &format : RKISP1_RSZ_MP_FORMATS)\n> -\t\tstreamFormats[format] =\n> -\t\t\t{ { RKISP1_RSZ_MP_SRC_MIN, data->sensor_->resolution() } };\n> +\tfor (const StreamRole role : roles) {\n> +\t\tstd::map<PixelFormat, std::vector<SizeRange>> streamFormats;\n>  \n> -\tStreamFormats formats(streamFormats);\n> -\tStreamConfiguration cfg(formats);\n> -\tcfg.pixelFormat = formats::NV12;\n> -\tcfg.size = data->sensor_->resolution();\n> +\t\tswitch (role) {\n> +\t\tcase StreamRole::StillCapture: {\n> +\t\t\tfor (const PixelFormat &format : RKISP1_RSZ_MP_FORMATS)\n> +\t\t\t\tstreamFormats[format] =\n> +\t\t\t\t\t{ { RKISP1_RSZ_MP_SRC_MIN, data->sensor_->resolution() } };\n> +\t\t\tbreak;\n> +\t\t}\n> +\t\tcase StreamRole::Viewfinder:\n> +\t\tcase StreamRole::VideoRecording: {\n> +\t\t\tfor (const PixelFormat &format : RKISP1_RSZ_SP_FORMATS)\n> +\t\t\t\tstreamFormats[format] =\n> +\t\t\t\t\t{ { RKISP1_RSZ_SP_SRC_MIN, data->sensor_->resolution() } };\n> +\t\t\tbreak;\n> +\t\t}\n\nIf we get viewfinder + video we'll generate a configuration with stream\nformats that won't be possible to produce simultaneously.\n\n> +\t\tdefault:\n> +\t\t\tLOG(RkISP1, Warning)\n> +\t\t\t\t<< \"Requested stream role not supported: \" << role;\n> +\t\t\tdelete config;\n> +\t\t\treturn nullptr;\n> +\t\t}\n>  \n> -\tconfig->addConfiguration(cfg);\n> +\t\tStreamFormats formats(streamFormats);\n> +\t\tStreamConfiguration cfg(formats);\n> +\t\tcfg.pixelFormat = formats::NV12;\n> +\t\tcfg.size = data->sensor_->resolution();\n> +\t\tcfg.bufferCount = 4;\n> +\n> +\t\tconfig->addConfiguration(cfg);\n> +\t}\n>  \n>  \tconfig->validate();\n>  \n> @@ -1216,7 +1237,10 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> -\tstd::set<Stream *> streams{ &data->mainPathStream_ };\n> +\tstd::set<Stream *> streams{\n> +\t\t&data->mainPathStream_,\n> +\t\t&data->selfPathStream_,\n> +\t};\n>  \tstd::shared_ptr<Camera> camera =\n>  \t\tCamera::create(this, data->sensor_->id(), streams);\n>  \tregisterCamera(std::move(camera), std::move(data));","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 284A3C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 15 Sep 2020 01:35:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A69D162DAB;\n\tTue, 15 Sep 2020 03:35:51 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6255962901\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Sep 2020 03:35:50 +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 C2CC5275;\n\tTue, 15 Sep 2020 03:35:48 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"roSyaZDz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1600133749;\n\tbh=9mq5Oh0T5T2aRJD2D/DyhEC6Qsp0NKBDLmUl3uvU9hM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=roSyaZDzKrELfEr4hg9pGg9ETEs9EZKRV2rFoNkpDaRxe3EXx81ZwyRwsksSjmLxO\n\tYgGEGFXA6sfLxliFkSJlJ7o3eBHagPICvprFBBmHh06gzEs7Q7UlR4Dorz/rpxvm53\n\tQpayzEA/lzMHTHNBo+NcK3tD+/UBKJK5NSwS7UwM=","Date":"Tue, 15 Sep 2020 04:35:21 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Message-ID":"<20200915013521.GZ15543@pendragon.ideasonboard.com>","References":"<20200914142149.63857-1-niklas.soderlund@ragnatech.se>\n\t<20200914142149.63857-14-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200914142149.63857-14-niklas.soderlund@ragnatech.se>","Subject":"Re: [libcamera-devel] [PATCH v2 13/13] libcamera: pipeline: rkisp1:\n\tExpose self path stream","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","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]