Show a patch.

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

{
    "id": 342,
    "url": "https://patchwork.libcamera.org/api/patches/342/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/342/",
    "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": "<20190122234505.32634-9-niklas.soderlund@ragnatech.se>",
    "date": "2019-01-22T23:45:05",
    "name": "[libcamera-devel,8/8,POC] cam: add hack option to staticly configure a pipeline",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "be42cc2a6345b9505f1e2d70a94f41d998031b28",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/342/mbox/",
    "series": [
        {
            "id": 118,
            "url": "https://patchwork.libcamera.org/api/series/118/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=118",
            "date": "2019-01-22T23:44:57",
            "name": "libcamera: add basic support for Streams and format configuration",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/118/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/342/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/342/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5AA2060C83\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jan 2019 00:46:44 +0100 (CET)",
            "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid ec8c39d8-1e9f-11e9-911a-0050569116f7;\n\tWed, 23 Jan 2019 00:46:22 +0100 (CET)"
        ],
        "X-Halon-ID": "ec8c39d8-1e9f-11e9-911a-0050569116f7",
        "Authorized-sender": "niklas@soderlund.pp.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 23 Jan 2019 00:45:05 +0100",
        "Message-Id": "<20190122234505.32634-9-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190122234505.32634-1-niklas.soderlund@ragnatech.se>",
        "References": "<20190122234505.32634-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 8/8] [POC] cam: add hack option to\n\tstaticly configure a pipeline",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Tue, 22 Jan 2019 23:46:44 -0000"
    },
    "content": "This is a hack prof of concept to try out the application API to query a\ncamera about its streams and then proceed to use that information to\nconfigure a static resolution of 640x480.\n\nNot-yet-Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/cam/main.cpp | 38 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 38 insertions(+)",
    "diff": "diff --git a/src/cam/main.cpp b/src/cam/main.cpp\nindex 22211670c6250887..6ff6dc978d91d323 100644\n--- a/src/cam/main.cpp\n+++ b/src/cam/main.cpp\n@@ -21,6 +21,7 @@ enum {\n \tOptCamera = 'c',\n \tOptHelp = 'h',\n \tOptList = 'l',\n+\tOptStreamsConfig = 'C',\n };\n \n static int parseOptions(int argc, char *argv[])\n@@ -32,6 +33,7 @@ static int parseOptions(int argc, char *argv[])\n \t\t\t \"camera\");\n \tparser.addOption(OptHelp, \"Display this help message\", \"help\");\n \tparser.addOption(OptList, \"List all cameras\", \"list\");\n+\tparser.addOption(OptStreamsConfig, \"Configure the first stream to 640x480\", \"hack-config\");\n \n \toptions = std::move(parser.parse(argc, argv));\n \tif (!options.valid())\n@@ -79,6 +81,42 @@ int main(int argc, char **argv)\n \t\t}\n \t}\n \n+\tif (options.isSet(OptStreamsConfig)) {\n+\t\tif (!options.isSet(OptCamera)) {\n+\t\t\tstd::cout << \"Can't configure stream, no camera selected\" << std::endl;\n+\t\t\tgoto out;\n+\t\t}\n+\n+\t\tstd::shared_ptr<Camera> cam = cm->get(options[OptCamera]);\n+\t\tif (!cam) {\n+\t\t\tstd::cout << \"Camera \" << options[OptCamera]\n+\t\t\t\t  << \" not found\" << std::endl;\n+\t\t\tgoto out;\n+\t\t}\n+\n+\t\tstd::vector<Stream> streams = cam->streams();\n+\t\tif (streams.size() != 1) {\n+\t\t\tstd::cout << \"Camera have \" << streams.size() <<\n+\t\t\t\t\" streams, I only know how to work with 1\" << std::endl;\n+\t\t\tgoto out;\n+\t\t}\n+\n+\t\tStreamConfiguration config = StreamConfiguration(streams.front());\n+\t\tconfig.setDimension(640, 480);\n+\n+\t\tstd::vector<StreamConfiguration *> configs;\n+\t\tconfigs.push_back(&config);\n+\n+\t\tif (cam->acquire()) {\n+\t\t\tstd::cout << \"Failed to acquire camera\" << std::endl;\n+\t\t\tgoto out;\n+\t\t}\n+\n+\t\tif (cam->configure(configs))\n+\t\t\tstd::cout << \"Failed to configure camera\" << std::endl;\n+\t}\n+\n+out:\n \tcm->stop();\n \n \treturn 0;\n",
    "prefixes": [
        "libcamera-devel",
        "8/8",
        "POC"
    ]
}