Show a patch.

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

{
    "id": 3826,
    "url": "https://patchwork.libcamera.org/api/patches/3826/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3826/",
    "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": "<20200520100320.436430-2-jacopo@jmondi.org>",
    "date": "2020-05-20T10:03:20",
    "name": "[libcamera-devel,v2,2/2] libcamera: properties: Re-name location to orientation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "ef985abf4392396e7ca2d1cf67233948f7029122",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3826/mbox/",
    "series": [
        {
            "id": 916,
            "url": "https://patchwork.libcamera.org/api/series/916/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=916",
            "date": "2020-05-20T10:03:19",
            "name": "[libcamera-devel,v2,1/2] include: linux: Update v4l2 ctrls for properties",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/916/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3826/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3826/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net\n\t[217.70.183.198])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 882C860DF9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 May 2020 12:00:05 +0200 (CEST)",
            "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay6-d.mail.gandi.net (Postfix) with ESMTPSA id E516FC001C;\n\tWed, 20 May 2020 10:00:04 +0000 (UTC)"
        ],
        "X-Originating-IP": "2.224.242.101",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 20 May 2020 12:03:20 +0200",
        "Message-Id": "<20200520100320.436430-2-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.26.2",
        "In-Reply-To": "<20200520100320.436430-1-jacopo@jmondi.org>",
        "References": "<20200520100320.436430-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 2/2] libcamera: properties: Re-name\n\tlocation to orientation",
        "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>",
        "X-List-Received-Date": "Wed, 20 May 2020 10:00:06 -0000"
    },
    "content": "Adapt the libcamera property name to match the V4L2 control name in the\nproperties definition and in the property collection routine.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/camera_sensor.cpp | 32 ++++++++++++++++----------------\n src/libcamera/property_ids.yaml | 10 +++++-----\n 2 files changed, 21 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 174df17cfaef..db65e154f985 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -209,32 +209,32 @@ int CameraSensor::init()\n \tconst ControlInfoMap &controls = subdev_->controls();\n \tint32_t propertyValue;\n \n-\t/* Camera Location: default is front location. */\n-\tconst auto &locationControl = controls.find(V4L2_CID_CAMERA_SENSOR_LOCATION);\n-\tif (locationControl != controls.end()) {\n-\t\tint32_t v4l2Location =\n-\t\t\tlocationControl->second.def().get<int32_t>();\n+\t/* Camera Orientation: default is front orientation. */\n+\tconst auto &orientationControl = controls.find(V4L2_CID_CAMERA_ORIENTATION);\n+\tif (orientationControl != controls.end()) {\n+\t\tint32_t v4l2Orientation =\n+\t\t\torientationControl->second.def().get<int32_t>();\n \n-\t\tswitch (v4l2Location) {\n+\t\tswitch (v4l2Orientation) {\n \t\tdefault:\n \t\t\tLOG(CameraSensor, Warning)\n-\t\t\t\t<< \"Unsupported camera location \"\n-\t\t\t\t<< v4l2Location << \", setting to Front\";\n+\t\t\t\t<< \"Unsupported camera orientation \"\n+\t\t\t\t<< v4l2Orientation << \", setting to Front\";\n \t\t\t/* Fall-through */\n-\t\tcase V4L2_LOCATION_FRONT:\n-\t\t\tpropertyValue = properties::CameraLocationFront;\n+\t\tcase V4L2_CAMERA_ORIENTATION_FRONT:\n+\t\t\tpropertyValue = properties::CameraOrientationFront;\n \t\t\tbreak;\n-\t\tcase V4L2_LOCATION_BACK:\n-\t\t\tpropertyValue = properties::CameraLocationBack;\n+\t\tcase V4L2_CAMERA_ORIENTATION_BACK:\n+\t\t\tpropertyValue = properties::CameraOrientationBack;\n \t\t\tbreak;\n-\t\tcase V4L2_LOCATION_EXTERNAL:\n-\t\t\tpropertyValue = properties::CameraLocationExternal;\n+\t\tcase V4L2_CAMERA_ORIENTATION_EXTERNAL:\n+\t\t\tpropertyValue = properties::CameraOrientationExternal;\n \t\t\tbreak;\n \t\t}\n \t} else {\n-\t\tpropertyValue = properties::CameraLocationFront;\n+\t\tpropertyValue = properties::CameraOrientationFront;\n \t}\n-\tproperties_.set(properties::Location, propertyValue);\n+\tproperties_.set(properties::Orientation, propertyValue);\n \n \t/* Camera Rotation: default is 0 degrees. */\n \tconst auto &rotationControl = controls.find(V4L2_CID_CAMERA_SENSOR_ROTATION);\ndiff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml\nindex ce627fa042ba..9cce8b2c9552 100644\n--- a/src/libcamera/property_ids.yaml\n+++ b/src/libcamera/property_ids.yaml\n@@ -5,22 +5,22 @@\n %YAML 1.2\n ---\n controls:\n-  - Location:\n+  - Orientation:\n       type: int32_t\n       description: |\n-        Camera mounting location\n+        The camera orientation, defined by the camera mounting position.\n       enum:\n-        - name: CameraLocationFront\n+        - name: CameraOrientationFront\n           value: 0\n           description: |\n             The camera is mounted on the front side of the device, facing the\n             user\n-        - name: CameraLocationBack\n+        - name: CameraOrientationBack\n           value: 1\n           description: |\n             The camera is mounted on the back side of the device, facing away\n             from the user\n-        - name: CameraLocationExternal\n+        - name: CameraOrientationExternal\n           value: 2\n           description: |\n             The camera is attached to the device in a way that allows it to\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "2/2"
    ]
}