Libav 0.7.1
Defines | Functions
libavfilter/graphparser.c File Reference
#include <ctype.h>
#include <string.h>
#include "libavutil/avstring.h"
#include "avfilter.h"
#include "avfiltergraph.h"

Go to the source code of this file.

Defines

#define WHITESPACES   " \n\t"

Functions

static int link_filter (AVFilterContext *src, int srcpad, AVFilterContext *dst, int dstpad, AVClass *log_ctx)
 Link two filters together.
static char * parse_link_name (const char **buf, AVClass *log_ctx)
 Parse the name of a link, which has the format "[linkname]".
static int create_filter (AVFilterContext **filt_ctx, AVFilterGraph *ctx, int index, const char *filt_name, const char *args, AVClass *log_ctx)
 Create an instance of a filter, initialize and insert it in the filtergraph in *ctx.
static int parse_filter (AVFilterContext **filt_ctx, const char **buf, AVFilterGraph *graph, int index, AVClass *log_ctx)
 Parse a string of the form FILTER_NAME[=PARAMS], and create a corresponding filter instance which is added to graph with create_filter().
static void free_inout (AVFilterInOut *head)
static AVFilterInOutextract_inout (const char *label, AVFilterInOut **links)
static void insert_inout (AVFilterInOut **inouts, AVFilterInOut *element)
static int link_filter_inouts (AVFilterContext *filt_ctx, AVFilterInOut **curr_inputs, AVFilterInOut **open_inputs, AVClass *log_ctx)
static int parse_inputs (const char **buf, AVFilterInOut **curr_inputs, AVFilterInOut **open_outputs, AVClass *log_ctx)
static int parse_outputs (const char **buf, AVFilterInOut **curr_inputs, AVFilterInOut **open_inputs, AVFilterInOut **open_outputs, AVClass *log_ctx)
int avfilter_graph_parse (AVFilterGraph *graph, const char *filters, AVFilterInOut *open_inputs, AVFilterInOut *open_outputs, AVClass *log_ctx)
 Add a graph described by a string to a graph.

Define Documentation

#define WHITESPACES   " \n\t"

Definition at line 30 of file graphparser.c.

Referenced by avfilter_graph_parse(), parse_inputs(), and parse_outputs().


Function Documentation

int avfilter_graph_parse ( AVFilterGraph graph,
const char *  filters,
AVFilterInOut inputs,
AVFilterInOut outputs,
AVClass log_ctx 
)

Add a graph described by a string to a graph.

Parameters:
graphthe filter graph where to link the parsed graph context
filtersstring to be parsed
inputslinked list to the inputs of the graph
outputslinked list to the outputs of the graph
Returns:
zero on success, a negative AVERROR code on error

Definition at line 330 of file graphparser.c.

Referenced by main().

static int create_filter ( AVFilterContext **  filt_ctx,
AVFilterGraph ctx,
int  index,
const char *  filt_name,
const char *  args,
AVClass log_ctx 
) [static]

Create an instance of a filter, initialize and insert it in the filtergraph in *ctx.

Parameters:
ctxthe filtergraph context
puthere a filter context in case of successful creation and configuration, NULL otherwise.
indexan index which is supposed to be unique for each filter instance added to the filtergraph
filt_namethe name of the filter to create
argsthe arguments provided to the filter during its initialization
log_ctxthe log context to use
Returns:
0 in case of success, a negative AVERROR code otherwise

Definition at line 94 of file graphparser.c.

Referenced by parse_filter().

static AVFilterInOut* extract_inout ( const char *  label,
AVFilterInOut **  links 
) [static]

Definition at line 181 of file graphparser.c.

Referenced by parse_inputs(), and parse_outputs().

static void free_inout ( AVFilterInOut head) [static]

Definition at line 171 of file graphparser.c.

Referenced by avfilter_graph_parse().

static void insert_inout ( AVFilterInOut **  inouts,
AVFilterInOut element 
) [static]

Definition at line 196 of file graphparser.c.

Referenced by link_filter_inouts(), parse_inputs(), and parse_outputs().

static int link_filter ( AVFilterContext src,
int  srcpad,
AVFilterContext dst,
int  dstpad,
AVClass log_ctx 
) [static]

Link two filters together.

See also:
avfilter_link()

Definition at line 37 of file graphparser.c.

Referenced by link_filter_inouts(), and parse_outputs().

static int link_filter_inouts ( AVFilterContext filt_ctx,
AVFilterInOut **  curr_inputs,
AVFilterInOut **  open_inputs,
AVClass log_ctx 
) [static]

Definition at line 202 of file graphparser.c.

Referenced by avfilter_graph_parse().

static int parse_filter ( AVFilterContext **  filt_ctx,
const char **  buf,
AVFilterGraph graph,
int  index,
AVClass log_ctx 
) [static]

Parse a string of the form FILTER_NAME[=PARAMS], and create a corresponding filter instance which is added to graph with create_filter().

Parameters:
filt_ctxput here a pointer to the created filter context on success, NULL otherwise
bufpointer to the buffer to parse, *buf will be updated to point to the char next after the parsed string
indexan index which is assigned to the created filter instance, and which is supposed to be unique for each filter instance added to the filtergraph
Returns:
0 in case of success, a negative AVERROR code otherwise

Definition at line 153 of file graphparser.c.

Referenced by avfilter_graph_parse().

static int parse_inputs ( const char **  buf,
AVFilterInOut **  curr_inputs,
AVFilterInOut **  open_outputs,
AVClass log_ctx 
) [static]

Definition at line 251 of file graphparser.c.

Referenced by avfilter_graph_parse().

static char* parse_link_name ( const char **  buf,
AVClass log_ctx 
) [static]

Parse the name of a link, which has the format "[linkname]".

Returns:
a pointer (that need to be freed after use) to the name between parenthesis

Definition at line 58 of file graphparser.c.

Referenced by parse_inputs(), and parse_outputs().

static int parse_outputs ( const char **  buf,
AVFilterInOut **  curr_inputs,
AVFilterInOut **  open_inputs,
AVFilterInOut **  open_outputs,
AVClass log_ctx 
) [static]

Definition at line 285 of file graphparser.c.

Referenced by avfilter_graph_parse().