summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-05-01 19:31:55 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-05-02 01:11:46 +0300
commit554cbc0fa8984ce7109c3b85d13900a890e8563e (patch)
treeedc92473467045ab0b3d49978f9dfbe5eabb82d6
parent4866bf6fe7e080b6b7f0842353d2383a3273f1c5 (diff)
libcamera: media_device: Expose media device API version number
Add a MediaDevice::version() function to expose the media device API version number. This can be useful to support driver API changes in pipeline handlers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
-rw-r--r--src/libcamera/include/media_device.h1
-rw-r--r--src/libcamera/media_device.cpp9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/libcamera/include/media_device.h b/src/libcamera/include/media_device.h
index 44a59e70..4d9f7661 100644
--- a/src/libcamera/include/media_device.h
+++ b/src/libcamera/include/media_device.h
@@ -40,6 +40,7 @@ public:
const std::string driver() const { return driver_; }
const std::string deviceNode() const { return deviceNode_; }
const std::string model() const { return model_; }
+ unsigned int version() const { return version_; }
const std::vector<MediaEntity *> &entities() const { return entities_; }
MediaEntity *getEntityByName(const std::string &name) const;
diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp
index 0d6b5efd..d4e7e100 100644
--- a/src/libcamera/media_device.cpp
+++ b/src/libcamera/media_device.cpp
@@ -315,6 +315,15 @@ done:
*/
/**
+ * \fn MediaDevice::version()
+ * \brief Retrieve the media device API version
+ *
+ * The version is formatted with the KERNEL_VERSION() macro.
+ *
+ * \return The MediaDevice API version
+ */
+
+/**
* \fn MediaDevice::entities()
* \brief Retrieve the list of entities in the media graph
* \return The list of MediaEntities registered in the MediaDevice