aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-01-19 19:38:11 +0100
committerNicolas George <nicolas.george@normalesup.org>2012-01-24 11:38:56 +0100
commit1fa88f343aa1cd6bbb4d90a1016037e08721a328 (patch)
treedbeeaed79a0b4b53064e1346eac416a72852b5cf
parent0c3577bfd98a8a3791adb7c01b4a203dddb345f8 (diff)
downloadffmpeg-1fa88f343aa1cd6bbb4d90a1016037e08721a328.tar.gz
lavd/lavfi: add dumpgraph option.
-rw-r--r--Changelog1
-rw-r--r--libavdevice/lavfi.c9
2 files changed, 10 insertions, 0 deletions
diff --git a/Changelog b/Changelog
index 6f69c45529..c9f017b0d9 100644
--- a/Changelog
+++ b/Changelog
@@ -28,6 +28,7 @@ version next:
- rv34: frame-level multi-threading
- optimized iMDCT transform on x86 using SSE for for mpegaudiodec
- Improved PGS subtitle decoder
+- dumpgraph option to lavfi device
version 0.9:
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index de3731a086..c4a0654c17 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -41,6 +41,7 @@
typedef struct {
AVClass *class; ///< class for private options
char *graph_str;
+ char *dump_graph;
AVFilterGraph *graph;
AVFilterContext **sinks;
int *sink_stream_map;
@@ -230,6 +231,13 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx,
if ((ret = avfilter_graph_config(lavfi->graph, avctx)) < 0)
FAIL(ret);
+ if (lavfi->dump_graph) {
+ char *dump = avfilter_graph_dump(lavfi->graph, lavfi->dump_graph);
+ fputs(dump, stderr);
+ fflush(stderr);
+ av_free(dump);
+ }
+
/* fill each stream with the information in the corresponding sink */
for (i = 0; i < avctx->nb_streams; i++) {
AVFilterLink *link = lavfi->sinks[lavfi->stream_sink_map[i]]->inputs[0];
@@ -329,6 +337,7 @@ static int lavfi_read_packet(AVFormatContext *avctx, AVPacket *pkt)
static const AVOption options[] = {
{ "graph", "Libavfilter graph", OFFSET(graph_str), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC },
+ { "dumpgraph", "Dump graph to stderr", OFFSET(dump_graph), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ NULL },
};