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>
This commit is contained in:
Laurent Pinchart
2020-05-01 19:31:55 +03:00
parent 4866bf6fe7
commit 554cbc0fa8
2 changed files with 10 additions and 0 deletions

View File

@@ -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;

View File

@@ -314,6 +314,15 @@ done:
* \return The MediaDevice model name
*/
/**
* \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