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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user