FFmpeg
|
#include "config.h"
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "avfilter_internal.h"
#include "buffersink.h"
#include "filters.h"
#include "formats.h"
#include "framequeue.h"
#include "video.h"
Go to the source code of this file.
Macros | |
#define | OFFSET(x) offsetof(AVFilterGraph, x) |
#define | F AV_OPT_FLAG_FILTERING_PARAM |
#define | V AV_OPT_FLAG_VIDEO_PARAM |
#define | A AV_OPT_FLAG_AUDIO_PARAM |
#define | MERGE(merger, link) |
#define | REDUCE_FORMATS(fmt_type, list_type, list, var, nb, add_format) |
#define | CH_CENTER_PAIR (AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER) |
#define | CH_FRONT_PAIR (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT) |
#define | CH_STEREO_PAIR (AV_CH_STEREO_LEFT | AV_CH_STEREO_RIGHT) |
#define | CH_WIDE_PAIR (AV_CH_WIDE_LEFT | AV_CH_WIDE_RIGHT) |
#define | CH_SIDE_PAIR (AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT) |
#define | CH_DIRECT_PAIR (AV_CH_SURROUND_DIRECT_LEFT | AV_CH_SURROUND_DIRECT_RIGHT) |
#define | CH_BACK_PAIR (AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT) |
Functions | |
void | ff_graph_thread_free (FFFilterGraph *graph) |
int | ff_graph_thread_init (FFFilterGraph *graph) |
AVFilterGraph * | avfilter_graph_alloc (void) |
Allocate a filter graph. More... | |
void | ff_filter_graph_remove_filter (AVFilterGraph *graph, AVFilterContext *filter) |
Remove a filter from a graph;. More... | |
void | avfilter_graph_free (AVFilterGraph **graphp) |
Free a graph, destroy its links, and set *graph to NULL. More... | |
int | avfilter_graph_create_filter (AVFilterContext **filt_ctx, const AVFilter *filt, const char *name, const char *args, void *opaque, AVFilterGraph *graph_ctx) |
A convenience wrapper that allocates and initializes a filter in a single step. More... | |
void | avfilter_graph_set_auto_convert (AVFilterGraph *graph, unsigned flags) |
Enable or disable automatic format conversion inside the graph. More... | |
AVFilterContext * | avfilter_graph_alloc_filter (AVFilterGraph *graph, const AVFilter *filter, const char *name) |
Create a new filter instance in a filter graph. More... | |
static int | graph_check_validity (AVFilterGraph *graph, void *log_ctx) |
Check for the validity of graph. More... | |
static int | graph_config_links (AVFilterGraph *graph, void *log_ctx) |
Configure all the links of graphctx. More... | |
static int | graph_check_links (AVFilterGraph *graph, void *log_ctx) |
AVFilterContext * | avfilter_graph_get_filter (AVFilterGraph *graph, const char *name) |
Get a filter instance identified by instance name from graph. More... | |
static int | filter_link_check_formats (void *log, AVFilterLink *link, AVFilterFormatsConfig *cfg) |
static int | filter_check_formats (AVFilterContext *ctx) |
Check the validity of the formats / etc. More... | |
static int | filter_query_formats (AVFilterContext *ctx) |
static int | formats_declared (AVFilterContext *f) |
static void | print_formats (void *log_ctx, int level, enum AVMediaType type, const AVFilterFormats *formats) |
static void | print_link_formats (void *log_ctx, int level, const AVFilterLink *l) |
static void | print_filter_formats (void *log_ctx, int level, const AVFilterContext *f) |
static int | query_formats (AVFilterGraph *graph, void *log_ctx) |
Perform one round of query_formats() and merging formats lists on the filter graph. More... | |
static int | get_fmt_score (enum AVSampleFormat dst_fmt, enum AVSampleFormat src_fmt) |
static enum AVSampleFormat | find_best_sample_fmt_of_2 (enum AVSampleFormat dst_fmt1, enum AVSampleFormat dst_fmt2, enum AVSampleFormat src_fmt) |
int | ff_fmt_is_regular_yuv (enum AVPixelFormat fmt) |
Returns true if a pixel format is "regular YUV", which includes all pixel formats that are affected by YUV colorspace negotiation. More... | |
int | ff_fmt_is_forced_full_range (enum AVPixelFormat fmt) |
Returns true if a YUV pixel format is forced full range (i.e. More... | |
static int | pick_format (AVFilterLink *link, AVFilterLink *ref) |
static int | reduce_formats_on_filter (AVFilterContext *filter) |
static int | reduce_formats (AVFilterGraph *graph) |
static void | swap_samplerates_on_filter (AVFilterContext *filter) |
static void | swap_samplerates (AVFilterGraph *graph) |
static void | swap_channel_layouts_on_filter (AVFilterContext *filter) |
static void | swap_channel_layouts (AVFilterGraph *graph) |
static void | swap_sample_fmts_on_filter (AVFilterContext *filter) |
static void | swap_sample_fmts (AVFilterGraph *graph) |
static int | pick_formats (AVFilterGraph *graph) |
static int | graph_config_formats (AVFilterGraph *graph, void *log_ctx) |
Configure the formats of all the links in the graph. More... | |
static int | graph_config_pointers (AVFilterGraph *graph, void *log_ctx) |
int | avfilter_graph_config (AVFilterGraph *graphctx, void *log_ctx) |
Check validity and configure all the links and formats in the graph. More... | |
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. More... | |
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. More... | |
static void | heap_bubble_up (FFFilterGraph *graph, FilterLinkInternal *li, int index) |
static void | heap_bubble_down (FFFilterGraph *graph, FilterLinkInternal *li, int index) |
void | ff_avfilter_graph_update_heap (AVFilterGraph *graph, FilterLinkInternal *li) |
Update the position of a link in the age heap. More... | |
int | avfilter_graph_request_oldest (AVFilterGraph *graph) |
Request a frame on the oldest sink link. More... | |
int | ff_filter_graph_run_once (AVFilterGraph *graph) |
Run one round of processing on a filter graph. More... | |
Variables | |
static const AVOption | filtergraph_options [] |
static const AVClass | filtergraph_class |
static const uint64_t | ch_subst [][2] |
#define OFFSET | ( | x | ) | offsetof(AVFilterGraph, x) |
Definition at line 44 of file avfiltergraph.c.
#define F AV_OPT_FLAG_FILTERING_PARAM |
Definition at line 45 of file avfiltergraph.c.
#define V AV_OPT_FLAG_VIDEO_PARAM |
Definition at line 46 of file avfiltergraph.c.
#define A AV_OPT_FLAG_AUDIO_PARAM |
Definition at line 47 of file avfiltergraph.c.
#define MERGE | ( | merger, | |
link | |||
) |
#define REDUCE_FORMATS | ( | fmt_type, | |
list_type, | |||
list, | |||
var, | |||
nb, | |||
add_format | |||
) |
Definition at line 923 of file avfiltergraph.c.
#define CH_CENTER_PAIR (AV_CH_FRONT_LEFT_OF_CENTER | AV_CH_FRONT_RIGHT_OF_CENTER) |
Definition at line 1086 of file avfiltergraph.c.
#define CH_FRONT_PAIR (AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT) |
Definition at line 1087 of file avfiltergraph.c.
#define CH_STEREO_PAIR (AV_CH_STEREO_LEFT | AV_CH_STEREO_RIGHT) |
Definition at line 1088 of file avfiltergraph.c.
#define CH_WIDE_PAIR (AV_CH_WIDE_LEFT | AV_CH_WIDE_RIGHT) |
Definition at line 1089 of file avfiltergraph.c.
#define CH_SIDE_PAIR (AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT) |
Definition at line 1090 of file avfiltergraph.c.
#define CH_DIRECT_PAIR (AV_CH_SURROUND_DIRECT_LEFT | AV_CH_SURROUND_DIRECT_RIGHT) |
Definition at line 1091 of file avfiltergraph.c.
#define CH_BACK_PAIR (AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT) |
Definition at line 1092 of file avfiltergraph.c.
void ff_graph_thread_free | ( | FFFilterGraph * | graph | ) |
Definition at line 73 of file avfiltergraph.c.
Referenced by avfilter_graph_free().
int ff_graph_thread_init | ( | FFFilterGraph * | graph | ) |
Definition at line 77 of file avfiltergraph.c.
Referenced by avfilter_graph_alloc_filter().
void ff_filter_graph_remove_filter | ( | AVFilterGraph * | graph, |
AVFilterContext * | filter | ||
) |
Remove a filter from a graph;.
Definition at line 101 of file avfiltergraph.c.
Referenced by avfilter_free().
|
static |
Check for the validity of graph.
A graph is considered valid if all its input and output pads are connected.
Definition at line 210 of file avfiltergraph.c.
Referenced by avfilter_graph_config().
|
static |
Configure all the links of graphctx.
Definition at line 248 of file avfiltergraph.c.
Referenced by avfilter_graph_config().
|
static |
Definition at line 265 of file avfiltergraph.c.
Referenced by avfilter_graph_config().
|
static |
Definition at line 297 of file avfiltergraph.c.
Referenced by filter_check_formats().
|
static |
Check the validity of the formats / etc.
lists set by query_formats().
In particular, check they do not contain any redundant element.
Definition at line 329 of file avfiltergraph.c.
Referenced by filter_query_formats().
|
static |
Definition at line 347 of file avfiltergraph.c.
Referenced by query_formats().
|
static |
Definition at line 413 of file avfiltergraph.c.
Referenced by query_formats().
|
static |
Definition at line 446 of file avfiltergraph.c.
Referenced by print_filter_formats(), and print_link_formats().
|
static |
Definition at line 474 of file avfiltergraph.c.
Referenced by query_formats().
|
static |
Definition at line 486 of file avfiltergraph.c.
Referenced by query_formats().
|
static |
Perform one round of query_formats() and merging formats lists on the filter graph.
Couldn't merge format lists; auto-insert conversion filters in reverse order to keep the order consistent with the list of mergers, since they are prepended onto the existing link
Definition at line 512 of file avfiltergraph.c.
Referenced by graph_config_formats().
|
static |
Definition at line 720 of file avfiltergraph.c.
Referenced by find_best_sample_fmt_of_2().
|
static |
Definition at line 743 of file avfiltergraph.c.
Referenced by pick_format().
int ff_fmt_is_regular_yuv | ( | enum AVPixelFormat | fmt | ) |
Returns true if a pixel format is "regular YUV", which includes all pixel formats that are affected by YUV colorspace negotiation.
Definition at line 754 of file avfiltergraph.c.
Referenced by pick_format(), and query_formats().
int ff_fmt_is_forced_full_range | ( | enum AVPixelFormat | fmt | ) |
Returns true if a YUV pixel format is forced full range (i.e.
YUVJ).
Definition at line 767 of file avfiltergraph.c.
Referenced by pick_format(), and query_formats().
|
static |
Definition at line 781 of file avfiltergraph.c.
Referenced by pick_formats().
|
static |
Definition at line 960 of file avfiltergraph.c.
Referenced by reduce_formats().
|
static |
Definition at line 1020 of file avfiltergraph.c.
Referenced by graph_config_formats().
|
static |
Definition at line 1037 of file avfiltergraph.c.
Referenced by swap_samplerates().
|
static |
Definition at line 1078 of file avfiltergraph.c.
Referenced by graph_config_formats().
|
static |
Definition at line 1120 of file avfiltergraph.c.
Referenced by swap_channel_layouts().
|
static |
Definition at line 1214 of file avfiltergraph.c.
Referenced by graph_config_formats().
|
static |
Definition at line 1222 of file avfiltergraph.c.
Referenced by swap_sample_fmts().
|
static |
Definition at line 1282 of file avfiltergraph.c.
Referenced by graph_config_formats().
|
static |
Definition at line 1291 of file avfiltergraph.c.
Referenced by graph_config_formats().
|
static |
Configure the formats of all the links in the graph.
Definition at line 1346 of file avfiltergraph.c.
Referenced by avfilter_graph_config().
|
static |
Definition at line 1374 of file avfiltergraph.c.
Referenced by avfilter_graph_config().
|
static |
Definition at line 1496 of file avfiltergraph.c.
Referenced by ff_avfilter_graph_update_heap().
|
static |
Definition at line 1515 of file avfiltergraph.c.
Referenced by avfilter_graph_request_oldest(), and ff_avfilter_graph_update_heap().
void ff_avfilter_graph_update_heap | ( | AVFilterGraph * | graph, |
FilterLinkInternal * | li | ||
) |
Update the position of a link in the age heap.
Definition at line 1539 of file avfiltergraph.c.
Referenced by update_link_current_pts().
int ff_filter_graph_run_once | ( | AVFilterGraph * | graph | ) |
Run one round of processing on a filter graph.
Definition at line 1596 of file avfiltergraph.c.
Referenced by avfilter_graph_request_oldest(), get_frame_internal(), and push_frame().
|
static |
Definition at line 48 of file avfiltergraph.c.
|
static |
Definition at line 64 of file avfiltergraph.c.
Referenced by avfilter_graph_alloc().
|
static |
Definition at line 1096 of file avfiltergraph.c.
Referenced by swap_channel_layouts_on_filter().