From patchwork Wed Jan 2 11:00:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 130 Return-Path: Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D72CD60B2F for ; Wed, 2 Jan 2019 12:00:19 +0100 (CET) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 99BF760016; Wed, 2 Jan 2019 11:00:18 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 2 Jan 2019 12:00:15 +0100 Message-Id: <20190102110016.5489-1-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] libcamera: media_device: Tiny valid() documentation improvement X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 11:00:20 -0000 Mention in the valid() method documentation, that a media graph has to be populated to be valid. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/media_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp index 1bd4f43..9fbc5a7 100644 --- a/src/libcamera/media_device.cpp +++ b/src/libcamera/media_device.cpp @@ -216,7 +216,7 @@ int MediaDevice::populate() /** * \fn MediaDevice::valid() - * \brief Query whether the media graph is valid + * \brief Query whether the media graph has been populated and is valid * \return true if the media graph is valid, false otherwise */ From patchwork Wed Jan 2 11:00:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 131 Return-Path: Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 804DF60B34 for ; Wed, 2 Jan 2019 12:00:20 +0100 (CET) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 22EBB6000C; Wed, 2 Jan 2019 11:00:19 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 2 Jan 2019 12:00:16 +0100 Message-Id: <20190102110016.5489-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190102110016.5489-1-jacopo@jmondi.org> References: <20190102110016.5489-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] libcamera: media_device: Make getEntityByName() const X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jan 2019 11:00:20 -0000 The function does not modify the instance state. Mark it as const. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/include/media_device.h | 2 +- src/libcamera/media_device.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/src/libcamera/include/media_device.h b/src/libcamera/include/media_device.h index d787be3..9db18bb 100644 --- a/src/libcamera/include/media_device.h +++ b/src/libcamera/include/media_device.h @@ -34,7 +34,7 @@ public: const std::string devnode() const { return devnode_; } const std::vector &entities() const { return entities_; } - MediaEntity *getEntityByName(const std::string &name); + MediaEntity *getEntityByName(const std::string &name) const; private: std::string driver_; diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp index 9fbc5a7..25d1825 100644 --- a/src/libcamera/media_device.cpp +++ b/src/libcamera/media_device.cpp @@ -244,7 +244,7 @@ int MediaDevice::populate() * \return The entity with \a name * \return nullptr if no entity with \a name is found */ -MediaEntity *MediaDevice::getEntityByName(const std::string &name) +MediaEntity *MediaDevice::getEntityByName(const std::string &name) const { for (MediaEntity *e : entities_) if (e->name() == name)