Show a patch.

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

{
    "id": 18318,
    "url": "https://patchwork.libcamera.org/api/patches/18318/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18318/",
    "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": "<20230227224910.151337-3-suhrid.subramaniam@mediatek.com>",
    "date": "2023-02-27T22:49:10",
    "name": "[libcamera-devel,v2,2/2] libcamera: pipeline: converter: return unique converter only if Valid",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "556bdf215a184eec32e2d0b8226fc54137f76b56",
    "submitter": {
        "id": 151,
        "url": "https://patchwork.libcamera.org/api/people/151/?format=api",
        "name": "Suhrid Subramaniam",
        "email": "suhridsubramaniam@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18318/mbox/",
    "series": [
        {
            "id": 3775,
            "url": "https://patchwork.libcamera.org/api/series/3775/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3775",
            "date": "2023-02-27T22:49:08",
            "name": "Check converter_ validity",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/3775/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18318/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18318/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 9EC37C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Feb 2023 22:50:46 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2C50962694;\n\tMon, 27 Feb 2023 23:50:46 +0100 (CET)",
            "from mail-pf1-x435.google.com (mail-pf1-x435.google.com\n\t[IPv6:2607:f8b0:4864:20::435])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D6F1E62690\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Feb 2023 23:50:44 +0100 (CET)",
            "by mail-pf1-x435.google.com with SMTP id n2so4551468pfo.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Feb 2023 14:50:44 -0800 (PST)",
            "from localhost.localdomain (sfosm0151r356001-v22.wiline.com.\n\t[67.207.106.98]) by smtp.gmail.com with ESMTPSA id\n\t17-20020aa79111000000b005e00086250asm4663117pfh.125.2023.02.27.14.50.42\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 27 Feb 2023 14:50:42 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1677538246;\n\tbh=jaN+/nfcez7lJtFUSsvDq4Qe4wyry8QeqzQvJX6JMV4=;\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:Cc:\n\tFrom;\n\tb=ubCoTYpNqjC4txVPKmkati/yhqg7I55kX3hIho4e2yK5e5eI9+g6ff+jQ9viDZKyb\n\ttPlZfsSuQSt1r0SeduNFhQHa9FIYrlo9Cm7AwPTOtaTk7vN6c2zAK49FUD5GJ5crxN\n\tYQ1D1GVUhzzpIvVMF0NMKjkc5K+JIVhCNaC3/VtNBfVn3u3sRvzvH841OZTIHxOo5P\n\tdvU51o6wPY//S+yi0MQJyfYoPaHy6LrM3BU7dnkxApQRTpKdnJkNS3p8w6v2YgKlQI\n\t3M6XuLJpopYBEgxnJEOzaJuQG8cBXIWxfaVYf6hmCNjCwt4I3VMRdbfM4qjA2QkKqc\n\tfNWCXPN46yEDw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\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=TUwIo7V/DDZHADoaLqdJ9JLMhBpB5S/xmzbvJMLuhdc=;\n\tb=P5WaP6wn2Uo8eXemNUYiFIKL7Wsgsp5ZoWmqRxnI01mxZLPtSJfMealOjIS/7YUxC0\n\tnzy8F7Uh0BQ3YJbs3dkLVamhyMKkBP0dUvO6D4fOP8pCm2Sna7vE2FWwPUTb/yv1N/lu\n\tIK9XBtLUWxa7bY/IzsGDgP3WDeiI/830weBPiIG3nKBbrQsth6DLlSXlzg6WvK3AyEE2\n\tKyP8UNLq+w84yAxAkQ//ezoAjrXLD6fDCLkviFw51gDDYsKyOuh5MvqOmEv0kEHbKXsP\n\tX9Dnnb/UjSo4IwBF/Gbo5hNtnT305719lut6ywW8Nnr8QpDXccuUxZ7+CZwM/q+mwLgo\n\t1Hkw=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"P5WaP6wn\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\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=TUwIo7V/DDZHADoaLqdJ9JLMhBpB5S/xmzbvJMLuhdc=;\n\tb=FqNX5x2k2dd9gSkcsK34Vk9sk4ounk3HLCa1oiPQCah1QLlj0uWKZvphbsP8+5VsrG\n\tWnQFxjzmMrlaCQroWyn9vc7jhDoS+qh+nDhrQbOTgefiYyUcXFDxXw0e2xyrFj4gd9Eg\n\toIUN6pJqbVtLklecyoV9kQLQgSOHyyvRjzXjSGJYWJMVQ5XT6nYX/qFef/xHlR/FvVEB\n\terzjxTJ0Skd2Or5NwTWF2Wwgham04q7Fydfn+TcC2K4B/0WYrvOh94npyZUWfogKoCI1\n\tqiUySveIPbT7PYrGYDEuL2xbZyUBIkGR6zFqRY/jl6aSh1Xv+s7oxHiQlICT/tsri+h9\n\tZVyQ==",
        "X-Gm-Message-State": "AO0yUKV9JKV2LUDBE2+cOd/AayLhfXTmEU0dw+8k0hza0YxhXnVW3n8a\n\tCX8oLBKJCTb9Aelys8kBMpYX+kQ+ohyocA==",
        "X-Google-Smtp-Source": "AK7set9PK7hWKiaNryfwshNrXshsej1cAJgy7Yp3n2odsHYFzna8hsfXWu8aLC8Et9SRCEdYZzlPpA==",
        "X-Received": "by 2002:a62:cdcc:0:b0:5e9:5b99:da9a with SMTP id\n\to195-20020a62cdcc000000b005e95b99da9amr627409pfg.3.1677538243117; \n\tMon, 27 Feb 2023 14:50:43 -0800 (PST)",
        "X-Google-Original-From": "Suhrid Subramaniam <suhrid.subramaniam@mediatek.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 27 Feb 2023 14:49:10 -0800",
        "Message-Id": "<20230227224910.151337-3-suhrid.subramaniam@mediatek.com>",
        "X-Mailer": "git-send-email 2.39.0",
        "In-Reply-To": "<20230227224910.151337-1-suhrid.subramaniam@mediatek.com>",
        "References": "<20230227224910.151337-1-suhrid.subramaniam@mediatek.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 2/2] libcamera: pipeline: converter:\n\treturn unique converter only if Valid",
        "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": "Suhrid Subramaniam via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Suhrid Subramaniam <suhridsubramaniam@gmail.com>",
        "Cc": "Suhrid Subramaniam <suhrid.subramaniam@mediatek.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "- Use isValid() to check if m2m_ exists for the selected converter_.\n- create an instance of the converter only if it is Valid.\n\nSigned-off-by: Suhrid Subramaniam <suhrid.subramaniam@mediatek.com>\n---\n src/libcamera/converter.cpp | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/libcamera/converter.cpp b/src/libcamera/converter.cpp\nindex 3de39cff..8a34d068 100644\n--- a/src/libcamera/converter.cpp\n+++ b/src/libcamera/converter.cpp\n@@ -207,8 +207,9 @@ ConverterFactoryBase::ConverterFactoryBase(const std::string name, std::initiali\n  * \\param[in] media Name of the factory\n  *\n  * \\return A unique pointer to a new instance of the converter subclass\n- * corresponding to the named factory or one of its alias. Otherwise a null\n- * pointer if no such factory exists\n+ * corresponding to the named factory or one of its alias if the converter \n+ * instance is valid (checked using isValid()). Otherwise a null pointer \n+ * if no such factory exists\n  */\n std::unique_ptr<Converter> ConverterFactoryBase::create(MediaDevice *media)\n {\n@@ -227,7 +228,7 @@ std::unique_ptr<Converter> ConverterFactoryBase::create(MediaDevice *media)\n \t\t\t<< factory->name_ << \" factory with \"\n \t\t\t<< (it == compatibles.end() ? \"no\" : media->driver()) << \" alias.\";\n \n-\t\treturn factory->createInstance(media);\n+\t\treturn factory->createInstance(media)->isValid() ? factory->createInstance(media) : nullptr;\n \t}\n \n \treturn nullptr;\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "2/2"
    ]
}