diff options
author | Todor Tomov <ttomov@mm-sol.com> | 2011-01-25 17:46:49 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-04-08 10:32:49 +0200 |
commit | b16cbe7bce0fd8d9d940473a2272b6b0148795c3 (patch) | |
tree | 8c273d84a3687ca19e08a2028f92a199e2337bcc | |
parent | 44a9923154c16ba57fe3f69e7643f7ef200b2a0b (diff) |
Print all links in media_print_topology_text()
Add printing of inbound links in media_print_topology_text().
Signed-off-by: Todor Tomov <ttomov@mm-sol.com>
-rw-r--r-- | src/main.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -267,7 +267,7 @@ static void media_print_topology_text(struct media_device *media) padding = printf("- entity %u: ", entity->info.id); printf("%s (%u pad%s, %u link%s)\n", entity->info.name, entity->info.pads, entity->info.pads > 1 ? "s" : "", - entity->info.links, entity->info.links > 1 ? "s" : ""); + entity->num_links, entity->num_links > 1 ? "s" : ""); printf("%*ctype %s subtype %s\n", padding, ' ', media_entity_type_to_string(entity->info.type), media_entity_subtype_to_string(entity->info.type)); @@ -286,14 +286,18 @@ static void media_print_topology_text(struct media_device *media) for (k = 0; k < entity->num_links; k++) { struct media_link *link = &entity->links[k]; - - if (link->source->entity != entity || - link->source->index != j) + struct media_pad *source = link->source; + struct media_pad *sink = link->sink; + + if (source->entity == entity && source->index == j) + printf("\t\t-> '%s':pad%u [", + sink->entity->info.name, sink->index); + else if (sink->entity == entity && sink->index == j) + printf("\t\t<- '%s':pad%u [", + source->entity->info.name, source->index); + else continue; - printf("\t\t-> '%s':pad%u [", - link->sink->entity->info.name, link->sink->index); - if (link->flags & MEDIA_LINK_FLAG_IMMUTABLE) printf("IMMUTABLE,"); if (link->flags & MEDIA_LINK_FLAG_ENABLED) |