#include "libavutil/avutil.h"
#include "libavutil/log.h"
#include "libavutil/samplefmt.h"
#include "libavutil/pixfmt.h"
#include "libavutil/rational.h"
#include "libavcodec/avcodec.h"
#include <stddef.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 | 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 More... | |
#define | AV_PERM_WRITE 0x02 |
can write to the buffer More... | |
#define | AV_PERM_PRESERVE 0x04 |
nobody else can overwrite the buffer More... | |
#define | AV_PERM_REUSE 0x08 |
can output the buffer multiple times, with the same contents each time More... | |
#define | AV_PERM_REUSE2 0x10 |
can output the buffer multiple times, modified each time More... | |
#define | AV_PERM_NEG_LINESIZES 0x20 |
the buffer requested can have negative linesizes More... | |
Typedefs | |
typedef struct AVFilterContext | AVFilterContext |
typedef struct AVFilterLink | AVFilterLink |
typedef struct AVFilterPad | AVFilterPad |
typedef struct AVFilterFormats | AVFilterFormats |
typedef struct AVFilterBuffer | AVFilterBuffer |
A reference-counted buffer data type used by the filter system. More... | |
typedef struct AVFilterBufferRefAudioProps | AVFilterBufferRefAudioProps |
Audio specific properties in a reference to an AVFilterBuffer. More... | |
typedef struct AVFilterBufferRefVideoProps | AVFilterBufferRefVideoProps |
Video specific properties in a reference to an AVFilterBuffer. More... | |
typedef struct AVFilterBufferRef | AVFilterBufferRef |
A reference to an AVFilterBuffer. More... | |
typedef struct AVFilter | AVFilter |
Filter definition. More... | |
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 | avfilter_copy_buffer_ref_props (AVFilterBufferRef *dst, AVFilterBufferRef *src) |
Copy properties of src to dst, without copying the actual data. More... | |
AVFilterBufferRef * | avfilter_ref_buffer (AVFilterBufferRef *ref, int pmask) |
Add a new reference to a buffer. More... | |
void | avfilter_unref_buffer (AVFilterBufferRef *ref) |
Remove a reference to a buffer. More... | |
void | avfilter_unref_bufferp (AVFilterBufferRef **ref) |
Remove a reference to a buffer and set the pointer to NULL. More... | |
const char * | avfilter_pad_get_name (AVFilterPad *pads, int pad_idx) |
Get the name of an AVFilterPad. More... | |
enum AVMediaType | avfilter_pad_get_type (AVFilterPad *pads, int pad_idx) |
Get the type of an AVFilterPad. More... | |
int | avfilter_link (AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) |
Link two filters together. More... | |
int | avfilter_config_links (AVFilterContext *filter) |
Negotiate the media format, dimensions, etc of all inputs to a filter. More... | |
AVFilterBufferRef * | avfilter_get_video_buffer_ref_from_arrays (uint8_t *data[4], int linesize[4], int perms, int w, int h, enum AVPixelFormat format) |
Create a buffer reference wrapped around an already allocated image buffer. More... | |
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. More... | |
void | avfilter_register_all (void) |
Initialize the filter system. More... | |
void | avfilter_uninit (void) |
Uninitialize the filter system. More... | |
int | avfilter_register (AVFilter *filter) |
Register a filter. More... | |
AVFilter * | avfilter_get_by_name (const char *name) |
Get a filter definition matching the given name. More... | |
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. More... | |
int | avfilter_open (AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name) |
Create a filter instance. More... | |
int | avfilter_init_filter (AVFilterContext *filter, const char *args, void *opaque) |
Initialize a filter. More... | |
void | avfilter_free (AVFilterContext *filter) |
Free a filter context. 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_copy_frame_props (AVFilterBufferRef *dst, const AVFrame *src) |
Copy the frame properties of src to dst, without copying the actual image data. More... | |
int | avfilter_copy_buf_props (AVFrame *dst, const AVFilterBufferRef *src) |
Copy the frame properties and data pointers of src to dst, without copying the actual data. More... | |
#define AV_PERM_NEG_LINESIZES 0x20 |
the buffer requested can have negative linesizes
Definition at line 102 of file avfilter.h.
Referenced by ff_filter_frame(), filter_frame(), and get_video_buffer().
#define AV_PERM_PRESERVE 0x04 |
nobody else can overwrite the buffer
Definition at line 99 of file avfilter.h.
Referenced by decode_video(), filter_frame(), movie_get_frame(), and video_thread().
#define AV_PERM_READ 0x01 |
can read from the buffer
Definition at line 97 of file avfilter.h.
Referenced by avfilter_get_audio_buffer_ref_from_arrays(), avfilter_get_video_buffer_ref_from_arrays(), decode_video(), filter_frame(), request_frame(), return_audio_frame(), and video_thread().
#define AV_PERM_REUSE 0x08 |
can output the buffer multiple times, with the same contents each time
Definition at line 100 of file avfilter.h.
#define AV_PERM_REUSE2 0x10 |
can output the buffer multiple times, modified each time
Definition at line 101 of file avfilter.h.
Referenced by movie_get_frame().
#define AV_PERM_WRITE 0x02 |
can write to the buffer
Definition at line 98 of file avfilter.h.
Referenced by av_buffersrc_write_frame(), color_request_frame(), filter_frame(), movie_get_frame(), output_frame(), read_from_fifo(), request_frame(), return_audio_frame(), and source_request_frame().
Filter definition.
This defines the pads a filter contains, and all the callback functions used to interact with the filter.
typedef struct AVFilterBuffer AVFilterBuffer |
A reference-counted buffer data type used by the filter system.
Filters should not store pointers to this structure directly, but instead use the AVFilterBufferRef structure below.
typedef struct AVFilterBufferRef AVFilterBufferRef |
A reference to an AVFilterBuffer.
Since filters can manipulate the origin of a buffer to, for example, crop image without any memcpy, the buffer origin and dimensions are per-reference properties. Linesize is also useful for image flipping, frame to field filters, etc, and so is also per-reference.
TODO: add anything necessary for frame reordering
typedef struct AVFilterBufferRefAudioProps AVFilterBufferRefAudioProps |
Audio specific properties in a reference to an AVFilterBuffer.
Since AVFilterBufferRef is common to different media formats, audio specific per reference properties must be separated out.
typedef struct AVFilterBufferRefVideoProps AVFilterBufferRefVideoProps |
Video specific properties in a reference to an AVFilterBuffer.
Since AVFilterBufferRef is common to different media formats, video specific per reference properties must be separated out.
typedef struct AVFilterContext AVFilterContext |
Definition at line 52 of file avfilter.h.
typedef struct AVFilterFormats AVFilterFormats |
Definition at line 55 of file avfilter.h.
typedef struct AVFilterLink AVFilterLink |
Definition at line 53 of file avfilter.h.
typedef struct AVFilterPad AVFilterPad |
Definition at line 54 of file avfilter.h.
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 294 of file avfilter.c.
Referenced by show_filters().
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 140 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 41 of file avfilter.c.
int avfilter_copy_buf_props | ( | AVFrame * | dst, |
const AVFilterBufferRef * | src | ||
) |
Copy the frame properties and data pointers of src to dst, without copying the actual data.
Definition at line 120 of file buffer.c.
Referenced by poll_filter(), and video_thread().
void avfilter_copy_buffer_ref_props | ( | AVFilterBufferRef * | dst, |
AVFilterBufferRef * | src | ||
) |
Copy properties of src to dst, without copying the actual data.
Definition at line 164 of file buffer.c.
Referenced by ff_filter_frame(), filter_frame(), and return_frame().
int avfilter_copy_frame_props | ( | AVFilterBufferRef * | dst, |
const AVFrame * | src | ||
) |
Copy the frame properties of src to dst, without copying the actual image data.
Definition at line 94 of file buffer.c.
Referenced by av_buffersrc_write_frame(), decode_video(), movie_get_frame(), and video_thread().
void avfilter_free | ( | AVFilterContext * | filter | ) |
Free a filter context.
filter | the filter to free |
Definition at line 391 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.
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 80 of file audio.c.
Referenced by 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.
name | the filter name to find |
Definition at line 274 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(), main(), and query_formats().
AVFilterBufferRef* avfilter_get_video_buffer_ref_from_arrays | ( | uint8_t * | data[4], |
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 101 of file video.c.
Referenced by decode_video(), ff_default_get_video_buffer(), and video_thread().
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 435 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.
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 103 of file avfilter.c.
Referenced by graph_insert_fifos(), and query_formats().
const char* avfilter_license | ( | void | ) |
Return the libavfilter license.
Definition at line 46 of file avfilter.c.
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 73 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(), and link_filter().
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 329 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.
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 444 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 449 of file avfilter.c.
Referenced by configure_input_filter(), configure_output_filter(), init_input_filter(), init_output_filter(), and open_output_file().
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 35 of file buffer.c.
Referenced by filter_frame(), request_frame(), and return_audio_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.
filter | the filter to register |
Definition at line 285 of file avfilter.c.
Initialize the filter system.
Register all builtin filters.
Definition at line 39 of file allfilters.c.
Referenced by main().
Uninitialize the filter system.
Unregister all filters.
Definition at line 299 of file avfilter.c.
Referenced by do_exit(), and exit_program().
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 75 of file buffer.c.
Referenced by add_to_queue(), av_buffersink_read_samples(), av_buffersrc_write_frame(), avfilter_unref_bufferp(), channelmap_filter_frame(), ff_filter_frame(), filter_frame(), flush_fifo(), join_request_frame(), output_frame(), poll_filter(), request_frame(), return_audio_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 88 of file buffer.c.
Referenced by alloc_picture(), filter_frame(), join_free_buffer(), join_uninit(), null_filter_frame(), queue_picture(), request_frame(), stream_close(), uninit(), and write_to_fifo().
unsigned avfilter_version | ( | void | ) |
Return the LIBAVFILTER_VERSION_INT constant.
Definition at line 37 of file avfilter.c.