diff options
author | Parthasarathi Susarla <partha.susarla@collabora.co.uk> | 2010-07-20 14:53:39 +0530 |
---|---|---|
committer | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2010-07-22 10:54:09 +0100 |
commit | e4f878c2fc9676d0d5d2e33227b058ebbdd5f39c (patch) | |
tree | c44d257603e76830fcdef7abdec43d25f2bfaa31 /tools | |
parent | 0c9577281e2e1693ac3f298c2b295983c66c2567 (diff) | |
download | gupnp-dlna-e4f878c2fc9676d0d5d2e33227b058ebbdd5f39c.tar.gz |
print topology instead of just the stream info
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gupnp-dlna-info.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/tools/gupnp-dlna-info.c b/tools/gupnp-dlna-info.c index e8fda89..12f9dc8 100644 --- a/tools/gupnp-dlna-info.c +++ b/tools/gupnp-dlna-info.c @@ -247,20 +247,33 @@ print_stream_info (GstStreamInformation * info, void *depth) } static void -print_duration (const GstDiscovererInformation * info, gint tab) +print_topology (GstStreamInformation * info, gint depth) { - g_print ("%*s%" GST_TIME_FORMAT "\n", tab + 1, " ", - GST_TIME_ARGS (info->duration)); + if (!info) + return; + + print_stream_info (info, GINT_TO_POINTER (depth)); + + if (info->next) + print_topology (info->next, depth + 1); + else if (info->streamtype == GST_STREAM_CONTAINER) { + GstStreamContainerInformation *cont = + (GstStreamContainerInformation *) info; + GList *tmp; + + for (tmp = cont->streams; tmp; tmp = tmp->next) { + GstStreamInformation *tmpinf = + (GstStreamInformation *) tmp->data; + print_topology (tmpinf, depth + 1); + } + } } static void -print_list (const GstDiscovererInformation * info, gint tab) +print_duration (const GstDiscovererInformation * info, gint tab) { - if (!info || !info->stream_list) - return; - - g_list_foreach (info->stream_list, (GFunc) print_stream_info, - GINT_TO_POINTER (tab)); + g_print ("%*s%" GST_TIME_FORMAT "\n", tab + 1, " ", + GST_TIME_ARGS (info->duration)); } static void @@ -287,8 +300,8 @@ print_gst_info (const GstDiscovererInformation *info, GError *err) if (verbose) { if (!(info->result & (GST_DISCOVERER_ERROR | GST_DISCOVERER_TIMEOUT))) { - g_print ("\nStream list:\n"); - print_list (info, 1); + g_print ("\nTopology:\n"); + print_topology (info->stream_info, 1); g_print ("\nDuration:\n"); print_duration (info, 1); } |