Show a patch.

GET /api/patches/21386/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 21386,
    "url": "https://patchwork.libcamera.org/api/patches/21386/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21386/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20240926163141.1593026-3-chenghaoyang@google.com>",
    "date": "2024-09-26T16:29:51",
    "name": "[v13,2/7] libcamera: Remove PipelineHandler Fatal check of non-empty MediaDevices",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "41a946d8020fdd8433230175f39bba0b6d992b1c",
    "submitter": {
        "id": 117,
        "url": "https://patchwork.libcamera.org/api/people/117/?format=api",
        "name": "Cheng-Hao Yang",
        "email": "chenghaoyang@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21386/mbox/",
    "series": [
        {
            "id": 4632,
            "url": "https://patchwork.libcamera.org/api/series/4632/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4632",
            "date": "2024-09-26T16:29:49",
            "name": "Add VirtualPipelineHandler",
            "version": 13,
            "mbox": "https://patchwork.libcamera.org/series/4632/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21386/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21386/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 BBA76C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 Sep 2024 16:31:55 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 86DD563518;\n\tThu, 26 Sep 2024 18:31:54 +0200 (CEST)",
            "from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com\n\t[IPv6:2607:f8b0:4864:20::62e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4EFF463502\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Sep 2024 18:31:50 +0200 (CEST)",
            "by mail-pl1-x62e.google.com with SMTP id\n\td9443c01a7336-2059204f448so11343595ad.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Sep 2024 09:31:50 -0700 (PDT)",
            "from chenghaoyang-low.c.googlers.com.com\n\t(208.158.221.35.bc.googleusercontent.com. [35.221.158.208])\n\tby smtp.gmail.com with ESMTPSA id\n\td9443c01a7336-20b37e20dffsm469035ad.170.2024.09.26.09.31.47\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 26 Sep 2024 09:31:47 -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=\"YKuKCJTg\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1727368308; x=1727973108;\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=kiUmVXVsj2k0GDB+36LjnEpbTRYu3p9GSgHQdhpEEMY=;\n\tb=YKuKCJTglb3A8T/xrd0Sy5Yo+BFWQEpV3SwTg4emwGewSGs6bIi0muIcndP1hhgGU2\n\tXWN9mE6oUvhxjGdXnAe1lAaknVRiBbz4tlXeYY1fIB1LePIN76HTDvqVMFnM4VtBMcic\n\tM4nvPO7RVz92kGb0heTpFt7NU/oZJWeIpbdKg=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1727368308; x=1727973108;\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=kiUmVXVsj2k0GDB+36LjnEpbTRYu3p9GSgHQdhpEEMY=;\n\tb=mFuNB9Wsp395tc7feZiqD6REbo3a4KX4k24UvuQBlypcaKe4cm8CIfMvJZX5f1/PB+\n\tCsqIZjpKN2i6LTzq+nUJBQcoGSMFWtHx/Yiu4NjDcFY2mVPkoi1BCt0qAjSP3rL3vJiB\n\ts1oqbe83tPXnrTk0fAnkCw06TUKXNq6VDzINhXBEu4k9VNnQ68/+StEAzqNokbHnZRoV\n\torB0lia4tRLfT2XQ0jyAI6EbnJdM9vZeHt/i7GVhtvpBz9zGvLtGURqMsMzpuEoc9jWh\n\tt0gvNaHniKGNNskCN8mqkY+cjUt7CkedVHWhq2iYZRAN5eTHAlRzi2E1X4vpp8mvlkVP\n\tdv2A==",
        "X-Gm-Message-State": "AOJu0YzKrWL2K9k/pHwR02nwQ4kvai0jhn30/K+2oxrlt09qIC9a2B1K\n\tIabzUuhj2f/jGYfk6r9vK34ZQHTS9K982wjPMT4uSCunkiaYmj7+ecal4oY/ptH7lviv6ptcFD0\n\t=",
        "X-Google-Smtp-Source": "AGHT+IHDwgNMxvJ0xeXvNmvEhvEADay7+zUrXXQKPh2Lk1Ljm/if5wXbTMCqG/b+ycc+bci+TVxHDA==",
        "X-Received": "by 2002:a17:902:e850:b0:1fd:67c2:f97f with SMTP id\n\td9443c01a7336-20b36ec8c9emr3241755ad.28.1727368308328; \n\tThu, 26 Sep 2024 09:31:48 -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 v13 2/7] libcamera: Remove PipelineHandler Fatal check of\n\tnon-empty MediaDevices",
        "Date": "Thu, 26 Sep 2024 16:29:51 +0000",
        "Message-ID": "<20240926163141.1593026-3-chenghaoyang@google.com>",
        "X-Mailer": "git-send-email 2.46.1.824.gd892dcdcdd-goog",
        "In-Reply-To": "<20240926163141.1593026-1-chenghaoyang@google.com>",
        "References": "<20240926163141.1593026-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 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 \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": [
        "v13",
        "2/7"
    ]
}