From patchwork Wed Jan 16 13:59:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 252 Return-Path: Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E23AD60C9A for ; Wed, 16 Jan 2019 14:59:50 +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 relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 6E212C0008; Wed, 16 Jan 2019 13:59:50 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 16 Jan 2019 14:59:47 +0100 Message-Id: <20190116135949.2097-4-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190116135949.2097-1-jacopo@jmondi.org> References: <20190116135949.2097-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/5] libcamera: media_object: Set devnode in MediaEntity 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, 16 Jan 2019 13:59:51 -0000 The MediaEntity::setDeviceNode() function was designed to set the device node path associated with a MediaEntity. The function was there, but the devnode_ member field was never actually set. Fix this. While at there add a getter method for the devnode_ member as it will soon be used. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/libcamera/include/media_object.h | 1 + src/libcamera/media_object.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/libcamera/include/media_object.h b/src/libcamera/include/media_object.h index a10f7e1..fad55a0 100644 --- a/src/libcamera/include/media_object.h +++ b/src/libcamera/include/media_object.h @@ -85,6 +85,7 @@ class MediaEntity : public MediaObject public: const std::string &name() const { return name_; } unsigned int function() const { return function_; } + const std::string &devnode() const { return devnode_; } unsigned int deviceMajor() const { return major_; } unsigned int deviceMinor() const { return minor_; } diff --git a/src/libcamera/media_object.cpp b/src/libcamera/media_object.cpp index 76dd326..4e90443 100644 --- a/src/libcamera/media_object.cpp +++ b/src/libcamera/media_object.cpp @@ -263,6 +263,15 @@ void MediaPad::addLink(MediaLink *link) * \return The entity's function */ +/** + * \fn MediaEntity::devnode() + * \brief Retrieve the entity's device node path, if any + * + * \sa int MediaEntity::setDeviceNode(const std::string &devnode) + * + * \return The entity's device node path, or an empty string if it is not set + */ + /** * \fn MediaEntity::deviceMajor() * \brief Retrieve the major number of the interface associated with the entity @@ -330,6 +339,8 @@ int MediaEntity::setDeviceNode(const std::string &devnode) return ret; } + devnode_ = devnode; + return 0; }