[{"id":31546,"web_url":"https://patchwork.libcamera.org/comment/31546/","msgid":"<172794378276.1619946.3904156497570134810@ping.linuxembedded.co.uk>","date":"2024-10-03T08:23:02","subject":"Re: [PATCH v14 2/7] libcamera: Remove PipelineHandler Fatal check of\n\tnon-empty MediaDevices","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Harvey Yang (2024-09-30 07:29:43)\n> The Fatal check of having at least one MediaDevice was to prevent\n> pipeline handler implementations searching and owning media devices with\n> custom conventions, instead of using the base function\n> |acquireMediaDevice|. It also has the assumption that there's at least\n> one media device to make a camera work.\n> \n> Now that the assumption will be broken by the virtual pipeline handler\n> added in the following patches, and developers should be aware of the\n> available functions in the base class to handle media devices, the Fatal\n> check is no longer needed.\n> \n> Signed-off-by: Harvey Yang <chenghaoyang@chromium.org>\n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline_handler.cpp | 11 ++++++++---\n>  1 file changed, 8 insertions(+), 3 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index e5940469..89a513e4 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -637,9 +637,14 @@ void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera)\n>  {\n>         cameras_.push_back(camera);\n>  \n> -       if (mediaDevices_.empty())\n> -               LOG(Pipeline, Fatal)\n> -                       << \"Registering camera with no media devices!\";\n> +       if (mediaDevices_.empty()) {\n> +               /*\n> +                * For virtual devices with no MediaDevice, there are no system\n> +                * devices to register.\n> +                */\n> +               manager_->_d()->addCamera(std::move(camera));\n> +               return;\n> +       }\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>  \n>         /*\n>          * Walk the entity list and map the devnums of all capture video nodes\n> -- \n> 2.46.1.824.gd892dcdcdd-goog\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 A80AAC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  3 Oct 2024 08:23:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5DF6363527;\n\tThu,  3 Oct 2024 10:23:06 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 782DB62C93\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Oct 2024 10:23:05 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8FB434C7;\n\tThu,  3 Oct 2024 10:21:32 +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=\"YRDP58Jp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727943692;\n\tbh=en4PpFS+lmMqFIxjVEyzxJJheRnyP9/aDs0WkQDM5uk=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=YRDP58JpnUrwX5gVbg2mGZQ1CAw27+yZHbYD16mMizPf34hd+rgJGXVGsKUBQ3X3V\n\tJN1q0BwqWKn6ukibZKHRn/AyWuz4cUlK9U3rmlxq5eWl4qqF5gSmQjnFz8UG7OZeHA\n\tqYl255ADyT2xlmNOAGyFp5TGqaaaA/Luue5Hqa/w=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240930063342.3014837-3-chenghaoyang@google.com>","References":"<20240930063342.3014837-1-chenghaoyang@google.com>\n\t<20240930063342.3014837-3-chenghaoyang@google.com>","Subject":"Re: [PATCH v14 2/7] libcamera: Remove PipelineHandler Fatal check of\n\tnon-empty MediaDevices","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Harvey Yang <chenghaoyang@google.com>,\n\tHarvey Yang <chenghaoyang@chromium.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Harvey Yang <chenghaoyang@chromium.org>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 03 Oct 2024 09:23:02 +0100","Message-ID":"<172794378276.1619946.3904156497570134810@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]