From 5db44e6da72f1734f4d423b33af511a4d68bfcf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Sun, 20 Jan 2019 15:55:03 +0100 Subject: libcamera: media_device: expose media graph model name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Laurent Pinchart --- src/libcamera/include/media_device.h | 2 ++ src/libcamera/media_device.cpp | 7 +++++++ 2 files changed, 9 insertions(+) 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 &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; } @@ -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 -- cgit v1.2.1