From patchwork Fri Dec 28 07:57:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 93 Return-Path: Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2DB9860B32 for ; Fri, 28 Dec 2018 08:58:00 +0100 (CET) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id BE7E81BF206; Fri, 28 Dec 2018 07:57:59 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Fri, 28 Dec 2018 08:57:42 +0100 Message-Id: <20181228075743.28637-4-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181228075743.28637-1-jacopo@jmondi.org> References: <20181228075743.28637-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH RESEND v2 3/4] libcamera: media device: Add MediaDeviceDesc 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: Fri, 28 Dec 2018 07:58:00 -0000 Add the MediaDeviceDesc class which represents the description of a media graph and the entities it contains. Signed-off-by: Jacopo Mondi --- src/libcamera/include/media_device.h | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) -- 2.20.1 diff --git a/src/libcamera/include/media_device.h b/src/libcamera/include/media_device.h index 642eea9..e1b26e2 100644 --- a/src/libcamera/include/media_device.h +++ b/src/libcamera/include/media_device.h @@ -19,6 +19,48 @@ namespace libcamera { +/** + * \class MediaDeviceDesc + * \brief Collects the representation of a media device + * + * The MediaDeviceDesc class allows components of the library to create + * a description of a media device, specifying a driver name and a list of + * entity names contained in it. + */ +class MediaDeviceDesc +{ +public: + /** + * \brief Construct a representation of a media device handled + * by driver \a driver's name + * \param driver The name of the driver that controls the media graph + * as returned by MEDIA_IOC_DEVICE_INFO + */ + MediaDeviceDesc(const std::string &driver) : driver_(driver) { } + + /** + * \brief Add an entity name to the list of entities handled in the + * media graph. + * \param entity The name of the entity to add + */ + void addEntity(const std::string entity) { entities_.push_back(entity); } + + /** + * \brief Return the name of the driver that controls the media graph + * as returned by MEDIA_IOC_DEVICE_INFO + */ + const std::string driver() { return driver_; } + + /** + * \brief Return the list of entities names + */ + std::vector &entities() { return entities_; } + +private: + std::string driver_; + std::vector entities_; +}; + class MediaDevice { public: