History

In graph2dot, print more specific audio information for audio links.

Stefano Sabatini committed 15 years ago

Commit 5d329e21 parent 2613c811 file · +13 −4Browse files

Unified · Split

tools/graph2dot.c+13−4
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222
2323 #undef HAVE_AV_CONFIG_H
2424 #include "libavutil/pixdesc.h"
25+#include "libavutil/audioconvert.h"
2526 #include "libavfilter/avfiltergraph.h"
2627
2728 static void usage(void)
@@ -67,10 +68,18 @@ static void print_digraph(FILE *outfile, AVFilterGraph *graph) · 39 unmodified lines
6768 dst_filter_ctx->filter->name);
6869
6970 fprintf(outfile, "\"%s\" -> \"%s\"", filter_ctx_label, dst_filter_ctx_label);
70− fprintf(outfile, " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ];\n",
71− link->type == AVMEDIA_TYPE_VIDEO ? av_pix_fmt_descriptors[link->format].name :
72− link->type == AVMEDIA_TYPE_AUDIO ? av_get_sample_fmt_name(link->format) : "unknown",
73− link->w, link->h, link->time_base.num, link->time_base.den);
71+ if (link->type == AVMEDIA_TYPE_VIDEO) {
72+ fprintf(outfile, " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ]",
73+ av_pix_fmt_descriptors[link->format].name,
74+ link->w, link->h, link->time_base.num, link->time_base.den);
75+ } else if (link->type == AVMEDIA_TYPE_AUDIO) {
76+ char buf[255];
77+ av_get_channel_layout_string(buf, sizeof(buf), -1, link->channel_layout);
78+ fprintf(outfile, " [ label= \"fmt:%s sr:%"PRId64" cl:%s\" ]",
79+ av_get_sample_fmt_name(link->format),
80+ link->sample_rate, buf);
81+ }
82+ fprintf(outfile, ";\n");
7483 }
7584 }
7685 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t