summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2019-01-16 11:59:56 +0100
committerJacopo Mondi <jacopo@jmondi.org>2019-01-21 11:35:44 +0100
commit5c85ef58833ee9866a3280d0dac6b285bc9ab6ad (patch)
tree18b8243f10a19ac1aa0e46238994459a39fadfab
parentec53057f0af858a0fbfbb6ceeb3cf83b5921858f (diff)
libcamera: media_object: Set devnode in MediaEntity
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. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/libcamera/include/media_object.h1
-rw-r--r--src/libcamera/media_object.cpp11
2 files changed, 12 insertions, 0 deletions
diff --git a/src/libcamera/include/media_object.h b/src/libcamera/include/media_object.h
index a10f7e13..fad55a06 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 530db71d..7d075384 100644
--- a/src/libcamera/media_object.cpp
+++ b/src/libcamera/media_object.cpp
@@ -264,6 +264,15 @@ void MediaPad::addLink(MediaLink *link)
*/
/**
+ * \fn MediaEntity::devnode()
+ * \brief Retrieve the entity's device node path, if any
+ *
+ * \sa int setDeviceNode()
+ *
+ * \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
* \return The interface major number, or 0 if the entity isn't associated with
@@ -330,6 +339,8 @@ int MediaEntity::setDeviceNode(const std::string &devnode)
return ret;
}
+ devnode_ = devnode;
+
return 0;
}