Show a patch.

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

{
    "id": 17290,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17290/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17290/",
    "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": "<20220903181037.1406-4-laurent.pinchart@ideasonboard.com>",
    "date": "2022-09-03T18:10:37",
    "name": "[libcamera-devel,3/3] pipeline: uvcvideo: Fail match() if the camera has no supported format",
    "commit_ref": "6225d647b47982833fa654bf9cf65eb8c04d2036",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "36f8f27e5d9995575f45df498f5932a4f61ddab3",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17290/mbox/",
    "series": [
        {
            "id": 3466,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3466/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3466",
            "date": "2022-09-03T18:10:34",
            "name": "libcamera: Fix crash with UVC cameras that expose no supported format",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3466/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17290/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17290/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 5AB74C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  3 Sep 2022 18:10:57 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0C67862048;\n\tSat,  3 Sep 2022 20:10:57 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 97EF562033\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  3 Sep 2022 20:10:54 +0200 (CEST)",
            "from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1FC6F51E;\n\tSat,  3 Sep 2022 20:10:54 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1662228657;\n\tbh=YoHGUU+J9t51mCK0KvdpqzuRO7l4o4hUUuhgOmBgcf8=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Ef09zyUNhYWbvyZVDcVLT++d9PXNhfyC8+S4tordDqS5UkZLi1/kM3dB+c0i5edIx\n\t8ZWWDeXZ7PQrwsMeMd52T7YNzWqbBNCdDmR0izt6rTqc3adVEUmKJExZwTiqTX0R0I\n\t1c2a0b0hqBmHa1MgP0QiIdJyALhJM0lTIGgnujeO918qlyKlLFq0UFx5TXxtvgVkLS\n\tMeupuG+nG3JkjC6YQ2qRwcgGDYw2p1wyAy4LFFCIo0EXO/Ar7KhmdBxqsFbufRG+pB\n\tWhjkFTPzTfUAbhftxTMGycrcG+M4zlBMWoH53aLz18aPXn49McEwPo5cB7l0cWoQII\n\tp//BP519xr8kg==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1662228654;\n\tbh=YoHGUU+J9t51mCK0KvdpqzuRO7l4o4hUUuhgOmBgcf8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=DY5ie0OAsm+mMlutpEtOp88T88XCcUFdMsxetb0FlvmpVvLfqmBPi+njlj/OmC8xI\n\tKBmQT1LZI1KGsSFC/QYN5OUFPdIJn2jekJq9Bwfkw4N+h9HLOZEGqiIut/+W1d8A+A\n\tVDNoO61FQW2ZkmfuTWWZMRDdUpJJglXvrNp6Nfxs="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"DY5ie0OA\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat,  3 Sep 2022 21:10:37 +0300",
        "Message-Id": "<20220903181037.1406-4-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.35.1",
        "In-Reply-To": "<20220903181037.1406-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20220903181037.1406-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 3/3] pipeline: uvcvideo: Fail match() if\n\tthe camera has no supported format",
        "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>",
        "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "A UVC device could expose only formats that are not supported by\nlibcamera. The pipeline handler doesn't currently consider this as an\nerror, and happily creates a camera. The camera won't be usable, and\nworse, generateConfiguration() and validate() will crash as those\nfunctions assume that at least one format is supported.\n\nFix this by failing match() if none of the formats exposed by the camera\nare supported. Log an error message in that case to notify the user.\n\nBug: https://bugs.libcamera.org/show_bug.cgi?id=145\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 7 +++++++\n 1 file changed, 7 insertions(+)",
    "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex be0fbaea508a..a28195450634 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -457,6 +457,13 @@ int UVCCameraData::init(MediaDevice *media)\n \t\t}\n \t}\n \n+\tif (formats_.empty()) {\n+\t\tLOG(UVC, Error)\n+\t\t\t<< \"Camera \" << id_ << \" (\" << media->model()\n+\t\t\t<< \") doesn't expose any supported format\";\n+\t\treturn -EINVAL;\n+\t}\n+\n \t/* Populate the camera properties. */\n \tproperties_.set(properties::Model, utils::toAscii(media->model()));\n \n",
    "prefixes": [
        "libcamera-devel",
        "3/3"
    ]
}