[libcamera-devel] [PATCH 1/2] libcamera: media_device: Expose media device API version number

Niklas Söderlund niklas.soderlund at ragnatech.se
Fri May 1 19:04:54 CEST 2020


Hi Laurent,

Thanks for your work.

On 2020-05-01 19:43:31 +0300, Laurent Pinchart wrote:
> 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 at ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

> ---
>  src/libcamera/include/media_device.h | 1 +
>  src/libcamera/media_device.cpp       | 9 +++++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/src/libcamera/include/media_device.h b/src/libcamera/include/media_device.h
> index 44a59e70139e..4d9f76618ec0 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 0d6b5efd9e7a..d4e7e1002224 100644
> --- a/src/libcamera/media_device.cpp
> +++ b/src/libcamera/media_device.cpp
> @@ -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
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list