Show a patch.

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

{
    "id": 471,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/471/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/471/",
    "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": "<20190201151354.17980-1-niklas.soderlund@ragnatech.se>",
    "date": "2019-02-01T15:13:54",
    "name": "[libcamera-devel] libcamera: pipeline: vimc: create camera for Sensor B",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "dd7318586de1b9e361122df1bc8ebbfcb7898a7c",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/471/mbox/",
    "series": [
        {
            "id": 161,
            "url": "https://patchwork.libcamera.org/api/1.1/series/161/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=161",
            "date": "2019-02-01T15:13:54",
            "name": "[libcamera-devel] libcamera: pipeline: vimc: create camera for Sensor B",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/161/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/471/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/471/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 906E960B10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Feb 2019 16:14:06 +0100 (CET)",
            "from localhost.localdomain (unknown [91.183.179.147])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid fe2e104d-2633-11e9-b5ae-0050569116f7;\n\tFri, 01 Feb 2019 16:14:02 +0100 (CET)"
        ],
        "X-Halon-ID": "fe2e104d-2633-11e9-b5ae-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": "Fri,  1 Feb 2019 16:13:54 +0100",
        "Message-Id": "<20190201151354.17980-1-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] libcamera: pipeline: vimc: create camera\n\tfor Sensor B",
        "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": "Fri, 01 Feb 2019 15:14:06 -0000"
    },
    "content": "Create a camera for Sensor B of the vimc pipeline. At this stage only\nSensor B is exposed while the are in total two sensors in the graph.\nGoing forward Sensor A should also be exposed as another camera. Sensor\nB was chosen since the graph is configured correctly for it out of the\nbox. As we lack control over sub devices formats it's not really\npossible to use Sensor A yet with the library.\n\nOnce both cameras are registered with the library they should be\nextended to provide two streams each, one for the raw output and one for\nthe output which uses the shared scaler.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/vimc.cpp | 17 +++++++++++++++--\n 1 file changed, 15 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\nindex 6ed069edec550a61..6ab6e203785499ec 100644\n--- a/src/libcamera/pipeline/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc.cpp\n@@ -12,6 +12,7 @@\n #include \"log.h\"\n #include \"media_device.h\"\n #include \"pipeline_handler.h\"\n+#include \"v4l2_device.h\"\n \n namespace libcamera {\n \n@@ -33,16 +34,20 @@ public:\n \n private:\n \tstd::shared_ptr<MediaDevice> media_;\n+\tV4L2Device *video_;\n \tStream stream_;\n };\n \n PipeHandlerVimc::PipeHandlerVimc(CameraManager *manager)\n-\t: PipelineHandler(manager), media_(nullptr)\n+\t: PipelineHandler(manager), media_(nullptr), video_(nullptr)\n {\n }\n \n PipeHandlerVimc::~PipeHandlerVimc()\n {\n+\tif (video_)\n+\t\tdelete video_;\n+\n \tif (media_)\n \t\tmedia_->release();\n }\n@@ -93,8 +98,16 @@ bool PipeHandlerVimc::match(DeviceEnumerator *enumerator)\n \n \tmedia_->acquire();\n \n+\tvideo_ = new V4L2Device(*media_->getEntityByName(\"Raw Capture 1\"));\n+\n+\tif (video_->open()) {\n+\t\tmedia_->release();\n+\t\treturn false;\n+\t}\n+\n \tstd::vector<Stream *> streams{ &stream_ };\n-\tstd::shared_ptr<Camera> camera = Camera::create(this, \"Dummy VIMC Camera\", streams);\n+\tstd::shared_ptr<Camera> camera = Camera::create(this, \"VIMC Sensor B\",\n+\t\t\t\t\t\t\tstreams);\n \tregisterCamera(std::move(camera));\n \n \treturn true;\n",
    "prefixes": [
        "libcamera-devel"
    ]
}