Show a patch.

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

{
    "id": 21416,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/21416/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21416/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20240930063342.3014837-3-chenghaoyang@google.com>",
    "date": "2024-09-30T06:29:43",
    "name": "[v14,2/7] 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/1.1/people/117/?format=api",
        "name": "Cheng-Hao Yang",
        "email": "chenghaoyang@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21416/mbox/",
    "series": [
        {
            "id": 4637,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4637/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4637",
            "date": "2024-09-30T06:29:41",
            "name": "Add VirtualPipelineHandler",
            "version": 14,
            "mbox": "https://patchwork.libcamera.org/series/4637/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21416/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21416/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 E73D3C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 30 Sep 2024 06:34:01 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0FAF763518;\n\tMon, 30 Sep 2024 08:34:01 +0200 (CEST)",
            "from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com\n\t[IPv6:2607:f8b0:4864:20::52f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BB01863512\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Sep 2024 08:33:52 +0200 (CEST)",
            "by mail-pg1-x52f.google.com with SMTP id\n\t41be03b00d2f7-7db238d07b3so3393393a12.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 29 Sep 2024 23:33:52 -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\td2e1a72fcca58-71b265166e2sm5487671b3a.131.2024.09.29.23.33.49\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 29 Sep 2024 23:33:50 -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=\"YuUQE9Sw\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1727678031; x=1728282831;\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=YuUQE9Sw9Mf6CY67ztmx7vV5eyCgH29e8iyepgaGM4cNlnX+EImbURFG9Keqf1t87o\n\tbqxHauKeRirOzPDDYmabaQW2/fY7bkJ6yxcAEb8g+6YU9uSApBU/a4dHr26UMWz5nanz\n\tR1POUIXHSIUGECx2+BJJjDD6pciN31xDw3qNk=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1727678031; x=1728282831;\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=rkHW+xGhZQjDdztIKXGONVba8mjlkVcIxBkE5Opu52tJOq0THZvQtCjh8SFdsxfaAF\n\tXr19VFqtazKBgAd3gU921Sh7XXdrBVsMq6oavU/Vlcw6FFjdjKJ76qMXVcgVSLdlkkIu\n\tMd/gzE9Hq0OS9TPfz7lWfw9elFJrAhnA63+4DCn9QTIQzg99yxqQxlEvlrxBtc2pGlXF\n\tHUJe8DglYCcKbWqL7TEQhlYQV2oxQe2k2+1BmmFDAKX0aMDymaikYMQ4JNNtFdstbg23\n\tvd8H+GKhapJsJRaqdV3x40Qd9Jt6edj4qZr2FoVl1QYojH/rMeadREh3pnxBUpdZCq2g\n\tw2lw==",
        "X-Gm-Message-State": "AOJu0Yz9bxBa20IEjbOmvFj00MEqeCbBaHaiacqdnN+VEUFsWcSJpQpB\n\t1RNph678EUcx9X4CjBT48Z1ryrHeEp8MgK0CY98tmiQ3LjEzxCaAzVVn7U7q5a4e2h/KoPzXP1M\n\t=",
        "X-Google-Smtp-Source": "AGHT+IFQ8kPHAz+7QdmuTluFHhcW/RLpJsPLaqiWLCyFraOok/vzNs/Y+JmbSyjPDtT0cFDT6rmYMg==",
        "X-Received": "by 2002:a05:6a20:5194:b0:1d5:10c3:adcd with SMTP id\n\tadf61e73a8af0-1d510c3ae36mr5941154637.31.1727678030673; \n\tSun, 29 Sep 2024 23:33:50 -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 v14 2/7] libcamera: Remove PipelineHandler Fatal check of\n\tnon-empty MediaDevices",
        "Date": "Mon, 30 Sep 2024 06:29:43 +0000",
        "Message-ID": "<20240930063342.3014837-3-chenghaoyang@google.com>",
        "X-Mailer": "git-send-email 2.46.1.824.gd892dcdcdd-goog",
        "In-Reply-To": "<20240930063342.3014837-1-chenghaoyang@google.com>",
        "References": "<20240930063342.3014837-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": [
        "v14",
        "2/7"
    ]
}