Show a patch.

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

{
    "id": 9547,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/9547/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9547/",
    "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": "<20200909104754.25940-1-email@uajain.com>",
    "date": "2020-09-09T10:47:54",
    "name": "[libcamera-devel,v2] android: camera_device: Fix value of orientation metadata",
    "commit_ref": "e917655d06ec86224b10b992e036460a7334b407",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "11219cb4536394e114eedff2064f98aed574fafe",
    "submitter": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/people/1/?format=api",
        "name": "Umang Jain",
        "email": "email@uajain.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/9547/mbox/",
    "series": [
        {
            "id": 1277,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1277/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1277",
            "date": "2020-09-09T10:47:54",
            "name": "[libcamera-devel,v2] android: camera_device: Fix value of orientation metadata",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1277/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9547/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9547/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 F306FBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  9 Sep 2020 10:48:02 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7A70E62CBA;\n\tWed,  9 Sep 2020 12:48:02 +0200 (CEST)",
            "from mail.uajain.com (static.126.159.217.95.clients.your-server.de\n\t[95.217.159.126])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0425D60534\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  9 Sep 2020 12:48:00 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=uajain.com header.i=@uajain.com\n\theader.b=\"mlXNszYT\"; dkim-atps=neutral",
        "From": "Umang Jain <email@uajain.com>",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=uajain.com; s=mail;\n\tt=1599648479; bh=ibukZ4NBXyyovdTmeSSkYu/Z+mtD81B6T+QAlnTqTZw=;\n\th=From:To:Cc:Subject;\n\tb=mlXNszYTid1i3Wq3sI7cwzpLkRvvbcBwIT3NfKeffg+PR7pu2ZMWQ7ZKwIbuAu12t\n\tOIKasVVXOwSifBU9na3OVb3olsTIHSfryVs5UjNIm5pGrBbK6oUDt82MbKnYILvjMV\n\tBUXgdJD9T8WwmsynDfeTItkeiNS/5GRr7nJqQy01c0RlKzw/eUojJ6QQSIFQnXtnWO\n\t1q9z0l8Re4i3L4QojmOtu3w6RqM/+I128gc7jvTPlvSO2WSIlusGEUTrnlDpolMwLB\n\tHCbVkY3qHZSI73NaoDjVHR5tM/h06oCyEW3LGhzH1+B1gXe9eOHNwELBZ3y+2Rh+Sr\n\tmtArydfeMvULg==",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  9 Sep 2020 16:17:54 +0530",
        "Message-Id": "<20200909104754.25940-1-email@uajain.com>",
        "Mime-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2] android: camera_device: Fix value of\n\torientation metadata",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Android's orientation metadata cannot have identical numerical\nvalue to libcamera's rotation property. This is due to the fact\nthat libcamera's rotation property specify the correction angle\nin anticlockwise direction whereas Android's orientation metadata\nspecifies the value in clockwise direction. Fix that by computing\ncorresponding value for clockwise direction from libcamera's rotation\nproperty.\n\nSigned-off-by: Umang Jain <email@uajain.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/android/camera_device.cpp | 15 ++++++++++-----\n 1 file changed, 10 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 2582991..8be846b 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -265,12 +265,17 @@ int CameraDevice::initialize()\n \t}\n \n \t/*\n-\t * The Android orientation metadata and libcamera rotation property are\n-\t * defined differently but have identical numerical values for Android\n-\t * devices such as phones and tablets.\n+\t * The Android orientation metadata specifies its rotation correction\n+\t * value in clockwise direction whereas libcamera specifies the\n+\t * rotation property in anticlockwise direction. Read the libcamera's\n+\t * rotation property (anticlockwise) and compute the corresponding\n+\t * value for clockwise direction as required by the Android orientation\n+\t * metadata.\n \t */\n-\tif (properties.contains(properties::Rotation))\n-\t\torientation_ = properties.get(properties::Rotation);\n+\tif (properties.contains(properties::Rotation)) {\n+\t\tint rotation = properties.get(properties::Rotation);\n+\t\torientation_ = (360 - rotation) % 360;\n+\t}\n \n \tint ret = camera_->acquire();\n \tif (ret) {\n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}