#include "libavcodec/imgconvert.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
Go to the source code of this file.
Defines | |
#define | LICENSE_PREFIX "libavfilter license: " |
#define | link_dpad(link) link->dst-> input_pads[link->dstpad] |
helper macros to get the in/out pad on the dst/src filter | |
#define | link_spad(link) link->src->output_pads[link->srcpad] |
#define | DPRINTF_START(ctx, func) dprintf(NULL, "%-16s: ", #func) |
#define | MAX_REGISTERED_AVFILTERS_NB 64 |
Functions | |
unsigned | avfilter_version (void) |
Returns the LIBAVFILTER_VERSION_INT constant. | |
const char * | avfilter_configuration (void) |
Returns the libavfilter build-time configuration. | |
const char * | avfilter_license (void) |
Returns the libavfilter license. | |
AVFilterPicRef * | avfilter_ref_pic (AVFilterPicRef *ref, int pmask) |
Adds a new reference to a picture. | |
void | avfilter_unref_pic (AVFilterPicRef *ref) |
Removes a reference to a picture. | |
void | avfilter_insert_pad (unsigned idx, unsigned *count, size_t padidx_off, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad) |
Inserts a new pad. | |
int | avfilter_link (AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) |
Links two filters together. | |
int | avfilter_insert_filter (AVFilterLink *link, AVFilterContext *filt, unsigned in, unsigned out) |
Inserts a filter in the middle of an existing link. | |
int | avfilter_config_links (AVFilterContext *filter) |
Negotiates the colorspace, dimensions, etc of all inputs to a filter. | |
static void | dprintf_picref (void *ctx, AVFilterPicRef *picref, int end) |
static void | dprintf_link (void *ctx, AVFilterLink *link, int end) |
AVFilterPicRef * | avfilter_get_video_buffer (AVFilterLink *link, int perms, int w, int h) |
Requests a picture buffer with a specific set of permissions. | |
int | avfilter_request_frame (AVFilterLink *link) |
Requests an input frame from the filter at the other end of the link. | |
int | avfilter_poll_frame (AVFilterLink *link) |
Polls a frame from the filter chain. | |
void | avfilter_start_frame (AVFilterLink *link, AVFilterPicRef *picref) |
Notifies the next filter of the start of a frame. | |
void | avfilter_end_frame (AVFilterLink *link) |
Notifies the next filter that the current frame has finished. | |
void | avfilter_draw_slice (AVFilterLink *link, int y, int h, int slice_dir) |
Sends a slice to the next filter. | |
AVFilter * | avfilter_get_by_name (const char *name) |
Gets a filter definition matching the given name. | |
int | avfilter_register (AVFilter *filter) |
Registers a filter. | |
AVFilter ** | av_filter_next (AVFilter **filter) |
If filter is NULL, returns a pointer to the first registered filter pointer, if filter is non-NULL, returns the next pointer after filter. | |
void | avfilter_uninit (void) |
Uninitializes the filter system. | |
static int | pad_count (const AVFilterPad *pads) |
static const char * | filter_name (void *p) |
AVFilterContext * | avfilter_open (AVFilter *filter, const char *inst_name) |
Creates a filter instance. | |
void | avfilter_destroy (AVFilterContext *filter) |
Destroys a filter. | |
int | avfilter_init_filter (AVFilterContext *filter, const char *args, void *opaque) |
Initializes a filter. | |
Variables | |
static AVFilter * | registered_avfilters [MAX_REGISTERED_AVFILTERS_NB+1] |
static int | next_registered_avfilter_idx = 0 |
static const AVClass | avfilter_class |
#define DPRINTF_START | ( | ctx, | |||
func | ) | dprintf(NULL, "%-16s: ", #func) |
Definition at line 194 of file avfilter.c.
Referenced by avfilter_draw_slice(), avfilter_get_video_buffer(), avfilter_request_frame(), and avfilter_start_frame().
#define LICENSE_PREFIX "libavfilter license: " |
#define link_dpad | ( | link | ) | link->dst-> input_pads[link->dstpad] |
helper macros to get the in/out pad on the dst/src filter
Definition at line 44 of file avfilter.c.
Referenced by avfilter_config_links(), avfilter_draw_slice(), avfilter_end_frame(), avfilter_get_video_buffer(), and avfilter_start_frame().
#define link_spad | ( | link | ) | link->src->output_pads[link->srcpad] |
Definition at line 45 of file avfilter.c.
Referenced by avfilter_config_links(), avfilter_poll_frame(), and avfilter_request_frame().
#define MAX_REGISTERED_AVFILTERS_NB 64 |
If filter is NULL, returns a pointer to the first registered filter pointer, if filter is non-NULL, returns the next pointer after filter.
If the returned pointer points to NULL, the last registered filter was already reached.
Definition at line 361 of file avfilter.c.
Referenced by show_filters().
int avfilter_config_links | ( | AVFilterContext * | filter | ) |
Negotiates the colorspace, dimensions, etc of all inputs to a filter.
filter | the filter to negotiate the properties for its inputs |
Definition at line 133 of file avfilter.c.
Referenced by avfilter_config_links(), and avfilter_graph_config_links().
const char* avfilter_configuration | ( | void | ) |
Returns the libavfilter build-time configuration.
Definition at line 32 of file avfilter.c.
Referenced by show_banner().
void avfilter_destroy | ( | AVFilterContext * | filter | ) |
Destroys a filter.
filter | the filter to destroy |
Definition at line 424 of file avfilter.c.
Referenced by avfilter_graph_destroy(), create_filter(), and query_formats().
void avfilter_draw_slice | ( | AVFilterLink * | link, | |
int | y, | |||
int | h, | |||
int | slice_dir | |||
) |
Sends a slice to the next filter.
Slices have to be provided in sequential order, either in top-bottom or bottom-top order. If slices are provided in non-sequential order the behavior of the function is undefined.
link | the output link over which the frame is being sent | |
y | offset in pixels from the top of the image for this slice | |
h | height of this slice in pixels | |
slice_dir | the assumed direction for sending slices, from the top slice to the bottom slice if the value is 1, from the bottom slice to the top slice if the value is -1, for other values the behavior of the function is undefined. |
Definition at line 294 of file avfilter.c.
Referenced by avfilter_default_draw_slice(), avfilter_null_draw_slice(), draw_slice(), and end_frame().
void avfilter_end_frame | ( | AVFilterLink * | link | ) |
Notifies the next filter that the current frame has finished.
link | the output link the frame was sent over |
Definition at line 276 of file avfilter.c.
Referenced by avfilter_default_end_frame(), avfilter_null_end_frame(), and end_frame().
AVFilter* avfilter_get_by_name | ( | const char * | name | ) |
Gets a filter definition matching the given name.
name | the filter name to find |
Definition at line 341 of file avfilter.c.
Referenced by create_filter(), and query_formats().
AVFilterPicRef* avfilter_get_video_buffer | ( | AVFilterLink * | link, | |
int | perms, | |||
int | w, | |||
int | h | |||
) |
Requests a picture buffer with a specific set of permissions.
link | the output link to the filter from which the picture will be requested | |
perms | the required access permissions | |
w | the minimum width of the buffer to allocate | |
h | the minimum height of the buffer to allocate |
Definition at line 196 of file avfilter.c.
Referenced by avfilter_default_start_frame(), avfilter_null_get_video_buffer(), get_video_buffer(), and start_frame().
int avfilter_init_filter | ( | AVFilterContext * | filter, | |
const char * | args, | |||
void * | opaque | |||
) |
Initializes a filter.
filter | the filter to initialize | |
args | A string of parameters to use when initializing the filter. The format and meaning of this string varies by filter. | |
opaque | Any extra non-string data needed by the filter. The meaning of this parameter varies by filter. |
Definition at line 451 of file avfilter.c.
Referenced by create_filter(), and video_thread().
int avfilter_insert_filter | ( | AVFilterLink * | link, | |
AVFilterContext * | filt, | |||
unsigned | in, | |||
unsigned | out | |||
) |
Inserts a filter in the middle of an existing link.
link | the link into which the filter should be inserted | |
filt | the filter to be inserted | |
in | the input pad on the filter to connect | |
out | the output pad on the filter to connect |
Definition at line 105 of file avfilter.c.
Referenced by query_formats().
void avfilter_insert_pad | ( | unsigned | idx, | |
unsigned * | count, | |||
size_t | padidx_off, | |||
AVFilterPad ** | pads, | |||
AVFilterLink *** | links, | |||
AVFilterPad * | newpad | |||
) |
Inserts a new pad.
idx | Insertion point. Pad is inserted at the end if this point is beyond the end of the list of pads. | |
count | Pointer to the number of pads in the list | |
padidx_off | Offset within an AVFilterLink structure to the element to increment when inserting a new pad causes link numbering to change | |
pads | Pointer to the pointer to the beginning of the list of pads | |
links | Pointer to the pointer to the beginning of the list of links | |
newpad | The new pad to add. A copy is made when adding. |
Definition at line 63 of file avfilter.c.
Referenced by avfilter_insert_inpad(), and avfilter_insert_outpad().
const char* avfilter_license | ( | void | ) |
int avfilter_link | ( | AVFilterContext * | src, | |
unsigned | srcpad, | |||
AVFilterContext * | dst, | |||
unsigned | dstpad | |||
) |
Links two filters together.
src | the source filter | |
srcpad | index of the output pad on the source filter | |
dst | the destination filter | |
dstpad | index of the input pad on the destination filter |
Definition at line 84 of file avfilter.c.
Referenced by avfilter_insert_filter(), link_filter(), and video_thread().
AVFilterContext* avfilter_open | ( | AVFilter * | filter, | |
const char * | inst_name | |||
) |
Creates a filter instance.
filter | the filter to create an instance of | |
inst_name | Name to give to the new instance. Can be NULL for none. |
Definition at line 393 of file avfilter.c.
Referenced by create_filter(), query_formats(), and video_thread().
int avfilter_poll_frame | ( | AVFilterLink * | link | ) |
Polls a frame from the filter chain.
link | the input link |
Definition at line 224 of file avfilter.c.
Referenced by avfilter_poll_frame().
AVFilterPicRef* avfilter_ref_pic | ( | AVFilterPicRef * | ref, | |
int | pmask | |||
) |
Adds a new reference to a picture.
ref | an existing reference to the picture | |
pmask | a bitmask containing the allowable permissions in the new reference |
Definition at line 47 of file avfilter.c.
Referenced by avfilter_default_start_frame(), and start_frame().
int avfilter_register | ( | AVFilter * | filter | ) |
Registers a filter.
This is only needed if you plan to use avfilter_get_by_name later to lookup the AVFilter structure by name. A filter can still by instantiated with avfilter_open even if it is not registered.
filter | the filter to register |
Definition at line 352 of file avfilter.c.
int avfilter_request_frame | ( | AVFilterLink * | link | ) |
Requests an input frame from the filter at the other end of the link.
link | the input link |
Definition at line 213 of file avfilter.c.
Referenced by avfilter_request_frame().
void avfilter_start_frame | ( | AVFilterLink * | link, | |
AVFilterPicRef * | picref | |||
) |
Notifies the next filter of the start of a frame.
link | the output link the frame will be sent over | |
picref | A reference to the frame about to be sent. The data for this frame need only be valid once draw_slice() is called for that portion. The receiving filter will free this reference when it no longer needs it. |
Definition at line 244 of file avfilter.c.
Referenced by avfilter_default_start_frame(), avfilter_null_start_frame(), and start_frame().
void avfilter_uninit | ( | void | ) |
Uninitializes the filter system.
Unregisters all filters.
Definition at line 366 of file avfilter.c.
Referenced by do_exit().
void avfilter_unref_pic | ( | AVFilterPicRef * | ref | ) |
Removes a reference to a picture.
If this is the last reference to the picture, the picture itself is also automatically freed.
ref | reference to the picture |
Definition at line 56 of file avfilter.c.
Referenced by alloc_picture(), avfilter_default_end_frame(), avfilter_end_frame(), end_frame(), queue_picture(), and stream_close().
unsigned avfilter_version | ( | void | ) |
static void dprintf_link | ( | void * | ctx, | |
AVFilterLink * | link, | |||
int | end | |||
) | [static] |
Definition at line 183 of file avfilter.c.
Referenced by avfilter_draw_slice(), avfilter_get_video_buffer(), avfilter_request_frame(), and avfilter_start_frame().
static void dprintf_picref | ( | void * | ctx, | |
AVFilterPicRef * | picref, | |||
int | end | |||
) | [static] |
Definition at line 171 of file avfilter.c.
Referenced by avfilter_get_video_buffer(), and avfilter_start_frame().
static const char* filter_name | ( | void * | p | ) | [static] |
Definition at line 380 of file avfilter.c.
static int pad_count | ( | const AVFilterPad * | pads | ) | [static] |
const AVClass avfilter_class [static] |
Initial value:
{ "AVFilter", filter_name, NULL, LIBAVUTIL_VERSION_INT, }
Definition at line 386 of file avfilter.c.
int next_registered_avfilter_idx = 0 [static] |
Definition at line 339 of file avfilter.c.
Referenced by avfilter_register(), and avfilter_uninit().
AVFilter* registered_avfilters[MAX_REGISTERED_AVFILTERS_NB+1] [static] |
Definition at line 337 of file avfilter.c.