libcamera: Add pointer to MediaDevice to MediaObject

Add a MediaDevice member field to the MediaObject class hierarcy.
Each media object now has a reference to the media device it belongs to,
and which it has been created by.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi
2019-01-03 12:07:08 +01:00
parent aed8c7823e
commit 6275a14215
3 changed files with 32 additions and 12 deletions
+2 -2
View File
@@ -430,11 +430,11 @@ bool MediaDevice::populateEntities(const struct media_v2_topology &topology)
MediaEntity *entity;
if (iface)
entity = new MediaEntity(&mediaEntities[i],
entity = new MediaEntity(this, &mediaEntities[i],
iface->devnode.major,
iface->devnode.minor);
else
entity = new MediaEntity(&mediaEntities[i]);
entity = new MediaEntity(this, &mediaEntities[i]);
if (!addObject(entity)) {
delete entity;