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>
This commit is contained in:
@@ -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_;
|
||||
|
||||
@@ -166,6 +166,7 @@ int MediaDevice::open()
|
||||
}
|
||||
|
||||
driver_ = info.driver;
|
||||
model_ = info.model;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -290,6 +291,12 @@ int MediaDevice::populate()
|
||||
* \return The MediaDevice deviceNode path
|
||||
*/
|
||||
|
||||
/**
|
||||
* \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
|
||||
|
||||
Reference in New Issue
Block a user