Show a patch.

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

{
    "id": 1057,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/1057/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1057/",
    "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": "<20190418141437.14014-11-laurent.pinchart@ideasonboard.com>",
    "date": "2019-04-18T14:14:34",
    "name": "[libcamera-devel,v3,10/13] libcamera: v4l2_subdevice: Add method to retrieve the media entity",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "759199f54b8699ddbe62a2a0be4eb48487fac7b4",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1057/mbox/",
    "series": [
        {
            "id": 256,
            "url": "https://patchwork.libcamera.org/api/1.1/series/256/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=256",
            "date": "2019-04-18T14:14:24",
            "name": "Rockchip ISP pipeline handler",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/256/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1057/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1057/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8BD5A60DD9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Apr 2019 16:14:58 +0200 (CEST)",
            "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 20C9F333\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Apr 2019 16:14:58 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555596898;\n\tbh=ILRE3jes+SJol1CGWD4Buu8u4PvudE83VpUzdZPq0RE=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=In6+5lGQ6Yre5akwBqBiQWNP+QzIZDJMrryj70JKJ4O28PEUSPdFaC2lrv8JQ7JrA\n\thYd2uvSrVkeRVaH2HxCeQC8B/3xM3hmiFRxcXSW5oZSbn6mkx8xAztB1wJiPlZqZ3O\n\teMkxRpLJ3NyElbx6ulT0d2Q1UcrF5rus/5idGtNY=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 18 Apr 2019 17:14:34 +0300",
        "Message-Id": "<20190418141437.14014-11-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190418141437.14014-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20190418141437.14014-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 10/13] libcamera: v4l2_subdevice: Add\n\tmethod to retrieve the media entity",
        "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": "Thu, 18 Apr 2019 14:15:00 -0000"
    },
    "content": "Add a method to retrieve the media entity associated with a subdevice.\nThe entityName() and deviceNode() methods are not needed anymore as they\ncan be accessed through the media entity, remove them.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_subdevice.h      |  3 +--\n src/libcamera/pipeline/ipu3/ipu3.cpp        |  4 ++--\n src/libcamera/v4l2_subdevice.cpp            | 22 +++++++--------------\n test/v4l2_subdevice/list_formats.cpp        |  6 +++---\n test/v4l2_subdevice/v4l2_subdevice_test.cpp |  2 +-\n 5 files changed, 14 insertions(+), 23 deletions(-)",
    "diff": "diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\nindex e592d67dd043..c7b0b4cb76ea 100644\n--- a/src/libcamera/include/v4l2_subdevice.h\n+++ b/src/libcamera/include/v4l2_subdevice.h\n@@ -41,8 +41,7 @@ public:\n \tbool isOpen() const;\n \tvoid close();\n \n-\tconst std::string &deviceNode() const { return entity_->deviceNode(); }\n-\tconst std::string &entityName() const { return entity_->name(); }\n+\tconst MediaEntity *entity() const { return entity_; }\n \n \tint setCrop(unsigned int pad, Rectangle *rect);\n \tint setCompose(unsigned int pad, Rectangle *rect);\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex fb9ee0af6c3a..f43969099b48 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -590,7 +590,7 @@ int PipelineHandlerIPU3::registerCameras()\n \t\t\t\t\t&IPU3CameraData::imguOutputBufferReady);\n \n \t\t/* Create and register the Camera instance. */\n-\t\tstd::string cameraName = cio2->sensor_->entityName() + \" \"\n+\t\tstd::string cameraName = cio2->sensor_->entity()->name() + \" \"\n \t\t\t\t       + std::to_string(id);\n \t\tstd::shared_ptr<Camera> camera = Camera::create(this,\n \t\t\t\t\t\t\t\tcameraName,\n@@ -1066,7 +1066,7 @@ int CIO2Device::init(const MediaDevice *media, unsigned int index)\n \t\t}\n \t}\n \tif (maxSize_.width == 0) {\n-\t\tLOG(IPU3, Info) << \"Sensor '\" << sensor_->entityName()\n+\t\tLOG(IPU3, Info) << \"Sensor '\" << sensor_->entity()->name()\n \t\t\t\t<< \"' detected, but no supported image format \"\n \t\t\t\t<< \" found: skip camera creation\";\n \t\treturn -ENODEV;\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex a03fadfd579e..5d5b168f98a2 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -131,12 +131,12 @@ int V4L2Subdevice::open()\n \t\treturn -EBUSY;\n \t}\n \n-\tret = ::open(deviceNode().c_str(), O_RDWR);\n+\tret = ::open(entity_->deviceNode().c_str(), O_RDWR);\n \tif (ret < 0) {\n \t\tret = -errno;\n \t\tLOG(V4L2Subdev, Error)\n-\t\t\t<< \"Failed to open V4L2 subdevice '\" << deviceNode()\n-\t\t\t<< \"': \" << strerror(-ret);\n+\t\t\t<< \"Failed to open V4L2 subdevice '\"\n+\t\t\t<< entity_->deviceNode() << \"': \" << strerror(-ret);\n \t\treturn ret;\n \t}\n \tfd_ = ret;\n@@ -166,17 +166,9 @@ void V4L2Subdevice::close()\n }\n \n /**\n- * \\fn V4L2Subdevice::deviceNode()\n- * \\brief Retrieve the path of the device node associated with the subdevice\n- *\n- * \\return The subdevice's device node system path\n- */\n-\n-/**\n- * \\fn V4L2Subdevice::entityName()\n- * \\brief Retrieve the name of the media entity associated with the subdevice\n- *\n- * \\return The name of the media entity the subdevice is associated to\n+ * \\fn V4L2Subdevice::entity()\n+ * \\brief Retrieve the media entity associated with the subdevice\n+ * \\return The subdevice's associated media entity.\n  */\n \n /**\n@@ -343,7 +335,7 @@ V4L2Subdevice *V4L2Subdevice::fromEntityName(const MediaDevice *media,\n \n std::string V4L2Subdevice::logPrefix() const\n {\n-\treturn \"'\" + entityName() + \"'\";\n+\treturn \"'\" + entity_->name() + \"'\";\n }\n \n int V4L2Subdevice::enumPadSizes(unsigned int pad,unsigned int code,\ndiff --git a/test/v4l2_subdevice/list_formats.cpp b/test/v4l2_subdevice/list_formats.cpp\nindex 09dec9abe854..18dd8761a8ab 100644\n--- a/test/v4l2_subdevice/list_formats.cpp\n+++ b/test/v4l2_subdevice/list_formats.cpp\n@@ -52,7 +52,7 @@ int ListFormatsTest::run()\n \tformats = scaler_->formats(0);\n \tif (formats.empty()) {\n \t\tcerr << \"Failed to list formats on pad 0 of subdevice \"\n-\t\t     << scaler_->entityName() << endl;\n+\t\t     << scaler_->entity()->name() << endl;\n \t\treturn TestFail;\n \t}\n \tfor (auto it = formats.begin(); it != formats.end(); ++it)\n@@ -61,7 +61,7 @@ int ListFormatsTest::run()\n \tformats = scaler_->formats(1);\n \tif (formats.empty()) {\n \t\tcerr << \"Failed to list formats on pad 1 of subdevice \"\n-\t\t     << scaler_->entityName() << endl;\n+\t\t     << scaler_->entity()->name() << endl;\n \t\treturn TestFail;\n \t}\n \tfor (auto it = formats.begin(); it != formats.end(); ++it)\n@@ -71,7 +71,7 @@ int ListFormatsTest::run()\n \tformats = scaler_->formats(2);\n \tif (!formats.empty()) {\n \t\tcerr << \"Listing formats on non-existing pad 2 of subdevice \"\n-\t\t     << scaler_->entityName()\n+\t\t     << scaler_->entity()->name()\n \t\t     << \" should return an empty format list\" << endl;\n \t\treturn TestFail;\n \t}\ndiff --git a/test/v4l2_subdevice/v4l2_subdevice_test.cpp b/test/v4l2_subdevice/v4l2_subdevice_test.cpp\nindex 06582969eb45..dfcf779af95e 100644\n--- a/test/v4l2_subdevice/v4l2_subdevice_test.cpp\n+++ b/test/v4l2_subdevice/v4l2_subdevice_test.cpp\n@@ -66,7 +66,7 @@ int V4L2SubdeviceTest::init()\n \tret = scaler_->open();\n \tif (ret) {\n \t\tcerr << \"Unable to open video subdevice \"\n-\t\t     << scaler_->deviceNode() << endl;\n+\t\t     << scaler_->entity()->deviceNode() << endl;\n \t\tmedia_->release();\n \t\treturn TestSkip;\n \t}\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "10/13"
    ]
}