Patch Detail
Show a patch.
GET /api/1.1/patches/989/?format=api
{ "id": 989, "url": "https://patchwork.libcamera.org/api/1.1/patches/989/?format=api", "web_url": "https://patchwork.libcamera.org/patch/989/", "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": "<20190415165700.22970-9-laurent.pinchart@ideasonboard.com>", "date": "2019-04-15T16:56:57", "name": "[libcamera-devel,08/11] libcamera: v4l2-subdevice: Add method to retrieve the media entity", "commit_ref": null, "pull_url": null, "state": "superseded", "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/989/mbox/", "series": [ { "id": 250, "url": "https://patchwork.libcamera.org/api/1.1/series/250/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=250", "date": "2019-04-15T16:56:49", "name": "Rockchip ISP pipeline handler", "version": 1, "mbox": "https://patchwork.libcamera.org/series/250/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/989/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/989/checks/", "tags": {}, "headers": { "Return-Path": "<laurent.pinchart@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4B5EB60DCD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Apr 2019 18:57:17 +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 DFD82D82\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 Apr 2019 18:57:16 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555347437;\n\tbh=dOgeYcAcLpZS9dLxPjaI9sVH6kP4eFSJllxtR6uNn+c=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=mtyuliQijBnx3S+Nsiju/jh0MHxdy1T/K+f4osr73XCglE8vdiNALBuRO8Nq7TCDQ\n\t5noCKNnzdSwRAKW7T0tmMGL7EA4TQs3cPXVI3S5fiuLBgETo/3AW3tRgmIf8BE9sMh\n\tbs3EiLvXqxs4ma0CaIPJba0N19jsWJYAmU6BALzk=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 15 Apr 2019 19:56:57 +0300", "Message-Id": "<20190415165700.22970-9-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>", "References": "<20190415165700.22970-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 08/11] 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": "Mon, 15 Apr 2019 16:57:17 -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>\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 c71dce7d8644..31bc9d298e5b 100644\n--- a/src/libcamera/include/v4l2_subdevice.h\n+++ b/src/libcamera/include/v4l2_subdevice.h\n@@ -40,8 +40,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 4ddd1ede1c81..e3c79f93963e 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -579,7 +579,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@@ -1055,7 +1055,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 e34cc1693b46..6b2d7cce6794 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -126,12 +126,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@@ -161,17 +161,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@@ -338,7 +330,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", "08/11" ] }