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:
parent
1af83ca6df
commit
5db44e6da7
2 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue