[{"id":2717,"web_url":"https://patchwork.libcamera.org/comment/2717/","msgid":"<20190928193729.GE4865@pendragon.ideasonboard.com>","date":"2019-09-28T19:37:29","subject":"Re: [libcamera-devel] [PATCH v3 06/13] libcamera: pipeline: Add\n\thelper to process meta data coming from IPA","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 Fri, Sep 27, 2019 at 04:44:10AM +0200, Niklas Söderlund wrote:\n> Add a helper to process meta data coming out of an IPA and associating\n> it with a request. The helper is needed as the pipeline handler needs to\n> access the private meta data member of the request, something only the\n> base pipeline class handler can do.\n\nI was going to say that the Request class should probably be reworked to\nease its use in pipeline handlers, but it's actually a nice feature that\npipeline handlers implementations can't poke freely in the request.\n\nAs metadata should use a control list instead of a fixed structure, I\nthink the control list should be exposed in a similar way as\nRequest::controls(), especially given that pipeline handlers may need to\nbuild it incrementally. That makes the automatic setting of the ready\nfield more difficult. We'll probably have to think a little bit more\nabout how this should be exposed exactly. I believe that a setMetaData()\nmethod for the Request class, callable by the PipelineHandler base class\nonly, could be a good option, as it would allow the Request to emit a\nsignal as soon as metadata is ready. It may be a premature optimisation\nthough.\n\n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/libcamera/include/pipeline_handler.h |  3 +++\n>  src/libcamera/pipeline_handler.cpp       | 16 ++++++++++++++++\n>  2 files changed, 19 insertions(+)\n> \n> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> index 4400c7ed835f551d..d2581a327c0804c3 100644\n> --- a/src/libcamera/include/pipeline_handler.h\n> +++ b/src/libcamera/include/pipeline_handler.h\n> @@ -30,6 +30,7 @@ class DeviceMatch;\n>  class MediaDevice;\n>  class PipelineHandler;\n>  class Request;\n> +struct IPAMetaData;\n>  \n>  class CameraData\n>  {\n> @@ -94,6 +95,8 @@ protected:\n>  \n>  \tCameraData *cameraData(const Camera *camera);\n>  \n> +\tvoid processMetaData(Request *request, const IPAMetaData &metaData);\n> +\n>  \tCameraManager *manager_;\n>  \n>  private:\n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index b8a3787e10a587b5..da0ad678b652768c 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -480,6 +480,22 @@ void PipelineHandler::hotplugMediaDevice(MediaDevice *media)\n>  \tmedia->disconnected.connect(this, &PipelineHandler::mediaDeviceDisconnected);\n>  }\n>  \n> +/**\n> + * \\brief Helper to process meta data from the IPA\n> + * \\param[in] request The request to associate the \\a metaData with\n> + * \\param[in] metaData The meta data to process\n> + *\n> + * This function is a helper for pipline handler implementations to process\n> + * meta data retrived from an IPA. It is mandatory to call this function with\n> + * any meta data returned from the IPA before it's passed to the application.\n> + */\n> +void PipelineHandler::processMetaData(Request *request,\n> +\t\t\t\t      const IPAMetaData &metaData)\n> +{\n> +\trequest->metaData_ = metaData;\n> +\trequest->metaData_.ready = true;\n> +}\n> +\n>  /**\n>   * \\brief Slot for the MediaDevice disconnected signal\n>   */","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 54D5A60BBA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 28 Sep 2019 21:37:41 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi\n\t[IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B6CF553B;\n\tSat, 28 Sep 2019 21:37:40 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1569699460;\n\tbh=nPSNxK5CRExXEIr6MhD6FreFFnmXeyjynNMWHfmXh/I=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Srh/j/wUvqWRKoX6VGOCrh0oTGsfccw6qrbcWo7s5f2YQcAsMtozdwDnoMII2BKXD\n\t7BJBYrnnzuTgZEo6mecVSB+QyBWPziMPsx3BM7A9eU48mGkshNXxVzHEibilhqCDgd\n\tYmo01xlO2Pm976cjuGQt36HCchandFGfqyRb6LQ4=","Date":"Sat, 28 Sep 2019 22:37:29 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190928193729.GE4865@pendragon.ideasonboard.com>","References":"<20190927024417.725906-1-niklas.soderlund@ragnatech.se>\n\t<20190927024417.725906-7-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190927024417.725906-7-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v3 06/13] libcamera: pipeline: Add\n\thelper to process meta data coming from IPA","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":"Sat, 28 Sep 2019 19:37:41 -0000"}}]