Skip to content
Snippets Groups Projects
Commit 009026ef authored by Stefano Sabatini's avatar Stefano Sabatini Committed by Janne Grunau
Browse files

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

parent 6c60fcf8
No related branches found
No related tags found
No related merge requests found
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#undef HAVE_AV_CONFIG_H #undef HAVE_AV_CONFIG_H
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
#include "libavutil/audioconvert.h"
#include "libavfilter/avfiltergraph.h" #include "libavfilter/avfiltergraph.h"
static void usage(void) static void usage(void)
...@@ -67,10 +68,18 @@ static void print_digraph(FILE *outfile, AVFilterGraph *graph) ...@@ -67,10 +68,18 @@ static void print_digraph(FILE *outfile, AVFilterGraph *graph)
dst_filter_ctx->filter->name); dst_filter_ctx->filter->name);
fprintf(outfile, "\"%s\" -> \"%s\"", filter_ctx_label, dst_filter_ctx_label); fprintf(outfile, "\"%s\" -> \"%s\"", filter_ctx_label, dst_filter_ctx_label);
fprintf(outfile, " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ];\n", if (link->type == AVMEDIA_TYPE_VIDEO) {
link->type == AVMEDIA_TYPE_VIDEO ? av_pix_fmt_descriptors[link->format].name : fprintf(outfile, " [ label= \"fmt:%s w:%d h:%d tb:%d/%d\" ]",
link->type == AVMEDIA_TYPE_AUDIO ? av_get_sample_fmt_name(link->format) : "unknown", av_pix_fmt_descriptors[link->format].name,
link->w, link->h, link->time_base.num, link->time_base.den); 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= \"fmt:%s sr:%"PRId64" cl:%s\" ]",
av_get_sample_fmt_name(link->format),
link->sample_rate, buf);
}
fprintf(outfile, ";\n");
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment