From patchwork Mon Jan 21 15:30:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 297 Return-Path: Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ACEE060C78 for ; Mon, 21 Jan 2019 16:30:45 +0100 (CET) X-Halon-ID: 82bee41e-1d91-11e9-9adf-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 82bee41e-1d91-11e9-9adf-005056917a89; Mon, 21 Jan 2019 16:30:41 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Mon, 21 Jan 2019 16:30:04 +0100 Message-Id: <20190121153005.19110-2-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121153005.19110-1-niklas.soderlund@ragnatech.se> References: <20190121153005.19110-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] libcamera: media_device: expose media graph model name X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 15:30:46 -0000 Pipeline handlers such as the upcoming ucvideo handler needs the model name to properly name the Camera object it creates. 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 a8dec0d3347bd5fc..d96b8ec718427011 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 devnode() const { return devnode_; } + 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 devnode_; + std::string model_; int fd_; bool valid_; bool acquired_; diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp index a346296bc38e8f3d..b315e4f383b3bbb1 100644 --- a/src/libcamera/media_device.cpp +++ b/src/libcamera/media_device.cpp @@ -162,6 +162,7 @@ int MediaDevice::open() } driver_ = info.driver; + model_ = info.model; return 0; } @@ -285,6 +286,12 @@ int MediaDevice::populate() * \return The MediaDevice devnode 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