libavfilter/avfilter.c File Reference

#include "libavutil/pixdesc.h"
#include "libavutil/rational.h"
#include "libavutil/audioconvert.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"

Go to the source code of this file.

Defines

#define LICENSE_PREFIX   "libavfilter license: "
#define MAX_REGISTERED_AVFILTERS_NB   128

Functions

unsigned avfilter_version (void)
 Return the LIBAVFILTER_VERSION_INT constant.
const char * avfilter_configuration (void)
 Return the libavfilter build-time configuration.
const char * avfilter_license (void)
 Return the libavfilter license.
void ff_command_queue_pop (AVFilterContext *filter)
void avfilter_insert_pad (unsigned idx, unsigned *count, size_t padidx_off, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad)
 Insert a new pad.
int avfilter_link (AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)
 Link two filters together.
void avfilter_link_free (AVFilterLink **link)
 Free the link in *link, and set its pointer to NULL.
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.
int avfilter_config_links (AVFilterContext *filter)
 Negotiate the media format, dimensions, etc of all inputs to a filter.
void ff_dlog_link (void *ctx, AVFilterLink *link, int end)
int avfilter_request_frame (AVFilterLink *link)
 Request an input frame from the filter at the other end of the link.
int avfilter_poll_frame (AVFilterLink *link)
 Poll a frame from the filter chain.
void ff_update_link_current_pts (AVFilterLink *link, int64_t pts)
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.
AVFilteravfilter_get_by_name (const char *name)
 Get a filter definition matching the given name.
int avfilter_register (AVFilter *filter)
 Register 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)
 Uninitialize the filter system.
static int pad_count (const AVFilterPad *pads)
static const char * filter_name (void *p)
int avfilter_open (AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name)
 Create a filter instance.
void avfilter_free (AVFilterContext *filter)
 Free a filter context.
int avfilter_init_filter (AVFilterContext *filter, const char *args, void *opaque)
 Initialize a filter.

Variables

static AVFilterregistered_avfilters [MAX_REGISTERED_AVFILTERS_NB+1]
static int next_registered_avfilter_idx = 0
static const AVClass avfilter_class


Define Documentation

#define LICENSE_PREFIX   "libavfilter license: "

#define MAX_REGISTERED_AVFILTERS_NB   128

Definition at line 319 of file avfilter.c.

Referenced by avfilter_register().


Function Documentation

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.

If the returned pointer points to NULL, the last registered filter was already reached.

Definition at line 350 of file avfilter.c.

Referenced by opt_filters().

int avfilter_config_links ( AVFilterContext filter  ) 

Negotiate the media format, dimensions, etc of all inputs to a filter.

Parameters:
filter the filter to negotiate the properties for its inputs
Returns:
zero on successful negotiation

Definition at line 158 of file avfilter.c.

Referenced by avfilter_config_links(), and ff_avfilter_graph_config_links().

const char* avfilter_configuration ( void   ) 

Return the libavfilter build-time configuration.

Definition at line 39 of file avfilter.c.

void avfilter_free ( AVFilterContext filter  ) 

Free a filter context.

Parameters:
filter the filter to free

Definition at line 440 of file avfilter.c.

Referenced by avfilter_graph_create_filter(), avfilter_graph_free(), avfilter_graph_parse(), avfilter_graph_parse2(), create_filter(), and main().

AVFilter* avfilter_get_by_name ( const char *  name  ) 

Get a filter definition matching the given name.

Parameters:
name the filter name to find
Returns:
the filter definition, if any matching one is registered. NULL if none found.

Definition at line 325 of file avfilter.c.

Referenced by configure_complex_filter(), configure_output_audio_filter(), configure_output_video_filter(), configure_video_filters(), create_filter(), DEF_CHOOSE_FORMAT(), init_filters(), insert_conv_filter(), lavfi_read_header(), main(), and query_formats().

int avfilter_init_filter ( AVFilterContext filter,
const char *  args,
void *  opaque 
)

Initialize a filter.

Parameters:
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.
Returns:
zero on success

Definition at line 490 of file avfilter.c.

Referenced by avfilter_graph_create_filter(), create_filter(), and main().

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.

Parameters:
link the link into which the filter should be inserted
filt the filter to be inserted
filt_srcpad_idx the input pad on the filter to connect
filt_dstpad_idx the output pad on the filter to connect
Returns:
zero on success

Definition at line 121 of file avfilter.c.

Referenced by insert_conv_filter(), and query_formats().

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

Insert a new pad.

Parameters:
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 59 of file avfilter.c.

Referenced by avfilter_insert_inpad(), and avfilter_insert_outpad().

const char* avfilter_license ( void   ) 

Return the libavfilter license.

Definition at line 44 of file avfilter.c.

int avfilter_link ( AVFilterContext src,
unsigned  srcpad,
AVFilterContext dst,
unsigned  dstpad 
)

Link two filters together.

Parameters:
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
Returns:
zero on success

Definition at line 80 of file avfilter.c.

Referenced by avfilter_graph_parse(), avfilter_insert_filter(), configure_complex_filter(), configure_output_audio_filter(), configure_output_video_filter(), configure_simple_filtergraph(), configure_video_filters(), DEF_CHOOSE_FORMAT(), lavfi_read_header(), and link_filter().

void avfilter_link_free ( AVFilterLink **  link  ) 

Free the link in *link, and set its pointer to NULL.

Definition at line 110 of file avfilter.c.

Referenced by avfilter_free().

int avfilter_open ( AVFilterContext **  filter_ctx,
AVFilter filter,
const char *  inst_name 
)

Create a filter instance.

Parameters:
filter_ctx put here a pointer to the created filter context on success, NULL on failure
filter the filter to create an instance of
inst_name Name to give to the new instance. Can be NULL for none.
Returns:
>= 0 in case of success, a negative error code otherwise

Definition at line 382 of file avfilter.c.

Referenced by avfilter_graph_create_filter(), create_filter(), and main().

int avfilter_poll_frame ( AVFilterLink link  ) 

Poll a frame from the filter chain.

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

Definition at line 281 of file avfilter.c.

Referenced by av_buffersink_poll_frame(), av_buffersink_read(), avfilter_poll_frame(), main(), and poll_frame().

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.

It is recommended to use avfilter_graph_send_command().

Definition at line 308 of file avfilter.c.

Referenced by avfilter_graph_send_command(), and avfilter_start_frame().

int avfilter_register ( AVFilter filter  ) 

Register 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.

Parameters:
filter the filter to register
Returns:
0 if the registration was successful, a negative value otherwise

Definition at line 336 of file avfilter.c.

Referenced by avfilter_register_all().

int avfilter_request_frame ( AVFilterLink link  ) 

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

Parameters:
link the input link
Returns:
zero on success or a negative error code; in particular: AVERROR_EOF means that the end of frames have been reached; AVERROR(EAGAIN) means that no frame could be immediately produced.

Definition at line 270 of file avfilter.c.

Referenced by av_buffersink_get_buffer_ref(), av_buffersink_read(), avfilter_graph_request_oldest(), avfilter_request_frame(), poll_frame(), request_frame(), request_samples(), and start_frame().

void avfilter_uninit ( void   ) 

Uninitialize the filter system.

Unregister all filters.

Definition at line 355 of file avfilter.c.

Referenced by do_exit(), and exit_program().

unsigned avfilter_version ( void   ) 

Return the LIBAVFILTER_VERSION_INT constant.

Definition at line 34 of file avfilter.c.

void ff_command_queue_pop ( AVFilterContext filter  ) 

Definition at line 50 of file avfilter.c.

Referenced by avfilter_free(), and avfilter_start_frame().

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

void ff_update_link_current_pts ( AVFilterLink link,
int64_t  pts 
)

Definition at line 299 of file avfilter.c.

Referenced by avfilter_start_frame(), and ff_filter_samples().

static const char* filter_name ( void *  p  )  [static]

Definition at line 369 of file avfilter.c.

Referenced by dshow_open_device(), and main().

static int pad_count ( const AVFilterPad pads  )  [static]

Definition at line 361 of file avfilter.c.

Referenced by avfilter_open().


Variable Documentation

const AVClass avfilter_class [static]

Initial value:

Definition at line 375 of file avfilter.c.

int next_registered_avfilter_idx = 0 [static]

Definition at line 323 of file avfilter.c.

Referenced by avfilter_register(), and avfilter_uninit().

AVFilter* registered_avfilters[MAX_REGISTERED_AVFILTERS_NB+1] [static]

Definition at line 321 of file avfilter.c.


Generated on Fri Oct 26 02:48:00 2012 for FFmpeg by  doxygen 1.5.8