summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-01-20 15:55:03 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-01-22 14:54:20 +0100
commit5db44e6da72f1734f4d423b33af511a4d68bfcf1 (patch)
tree92195c20c86b0aaa449a046a1c7f101d5d2b909a /src
parent1af83ca6df779fc3c7f8f4fc48f3ca82d824987d (diff)
libcamera: media_device: expose media graph model name
Pipeline handlers such as the upcoming ucvideo handler need the model name to properly name the Camera objects they create. Store the model name when querying the media device info and handle it in a similar fashion as the driver name which is already retrieved. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/include/media_device.h2
-rw-r--r--src/libcamera/media_device.cpp7
2 files changed, 9 insertions, 0 deletions
diff --git a/src/libcamera/include/media_device.h b/src/libcamera/include/media_device.h
index ba3046dd..8a7b9489 100644
--- a/src/libcamera/include/media_device.h
+++ b/src/libcamera/include/media_device.h
@@ -36,6 +36,7 @@ public:
const std::string driver() const { return driver_; }
const std::string deviceNode() const { return deviceNode_; }
+ const std::string model() const { return model_; }
const std::vector<MediaEntity *> &entities() const { return entities_; }
MediaEntity *getEntityByName(const std::string &name) const;
@@ -50,6 +51,7 @@ public:
private:
std::string driver_;
std::string deviceNode_;
+ std::string model_;
int fd_;
bool valid_;
bool acquired_;
diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp
index 81c6a773..b12e7143 100644
--- a/src/libcamera/media_device.cpp
+++ b/src/libcamera/media_device.cpp
@@ -166,6 +166,7 @@ int MediaDevice::open()
}
driver_ = info.driver;
+ model_ = info.model;
return 0;
}
@@ -291,6 +292,12 @@ int MediaDevice::populate()
*/
/**
+ * \fn MediaDevice::model()
+ * \brief Retrieve the media device model name
+ * \return The MediaDevice model name
+ */
+
+/**
* \fn MediaDevice::entities()
* \brief Retrieve the list of entities in the media graph
* \return The list of MediaEntities registered in the MediaDevice