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
22 22
23#undef HAVE_AV_CONFIG_H23#undef HAVE_AV_CONFIG_H
24#include "libavutil/pixdesc.h"24#include "libavutil/pixdesc.h"
25#include "libavutil/audioconvert.h"
25#include "libavfilter/avfiltergraph.h"26#include "libavfilter/avfiltergraph.h"
26 27
27static void usage(void)28static void usage(void)
@@ -67,10 +68,18 @@ static void print_digraph(FILE *outfile, AVFilterGraph *graph) · 39 unmodified lines
67 dst_filter_ctx->filter->name);68 dst_filter_ctx->filter->name);
68 69
69 fprintf(outfile, "\"%s\" -> \"%s\"", filter_ctx_label, dst_filter_ctx_label);70 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 if (link->type == AVMEDIA_TYPE_VIDEO) {
71 link->type == AVMEDIA_TYPE_VIDEO ? av_pix_fmt_descriptors[link->format].name :72 fprintf(outfile, " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ]",
72 link->type == AVMEDIA_TYPE_AUDIO ? av_get_sample_fmt_name(link->format) : "unknown",73 av_pix_fmt_descriptors[link->format].name,
73 link->w, link->h, link->time_base.num, link->time_base.den);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");
74 }83 }
75 }84 }
76 }85 }

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