@@ -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<std::string> &entities() { return entities_; }
+
+private:
+ std::string driver_;
+ std::vector<std::string> entities_;
+};
+
class MediaDevice
{
public:
Add the MediaDeviceDesc class which represents the description of a media graph and the entities it contains. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> --- src/libcamera/include/media_device.h | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) -- 2.20.1