diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-07-03 21:37:44 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-08-31 22:44:10 +0300 |
commit | a376aa331ae9308f55baa9bb50680c35dc032058 (patch) | |
tree | dd3d6badc55a1932af86ed54c01b8e879ab971b1 /src/libcamera/media_device.cpp | |
parent | 2e4fc65f77309fd99225ab0b40c123f92eba13a8 (diff) |
libcamera: media_object: Expose entity type
Add a new field to the MediaEntity class to identify the type of
interface it exposes to userspace. The MediaEntity constructor is
changed to take a media_v2_interface pointer instead of just the device
node major and minor to have access to the interface type.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Tested-by: Martin Kepplinger <martin.kepplinger@puri.sm>
Diffstat (limited to 'src/libcamera/media_device.cpp')
-rw-r--r-- | src/libcamera/media_device.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp index 2d519126..ccaf039b 100644 --- a/src/libcamera/media_device.cpp +++ b/src/libcamera/media_device.cpp @@ -652,14 +652,7 @@ bool MediaDevice::populateEntities(const struct media_v2_topology &topology) */ struct media_v2_interface *iface = findInterface(topology, ent->id); - - MediaEntity *entity; - if (iface) - entity = new MediaEntity(this, ent, - iface->devnode.major, - iface->devnode.minor); - else - entity = new MediaEntity(this, ent); + MediaEntity *entity = new MediaEntity(this, ent, iface); if (!addObject(entity)) { delete entity; |