Show a patch.

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

{
    "id": 1181,
    "url": "https://patchwork.libcamera.org/api/patches/1181/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1181/",
    "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": "<20190508165814.26201-5-niklas.soderlund@ragnatech.se>",
    "date": "2019-05-08T16:58:13",
    "name": "[libcamera-devel,4/5] test: v4l2_device: Reset media links and set a resolution",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "fe0c8772e9ed11400746d4cf2c64527505fb205e",
    "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/1181/mbox/",
    "series": [
        {
            "id": 301,
            "url": "https://patchwork.libcamera.org/api/series/301/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=301",
            "date": "2019-05-08T16:58:09",
            "name": "test: v4l2_device: Cleanups and a small speed increase",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/301/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1181/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1181/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C8AD60E7D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 May 2019 18:58:34 +0200 (CEST)",
            "from localhost.localdomain (unknown [79.138.136.66])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 8277c700-71b2-11e9-81fd-0050569116f7;\n\tWed, 08 May 2019 18:58:32 +0200 (CEST)"
        ],
        "X-Halon-ID": "8277c700-71b2-11e9-81fd-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,  8 May 2019 18:58:13 +0200",
        "Message-Id": "<20190508165814.26201-5-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190508165814.26201-1-niklas.soderlund@ragnatech.se>",
        "References": "<20190508165814.26201-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 4/5] test: v4l2_device: Reset media links\n\tand set a resolution",
        "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": "Wed, 08 May 2019 16:58:34 -0000"
    },
    "content": "When initializing the test reset any media links and set a know\nresolutions. This is needed to put the device under test into known\nstate and not have the v4l2 device tests depend on that no one have\ntouched the device before the test is executed.\n\nThe resolution is picked purely at random and could possibly be moved to\neach test case if there is a need for different resolutions for a\nspecific one.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n test/v4l2_device/v4l2_device_test.cpp | 19 ++++++++++++++++++-\n 1 file changed, 18 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/test/v4l2_device/v4l2_device_test.cpp b/test/v4l2_device/v4l2_device_test.cpp\nindex ee5a8e009bef2a5e..5bd80a6c68d796b6 100644\n--- a/test/v4l2_device/v4l2_device_test.cpp\n+++ b/test/v4l2_device/v4l2_device_test.cpp\n@@ -54,7 +54,24 @@ int V4L2DeviceTest::init()\n \tif (!capture_)\n \t\treturn TestFail;\n \n-\treturn capture_->open();\n+\tmedia_->acquire();\n+\tif (media_->disableLinks())\n+\t\treturn TestFail;\n+\tmedia_->release();\n+\n+\tif (capture_->open())\n+\t\treturn TestFail;\n+\n+\tV4L2DeviceFormat format = {};\n+\tif (capture_->getFormat(&format))\n+\t\treturn TestFail;\n+\n+\tformat.size.width = 640;\n+\tformat.size.height = 480;\n+\tif (capture_->setFormat(&format))\n+\t\treturn TestFail;\n+\n+\treturn TestPass;\n }\n \n void V4L2DeviceTest::cleanup()\n",
    "prefixes": [
        "libcamera-devel",
        "4/5"
    ]
}