libcamera: media_device: Create entities with major and minor numbers
Extend the MediaEntity object with device node major and minor numbers, and retrieve them from the media graph using interfaces. They will be used by the DeviceEnumerator to retrieve the devnode path. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
14291e50b7
commit
d4af90d729
@@ -54,6 +54,8 @@ private:
|
||||
|
||||
std::vector<MediaEntity *> entities_;
|
||||
|
||||
struct media_v2_interface *findInterface(const struct media_v2_topology &topology,
|
||||
unsigned int entityId);
|
||||
bool populateEntities(const struct media_v2_topology &topology);
|
||||
bool populatePads(const struct media_v2_topology &topology);
|
||||
bool populateLinks(const struct media_v2_topology &topology);
|
||||
|
||||
@@ -80,21 +80,28 @@ class MediaEntity : public MediaObject
|
||||
{
|
||||
public:
|
||||
const std::string &name() const { return name_; }
|
||||
unsigned int major() const { return major_; }
|
||||
unsigned int minor() const { return minor_; }
|
||||
|
||||
const std::vector<MediaPad *> &pads() const { return pads_; }
|
||||
|
||||
const MediaPad *getPadByIndex(unsigned int index) const;
|
||||
const MediaPad *getPadById(unsigned int id) const;
|
||||
|
||||
int setDeviceNode(const std::string &devnode);
|
||||
|
||||
private:
|
||||
friend class MediaDevice;
|
||||
|
||||
MediaEntity(const struct media_v2_entity *entity);
|
||||
MediaEntity(const struct media_v2_entity *entity,
|
||||
unsigned int major = 0, unsigned int minor = 0);
|
||||
MediaEntity(const MediaEntity &) = delete;
|
||||
~MediaEntity();
|
||||
|
||||
std::string name_;
|
||||
std::string devnode_;
|
||||
unsigned int major_;
|
||||
unsigned int minor_;
|
||||
|
||||
std::vector<MediaPad *> pads_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user