{"id":20778,"url":"https://patchwork.libcamera.org/api/patches/20778/?format=json","web_url":"https://patchwork.libcamera.org/patch/20778/","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":"<20240805135104.139932-3-chenghaoyang@google.com>","date":"2024-08-05T13:48:33","name":"[v8,2/8] libcamera: Remove PipelineHandler Fatal check of non-empty MediaDevices","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"41a946d8020fdd8433230175f39bba0b6d992b1c","submitter":{"id":117,"url":"https://patchwork.libcamera.org/api/people/117/?format=json","name":"Cheng-Hao Yang","email":"chenghaoyang@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/20778/mbox/","series":[{"id":4487,"url":"https://patchwork.libcamera.org/api/series/4487/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4487","date":"2024-08-05T13:48:31","name":"Add VirtualPipelineHandler","version":8,"mbox":"https://patchwork.libcamera.org/series/4487/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/20778/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/20778/checks/","tags":{},"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 2C10CBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  5 Aug 2024 13:51:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C8390633AC;\n\tMon,  5 Aug 2024 15:51:11 +0200 (CEST)","from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com\n\t[IPv6:2a00:1450:4864:20::32c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7124B63385\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  5 Aug 2024 15:51:07 +0200 (CEST)","by mail-wm1-x32c.google.com with SMTP id\n\t5b1f17b1804b1-428e0d18666so31745125e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 05 Aug 2024 06:51:07 -0700 (PDT)","from chenghaoyang-germany.c.googlers.com.com\n\t(49.222.77.34.bc.googleusercontent.com. [34.77.222.49])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-428e8d6555fsm137146675e9.26.2024.08.05.06.51.06\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 05 Aug 2024 06:51:06 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"Y+Old/hk\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1722865867; x=1723470667;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=w2G6hUf2Cak1GfsOKDoIwK7EE5JVC84nVLBIdAJv3xA=;\n\tb=Y+Old/hkm19MW99dZCmBiqk1l4N0jNn5tRzLasDbUbevOZaRuoVT1Ie8JrDbMKZXgz\n\tEYbWGGLvrnyEwWDCwxDBGHNBE+sc3jC0HomRleNYr5A3n9PRTPqQJniqttAxV4kMyXs2\n\tR3OGl5JZ6I4LmZeKgU9FlHcOsbjnw9j6FUvxU=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1722865867; x=1723470667;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=w2G6hUf2Cak1GfsOKDoIwK7EE5JVC84nVLBIdAJv3xA=;\n\tb=kTng96YXlrvS7awoX44gCUuSFXx001L1RPnuoNxRq2c70Aiz9f1GpQeHYaj1+xlxXp\n\tCJhzH6IyvPpGqL6iymxieHTQE+6cRJPPh5TiCX7RYr36vxd8ZCbekpN2wnU8tTf6jVSN\n\tJH4eudAtH06wBxjr5LuvnbsKL4HR0MW9GADd+EIDXQdD/wz4nCG/HQW9G86cZWlRGcgI\n\tg34SMoXYwJjlFkGMWYXrxcwyI0GWNiCR796t4d7/VF5fs01ySwDTf9KPmHmqaA8frdko\n\tfgLb4zl3I8ZDDiLsKeQMT6GSK2MZlc1EnfbrUbSQ+TAdtcM0p6SWapQ84Z+WLWvK2n0q\n\tPfmA==","X-Gm-Message-State":"AOJu0YycZo1O/LU99M9Yo6OIzwxtJC4tErs+1V14YHKfLIDTyw20lqib\n\tBJcFhRiNIxcrnlkUfz6nY/1cwNJ5FbYBfP3Jms4Vmfiye4fAevA89QVWAw+Uk7RncjkNZPtEkpf\n\tiSFRRE/w=","X-Google-Smtp-Source":"AGHT+IGLfb0tw4kO8aXn2dLV9Bhrq8bDtg4S8IkgZUiuAM/Kw/Rp6CdC01pt+y7qEiknxmIcKCrP8A==","X-Received":"by 2002:a05:600c:354c:b0:426:5269:1a50 with SMTP id\n\t5b1f17b1804b1-428e6b01bb0mr72504455e9.11.1722865866663; \n\tMon, 05 Aug 2024 06:51:06 -0700 (PDT)","From":"Harvey Yang <chenghaoyang@chromium.org>","X-Google-Original-From":"Harvey Yang <chenghaoyang@google.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Harvey Yang <chenghaoyang@google.com>,\n\tHarvey Yang <chenghaoyang@chromium.org>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"[PATCH v8 2/8] libcamera: Remove PipelineHandler Fatal check of\n\tnon-empty MediaDevices","Date":"Mon,  5 Aug 2024 13:48:33 +0000","Message-ID":"<20240805135104.139932-3-chenghaoyang@google.com>","X-Mailer":"git-send-email 2.46.0.rc2.264.g509ed76dc8-goog","In-Reply-To":"<20240805135104.139932-1-chenghaoyang@google.com>","References":"<20240805135104.139932-1-chenghaoyang@google.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>"},"content":"The Fatal check of having at least one MediaDevice was to prevent\npipeline handler implementations searching and owning media devices with\ncustom conventions, instead of using the base function\n|acquireMediaDevice|. It also has the assumption that there's at least\none media device to make a camera work.\n\nNow that the assumption will be broken by the virtual pipeline handler\nadded in the following patches, and developers should be aware of the\navailable functions in the base class to handle media devices, the Fatal\ncheck is no longer needed.\n\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline_handler.cpp | 11 ++++++++---\n 1 file changed, 8 insertions(+), 3 deletions(-)","diff":"diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 5ea2ca78..125cf9d5 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -605,9 +605,14 @@ void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera)\n {\n \tcameras_.push_back(camera);\n \n-\tif (mediaDevices_.empty())\n-\t\tLOG(Pipeline, Fatal)\n-\t\t\t<< \"Registering camera with no media devices!\";\n+\tif (mediaDevices_.empty()) {\n+\t\t/*\n+\t\t * For virtual devices with no MediaDevice, there are no system\n+\t\t * devices to register.\n+\t\t */\n+\t\tmanager_->_d()->addCamera(std::move(camera));\n+\t\treturn;\n+\t}\n \n \t/*\n \t * Walk the entity list and map the devnums of all capture video nodes\n","prefixes":["v8","2/8"]}