FFmpeg
|
Files | |
file | avfilter.h |
external API header | |
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 | AVFilter |
Filter definition. More... | |
struct | AVFilterContext |
An instance of a filter. More... | |
struct | AVFilterLink |
A link between two filters. More... | |
Macros | |
#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) | |
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 AVClass * | avfilter_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. | |
AVFilterBufferRef * | avfilter_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. | |
int | avfilter_ref_get_channels (AVFilterBufferRef *ref) |
Get the number of channels of a buffer reference. | |
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. | |
int | avfilter_link_get_channels (AVFilterLink *link) |
Get the number of channels of a link. | |
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. | |
AVFilterBufferRef * | avfilter_get_video_buffer_ref_from_arrays (uint8_t *const data[4], const int linesize[4], int perms, int w, int h, enum AVPixelFormat format) |
Create a buffer reference wrapped around an already allocated image buffer. | |
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. | |
AVFilterBufferRef * | avfilter_get_audio_buffer_ref_from_arrays_channels (uint8_t **data, int linesize, int perms, int nb_samples, enum AVSampleFormat sample_fmt, int channels, 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. | |
AVFilter * | avfilter_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 AV_PERM_READ 0x01 |
can read from the buffer
Definition at line 112 of file avfilter.h.
Referenced by avfilter_get_audio_buffer_ref_from_arrays_channels(), avfilter_get_video_buffer_ref_from_arrays(), decode_video(), ff_default_get_audio_buffer(), ff_default_get_video_buffer(), ff_get_ref_perms_string(), ff_vf_next_put_image(), filter_frame(), init(), return_audio_frame(), sub2video_prepare(), and video_thread().
#define AV_PERM_WRITE 0x02 |
can write to the buffer
Definition at line 113 of file avfilter.h.
Referenced by av_asrc_buffer_add_samples(), av_buffersink_read_samples(), av_buffersrc_add_frame(), config_output(), config_video_output(), ff_copy_buffer_ref(), ff_default_get_audio_buffer(), ff_default_get_video_buffer(), ff_filter_frame_needs_framing(), ff_get_ref_perms_string(), ff_vf_next_put_image(), filter_frame(), frame_to_buf(), geq_filter_frame(), output_frame(), pp_filter_frame(), push_frame(), push_samples(), read_from_fifo(), request_frame(), return_audio_frame(), send_silence(), source_request_frame(), and split_init().
#define AV_PERM_PRESERVE 0x04 |
nobody else can overwrite the buffer
Definition at line 114 of file avfilter.h.
Referenced by config_output(), config_video_output(), decode_video(), ff_default_get_audio_buffer(), ff_default_get_video_buffer(), ff_get_ref_perms_string(), frame_to_buf(), init(), request_frame(), sub2video_prepare(), and video_thread().
#define AV_PERM_REUSE 0x08 |
can output the buffer multiple times, with the same contents each time
Definition at line 115 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 116 of file avfilter.h.
Referenced by config_output(), config_video_output(), ff_default_get_audio_buffer(), ff_default_get_video_buffer(), ff_get_ref_perms_string(), ff_vf_next_put_image(), and frame_to_buf().
#define AV_PERM_NEG_LINESIZES 0x20 |
the buffer requested can have negative linesizes
Definition at line 117 of file avfilter.h.
Referenced by ff_default_get_audio_buffer(), ff_default_get_video_buffer(), ff_filter_frame_framed(), ff_get_ref_perms_string(), filter_frame(), and get_video_buffer().
#define AV_PERM_ALIGN 0x40 |
the buffer must be aligned
Definition at line 118 of file avfilter.h.
Referenced by ff_default_get_audio_buffer(), ff_default_get_video_buffer(), filter_frame(), and get_video_buffer().
#define AVFILTER_ALIGN 16 |
Definition at line 120 of file avfilter.h.
Referenced by get_video_buffer().
#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 762 of file avfilter.h.
Referenced by avfilter_graph_queue_command(), avfilter_graph_send_command(), check_keyboard_interaction(), and filter_frame().
#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 763 of file avfilter.h.
Referenced by avfilter_graph_send_command().
unsigned avfilter_version | ( | void | ) |
Return the LIBAVFILTER_VERSION_INT constant.
Definition at line 79 of file avfilter.c.
const char* avfilter_configuration | ( | void | ) |
Return the libavfilter build-time configuration.
Definition at line 84 of file avfilter.c.
const char* avfilter_license | ( | void | ) |
Return the libavfilter license.
Definition at line 89 of file avfilter.c.
Get the class for the AVFilterContext struct.
Definition at line 498 of file avfilter.c.
Referenced by show_help_default().
void avfilter_copy_buffer_ref_props | ( | AVFilterBufferRef * | dst, |
AVFilterBufferRef * | src | ||
) |
Copy properties of src to dst, without copying the actual data.
Definition at line 189 of file buffer.c.
Referenced by ff_copy_buffer_ref(), ff_filter_frame_framed(), ff_filter_frame_needs_framing(), filter_frame(), geq_filter_frame(), pp_filter_frame(), and return_frame().
AVFilterBufferRef* avfilter_ref_buffer | ( | AVFilterBufferRef * | ref, |
int | pmask | ||
) |
Add a new reference to a buffer.
ref | an existing reference to the buffer |
pmask | a bitmask containing the allowable permissions in the new reference |
Definition at line 51 of file buffer.c.
Referenced by filter_frame(), push_frame(), request_frame(), return_audio_frame(), and sub2video_push_ref().
void avfilter_unref_buffer | ( | AVFilterBufferRef * | ref | ) |
Remove a reference to a buffer.
If this is the last reference to the buffer, the buffer itself is also automatically freed.
ref | reference to the buffer, may be NULL |
Definition at line 161 of file buffer.c.
Referenced by add_to_queue(), av_buffersink_read_samples(), av_buffersrc_add_frame(), av_buffersrc_add_ref(), avfilter_unref_bufferp(), channelmap_filter_frame(), common_uninit(), ff_buffersink_read_samples_compat(), ff_bufqueue_add(), ff_bufqueue_discard_all(), ff_filter_frame_framed(), ff_filter_frame_needs_framing(), filter_frame(), flush_fifo(), frame_to_buf(), join_request_frame(), lavfi_read_packet(), output_frame(), pp_filter_frame(), process_frame(), reap_filters(), request_frame(), return_audio_frame(), try_filter_frame(), uninit(), and write_to_fifo().
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.
ref | pointer to the buffer reference |
Definition at line 183 of file buffer.c.
Referenced by alloc_picture(), avfilter_get_audio_buffer_ref_from_frame(), avfilter_get_video_buffer_ref_from_frame(), avfilter_link_free(), config_output(), config_video_output(), exit_program(), filter_frame(), geq_filter_frame(), join_free_buffer(), join_uninit(), main(), null_filter_frame(), queue_picture(), request_frame(), stream_close(), uninit(), write_to_fifo(), and yae_clear().
int avfilter_ref_get_channels | ( | AVFilterBufferRef * | ref | ) |
const char* avfilter_pad_get_name | ( | AVFilterPad * | pads, |
int | pad_idx | ||
) |
Get the name of an AVFilterPad.
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 |
Definition at line 626 of file avfilter.c.
enum AVMediaType avfilter_pad_get_type | ( | AVFilterPad * | pads, |
int | pad_idx | ||
) |
Get the type of an AVFilterPad.
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 |
Definition at line 631 of file avfilter.c.
Referenced by configure_input_filter(), configure_output_filter(), init_input_filter(), init_output_filter(), and open_output_file().
int avfilter_link | ( | AVFilterContext * | src, |
unsigned | srcpad, | ||
AVFilterContext * | dst, | ||
unsigned | dstpad | ||
) |
Link 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 125 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 156 of file avfilter.c.
Referenced by avfilter_free().
int avfilter_link_get_channels | ( | AVFilterLink * | link | ) |
Get the number of channels of a link.
Definition at line 169 of file avfilter.c.
Referenced by transcode_init().
void avfilter_link_set_closed | ( | AVFilterLink * | link, |
int | closed | ||
) |
Set the closed field of a link.
Definition at line 174 of file avfilter.c.
int avfilter_config_links | ( | AVFilterContext * | filter | ) |
Negotiate the media format, dimensions, etc of all inputs to a filter.
filter | the filter to negotiate the properties for its inputs |
Definition at line 217 of file avfilter.c.
Referenced by avfilter_config_links(), and graph_config_links().
AVFilterBufferRef* avfilter_get_video_buffer_ref_from_arrays | ( | uint8_t *const | data[4], |
const int | linesize[4], | ||
int | perms, | ||
int | w, | ||
int | h, | ||
enum AVPixelFormat | format | ||
) |
Create a buffer reference wrapped around an already allocated image buffer.
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().
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.
See avfilter_get_audio_buffer_ref_from_arrays_channels() for a version that can handle unknown channel layouts.
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 171 of file audio.c.
Referenced by av_asrc_buffer_add_samples(), and join_request_frame().
AVFilterBufferRef* avfilter_get_audio_buffer_ref_from_arrays_channels | ( | uint8_t ** | data, |
int | linesize, | ||
int | perms, | ||
int | nb_samples, | ||
enum AVSampleFormat | sample_fmt, | ||
int | channels, | ||
uint64_t | channel_layout | ||
) |
Create an audio buffer reference wrapped around an already allocated samples buffer.
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 |
channels | the number of channels of the buffer |
channel_layout | the channel layout of the buffer, must be either 0 or consistent with channels |
Definition at line 95 of file audio.c.
Referenced by avfilter_get_audio_buffer_ref_from_arrays(), avfilter_get_audio_buffer_ref_from_frame(), and ff_default_get_audio_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.
It is recommended to use avfilter_graph_send_command().
Definition at line 383 of file avfilter.c.
Referenced by avfilter_graph_send_command(), and ff_filter_frame_framed().
Initialize the filter system.
Register all builtin filters.
Definition at line 39 of file allfilters.c.
Referenced by lavfi_read_header(), and main().
Uninitialize the filter system.
Unregister all filters.
Definition at line 438 of file avfilter.c.
Referenced by do_exit(), and exit_program().
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.
filter | the filter to register |
Definition at line 411 of file avfilter.c.
AVFilter* avfilter_get_by_name | ( | const char * | name | ) |
Get a filter definition matching the given name.
name | the filter name to find |
Definition at line 400 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(), lavfi_read_header(), main(), and query_formats().
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 433 of file avfilter.c.
Referenced by filter_child_class_next(), and show_filters().
int avfilter_open | ( | AVFilterContext ** | filter_ctx, |
AVFilter * | filter, | ||
const char * | inst_name | ||
) |
Create a filter instance.
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. |
Definition at line 503 of file avfilter.c.
Referenced by avfilter_graph_create_filter(), create_filter(), and main().
int avfilter_init_filter | ( | AVFilterContext * | filter, |
const char * | args, | ||
void * | opaque | ||
) |
Initialize 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 615 of file avfilter.c.
Referenced by avfilter_graph_create_filter(), create_filter(), and main().
void avfilter_free | ( | AVFilterContext * | filter | ) |
Free a filter context.
filter | the filter to free |
Definition at line 565 of file avfilter.c.
Referenced by avfilter_graph_create_filter(), avfilter_graph_free(), avfilter_graph_parse(), avfilter_graph_parse2(), 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.
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 |
Definition at line 179 of file avfilter.c.
Referenced by graph_insert_fifos(), and query_formats().