aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-06-06 23:18:46 +0200
committerStefano Sabatini <stefasab@gmail.com>2012-06-06 23:20:02 +0200
commitce7266c66a709d104d6c35f29dd629092aa0bc07 (patch)
tree0bc5954363b16988cb4d5630dd835a528e35c5b6
parent20689670c8af3862a4e13ba4192f3197fa42363b (diff)
downloadffmpeg-ce7266c66a709d104d6c35f29dd629092aa0bc07.tar.gz
tools/graph2dot: factorize code printing non-media specific link information
-rw-r--r--tools/graph2dot.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/tools/graph2dot.c b/tools/graph2dot.c
index 0b8dd03b83..e3a12e29f0 100644
--- a/tools/graph2dot.c
+++ b/tools/graph2dot.c
@@ -67,29 +67,27 @@ static void print_digraph(FILE *outfile, AVFilterGraph *graph)
dst_filter_ctx->name,
dst_filter_ctx->filter->name);
- fprintf(outfile, "\"%s\" -> \"%s\"",
- filter_ctx_label, dst_filter_ctx_label);
+ fprintf(outfile, "\"%s\" -> \"%s\" [ label= \"inpad:%s ",
+ filter_ctx_label, dst_filter_ctx_label, link->srcpad->name);
+
if (link->type == AVMEDIA_TYPE_VIDEO) {
fprintf(outfile,
- " [ label= \"inpad:%s fmt:%s w:%d h:%d tb:%d/%d outpad:%s\" ]",
- link->srcpad->name,
+ "fmt:%s w:%d h:%d tb:%d/%d",
av_pix_fmt_descriptors[link->format].name,
- link->w, link->h, link->time_base.num,
- link->time_base.den,
- link->dstpad->name);
+ link->w, link->h,
+ link->time_base.num, link->time_base.den);
} else if (link->type == AVMEDIA_TYPE_AUDIO) {
char buf[255];
av_get_channel_layout_string(buf, sizeof(buf), -1,
link->channel_layout);
fprintf(outfile,
- " [ label= \"inpad:%s fmt:%s sr:%"PRId64" cl:%s tb:%d/%d outpad:%s\" ]",
- link->srcpad->name,
+ "fmt:%s sr:%"PRId64" cl:%s tb:%d/%d",
av_get_sample_fmt_name(link->format),
link->sample_rate, buf,
- link->time_base.num, link->time_base.den,
- link->dstpad->name);
+ link->time_base.num, link->time_base.den);
}
- fprintf(outfile, ";\n");
+
+ fprintf(outfile, " outpad:%s\" ];\n", link->dstpad->name);
}
}
}