History

tools/graph2dot: factorize code printing non-media specific link information

Stefano Sabatini committed 14 years ago

Commit ce7266c1 parent 20689671 file · +10 −12Browse files

Unified · Split

tools/graph2dot.c+10−12
@@ -67,29 +67,27 @@ static void print_digraph(FILE *outfile, AVFilterGraph *graph) · 66 unmodified lines
6767 dst_filter_ctx->name,
6868 dst_filter_ctx->filter->name);
6969
70− fprintf(outfile, "\"%s\" -> \"%s\"",
71− filter_ctx_label, dst_filter_ctx_label);
70+ fprintf(outfile, "\"%s\" -> \"%s\" [ label= \"inpad:%s ",
71+ filter_ctx_label, dst_filter_ctx_label, link->srcpad->name);
72+
7273 if (link->type == AVMEDIA_TYPE_VIDEO) {
7374 fprintf(outfile,
74− " [ label= \"inpad:%s fmt:%s w:%d h:%d tb:%d/%d outpad:%s\" ]",
75− link->srcpad->name,
75+ "fmt:%s w:%d h:%d tb:%d/%d",
7676 av_pix_fmt_descriptors[link->format].name,
77− link->w, link->h, link->time_base.num,
78− link->time_base.den,
79− link->dstpad->name);
77+ link->w, link->h,
78+ link->time_base.num, link->time_base.den);
8079 } else if (link->type == AVMEDIA_TYPE_AUDIO) {
8180 char buf[255];
8281 av_get_channel_layout_string(buf, sizeof(buf), -1,
8382 link->channel_layout);
8483 fprintf(outfile,
85− " [ label= \"inpad:%s fmt:%s sr:%"PRId64" cl:%s tb:%d/%d outpad:%s\" ]",
86− link->srcpad->name,
84+ "fmt:%s sr:%"PRId64" cl:%s tb:%d/%d",
8785 av_get_sample_fmt_name(link->format),
8886 link->sample_rate, buf,
89− link->time_base.num, link->time_base.den,
90− link->dstpad->name);
87+ link->time_base.num, link->time_base.den);
9188 }
92− fprintf(outfile, ";\n");
89+
90+ fprintf(outfile, " outpad:%s\" ];\n", link->dstpad->name);
9391 }
9492 }
9593 }

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