{"id":800,"url":"https://patchwork.libcamera.org/api/1.1/patches/800/?format=json","web_url":"https://patchwork.libcamera.org/patch/800/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190326083902.26121-6-jacopo@jmondi.org>","date":"2019-03-26T08:38:48","name":"[libcamera-devel,v5,05/19] libcamera: v4l2_subdevice: Rename deviceName() method","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"32296243f4f39c3cb2305d3ff06c095074add930","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/800/mbox/","series":[{"id":219,"url":"https://patchwork.libcamera.org/api/1.1/series/219/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=219","date":"2019-03-26T08:38:43","name":"libcamera: ipu3: Add ImgU support","version":5,"mbox":"https://patchwork.libcamera.org/series/219/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/800/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/800/checks/","tags":{},"headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B0E961113\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Mar 2019 09:38:33 +0100 (CET)","from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay10.mail.gandi.net (Postfix) with ESMTPSA id ADE6B240005;\n\tTue, 26 Mar 2019 08:38:32 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 26 Mar 2019 09:38:48 +0100","Message-Id":"<20190326083902.26121-6-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20190326083902.26121-1-jacopo@jmondi.org>","References":"<20190326083902.26121-1-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v5 05/19] libcamera: v4l2_subdevice:\n\tRename deviceName() method","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":"Tue, 26 Mar 2019 08:38:33 -0000"},"content":"Rename the 'deviceName()' method to 'entityName()' as it actually\nreturns the name of the entity backing the v4l2 subdevice.\n\nWhile at it, make the names getter methods return a const reference\ninstead of returning by copy.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_subdevice.h | 4 ++--\n src/libcamera/v4l2_subdevice.cpp       | 4 ++--\n test/v4l2_subdevice/list_formats.cpp   | 6 +++---\n 3 files changed, 7 insertions(+), 7 deletions(-)","diff":"diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\nindex 3ecf08514898..f42cccabda94 100644\n--- a/src/libcamera/include/v4l2_subdevice.h\n+++ b/src/libcamera/include/v4l2_subdevice.h\n@@ -37,8 +37,8 @@ public:\n \tbool isOpen() const;\n \tvoid close();\n \n-\tstd::string deviceNode() const { return entity_->deviceNode(); }\n-\tstd::string deviceName() const { return entity_->name(); }\n+\tconst std::string &deviceNode() const { return entity_->deviceNode(); }\n+\tconst std::string &entityName() const { return entity_->name(); }\n \n \tint setCrop(unsigned int pad, Rectangle *rect);\n \tint setCompose(unsigned int pad, Rectangle *rect);\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex 8260e6ebce0e..10925f9fe497 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -166,7 +166,7 @@ void V4L2Subdevice::close()\n  */\n \n /**\n- * \\fn V4L2Subdevice::deviceName()\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@@ -315,7 +315,7 @@ int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format)\n \n std::string V4L2Subdevice::logPrefix() const\n {\n-\treturn \"'\" + deviceName() + \"'\";\n+\treturn \"'\" + entityName() + \"'\";\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 bf8597797d4b..db486554b7b5 100644\n--- a/test/v4l2_subdevice/list_formats.cpp\n+++ b/test/v4l2_subdevice/list_formats.cpp\n@@ -51,7 +51,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_->deviceName() << endl;\n+\t\t     << scaler_->entityName() << endl;\n \t\treturn TestFail;\n \t}\n \tfor (auto it = formats.begin(); it != formats.end(); ++it)\n@@ -60,7 +60,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_->deviceName() << endl;\n+\t\t     << scaler_->entityName() << endl;\n \t\treturn TestFail;\n \t}\n \tfor (auto it = formats.begin(); it != formats.end(); ++it)\n@@ -70,7 +70,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_->deviceName()\n+\t\t     << scaler_->entityName()\n \t\t     << \" should return an empty format list\" << endl;\n \t\treturn TestFail;\n \t}\n","prefixes":["libcamera-devel","v5","05/19"]}