diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2014-01-27 02:11:47 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2014-03-10 19:53:59 +0100 |
commit | 69ded6a53907c667b01a2b1dcafc24715c9b5bff (patch) | |
tree | c592cd991a3740b2a594bfefe3ba1aea07b89656 /src/mediactl.c | |
parent | 00b872075dc1232ceeadb2a732b6926c285ac7fb (diff) |
Make the media_entity structure private
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Diffstat (limited to 'src/mediactl.c')
-rw-r--r-- | src/mediactl.c | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/src/mediactl.c b/src/mediactl.c index 304e185..dd5bd57 100644 --- a/src/mediactl.c +++ b/src/mediactl.c @@ -111,9 +111,38 @@ unsigned int media_get_entities_count(struct media_device *media) return media->entities_count; } -struct media_entity *media_get_entities(struct media_device *media) +struct media_entity *media_get_entity(struct media_device *media, unsigned int index) { - return media->entities; + if (index >= media->entities_count) + return NULL; + + return &media->entities[index]; +} + +const struct media_pad *media_entity_get_pad(struct media_entity *entity, unsigned int index) +{ + if (index >= entity->info.pads) + return NULL; + + return &entity->pads[index]; +} + +unsigned int media_entity_get_links_count(struct media_entity *entity) +{ + return entity->num_links; +} + +const struct media_link *media_entity_get_link(struct media_entity *entity, unsigned int index) +{ + if (index >= entity->num_links) + return NULL; + + return &entity->links[index]; +} + +const char *media_entity_get_devname(struct media_entity *entity) +{ + return entity->devname[0] ? entity->devname : NULL; } const struct media_device_info *media_get_info(struct media_device *media) @@ -126,6 +155,11 @@ const char *media_get_devnode(struct media_device *media) return media->devnode; } +const struct media_entity_desc *media_entity_get_info(struct media_entity *entity) +{ + return &entity->info; +} + /* ----------------------------------------------------------------------------- * Open/close */ |