Libav
Macros | Functions | Variables
avfilter.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/rational.h"
#include "libavutil/samplefmt.h"
#include "audio.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Macros

#define LICENSE_PREFIX   "libavfilter license: "
 
#define OFFSET(x)   offsetof(AVFilterContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM
 

Functions

unsigned avfilter_version (void)
 Return the LIBAVFILTER_VERSION_INT constant. More...
 
const char * avfilter_configuration (void)
 Return the libavfilter build-time configuration. More...
 
const char * avfilter_license (void)
 Return the libavfilter license. More...
 
void ff_insert_pad (unsigned idx, unsigned *count, size_t padidx_off, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad)
 Insert a new pad. More...
 
int avfilter_link (AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)
 Link two filters together. More...
 
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. More...
 
int avfilter_config_links (AVFilterContext *filter)
 Negotiate the media format, dimensions, etc of all inputs to a filter. More...
 
void ff_dlog_link (void *ctx, AVFilterLink *link, int end)
 
int ff_request_frame (AVFilterLink *link)
 Request an input frame from the filter at the other end of the link. More...
 
int ff_poll_frame (AVFilterLink *link)
 Poll a frame from the filter chain. More...
 
const AVFilteravfilter_get_by_name (const char *name)
 Get a filter definition matching the given name. More...
 
int avfilter_register (AVFilter *filter)
 Register a filter. More...
 
const AVFilteravfilter_next (const AVFilter *prev)
 Iterate over all registered filters. More...
 
int avfilter_pad_count (const AVFilterPad *pads)
 Get the number of elements in a NULL-terminated array of AVFilterPads (e.g. More...
 
static const char * filter_name (void *p)
 
static voidfilter_child_next (void *obj, void *prev)
 
static const AVClassfilter_child_class_next (const AVClass *prev)
 
static int default_execute (AVFilterContext *ctx, avfilter_action_func *func, void *arg, int *ret, int nb_jobs)
 
AVFilterContextff_filter_alloc (const AVFilter *filter, const char *inst_name)
 Allocate a new filter context and return it. More...
 
static void free_link (AVFilterLink *link)
 
void avfilter_free (AVFilterContext *filter)
 Free a filter context. More...
 
static int process_unnamed_options (AVFilterContext *ctx, AVDictionary **options, const char *args)
 
int avfilter_init_dict (AVFilterContext *ctx, AVDictionary **options)
 Initialize a filter with the supplied dictionary of options. More...
 
int avfilter_init_str (AVFilterContext *filter, const char *args)
 Initialize a filter with the supplied parameters. More...
 
const char * avfilter_pad_get_name (const AVFilterPad *pads, int pad_idx)
 Get the name of an AVFilterPad. More...
 
enum AVMediaType avfilter_pad_get_type (const AVFilterPad *pads, int pad_idx)
 Get the type of an AVFilterPad. More...
 
static int default_filter_frame (AVFilterLink *link, AVFrame *frame)
 
int ff_filter_frame (AVFilterLink *link, AVFrame *frame)
 Send a frame of data to the next filter. More...
 
const AVClassavfilter_get_class (void)
 

Variables

static AVFilterfirst_filter
 
static const AVOption avfilter_options []
 
static const AVClass avfilter_class
 

Macro Definition Documentation

#define LICENSE_PREFIX   "libavfilter license: "

Referenced by avfilter_license().

#define OFFSET (   x)    offsetof(AVFilterContext, x)

Definition at line 359 of file avfilter.c.

#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 360 of file avfilter.c.

Function Documentation

void ff_insert_pad ( unsigned  idx,
unsigned *  count,
size_t  padidx_off,
AVFilterPad **  pads,
AVFilterLink ***  links,
AVFilterPad newpad 
)

Insert a new pad.

Parameters
idxInsertion point. Pad is inserted at the end if this point is beyond the end of the list of pads.
countPointer to the number of pads in the list
padidx_offOffset within an AVFilterLink structure to the element to increment when inserting a new pad causes link numbering to change
padsPointer to the pointer to the beginning of the list of pads
linksPointer to the pointer to the beginning of the list of links
newpadThe new pad to add. A copy is made when adding.

Definition at line 54 of file avfilter.c.

Referenced by ff_insert_inpad(), and ff_insert_outpad().

void ff_dlog_link ( void ctx,
AVFilterLink link,
int  end 
)

Definition at line 220 of file avfilter.c.

Referenced by ff_filter_frame(), ff_get_video_buffer(), and ff_request_frame().

int ff_request_frame ( AVFilterLink link)

Request an input frame from the filter at the other end of the link.

Parameters
linkthe input link
Returns
zero on success

Definition at line 244 of file avfilter.c.

Referenced by av_buffersink_get_frame(), av_buffersink_get_samples(), ff_request_frame(), join_request_frame(), poll_frame(), request_frame(), request_samples(), and return_audio_frame().

int ff_poll_frame ( AVFilterLink link)

Poll a frame from the filter chain.

Parameters
linkthe input link
Returns
the number of immediately available frames, a negative number in case of error

Definition at line 255 of file avfilter.c.

Referenced by ff_poll_frame(), and poll_frame().

static const char* filter_name ( void p)
static

Definition at line 330 of file avfilter.c.

Referenced by main().

static void* filter_child_next ( void obj,
void prev 
)
static

Definition at line 336 of file avfilter.c.

static const AVClass* filter_child_class_next ( const AVClass prev)
static

Definition at line 344 of file avfilter.c.

static int default_execute ( AVFilterContext ctx,
avfilter_action_func func,
void arg,
int *  ret,
int  nb_jobs 
)
static

Definition at line 377 of file avfilter.c.

Referenced by ff_filter_alloc().

AVFilterContext* ff_filter_alloc ( const AVFilter filter,
const char *  inst_name 
)

Allocate a new filter context and return it.

Parameters
filterwhat filter to create an instance of
inst_namename to give to the new filter context
Returns
newly created filter context or NULL on failure

Definition at line 390 of file avfilter.c.

Referenced by avfilter_graph_alloc_filter().

static void free_link ( AVFilterLink link)
static

Definition at line 472 of file avfilter.c.

Referenced by avfilter_free().

static int process_unnamed_options ( AVFilterContext ctx,
AVDictionary **  options,
const char *  args 
)
static

Definition at line 523 of file avfilter.c.

Referenced by avfilter_init_str().

static int default_filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 723 of file avfilter.c.

Referenced by ff_filter_frame().

int ff_filter_frame ( AVFilterLink link,
AVFrame frame 
)

Send a frame of data to the next filter.

Parameters
linkthe output link over which the data is being sent
framea reference to the buffer of data being sent. The receiving filter will free this reference when it no longer needs it or pass it on to the next filter.
Returns
>= 0 on success, a negative AVERROR on error. The receiving filter is responsible for unreferencing frame in case of error.

Definition at line 728 of file avfilter.c.

Referenced by channelmap_filter_frame(), color_request_frame(), compand_delay(), compand_drain(), compand_nodelay(), default_filter_frame(), filter_frame(), join_request_frame(), output_frame(), request_frame(), return_audio_frame(), return_frame(), and source_request_frame().

Variable Documentation

AVFilter* first_filter
static

Definition at line 273 of file avfilter.c.

Referenced by avfilter_next(), and avfilter_register().

const AVOption avfilter_options[]
static
Initial value:
= {
{ "thread_type", "Allowed thread types", OFFSET(thread_type), AV_OPT_TYPE_FLAGS,
{ .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, FLAGS, "thread_type" },
{ "slice", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AVFILTER_THREAD_SLICE }, .unit = "thread_type" },
{ NULL },
}
#define AVFILTER_THREAD_SLICE
Process multiple parts of the frame concurrently.
Definition: avfilter.h:558
NULL
Definition: eval.c:55
#define FLAGS
Definition: avfilter.c:360
#define OFFSET(x)
Definition: avfilter.c:359

Definition at line 361 of file avfilter.c.

const AVClass avfilter_class
static
Initial value:
= {
.class_name = "AVFilter",
.item_name = filter_name,
.child_next = filter_child_next,
.child_class_next = filter_child_class_next,
}
static const char * filter_name(void *p)
Definition: avfilter.c:330
const struct AVOption * option
a pointer to the first option specified in the class if any or NULL
Definition: log.h:51
static void * filter_child_next(void *obj, void *prev)
Definition: avfilter.c:336
static const AVOption avfilter_options[]
Definition: avfilter.c:361
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
static const AVClass * filter_child_class_next(const AVClass *prev)
Definition: avfilter.c:344

Definition at line 368 of file avfilter.c.

Referenced by avfilter_get_class(), and ff_filter_alloc().