FFmpeg
Macros | Functions
graphparser.c File Reference
#include <string.h>
#include <stdio.h>
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "avfilter_internal.h"
#include "internal.h"

Go to the source code of this file.

Macros

#define WHITESPACES   " \n\t\r"
 

Functions

static char * parse_link_name (const char **buf, void *log_ctx)
 Parse the name of a link, which has the format "[linkname]". More...
 
AVFilterInOutavfilter_inout_alloc (void)
 Allocate a single AVFilterInOut entry. More...
 
void avfilter_inout_free (AVFilterInOut **inout)
 Free the supplied list of AVFilterInOut and set *inout to NULL. More...
 
static AVFilterInOutextract_inout (const char *label, AVFilterInOut **links)
 
static void append_inout (AVFilterInOut **inouts, AVFilterInOut **element)
 
static int parse_sws_flags (const char **buf, char **dst, void *log_ctx)
 
int avfilter_graph_parse2 (AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs)
 Add a graph described by a string to a graph. More...
 
int avfilter_graph_parse (AVFilterGraph *graph, const char *filters, AVFilterInOut *open_inputs, AVFilterInOut *open_outputs, void *log_ctx)
 Add a graph described by a string to a graph. More...
 
static void pad_params_free (AVFilterPadParams **pfpp)
 
static void filter_params_free (AVFilterParams **pp)
 
static void chain_free (AVFilterChain **pch)
 
void avfilter_graph_segment_free (AVFilterGraphSegment **pseg)
 Free the provided AVFilterGraphSegment and everything associated with it. More...
 
static int linklabels_parse (void *logctx, const char **linklabels, AVFilterPadParams ***res, unsigned *nb_res)
 
static int filter_parse (void *logctx, const char **filter, AVFilterParams **pp)
 
static int chain_parse (void *logctx, const char **pchain, AVFilterChain **pch)
 
int avfilter_graph_segment_parse (AVFilterGraph *graph, const char *graph_str, int flags, AVFilterGraphSegment **pseg)
 Parse a textual filtergraph description into an intermediate form. More...
 
int avfilter_graph_segment_create_filters (AVFilterGraphSegment *seg, int flags)
 Create filters specified in a graph segment. More...
 
static int fail_creation_pending (AVFilterGraphSegment *seg, const char *fn, const char *func)
 
int avfilter_graph_segment_apply_opts (AVFilterGraphSegment *seg, int flags)
 Apply parsed options to filter instances in a graph segment. More...
 
int avfilter_graph_segment_init (AVFilterGraphSegment *seg, int flags)
 Initialize all filter instances in a graph segment. More...
 
static unsigned find_linklabel (AVFilterGraphSegment *seg, const char *label, int output, size_t idx_chain, size_t idx_filter, AVFilterParams **pp)
 
static int inout_add (AVFilterInOut **inouts, AVFilterContext *f, unsigned pad_idx, const char *label)
 
static int link_inputs (AVFilterGraphSegment *seg, size_t idx_chain, size_t idx_filter, AVFilterInOut **inputs)
 
static int link_outputs (AVFilterGraphSegment *seg, size_t idx_chain, size_t idx_filter, AVFilterInOut **outputs)
 
int avfilter_graph_segment_link (AVFilterGraphSegment *seg, int flags, AVFilterInOut **inputs, AVFilterInOut **outputs)
 Link filters in a graph segment. More...
 
static void log_unknown_opt (const AVFilterGraphSegment *seg)
 
int avfilter_graph_segment_apply (AVFilterGraphSegment *seg, int flags, AVFilterInOut **inputs, AVFilterInOut **outputs)
 Apply all filter/link descriptions from a graph segment to the associated filtergraph. More...
 
int avfilter_graph_parse_ptr (AVFilterGraph *graph, const char *filters, AVFilterInOut **open_inputs_ptr, AVFilterInOut **open_outputs_ptr, void *log_ctx)
 Add a graph described by a string to a graph. More...
 

Macro Definition Documentation

◆ WHITESPACES

#define WHITESPACES   " \n\t\r"

Definition at line 35 of file graphparser.c.

Function Documentation

◆ parse_link_name()

static char* parse_link_name ( const char **  buf,
void *  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 43 of file graphparser.c.

Referenced by linklabels_parse().

◆ extract_inout()

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

Definition at line 86 of file graphparser.c.

Referenced by avfilter_graph_parse(), and avfilter_graph_parse_ptr().

◆ append_inout()

static void append_inout ( AVFilterInOut **  inouts,
AVFilterInOut **  element 
)
static

Definition at line 103 of file graphparser.c.

Referenced by avfilter_graph_parse_ptr(), and inout_add().

◆ parse_sws_flags()

static int parse_sws_flags ( const char **  buf,
char **  dst,
void *  log_ctx 
)
static

Definition at line 115 of file graphparser.c.

Referenced by avfilter_graph_segment_parse().

◆ pad_params_free()

static void pad_params_free ( AVFilterPadParams **  pfpp)
static

Definition at line 227 of file graphparser.c.

Referenced by filter_params_free(), and linklabels_parse().

◆ filter_params_free()

static void filter_params_free ( AVFilterParams **  pp)
static

Definition at line 239 of file graphparser.c.

Referenced by chain_free(), chain_parse(), and filter_parse().

◆ chain_free()

static void chain_free ( AVFilterChain **  pch)
static

◆ linklabels_parse()

static int linklabels_parse ( void *  logctx,
const char **  linklabels,
AVFilterPadParams ***  res,
unsigned *  nb_res 
)
static

Definition at line 292 of file graphparser.c.

Referenced by avfilter_graph_parse_ptr(), and filter_parse().

◆ filter_parse()

static int filter_parse ( void *  logctx,
const char **  filter,
AVFilterParams **  pp 
)
static

Definition at line 338 of file graphparser.c.

Referenced by chain_parse().

◆ chain_parse()

static int chain_parse ( void *  logctx,
const char **  pchain,
AVFilterChain **  pch 
)
static

Definition at line 403 of file graphparser.c.

Referenced by avfilter_graph_segment_parse().

◆ fail_creation_pending()

static int fail_creation_pending ( AVFilterGraphSegment seg,
const char *  fn,
const char *  func 
)
static

◆ find_linklabel()

static unsigned find_linklabel ( AVFilterGraphSegment seg,
const char *  label,
int  output,
size_t  idx_chain,
size_t  idx_filter,
AVFilterParams **  pp 
)
static

Definition at line 643 of file graphparser.c.

Referenced by link_inputs(), and link_outputs().

◆ inout_add()

static int inout_add ( AVFilterInOut **  inouts,
AVFilterContext f,
unsigned  pad_idx,
const char *  label 
)
static

Definition at line 677 of file graphparser.c.

Referenced by link_inputs(), and link_outputs().

◆ link_inputs()

static int link_inputs ( AVFilterGraphSegment seg,
size_t  idx_chain,
size_t  idx_filter,
AVFilterInOut **  inputs 
)
static

Definition at line 701 of file graphparser.c.

Referenced by avfilter_graph_segment_link().

◆ link_outputs()

static int link_outputs ( AVFilterGraphSegment seg,
size_t  idx_chain,
size_t  idx_filter,
AVFilterInOut **  outputs 
)
static

Definition at line 746 of file graphparser.c.

Referenced by avfilter_graph_segment_link().

◆ log_unknown_opt()

static void log_unknown_opt ( const AVFilterGraphSegment seg)
static

Definition at line 856 of file graphparser.c.

Referenced by avfilter_graph_parse_ptr(), and avfilter_graph_segment_apply().