lavfi: dump the filter graph

Especially useful to see what video formats are involved on the various
filter links.

I suspect this function is not available on Libav, so add necessary
ifdeffery preemptively.
This commit is contained in:
wm4 2016-02-12 20:28:07 +01:00
parent f9f3175487
commit cf323d0cc1
1 changed files with 13 additions and 0 deletions

View File

@ -429,6 +429,17 @@ error:
return false;
}
static void dump_graph(struct lavfi *c)
{
#if LIBAVFILTER_VERSION_MICRO >= 100
MP_VERBOSE(c, "Filter graph:\n");
char *s = avfilter_graph_dump(c->graph, NULL);
if (s)
MP_VERBOSE(c, "%s\n", s);
av_free(s);
#endif
}
// Initialize the graph if all inputs have formats set. If it's already
// initialized, or can't be initialized yet, do nothing.
static void init_graph(struct lavfi *c)
@ -451,6 +462,8 @@ static void init_graph(struct lavfi *c)
}
c->initialized = true;
dump_graph(c);
}
}