History

Remove usage of AVFilterGraphDesc outside avfiltergraph.c Commited in SoC by Vitor Sessak on 2008-03-26 20:51:24

Originally committed as revision 12738 to svn://svn.ffmpeg.org/ffmpeg/trunk

Vitor Sessak committed 18 years ago

Commit 87506da1 parent 58f472d2 files · +24 −11Browse files

Unified · Split

2 files
  1. libavfilter/avfiltergraph.c +15 −6
  2. libavfilter/avfiltergraph.h +9 −5
libavfilter/avfiltergraph.c+15−6
@@ -554,16 +554,25 @@ static AVFilterGraphDesc *parse_chain(const char *filters, int has_in) · 553 unmodified lines
554554 /**
555555 * Parse a string describing a filter graph.
556556 */
557−AVFilterGraphDesc *avfilter_graph_parse_chain(const char *filters)
557+int avfilter_graph_parse_chain(AVFilterGraph *graph, const char *filters, AVFilterContext *in, int inpad, AVFilterContext *out, int outpad)
558558 {
559− AVFilterGraphDesc *ret;
559+ AVFilterGraphDesc *desc;
560560
561561 /* Try first to parse supposing there is no (in) element */
562− if ((ret = parse_chain(filters, 0)))
563− return ret;
562+ if (!(desc = parse_chain(filters, 0))) {
563+ /* If it didn't work, parse supposing there is an (in) element */
564+ desc = parse_chain(filters, 1);
565+ }
566+ if (!desc)
567+ return -1;
568+
569+ if (graph_load_from_desc3(graph, desc, in, inpad, out, outpad) < 0) {
570+ avfilter_graph_free_desc(desc);
571+ return -1;
572+ }
564573
565− /* Parse supposing there is an (in) element */
566− return parse_chain(filters, 1);
574+ avfilter_graph_free_desc(desc);
575+ return 0;
567576 }
568577
569578 /**
libavfilter/avfiltergraph.h+9−5
@@ -72,12 +72,16 @@ typedef struct AVFilterGraph { · 71 unmodified lines
7272 } AVFilterGraph;
7373
7474 /**
75− * Parse a graph composed of a simple chain of filters which is described by
76− * a single string.
77− * @param filters String listing filters and their arguments.
78− * @return The parsed graph description.
75+ * Add to a graph a graph described by a string.
76+ * @param graph the filter graph where to link the parsed graph context
77+ * @param filters string to be parsed
78+ * @param in input to the graph to be parsed (TODO: allow several)
79+ * @param inpad pad index of the input
80+ * @param in output to the graph to be parsed (TODO: allow several)
81+ * @param inpad pad index of the output
82+ * @return zero on success, -1 on error
7983 */
80−AVFilterGraphDesc *avfilter_graph_parse_chain(const char *filters);
84+int avfilter_graph_parse_chain(AVFilterGraph *graph, const char *filters, AVFilterContext *in, int inpad, AVFilterContext *out, int outpad);
8185
8286 /**
8387 * Free a filter graph description.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t