diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2008-04-04 20:07:50 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2008-04-04 20:07:50 +0000 |
commit | 16db7fe0aca9c81bb3562dbe35e5a2e541edd08d (patch) | |
tree | 96be0598e54ca55a2581d29a731cdabda022ebec /libavfilter/avfiltergraph.h | |
parent | 1df675bf4452b554fd9aef54f594d7e3ebd1b0b8 (diff) | |
download | ffmpeg-16db7fe0aca9c81bb3562dbe35e5a2e541edd08d.tar.gz |
Make filter graph description parsing code independent of the code to
read said description from a file.
Commited in SoC by Bobby Bingham on 2007-12-22 17:16:21
Originally committed as revision 12714 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/avfiltergraph.h')
-rw-r--r-- | libavfilter/avfiltergraph.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/libavfilter/avfiltergraph.h b/libavfilter/avfiltergraph.h index d701a3d584..a96dfb8037 100644 --- a/libavfilter/avfiltergraph.h +++ b/libavfilter/avfiltergraph.h @@ -57,6 +57,16 @@ typedef struct AVFilterGraphDescExport struct AVFilterGraphDescExport *next; } AVFilterGraphDescExport; +/** Sections of a filter graph description */ +typedef enum +{ + SEC_NONE = 0, + SEC_FILTERS, + SEC_LINKS, + SEC_INPUTS, + SEC_OUTPUTS +} AVFilterGraphDescSection; + /** Description of a graph to be loaded from a file, etc */ typedef struct { @@ -66,6 +76,30 @@ typedef struct AVFilterGraphDescExport *outputs; ///< outputs to export } AVFilterGraphDesc; +typedef struct +{ + AVFilterGraphDescSection section; ///< current section being parsed + + AVFilterGraphDescFilter **filterp; ///< last parsed filter + AVFilterGraphDescLink **linkp; ///< last parsed link + AVFilterGraphDescExport **inputp; ///< last parsed exported input + AVFilterGraphDescExport **outputp; ///< last parsed exported output +} AVFilterGraphDescParser; + +/** Parse a line of a filter graph description. + * @param desc Pointer to an AVFilterGraphDesc pointer. If *desc is NULL, + * a new AVFilterGraphDesc structure will be created for you. + * Must be the same between multiple invocations when parsing + * the same description. + * @param parser Parser state. Must be the same between multiple invocations + * when parsing the same description + * @param line Line of the graph description to parse. + * @return Zero on success, negative on error. + */ +int avfilter_graph_parse_desc(AVFilterGraphDesc **desc, + AVFilterGraphDescParser **parser, + char *line); + /** * Load a filter graph description from a file * @param filename Name of the file from which to load the description |