From b16cbe7bce0fd8d9d940473a2272b6b0148795c3 Mon Sep 17 00:00:00 2001 From: Todor Tomov Date: Tue, 25 Jan 2011 17:46:49 +0200 Subject: Print all links in media_print_topology_text() Add printing of inbound links in media_print_topology_text(). Signed-off-by: Todor Tomov --- src/main.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 9b34008..0bc6135 100644 --- a/src/main.c +++ b/src/main.c @@ -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) -- cgit v1.2.3