libavfilter/avfilter.h File Reference

#include <stddef.h>
#include "libavutil/avutil.h"
#include "libavutil/log.h"
#include "libavutil/samplefmt.h"
#include "libavutil/pixfmt.h"
#include "libavutil/rational.h"
#include "libavfilter/version.h"

Go to the source code of this file.

Data Structures

struct  AVFilterBuffer
 A reference-counted buffer data type used by the filter system. More...
struct  AVFilterBufferRefAudioProps
 Audio specific properties in a reference to an AVFilterBuffer. More...
struct  AVFilterBufferRefVideoProps
 Video specific properties in a reference to an AVFilterBuffer. More...
struct  AVFilterBufferRef
 A reference to an AVFilterBuffer. More...
struct  AVFilterPad
 A filter pad used for either input or output. More...
struct  AVFilter
 Filter definition. More...
struct  AVFilterContext
 An instance of a filter. More...
struct  AVFilterLink
 A link between two filters. More...

Defines

#define AV_PERM_READ   0x01
 can read from the buffer
#define AV_PERM_WRITE   0x02
 can write to the buffer
#define AV_PERM_PRESERVE   0x04
 nobody else can overwrite the buffer
#define AV_PERM_REUSE   0x08
 can output the buffer multiple times, with the same contents each time
#define AV_PERM_REUSE2   0x10
 can output the buffer multiple times, modified each time
#define AV_PERM_NEG_LINESIZES   0x20
 the buffer requested can have negative linesizes
#define AV_PERM_ALIGN   0x40
 the buffer must be aligned
#define AVFILTER_ALIGN   16
#define AVFILTER_CMD_FLAG_ONE   1
 Stop once a filter understood the command (for target=all for example), fast filters are favored automatically.
#define AVFILTER_CMD_FLAG_FAST   2
 Only execute command when its fast (like a video out that supports contrast adjustment in hw).

Typedefs

typedef struct AVFilterContext AVFilterContext
typedef struct AVFilterLink AVFilterLink
typedef struct AVFilterPad AVFilterPad
typedef struct AVFilterFormats AVFilterFormats

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.
const AVClassavfilter_get_class (void)
 Get the class for the AVFilterContext struct.
void avfilter_copy_buffer_ref_props (AVFilterBufferRef *dst, AVFilterBufferRef *src)
 Copy properties of src to dst, without copying the actual data.
AVFilterBufferRefavfilter_ref_buffer (AVFilterBufferRef *ref, int pmask)
 Add a new reference to a buffer.
void avfilter_unref_buffer (AVFilterBufferRef *ref)
 Remove a reference to a buffer.
void avfilter_unref_bufferp (AVFilterBufferRef **ref)
 Remove a reference to a buffer and set the pointer to NULL.
const char * avfilter_pad_get_name (AVFilterPad *pads, int pad_idx)
 Get the name of an AVFilterPad.
enum AVMediaType avfilter_pad_get_type (AVFilterPad *pads, int pad_idx)
 Get the type of an AVFilterPad.
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.
void avfilter_link_set_closed (AVFilterLink *link, int closed)
 Set the closed field of a link.
int avfilter_config_links (AVFilterContext *filter)
 Negotiate the media format, dimensions, etc of all inputs to a filter.
AVFilterBufferRefavfilter_get_video_buffer_ref_from_arrays (uint8_t *const data[4], const int linesize[4], int perms, int w, int h, enum PixelFormat format)
 Create a buffer reference wrapped around an already allocated image buffer.
AVFilterBufferRefavfilter_get_audio_buffer_ref_from_arrays (uint8_t **data, int linesize, int perms, int nb_samples, enum AVSampleFormat sample_fmt, uint64_t channel_layout)
 Create an audio buffer reference wrapped around an already allocated samples buffer.
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.
void avfilter_register_all (void)
 Initialize the filter system.
void avfilter_uninit (void)
 Uninitialize the filter system.
int avfilter_register (AVFilter *filter)
 Register a filter.
AVFilteravfilter_get_by_name (const char *name)
 Get a filter definition matching the given name.
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.
int avfilter_open (AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name)
 Create a filter instance.
int avfilter_init_filter (AVFilterContext *filter, const char *args, void *opaque)
 Initialize a filter.
void avfilter_free (AVFilterContext *filter)
 Free a filter context.
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.


Define Documentation

#define AV_PERM_ALIGN   0x40

the buffer must be aligned

Definition at line 106 of file avfilter.h.

Referenced by ff_default_get_audio_buffer(), ff_default_get_video_buffer(), filter_samples(), get_video_buffer(), and start_frame().

#define AV_PERM_NEG_LINESIZES   0x20

the buffer requested can have negative linesizes

Definition at line 105 of file avfilter.h.

Referenced by ff_default_get_audio_buffer(), ff_default_get_video_buffer(), ff_get_ref_perms_string(), ff_start_frame(), get_video_buffer(), and start_frame().

#define AV_PERM_PRESERVE   0x04

#define AV_PERM_READ   0x01

#define AV_PERM_REUSE   0x08

can output the buffer multiple times, with the same contents each time

Definition at line 103 of file avfilter.h.

Referenced by ff_default_get_audio_buffer(), ff_default_get_video_buffer(), ff_get_ref_perms_string(), and request_frame().

#define AV_PERM_REUSE2   0x10

can output the buffer multiple times, modified each time

Definition at line 104 of file avfilter.h.

Referenced by config_output(), ff_default_get_audio_buffer(), ff_default_get_video_buffer(), ff_get_ref_perms_string(), frame_to_buf(), and vf_next_put_image().

#define AV_PERM_WRITE   0x02

#define AVFILTER_ALIGN   16

Definition at line 108 of file avfilter.h.

Referenced by get_video_buffer().

#define AVFILTER_CMD_FLAG_FAST   2

Only execute command when its fast (like a video out that supports contrast adjustment in hw).

Definition at line 778 of file avfilter.h.

Referenced by avfilter_graph_send_command().

#define AVFILTER_CMD_FLAG_ONE   1

Stop once a filter understood the command (for target=all for example), fast filters are favored automatically.

Definition at line 777 of file avfilter.h.

Referenced by avfilter_graph_queue_command(), avfilter_graph_send_command(), check_keyboard_interaction(), and process_frame().


Typedef Documentation

Definition at line 55 of file avfilter.h.

Definition at line 58 of file avfilter.h.

typedef struct AVFilterLink AVFilterLink

Definition at line 56 of file avfilter.h.

typedef struct AVFilterPad AVFilterPad

Definition at line 57 of file avfilter.h.


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 424 of file avfilter.c.

Referenced by filter_child_class_next(), and show_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 207 of file avfilter.c.

Referenced by avfilter_config_links(), and graph_config_links().

const char* avfilter_configuration ( void   ) 

Return the libavfilter build-time configuration.

Definition at line 79 of file avfilter.c.

void avfilter_copy_buffer_ref_props ( AVFilterBufferRef dst,
AVFilterBufferRef src 
)

Copy properties of src to dst, without copying the actual data.

Definition at line 184 of file buffer.c.

Referenced by default_start_frame(), end_frame(), ff_copy_buffer_ref(), ff_filter_samples(), ff_inplace_start_frame(), ff_start_frame(), filter_samples(), return_frame(), and start_frame().

void avfilter_free ( AVFilterContext filter  ) 

Free a filter context.

Parameters:
filter the filter to free

Definition at line 556 of file avfilter.c.

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

AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays ( uint8_t **  data,
int  linesize,
int  perms,
int  nb_samples,
enum AVSampleFormat  sample_fmt,
uint64_t  channel_layout 
)

Create an audio buffer reference wrapped around an already allocated samples buffer.

Parameters:
data pointers to the samples plane buffers
linesize linesize for the samples plane buffers
perms the required access permissions
nb_samples number of samples per channel
sample_fmt the format of each sample in the buffer to allocate
channel_layout the channel layout of the buffer

Definition at line 90 of file audio.c.

Referenced by av_asrc_buffer_add_samples(), avfilter_get_audio_buffer_ref_from_frame(), ff_default_get_audio_buffer(), and join_request_frame().

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 399 of file avfilter.c.

Referenced by configure_input_audio_filter(), configure_input_video_filter(), configure_output_audio_filter(), configure_output_video_filter(), create_filter(), graph_insert_fifos(), init_filters(), insert_conv_filter(), lavfi_read_header(), main(), and query_formats().

const AVClass* avfilter_get_class ( void   ) 

Get the class for the AVFilterContext struct.

Definition at line 489 of file avfilter.c.

Referenced by show_help_default().

AVFilterBufferRef* avfilter_get_video_buffer_ref_from_arrays ( uint8_t *const   data[4],
const int  linesize[4],
int  perms,
int  w,
int  h,
enum PixelFormat  format 
)

Create a buffer reference wrapped around an already allocated image buffer.

Parameters:
data pointers to the planes of the image to reference
linesize linesizes for the planes of the image to reference
perms the required access permissions
w the width of the image specified by the data and linesize arrays
h the height of the image specified by the data and linesize arrays
format the pixel format of the image specified by the data and linesize arrays

Definition at line 96 of file video.c.

Referenced by avfilter_get_video_buffer_ref_from_frame(), decode_video(), ff_default_get_video_buffer(), sub2video_prepare(), and video_thread().

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 606 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 169 of file avfilter.c.

Referenced by graph_insert_fifos(), insert_conv_filter(), and query_formats().

const char* avfilter_license ( void   ) 

Return the libavfilter license.

Definition at line 84 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 120 of file avfilter.c.

Referenced by avfilter_graph_parse(), avfilter_insert_filter(), configure_input_audio_filter(), configure_input_video_filter(), configure_output_audio_filter(), configure_output_video_filter(), 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 151 of file avfilter.c.

Referenced by avfilter_free().

void avfilter_link_set_closed ( AVFilterLink link,
int  closed 
)

Set the closed field of a link.

Definition at line 164 of file avfilter.c.

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 494 of file avfilter.c.

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

const char* avfilter_pad_get_name ( AVFilterPad pads,
int  pad_idx 
)

Get the name of an AVFilterPad.

Parameters:
pads an array of AVFilterPads
pad_idx index of the pad in the array it; is the caller's responsibility to ensure the index is valid
Returns:
name of the pad_idx'th pad in pads

Definition at line 617 of file avfilter.c.

enum AVMediaType avfilter_pad_get_type ( AVFilterPad pads,
int  pad_idx 
)

Get the type of an AVFilterPad.

Parameters:
pads an array of AVFilterPads
pad_idx index of the pad in the array; it is the caller's responsibility to ensure the index is valid
Returns:
type of the pad_idx'th pad in pads

Definition at line 622 of file avfilter.c.

Referenced by configure_input_filter(), configure_output_filter(), init_input_filter(), init_output_filter(), and opt_output_file().

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 382 of file avfilter.c.

Referenced by avfilter_graph_send_command(), and ff_start_frame().

AVFilterBufferRef* avfilter_ref_buffer ( AVFilterBufferRef ref,
int  pmask 
)

Add a new reference to a buffer.

Parameters:
ref an existing reference to the buffer
pmask a bitmask containing the allowable permissions in the new reference
Returns:
a new reference to the buffer with the same properties as the old, excluding any permissions denied by pmask

Definition at line 51 of file buffer.c.

Referenced by default_start_frame(), end_frame(), ff_inplace_start_frame(), ff_null_start_frame(), filter_frame(), filter_samples(), push_frame(), request_frame(), return_audio_frame(), source_request_frame(), start_frame(), sub2video_push_ref(), try_start_frame(), and vf_next_put_image().

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 410 of file avfilter.c.

Referenced by avfilter_register_all().

void avfilter_register_all ( void   ) 

Initialize the filter system.

Register all builtin filters.

Definition at line 34 of file allfilters.c.

Referenced by lavfi_read_header(), and main().

void avfilter_uninit ( void   ) 

Uninitialize the filter system.

Unregister all filters.

Definition at line 429 of file avfilter.c.

Referenced by do_exit(), and exit_program().

void avfilter_unref_buffer ( AVFilterBufferRef ref  ) 

void avfilter_unref_bufferp ( AVFilterBufferRef **  ref  ) 

Remove a reference to a buffer and set the pointer to NULL.

If this is the last reference to the buffer, the buffer itself is also automatically freed.

Parameters:
ref pointer to the buffer reference

Definition at line 178 of file buffer.c.

Referenced by alloc_picture(), avfilter_link_free(), clear_link(), config_output(), end_frame(), exit_program(), ff_inplace_start_frame(), ff_start_frame(), filter_samples(), join_free_buffer(), join_uninit(), main(), queue_picture(), request_frame(), start_frame(), stream_close(), uninit(), write_to_fifo(), and yae_clear().

unsigned avfilter_version ( void   ) 

Return the LIBAVFILTER_VERSION_INT constant.

Definition at line 74 of file avfilter.c.


Generated on Fri Oct 26 02:50:09 2012 for FFmpeg by  doxygen 1.5.8