diff options
author | Todor Tomov <ttomov@mm-sol.com> | 2011-01-25 17:46:42 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-02-07 15:36:52 +0100 |
commit | 7ac89cd8f37ce9665c1701521b27a19d64223bed (patch) | |
tree | c2c1094fe95b59e8f26af6b17050ac4e62da7059 | |
parent | 7ceb74fa28415ad6ea7f359d1c7a4914a952ad4c (diff) |
Modify media_entity_remote_pad() to return source pad only
Rename media_entity_remote_pad() to media_entity_remote_source().
When it is called on a sink pad, return the linked source pad.
When it is called on a source pad, return NULL.
Signed-off-by: Todor Tomov <ttomov@mm-sol.com>
-rw-r--r-- | media.c | 8 | ||||
-rw-r--r-- | media.h | 2 |
2 files changed, 5 insertions, 5 deletions
@@ -37,19 +37,19 @@ /* * media_entity_remote_pad - */ -struct media_entity_pad *media_entity_remote_pad(struct media_entity_pad *pad) +struct media_entity_pad *media_entity_remote_source(struct media_entity_pad *pad) { unsigned int i; + if (!(pad->flags & MEDIA_PAD_FLAG_INPUT)) + return NULL; + for (i = 0; i < pad->entity->info.links; ++i) { struct media_entity_link *link = &pad->entity->links[i]; if (!(link->flags & MEDIA_LINK_FLAG_ACTIVE)) continue; - if (link->source == pad) - return link->sink; - if (link->sink == pad) return link->source; } @@ -52,7 +52,7 @@ struct media_device { struct media_device *media_open(const char *name, int verbose); void media_close(struct media_device *media); -struct media_entity_pad *media_entity_remote_pad(struct media_entity_pad *pad); +struct media_entity_pad *media_entity_remote_source(struct media_entity_pad *pad); static inline unsigned int media_entity_type(struct media_entity *entity) { |