Go to the documentation of this file.
36 #define FF_INTERNAL_FIELDS 1
45 #define OFFSET(x) offsetof(AVFilterGraph, x)
46 #define F AV_OPT_FLAG_FILTERING_PARAM
47 #define V AV_OPT_FLAG_VIDEO_PARAM
48 #define A AV_OPT_FLAG_AUDIO_PARAM
54 { .i64 = 0 }, 0, INT_MAX,
F|
V|
A,
"threads"},
55 {
"auto",
"autodetect a suitable number of threads to use", 0,
AV_OPT_TYPE_CONST, {.i64 = 0 }, .flags =
F|
V|
A, .unit =
"threads"},
56 {
"scale_sws_opts" ,
"default scale filter options" ,
OFFSET(scale_sws_opts) ,
58 {
"aresample_swr_opts" ,
"default aresample filter options" ,
OFFSET(aresample_swr_opts) ,
78 graph->thread_type = 0;
79 graph->nb_threads = 1;
106 for (
i = 0;
i <
graph->nb_filters;
i++) {
112 for (j = 0; j<
filter->nb_outputs; j++)
126 while ((*graph)->nb_filters)
141 const char *
name,
const char *args,
void *opaque,
173 if (
graph->thread_type && !
graph->internal->thread_execute) {
174 if (
graph->execute) {
175 graph->internal->thread_execute =
graph->execute;
214 for (
i = 0;
i <
graph->nb_filters;
i++) {
218 for (j = 0; j <
filt->nb_inputs; j++) {
219 if (!
filt->inputs[j] || !
filt->inputs[j]->src) {
220 pad = &
filt->input_pads[j];
222 "Input pad \"%s\" with type %s of the filter instance \"%s\" of %s not connected to any source\n",
228 for (j = 0; j <
filt->nb_outputs; j++) {
229 if (!
filt->outputs[j] || !
filt->outputs[j]->dst) {
230 pad = &
filt->output_pads[j];
232 "Output pad \"%s\" with type %s of the filter instance \"%s\" of %s not connected to any destination\n",
252 for (
i = 0;
i <
graph->nb_filters;
i++) {
255 if (!
filt->nb_outputs) {
271 for (
i = 0;
i <
graph->nb_filters;
i++) {
273 for (j = 0; j <
f->nb_outputs; j++) {
289 for (
i = 0;
i <
graph->nb_filters;
i++)
300 switch (
link->type) {
330 for (
i = 0;
i <
ctx->nb_inputs;
i++) {
335 for (
i = 0;
i <
ctx->nb_outputs;
i++) {
349 ctx->outputs &&
ctx->outputs[0] ?
ctx->outputs[0]->type :
352 if ((
ret =
ctx->filter->formats.query_func(
ctx)) < 0) {
379 for (
i = 0;
i <
f->nb_inputs;
i++) {
380 if (!
f->inputs[
i]->outcfg.formats)
383 !(
f->inputs[
i]->outcfg.samplerates &&
384 f->inputs[
i]->outcfg.channel_layouts))
387 for (
i = 0;
i <
f->nb_outputs;
i++) {
388 if (!
f->outputs[
i]->incfg.formats)
391 !(
f->outputs[
i]->incfg.samplerates &&
392 f->outputs[
i]->incfg.channel_layouts))
411 int converter_count = 0;
412 int count_queried = 0;
413 int count_merged = 0;
414 int count_already_merged = 0;
415 int count_delayed = 0;
417 for (
i = 0;
i <
graph->nb_filters;
i++) {
428 count_queried +=
ret >= 0;
432 for (
i = 0;
i <
graph->nb_filters;
i++) {
435 for (j = 0; j <
filter->nb_inputs; j++) {
439 int convert_needed = 0;
446 for (neg_step = 1; neg_step < neg->
nb_mergers; neg_step++) {
447 const AVFilterFormatsMerger *m = &neg->
mergers[neg_step];
450 if (
a &&
b &&
a !=
b && !m->can_merge(
a,
b)) {
455 for (neg_step = 0; neg_step < neg->
nb_mergers; neg_step++) {
456 const AVFilterFormatsMerger *m = &neg->
mergers[neg_step];
462 count_already_merged++;
463 }
else if (!convert_needed) {
465 ret = m->merge(
a,
b);
473 if (convert_needed) {
480 if (
graph->disable_auto_convert) {
482 "The filters '%s' and '%s' do not have a common format "
483 "and automatic conversion is disabled.\n",
491 "'%s' filter not present, cannot convert formats.\n",
495 snprintf(inst_name,
sizeof(inst_name),
"auto_%s_%d",
516 av_assert0(outlink-> incfg.samplerates->refcount > 0);
520 av_assert0(outlink-> incfg.channel_layouts->refcount > 0);
523 #define MERGE(merger, link) \
524 ((merger)->merge(FF_FIELD_AT(void *, (merger)->offset, (link)->incfg), \
525 FF_FIELD_AT(void *, (merger)->offset, (link)->outcfg)))
526 for (neg_step = 0; neg_step < neg->
nb_mergers; neg_step++) {
527 const AVFilterFormatsMerger *m = &neg->
mergers[neg_step];
533 "Impossible to convert between the formats supported by the filter "
534 "'%s' and the filter '%s'\n",
link->src->name,
link->dst->name);
543 "%d queried, %d merged, %d already done, %d delayed\n",
544 count_queried, count_merged, count_already_merged, count_delayed);
553 if (count_queried || count_merged)
556 for (
i = 0;
i <
graph->nb_filters;
i++)
561 "The following filters could not choose their formats: %s\n"
562 "Consider inserting the (a)format filter near their input or "
563 "output.\n", bp.str);
600 return score1 < score2 ? dst_fmt1 : dst_fmt2;
614 for (
i = 0;
i <
link->incfg.formats->nb_formats;
i++) {
621 link->incfg.formats->formats[0] = best;
627 for (
i = 0;
i <
link->incfg.formats->nb_formats;
i++) {
634 link->incfg.formats->formats[0] = best;
638 link->incfg.formats->nb_formats = 1;
642 if (!
link->incfg.samplerates->nb_formats) {
644 " the link between filters %s and %s.\n",
link->src->name,
648 link->incfg.samplerates->nb_formats = 1;
651 if (
link->incfg.channel_layouts->all_layouts) {
653 " the link between filters %s and %s.\n",
link->src->name,
655 if (!
link->incfg.channel_layouts->all_counts)
657 "supported, try specifying a channel layout using "
658 "'aformat=channel_layouts=something'.\n");
661 link->incfg.channel_layouts->nb_channel_layouts = 1;
679 #define REDUCE_FORMATS(fmt_type, list_type, list, var, nb, add_format) \
681 for (i = 0; i < filter->nb_inputs; i++) { \
682 AVFilterLink *link = filter->inputs[i]; \
685 if (!link->outcfg.list || link->outcfg.list->nb != 1) \
687 fmt = link->outcfg.list->var[0]; \
689 for (j = 0; j < filter->nb_outputs; j++) { \
690 AVFilterLink *out_link = filter->outputs[j]; \
693 if (link->type != out_link->type || \
694 out_link->incfg.list->nb == 1) \
696 fmts = out_link->incfg.list; \
698 if (!out_link->incfg.list->nb) { \
699 if ((ret = add_format(&out_link->incfg.list, fmt)) < 0)\
705 for (k = 0; k < out_link->incfg.list->nb; k++) \
706 if (fmts->var[k] == fmt) { \
707 fmts->var[0] = fmt; \
718 int i, j, k,
ret = 0;
726 for (
i = 0;
i <
filter->nb_inputs;
i++) {
730 if (!
inlink->outcfg.channel_layouts ||
731 inlink->outcfg.channel_layouts->nb_channel_layouts != 1)
733 fmt =
inlink->outcfg.channel_layouts->channel_layouts[0];
735 for (j = 0; j <
filter->nb_outputs; j++) {
773 for (
i = 0;
i <
graph->nb_filters;
i++) {
789 for (
i = 0;
i <
filter->nb_inputs;
i++) {
793 link->outcfg.samplerates->nb_formats== 1)
801 for (
i = 0;
i <
filter->nb_outputs;
i++) {
803 int best_idx, best_diff = INT_MAX;
814 if (
diff < best_diff) {
828 for (
i = 0;
i <
graph->nb_filters;
i++)
832 #define CH_CENTER_PAIR (AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER)
833 #define CH_FRONT_PAIR (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT)
834 #define CH_STEREO_PAIR (AV_CH_STEREO_LEFT | AV_CH_STEREO_RIGHT)
835 #define CH_WIDE_PAIR (AV_CH_WIDE_LEFT | AV_CH_WIDE_RIGHT)
836 #define CH_SIDE_PAIR (AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT)
837 #define CH_DIRECT_PAIR (AV_CH_SURROUND_DIRECT_LEFT | AV_CH_SURROUND_DIRECT_RIGHT)
838 #define CH_BACK_PAIR (AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT)
871 for (
i = 0;
i <
filter->nb_inputs;
i++) {
875 link->outcfg.channel_layouts->nb_channel_layouts == 1)
881 for (
i = 0;
i <
filter->nb_outputs;
i++) {
883 int best_idx = -1, best_score = INT_MIN, best_count_diff = INT_MAX;
890 uint64_t in_chlayout =
link->outcfg.channel_layouts->channel_layouts[0];
894 int count_diff = out_channels - in_channels;
895 int matched_channels, extra_channels;
907 score -= 10000 +
FFABS(out_channels - in_channels) +
908 (in_channels > out_channels ? 10000 : 0);
909 in_chlayout = out_chlayout = 0;
918 if (( in_chlayout & cmp0) && (!(out_chlayout & cmp0)) &&
919 (out_chlayout & cmp1) && (!( in_chlayout & cmp1))) {
920 in_chlayout &= ~cmp0;
921 out_chlayout &= ~cmp1;
939 score += 10 * matched_channels - 5 * extra_channels;
941 if (score > best_score ||
942 (count_diff < best_count_diff && score == best_score)) {
945 best_count_diff = count_diff;
959 for (
i = 0;
i <
graph->nb_filters;
i++)
969 for (
i = 0;
i <
filter->nb_inputs;
i++) {
973 link->outcfg.formats->nb_formats == 1)
982 for (
i = 0;
i <
filter->nb_outputs;
i++) {
984 int best_idx = -1, best_score = INT_MIN;
1002 if (
bps == 4 && out_bps == 8) {
1008 score = -
abs(out_bps -
bps);
1012 if (score > best_score) {
1027 for (
i = 0;
i <
graph->nb_filters;
i++)
1039 for (
i = 0;
i <
graph->nb_filters;
i++) {
1042 for (j = 0; j <
filter->nb_inputs; j++){
1043 if (
filter->inputs[j]->incfg.formats &&
filter->inputs[j]->incfg.formats->nb_formats == 1) {
1051 for (j = 0; j <
filter->nb_outputs; j++){
1052 if (
filter->outputs[j]->incfg.formats &&
filter->outputs[j]->incfg.formats->nb_formats == 1) {
1060 for (j = 0; j <
filter->nb_outputs; j++) {
1061 if (
filter->outputs[j]->format<0) {
1071 for (
i = 0;
i <
graph->nb_filters;
i++) {
1074 for (j = 0; j <
filter->nb_inputs; j++)
1077 for (j = 0; j <
filter->nb_outputs; j++)
1118 int sink_links_count = 0, n = 0;
1122 for (
i = 0;
i <
graph->nb_filters;
i++) {
1124 for (j = 0; j <
f->nb_inputs; j++) {
1125 f->inputs[j]->graph =
graph;
1126 f->inputs[j]->age_index = -1;
1128 for (j = 0; j <
f->nb_outputs; j++) {
1129 f->outputs[j]->graph =
graph;
1130 f->outputs[j]->age_index= -1;
1132 if (!
f->nb_outputs) {
1133 if (
f->nb_inputs > INT_MAX - sink_links_count)
1135 sink_links_count +=
f->nb_inputs;
1138 sinks =
av_calloc(sink_links_count,
sizeof(*sinks));
1141 for (
i = 0;
i <
graph->nb_filters;
i++) {
1143 if (!
f->nb_outputs) {
1144 for (j = 0; j <
f->nb_inputs; j++) {
1145 sinks[n] =
f->inputs[j];
1146 f->inputs[j]->age_index = n++;
1151 graph->sink_links = sinks;
1152 graph->sink_links_count = sink_links_count;
1190 for (
i = 0;
i <
graph->nb_filters;
i++) {
1192 if (!strcmp(target,
"all") || (
filter->name && !strcmp(target,
filter->name)) || !strcmp(target,
filter->filter->name)) {
1211 for (
i = 0;
i <
graph->nb_filters;
i++) {
1213 if(
filter && (!strcmp(target,
"all") || !strcmp(target,
filter->name) || !strcmp(target,
filter->filter->name))){
1215 while (*queue && (*queue)->
time <= ts)
1216 queue = &(*queue)->
next;
1224 (*queue)->time = ts;
1225 (*queue)->flags =
flags;
1226 (*queue)->next =
next;
1243 int parent = (
index - 1) >> 1;
1244 if (
links[parent]->current_pts_us >=
link->current_pts_us)
1262 int child = 2 *
index + 1;
1263 if (child >=
graph->sink_links_count)
1265 if (child + 1 <
graph->sink_links_count &&
1266 links[child + 1]->current_pts_us <
links[child]->current_pts_us)
1268 if (
link->current_pts_us <
links[child]->current_pts_us)
1287 int64_t frame_count;
1290 while (
graph->sink_links_count) {
1291 oldest =
graph->sink_links[0];
1312 if (!
graph->sink_links_count)
1336 for (
i = 1;
i <
graph->nb_filters;
i++)
A list of supported channel layouts.
#define AVFILTER_CMD_FLAG_ONE
Stop once a filter understood the command (for target=all for example), fast filters are favored auto...
AVPixelFormat
Pixel format.
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
void av_opt_set_defaults(void *s)
Set the values of all AVOption fields to their default values.
static const uint64_t ch_subst[][2]
#define REDUCE_FORMATS(fmt_type, list_type, list, var, nb, add_format)
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
int frame_wanted_out
True if a frame is currently wanted on the output of this filter.
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AVERROR_EOF
End of file.
AVFilterPad * dstpad
input pad on the dest filter
int attribute_align_arg av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flags)
Get a frame with filtered data from sink and put it in frame.
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
static int filter_query_formats(AVFilterContext *ctx)
int ff_filter_activate(AVFilterContext *filter)
static void swap_sample_fmts(AVFilterGraph *graph)
struct AVFilterInOut * next
next input/input in the list, NULL if this is the last
const char * conversion_filter
static int graph_check_validity(AVFilterGraph *graph, void *log_ctx)
Check for the validity of graph.
static int query_formats(AVFilterGraph *graph, void *log_ctx)
Perform one round of query_formats() and merging formats lists on the filter graph.
static int pick_formats(AVFilterGraph *graph)
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
static int pick_format(AVFilterLink *link, AVFilterLink *ref)
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
int ff_filter_graph_run_once(AVFilterGraph *graph)
Run one round of processing on a filter graph.
A link between two filters.
AVFilterFormatsConfig outcfg
Lists of supported formats / etc.
AVFilterContext * ff_filter_alloc(const AVFilter *filter, const char *inst_name)
Allocate a new filter context and return it.
static void convert(float y, float u, float v, float *b, float *g, float *r)
static void swap_samplerates(AVFilterGraph *graph)
void avfilter_graph_free(AVFilterGraph **graph)
Free a graph, destroy its links, and set *graph to NULL.
static int get_fmt_score(enum AVSampleFormat dst_fmt, enum AVSampleFormat src_fmt)
int avfilter_graph_create_filter(AVFilterContext **filt_ctx, const AVFilter *filt, const char *name, const char *args, void *opaque, AVFilterGraph *graph_ctx)
Create and add a filter instance into an existing graph.
AVFilterContext * avfilter_graph_alloc_filter(AVFilterGraph *graph, const AVFilter *filter, const char *name)
Create a new filter instance in a filter graph.
AVFilterGraph * avfilter_graph_alloc(void)
Allocate a filter graph.
static int reduce_formats(AVFilterGraph *graph)
int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, unsigned filt_srcpad_idx, unsigned filt_dstpad_idx)
Insert a filter in the middle of an existing link.
static int graph_config_formats(AVFilterGraph *graph, void *log_ctx)
Configure the formats of all the links in the graph.
int avfilter_config_links(AVFilterContext *filter)
Negotiate the media format, dimensions, etc of all inputs to a filter.
#define AV_BPRINT_SIZE_AUTOMATIC
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
#define AVFILTER_THREAD_SLICE
Process multiple parts of the frame concurrently.
Callbacks and properties to describe the steps of a format negotiation.
static void heap_bubble_down(AVFilterGraph *graph, AVFilterLink *link, int index)
int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enum AVPixelFormat pix_fmt, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of a plane of an image with...
A filter pad used for either input or output.
#define filters(fmt, inverse, clip, i, c)
enum AVSampleFormat av_get_planar_sample_fmt(enum AVSampleFormat sample_fmt)
Get the planar alternative form of the given sample format.
static int reduce_formats_on_filter(AVFilterContext *filter)
enum AVMediaType type
filter media type
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define FF_ARRAY_ELEMS(a)
#define MERGE(merger, link)
#define AV_CH_LOW_FREQUENCY
#define AV_BUFFERSINK_FLAG_PEEK
Tell av_buffersink_get_buffer_ref() to read video/samples buffer reference, but not remove it from th...
void * av_realloc_array(void *ptr, size_t nmemb, size_t size)
uint64_t * channel_layouts
list of channel layouts
int channels
number of audio channels, only used for audio.
int avfilter_process_command(AVFilterContext *filter, const char *cmd, const char *arg, char *res, int res_len, int flags)
Make the filter instance process a command.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
static const AVOption filtergraph_options[]
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int graph_config_pointers(AVFilterGraph *graph, void *log_ctx)
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
const AVFilterFormatsMerger * mergers
static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a link
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
int(* activate)(AVFilterContext *ctx)
Filter activation function.
const AVFilter * avfilter_get_by_name(const char *name)
Get a filter definition matching the given name.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
Check validity and configure all the links and formats in the graph.
uint8_t nb_components
The number of components each pixel has, (1-4)
void avfilter_graph_set_auto_convert(AVFilterGraph *graph, unsigned flags)
Enable or disable automatic format conversion inside the graph.
const char * av_default_item_name(void *ptr)
Return the context name.
char * name
name of this filter instance
static void heap_bubble_up(AVFilterGraph *graph, AVFilterLink *link, int index)
AVFilterContext * avfilter_graph_get_filter(AVFilterGraph *graph, const char *name)
Get a filter instance identified by instance name from graph.
void av_opt_free(void *obj)
Free all allocated objects in obj.
int avfilter_graph_request_oldest(AVFilterGraph *graph)
Request a frame on the oldest sink link.
static int graph_config_links(AVFilterGraph *graph, void *log_ctx)
Configure all the links of graphctx.
#define AV_CH_FRONT_CENTER
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
@ AV_CLASS_CATEGORY_FILTER
void ff_graph_thread_free(AVFilterGraph *graph)
struct AVFilterCommand * next
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
int sample_rate
Sample rate of the audio data.
int format
agreed upon media format
int avfilter_graph_queue_command(AVFilterGraph *graph, const char *target, const char *command, const char *arg, int flags, double ts)
Queue a command for one or more filter instances.
AVFilterContext * dst
dest filter
char all_layouts
accept any known channel layout
char all_counts
accept any channel layout or count
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
AVFilterFormatsConfig incfg
Lists of supported formats / etc.
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
uint64_t channel_layout
Channel layout of the audio data.
static enum AVSampleFormat find_best_sample_fmt_of_2(enum AVSampleFormat dst_fmt1, enum AVSampleFormat dst_fmt2, enum AVSampleFormat src_fmt)
int avfilter_init_str(AVFilterContext *filter, const char *args)
Initialize a filter with the supplied parameters.
static int filter_link_check_formats(void *log, AVFilterLink *link, AVFilterFormatsConfig *cfg)
static void swap_sample_fmts_on_filter(AVFilterContext *filter)
int age_index
Index in the age array.
#define i(width, name, range_min, range_max)
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
int w
agreed upon image width
static void swap_channel_layouts_on_filter(AVFilterContext *filter)
static int graph_check_links(AVFilterGraph *graph, void *log_ctx)
#define av_assert1(cond)
assert() equivalent, that does not lie in speed critical code.
AVSampleFormat
Audio sample formats.
#define AV_CH_BACK_CENTER
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static const int8_t filt[NUMTAPS *2]
const char * name
Pad name.
void * av_calloc(size_t nmemb, size_t size)
int ff_graph_thread_init(AVFilterGraph *graph)
static void swap_channel_layouts(AVFilterGraph *graph)
#define AVFILTER_CMD_FLAG_FAST
Only execute command when its fast (like a video out that supports contrast adjustment in hw)
enum AVMediaType type
AVFilterPad type.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output links
#define FFSWAP(type, a, b)
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
unsigned conversion_opts_offset
void av_bprintf(AVBPrint *buf, const char *fmt,...)
static int formats_declared(AVFilterContext *f)
const char * av_get_media_type_string(enum AVMediaType media_type)
Return a string describing the media_type enum, NULL if media_type is unknown.
enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
Compute what kind of losses will occur when converting from one specific pixel format to another.
int h
agreed upon image height
void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter)
Remove a filter from a graph;.
void ff_framequeue_global_init(FFFrameQueueGlobal *fqg)
Init a global structure.
void ff_avfilter_graph_update_heap(AVFilterGraph *graph, AVFilterLink *link)
Update the position of a link in the age heap.
enum AVSampleFormat av_get_packed_sample_fmt(enum AVSampleFormat sample_fmt)
Get the packed alternative form of the given sample format.
static int ref[MAX_W *MAX_W]
char * av_strdup(const char *s)
Duplicate a string.
int nb_channel_layouts
number of channel layouts
void avfilter_free(AVFilterContext *filter)
Free a filter context.
static av_always_inline int diff(const uint32_t a, const uint32_t b)
static void swap_samplerates_on_filter(AVFilterContext *filter)
@ FF_FILTER_FORMATS_QUERY_FUNC
formats.query active.
#define flags(name, subs,...)
int avfilter_graph_send_command(AVFilterGraph *graph, const char *target, const char *cmd, const char *arg, char *res, int res_len, int flags)
Send a command to one or more filter instances.
#define FF_FIELD_AT(type, off, obj)
Access a field in a structure by its offset.
const AVFilter * filter
the AVFilter of which this is an instance
unsigned refcount
number of references to this list
static int filter_check_formats(AVFilterContext *ctx)
Check the validity of the formats / etc.
@ AV_SAMPLE_FMT_S32
signed 32 bits
static const AVClass filtergraph_class
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
double time
time expressed in seconds