22 #ifndef AVFILTER_AVFILTER_H
23 #define AVFILTER_AVFILTER_H
81 #define AV_PERM_READ 0x01
82 #define AV_PERM_WRITE 0x02
83 #define AV_PERM_PRESERVE 0x04
84 #define AV_PERM_REUSE 0x08
85 #define AV_PERM_REUSE2 0x10
86 #define AV_PERM_NEG_LINESIZES 0x20
371 uint64_t channel_layout,
int planar);
455 int perms,
int w,
int h);
460 uint64_t channel_layout,
int planar);
486 int perms,
int w,
int h);
491 uint64_t channel_layout,
int planar);
683 uint64_t channel_layout,
int planar);
822 unsigned filt_srcpad_idx,
unsigned filt_dstpad_idx);
uint8_t * data[8]
buffer data for each plane/channel
int(* poll_frame)(AVFilterLink *link)
Frame poll callback.
int size
audio buffer size
int nb_samples
number of audio samples
AVFilterBufferRefAudioProps * audio
audio buffer specific properties
AVFilterBufferRefVideoProps * video
video buffer specific properties
int linesize[8]
number of bytes per line
int avfilter_poll_frame(AVFilterLink *link)
Poll a frame from the filter chain.
static void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src)
Copy properties of src to dst, without copying the actual data.
int h
agreed upon image height
AVFilterFormats * avfilter_all_formats(enum AVMediaType type)
Return a list of all formats supported by Libav for the given media type.
int(* init)(AVFilterContext *ctx, const char *args, void *opaque)
Filter initialization function.
AVFilterBufferRef * out_buf
Libavfilter version macros.
void * priv
private data to be used by a custom free function
enum AVMediaType type
media type of buffer data
Audio specific properties in a reference to an AVFilterBuffer.
A reference-counted buffer data type used by the filter system.
AVFilterBufferRef * avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms, int w, int h, enum PixelFormat format)
Create a buffer reference wrapped around an already allocated image buffer.
enum AVMediaType type
AVFilterPad type.
struct AVFilterBufferRefVideoProps AVFilterBufferRefVideoProps
Video specific properties in a reference to an AVFilterBuffer.
AVFilterBufferRef * avfilter_default_get_audio_buffer(AVFilterLink *link, int perms, enum AVSampleFormat sample_fmt, int size, uint64_t channel_layout, int planar)
default handler for get_audio_buffer() for audio inputs
int(* query_formats)(AVFilterContext *)
Queries formats supported by the filter and its pads, and sets the in_formats for links connected to ...
void(* start_frame)(AVFilterLink *link, AVFilterBufferRef *picref)
Callback called before passing the first slice of a new frame.
AVFilterPad * dstpad
input pad on the dest filter
void(* end_frame)(AVFilterLink *link)
Callback called after the slices of a frame are completely sent.
int h
width and height of the allocated buffer
void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
default handler for start_frame() for video inputs
void avfilter_unref_buffer(AVFilterBufferRef *ref)
Remove a reference to a buffer.
void avfilter_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
Send a buffer of audio samples to the next filter.
enum AVFilterLink::@62 init_state
stage of the initialization of the link properties (dimensions, etc)
const char * name
Pad name.
int priv_size
size of private data to allocate for the filter
AVFilterLink ** inputs
array of pointers to input links
char * name
name of this filter instance
void avfilter_null_end_frame(AVFilterLink *link)
end_frame() handler for filters which simply pass video along
static void avfilter_insert_outpad(AVFilterContext *f, unsigned index, AVFilterPad *p)
Insert a new output pad for the filter.
AVFilterPad * output_pads
array of output pads
int linesize[8]
number of bytes per line
int(* request_frame)(AVFilterLink *link)
Frame request callback.
int avfilter_default_config_input_link(AVFilterLink *link)
default handler for config_props() for audio/video inputs
int top_field_first
field order
void avfilter_default_end_frame(AVFilterLink *link)
default handler for end_frame() for video inputs
AVFilterBufferRef * avfilter_get_audio_buffer(AVFilterLink *link, int perms, enum AVSampleFormat sample_fmt, int size, uint64_t channel_layout, int planar)
Request an audio samples buffer with a specific set of permissions.
unsigned input_count
number of input pads
int avfilter_add_format(AVFilterFormats **avff, int fmt)
Add fmt to the list of media formats contained in *avff.
int key_frame
1 -> keyframe, 0-> not
int avfilter_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
void(* filter_samples)(AVFilterLink *link, AVFilterBufferRef *samplesref)
Samples filtering callback.
void(* uninit)(AVFilterContext *ctx)
Filter uninitialization function.
void avfilter_null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
filter_samples() handler for filters which simply pass audio along
AVRational pixel_aspect
pixel aspect ratio
int64_t pts
presentation timestamp.
A filter pad used for either input or output.
int avfilter_default_query_formats(AVFilterContext *ctx)
Default handler for query_formats()
A link between two filters.
AVFilterPad * input_pads
array of input pads
void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
void avfilter_register_all(void)
Initialize the filter system.
AVFilterBufferRef * avfilter_null_get_audio_buffer(AVFilterLink *link, int perms, enum AVSampleFormat sample_fmt, int size, uint64_t channel_layout, int planar)
get_audio_buffer() handler for filters which simply pass audio along
AVFilterBuffer * buf
the buffer that this is a reference to
void * priv
private data for use by the filter
AVFilterBufferRef * avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
default handler for get_video_buffer() for video inputs
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
Video specific properties in a reference to an AVFilterBuffer.
AVFilterFormats * avfilter_make_format_list(const int *fmts)
Create a list of supported formats.
AVFilterFormats * in_formats
Lists of formats supported by the input and output filters respectively.
unsigned avfilter_version(void)
Return the LIBAVFILTER_VERSION_INT constant.
int w
agreed upon image width
AVFilterBufferRef * avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
Add a new reference to a buffer.
static void filter(MpegAudioContext *s, int ch, const short *samples, int incr)
unsigned output_count
number of output pads
void avfilter_free(AVFilterContext *filter)
Free a filter context.
void avfilter_default_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
default handler for filter_samples() for audio inputs
void avfilter_end_frame(AVFilterLink *link)
Notifie the next filter that the current frame has finished.
void(* draw_slice)(AVFilterLink *link, int y, int height, int slice_dir)
Slice drawing callback.
int avfilter_config_links(AVFilterContext *filter)
Negotiate the media format, dimensions, etc of all inputs to a filter.
struct AVFilterBufferRef AVFilterBufferRef
A reference to an AVFilterBuffer.
unsigned refcount
number of references to this buffer
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.
AVFilterContext * src
source filter
int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
Copy the frame properties of src to dst, without copying the actual image data.
const char * avfilter_configuration(void)
Return the libavfilter build-time configuration.
int format
agreed upon media format
const AVFilterPad * inputs
NULL terminated list of inputs. NULL if none.
void(* free)(struct AVFilterBuffer *buf)
A pointer to the function to deallocate this buffer if the default function is not sufficient...
int64_t sample_rate
samples per second
A reference to an AVFilterBuffer.
struct AVFilterFormats AVFilterFormats
A list of supported formats for one end of a filter link.
struct AVFilter AVFilter
Filter definition.
int perms
permissions, see the AV_PERM_* flags
uint32_t sample_rate
audio buffer sample rate
static void(WINAPI *cond_broadcast)(pthread_cond_t *cond)
void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref)
Add *ref as a new reference to formats.
int avfilter_default_config_output_link(AVFilterLink *link)
default handler for config_props() for audio/video outputs
void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, AVFilterPad **pads, AVFilterLink ***links, AVFilterPad *newpad)
Insert a new pad.
void avfilter_uninit(void)
Uninitialize the filter system.
enum AVPictureType pict_type
picture type of the frame
void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
start_frame() handler for filters which simply pass video along
Describe the class of an AVClass context structure.
AVFilterBufferRef * src_buf
The buffer reference currently being sent across the link by the source filter.
rational number numerator/denominator
const char * name
filter name
AVRational sample_aspect_ratio
agreed upon sample aspect ratio
AVFilterFormats * avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
Return a format list which contains the intersection of the formats of a and b.
AVFilterBufferRef * avfilter_null_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
get_video_buffer() handler for filters which simply pass video along
uint64_t channel_layout
channel layout of audio buffer
AVFilterLink ** outputs
array of pointers to output links
int planar
audio buffer - planar or packed
enum AVMediaType type
filter media type
int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name)
Create a filter instance.
AVFilterBufferRef * avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
Request a picture buffer with a specific set of permissions.
void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
Send a slice to the next filter.
int rej_perms
Permissions which are not accepted on incoming buffers.
int interlaced
is frame interlaced
void avfilter_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref)
Before After |formats |<------—.
int avfilter_register(AVFilter *filter)
Register a filter.
AVSampleFormat
all in native-endian format
uint64_t channel_layout
channel layout of current buffer (see libavutil/audioconvert.h)
void avfilter_default_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
default handler for draw_slice() for video inputs
const char * description
A description for the filter.
int64_t pos
byte position in stream, -1 if unknown
void avfilter_formats_unref(AVFilterFormats **ref)
If *ref is non-NULL, remove *ref as a reference to the format list it currently points to...
static void avfilter_insert_inpad(AVFilterContext *f, unsigned index, AVFilterPad *p)
Insert a new input pad for the filter.
AVFilterContext * dst
dest filter
AVFilter * filter
the AVFilter of which this is an instance
const AVClass * av_class
needed for av_log()
uint8_t * data[8]
picture/audio data for each plane
struct AVFilterBuffer AVFilterBuffer
A reference-counted buffer data type used by the filter system.
AVFilterBufferRef * cur_buf
AVFilterPad * srcpad
output pad on the source filter
const AVFilterPad * outputs
NULL terminated list of outputs. NULL if none.
int(* config_props)(AVFilterLink *link)
Link configuration callback.
struct AVFilterBufferRefAudioProps AVFilterBufferRefAudioProps
Audio specific properties in a reference to an AVFilterBuffer.
const char * avfilter_license(void)
Return the libavfilter license.
void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
Notify the next filter of the start of a frame.
void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
draw_slice() handler for filters which simply pass video along
int min_perms
Minimum required permissions on incoming buffers.
int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque)
Initialize 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...
AVFilterFormats * out_formats
int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)
Link two filters together.