Commit 3ddd8c08 authored by vitor's avatar vitor

Remove usage of AVFilterGraphDesc outside avfiltergraph.c

Commited in SoC by Vitor Sessak on 2008-03-26 20:51:24


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@12738 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent ba5ce89a
...@@ -554,16 +554,25 @@ static AVFilterGraphDesc *parse_chain(const char *filters, int has_in) ...@@ -554,16 +554,25 @@ static AVFilterGraphDesc *parse_chain(const char *filters, int has_in)
/** /**
* Parse a string describing a filter graph. * Parse a string describing a filter graph.
*/ */
AVFilterGraphDesc *avfilter_graph_parse_chain(const char *filters) int avfilter_graph_parse_chain(AVFilterGraph *graph, const char *filters, AVFilterContext *in, int inpad, AVFilterContext *out, int outpad)
{ {
AVFilterGraphDesc *ret; AVFilterGraphDesc *desc;
/* Try first to parse supposing there is no (in) element */ /* Try first to parse supposing there is no (in) element */
if ((ret = parse_chain(filters, 0))) if (!(desc = parse_chain(filters, 0))) {
return ret; /* If it didn't work, parse supposing there is an (in) element */
desc = parse_chain(filters, 1);
}
if (!desc)
return -1;
if (graph_load_from_desc3(graph, desc, in, inpad, out, outpad) < 0) {
avfilter_graph_free_desc(desc);
return -1;
}
/* Parse supposing there is an (in) element */ avfilter_graph_free_desc(desc);
return parse_chain(filters, 1); return 0;
} }
/** /**
......
...@@ -72,12 +72,16 @@ typedef struct AVFilterGraph { ...@@ -72,12 +72,16 @@ typedef struct AVFilterGraph {
} AVFilterGraph; } AVFilterGraph;
/** /**
* Parse a graph composed of a simple chain of filters which is described by * Add to a graph a graph described by a string.
* a single string. * @param graph the filter graph where to link the parsed graph context
* @param filters String listing filters and their arguments. * @param filters string to be parsed
* @return The parsed graph description. * @param in input to the graph to be parsed (TODO: allow several)
* @param inpad pad index of the input
* @param in output to the graph to be parsed (TODO: allow several)
* @param inpad pad index of the output
* @return zero on success, -1 on error
*/ */
AVFilterGraphDesc *avfilter_graph_parse_chain(const char *filters); int avfilter_graph_parse_chain(AVFilterGraph *graph, const char *filters, AVFilterContext *in, int inpad, AVFilterContext *out, int outpad);
/** /**
* Free a filter graph description. * Free a filter graph description.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment