summaryrefslogtreecommitdiff
path: root/libavfilter/graphparser.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2013-07-02 01:39:14 +0200
committerStefano Sabatini <stefasab@gmail.com>2013-07-03 13:21:42 +0200
commit838bd731393a29a41a86ff15ccf972f967306319 (patch)
treedc3861a36f6338bab0531b00aea8adfbcd77a2c4 /libavfilter/graphparser.c
parent5efbeae38cdcf8ed099be06f59fb422b5004e163 (diff)
downloadffmpeg-838bd731393a29a41a86ff15ccf972f967306319.tar.gz
lavfi: create Libav-API compatibility layer for avfilter_graph_parse() at the next bump
Add function avfilter_graph_parse_ptr() and favor it in place of avfilter_graph_parse(), which will be restored with the old/Libav signature at the next bump. If HAVE_INCOMPATIBLE_LIBAV_API is enabled it will use the Libav-compatible signature for avfilter_graph_parse(). At the next major bump the current implementation of avfilter_graph_parse() should be dropped in favor of the Libav/old implementation. Should address trac ticket #2672.
Diffstat (limited to 'libavfilter/graphparser.c')
-rw-r--r--libavfilter/graphparser.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/libavfilter/graphparser.c b/libavfilter/graphparser.c
index 9241cf3bf2..6cf19e9860 100644
--- a/libavfilter/graphparser.c
+++ b/libavfilter/graphparser.c
@@ -447,14 +447,12 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters,
return ret;
}
+#if HAVE_INCOMPATIBLE_LIBAV_ABI || !FF_API_OLD_GRAPH_PARSE
int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
- AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr,
- void *log_ctx)
+ AVFilterInOut *open_inputs,
+ AVFilterInOut *open_outputs, void *log_ctx)
{
-#if 0
int ret;
- AVFilterInOut *open_inputs = open_inputs_ptr ? *open_inputs_ptr : NULL;
- AVFilterInOut *open_outputs = open_outputs_ptr ? *open_outputs_ptr : NULL;
AVFilterInOut *cur, *match, *inputs = NULL, *outputs = NULL;
if ((ret = avfilter_graph_parse2(graph, filters, &inputs, &outputs)) < 0)
@@ -508,14 +506,22 @@ int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
}
avfilter_inout_free(&inputs);
avfilter_inout_free(&outputs);
- /* clear open_in/outputs only if not passed as parameters */
- if (open_inputs_ptr) *open_inputs_ptr = open_inputs;
- else avfilter_inout_free(&open_inputs);
- if (open_outputs_ptr) *open_outputs_ptr = open_outputs;
- else avfilter_inout_free(&open_outputs);
+ avfilter_inout_free(&open_inputs);
+ avfilter_inout_free(&open_outputs);
return ret;
-}
#else
+int avfilter_graph_parse(AVFilterGraph *graph, const char *filters,
+ AVFilterInOut **inputs, AVFilterInOut **outputs,
+ void *log_ctx)
+{
+ return avfilter_graph_parse_ptr(graph, filters, inputs, outputs, log_ctx);
+}
+#endif
+
+int avfilter_graph_parse_ptr(AVFilterGraph *graph, const char *filters,
+ AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr,
+ void *log_ctx)
+{
int index = 0, ret = 0;
char chr = 0;
@@ -595,5 +601,3 @@ end:
}
return ret;
}
-
-#endif