fftools_ffmpeg_filter.c File Reference

Go to the source code of this file.

## Macros

#define | DEF_CHOOSE_FORMAT(suffix, type, var, supported_list, none, get_name)
#define | AUTO_INSERT_FILTER(opt_name, filter_name, arg)
#define | AUTO_INSERT_FILTER_INPUT(opt_name, filter_name, arg)

## Functions

static enum AVPixelFormat * | get_compliance_unofficial_pix_fmts (enum AVCodecID codec_id, const enum AVPixelFormat default_formats[])
enum AVPixelFormat | choose_pixel_fmt (AVStream *st, AVCodecContext *enc_ctx, const AVCodec *codec, enum AVPixelFormat target)
void | choose_sample_fmt (AVStream *st, const AVCodec *codec)
static char * | choose_pix_fmts (OutputFilter *ofilter)
| DEF_CHOOSE_FORMAT (sample_fmts, enum AVSampleFormat, format, formats, AV_SAMPLE_FMT_NONE, GET_SAMPLE_FMT_NAME) DEF_CHOOSE_FORMAT(sample_rates
GET_SAMPLE_RATE_NAME | DEF_CHOOSE_FORMAT (channel_layouts, uint64_t, channel_layout, channel_layouts, 0, GET_CH_LAYOUT_NAME)
static char * | describe_filter_link (FilterGraph *fg, AVFilterInOut *inout, int in)
static void | init_input_filter (FilterGraph *fg, AVFilterInOut *in)
int | init_complex_filtergraph (FilterGraph *fg)
static int | insert_trim (int64_t start_time, int64_t duration, AVFilterContext **last_filter, int *pad_idx, const char *filter_name)
static int | insert_filter (AVFilterContext **last_filter, int *pad_idx, const char *filter_name, const char *args)
static int | configure_output_video_filter (FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
static int | configure_output_audio_filter (FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
int | configure_output_filter (FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out)
void | check_filter_outputs (void)
static int | sub2video_prepare (InputStream *ist, InputFilter *ifilter)
static int | configure_input_video_filter (FilterGraph *fg, InputFilter *ifilter, AVFilterInOut *in)
static int | configure_input_audio_filter (FilterGraph *fg, InputFilter *ifilter, AVFilterInOut *in)
static int | configure_input_filter (FilterGraph *fg, InputFilter *ifilter, AVFilterInOut *in)
static void | cleanup_filtergraph (FilterGraph *fg)
int | configure_filtergraph (FilterGraph *fg)
int | ifilter_parameters_from_frame (InputFilter *ifilter, const AVFrame *frame)
int | filtergraph_is_simple (FilterGraph *fg)

## Variables

| int
| sample_rate
| sample_rates

## Macro Definition Documentation

## AUTO_INSERT_FILTER

#define AUTO_INSERT_FILTER | ( |  | opt_name,
|  |  | filter_name,
|  |  | arg
| ) |  |

Value:
do { \
AVFilterContext *filt_ctx; \
\
av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi " \
"similarly to -af " filter_name "=%s.\n", arg); \
\
ret = avfilter_graph_create_filter(&filt_ctx, \
avfilter_get_by_name(filter_name), \
filter_name, arg, NULL, fg->graph); \
if (ret < 0) \
return ret; \
\
ret = avfilter_link(last_filter, pad_idx, filt_ctx, 0); \
if (ret < 0) \
return ret; \
\
last_filter = filt_ctx; \
pad_idx = 0; \
} while (0)

## AUTO_INSERT_FILTER_INPUT

#define AUTO_INSERT_FILTER_INPUT | ( |  | opt_name,
|  |  | filter_name,
|  |  | arg
| ) |  |

Value:
do { \
AVFilterContext *filt_ctx; \
\
av_log(NULL, AV_LOG_INFO, opt_name " is forwarded to lavfi " \
"similarly to -af " filter_name "=%s.\n", arg); \
\
snprintf(name, sizeof(name), "graph_%d_%s_in_%d_%d", \
fg->index, filter_name, ist->file_index, ist->st->index); \
ret = avfilter_graph_create_filter(&filt_ctx, \
avfilter_get_by_name(filter_name), \
name, arg, NULL, fg->graph); \
if (ret < 0) \
return ret; \
\
ret = avfilter_link(last_filter, 0, filt_ctx, 0); \
if (ret < 0) \
return ret; \
\
last_filter = filt_ctx; \
} while (0)

## DEF_CHOOSE_FORMAT

#define DEF_CHOOSE_FORMAT | ( |  | suffix,
|  |  | type,
|  |  | var,
|  |  | supported_list,
|  |  | none,
|  |  | get_name
| ) |  |

Value:
static char *choose_ ## suffix (OutputFilter *ofilter) \
{ \
if (ofilter->var != none) { \
get_name(ofilter->var); \
return av_strdup(name); \
} else if (ofilter->supported_list) { \
const type *p; \
AVIOContext *s = NULL; \
uint8_t *ret; \
int len; \
\
if (avio_open_dyn_buf(&s) < 0) \
exit_program(1); \
\
for (p = ofilter->supported_list; *p != none; p++) { \
get_name(*p); \
avio_printf(s, "%s|", name); \
} \
len = avio_close_dyn_buf(s, &ret); \
ret[len - 1] = 0; \
return ret; \
} else \
return NULL; \
}
OutputFilter
Definition: fftools_ffmpeg.h:287

Definition at line 168 of file fftools_ffmpeg_filter.c.

## Function Documentation

## check_filter_outputs()

void check_filter_outputs | ( | void |  | ) |

Definition at line 692 of file fftools_ffmpeg_filter.c.

## choose_pix_fmts()

static char* choose_pix_fmts | ( | OutputFilter * | ofilter | ) |

static

Definition at line 124 of file fftools_ffmpeg_filter.c.

## choose_pixel_fmt()

enum AVPixelFormat choose_pixel_fmt | ( | AVStream * | st,
|  | AVCodecContext * | enc_ctx,
|  | const AVCodec * | codec,
|  | enum AVPixelFormat | target
| ) |  |

Definition at line 50 of file fftools_ffmpeg_filter.c.

## choose_sample_fmt()

void choose_sample_fmt | ( | AVStream * | st,
|  | const AVCodec * | codec
| ) |  |

Definition at line 101 of file fftools_ffmpeg_filter.c.

## cleanup_filtergraph()

static void cleanup_filtergraph | ( | FilterGraph * | fg | ) |

static

Definition at line 1002 of file fftools_ffmpeg_filter.c.

## configure_filtergraph()

int configure_filtergraph | ( | FilterGraph * | fg | ) |

Definition at line 1012 of file fftools_ffmpeg_filter.c.

## configure_input_audio_filter()

static int configure_input_audio_filter | ( | FilterGraph * | fg,
|  | InputFilter * | ifilter,
|  | AVFilterInOut * | in
| ) |  |

static

Definition at line 876 of file fftools_ffmpeg_filter.c.

## configure_input_filter()

static int configure_input_filter | ( | FilterGraph * | fg,
|  | InputFilter * | ifilter,
|  | AVFilterInOut * | in
| ) |  |

static

Definition at line 986 of file fftools_ffmpeg_filter.c.

## configure_input_video_filter()

static int configure_input_video_filter | ( | FilterGraph * | fg,
|  | InputFilter * | ifilter,
|  | AVFilterInOut * | in
| ) |  |

static

Definition at line 754 of file fftools_ffmpeg_filter.c.

## configure_output_audio_filter()

static int configure_output_audio_filter | ( | FilterGraph * | fg,
|  | OutputFilter * | ofilter,
|  | AVFilterInOut * | out
| ) |  |

static

Definition at line 557 of file fftools_ffmpeg_filter.c.

## configure_output_filter()

int configure_output_filter | ( | FilterGraph * | fg,
|  | OutputFilter * | ofilter,
|  | AVFilterInOut * | out
| ) |  |

Definition at line 678 of file fftools_ffmpeg_filter.c.

## configure_output_video_filter()

static int configure_output_video_filter | ( | FilterGraph * | fg,
|  | OutputFilter * | ofilter,
|  | AVFilterInOut * | out
| ) |  |

static

Definition at line 463 of file fftools_ffmpeg_filter.c.

## DEF_CHOOSE_FORMAT() [1/2]

GET_SAMPLE_RATE_NAME DEF_CHOOSE_FORMAT | ( | channel_layouts | ,
|  | uint64_t | ,
|  | channel_layout | ,
|  | channel_layouts | ,
|  | 0 | ,
|  | GET_CH_LAYOUT_NAME |
| ) |  |

Definition at line 203 of file fftools_ffmpeg_filter.c.

## DEF_CHOOSE_FORMAT() [2/2]

DEF_CHOOSE_FORMAT | ( | sample_fmts | ,
|  | enum | AVSampleFormat,
|  | format | ,
|  | formats | ,
|  | AV_SAMPLE_FMT_NONE | ,
|  | GET_SAMPLE_FMT_NAME |
| ) |  |

## describe_filter_link()

static char* describe_filter_link | ( | FilterGraph * | fg,
|  | AVFilterInOut * | inout,
|  | int | in
| ) |  |

static

Definition at line 243 of file fftools_ffmpeg_filter.c.

## filtergraph_is_simple()

int filtergraph_is_simple | ( | FilterGraph * | fg | ) |

Definition at line 1209 of file fftools_ffmpeg_filter.c.

## get_compliance_unofficial_pix_fmts()

static enum AVPixelFormat* get_compliance_unofficial_pix_fmts | ( | enum AVCodecID | codec_id,
|  | const enum AVPixelFormat | default_formats[]
| ) |  |

static

Definition at line 50 of file fftools_ffmpeg_filter.c.

## ifilter_parameters_from_frame()

int ifilter_parameters_from_frame | ( | InputFilter * | ifilter,
|  | const AVFrame * | frame
| ) |  |

Definition at line 1186 of file fftools_ffmpeg_filter.c.

## init_complex_filtergraph()

int init_complex_filtergraph | ( | FilterGraph * | fg | ) |

Definition at line 349 of file fftools_ffmpeg_filter.c.

## init_input_filter()

static void init_input_filter | ( | FilterGraph * | fg,
|  | AVFilterInOut * | in
| ) |  |

static

Definition at line 262 of file fftools_ffmpeg_filter.c.

## insert_filter()

static int insert_filter | ( | AVFilterContext ** | last_filter,
|  | int * | pad_idx,
|  | const char * | filter_name,
|  | const char * | args
| ) |  |

static

Definition at line 441 of file fftools_ffmpeg_filter.c.

## insert_trim()

static int insert_trim | ( | int64_t | start_time,
|  | int64_t | duration,
|  | AVFilterContext ** | last_filter,
|  | int * | pad_idx,
|  | const char * | filter_name
| ) |  |

static

Definition at line 390 of file fftools_ffmpeg_filter.c.

## sub2video_prepare()

static int sub2video_prepare | ( | InputStream * | ist,
|  | InputFilter * | ifilter
| ) |  |

static

Definition at line 707 of file fftools_ffmpeg_filter.c.

## Variable Documentation

## int

int

Definition at line 200 of file fftools_ffmpeg_filter.c.

## sample_rate

sample_rate

Definition at line 200 of file fftools_ffmpeg_filter.c.

## sample_rates

sample_rates

Definition at line 200 of file fftools_ffmpeg_filter.c.