49 perms, w, h, link->
format);
60 uint64_t channel_layout,
int planar)
64 int i, sample_size, chans_nb, bufsize, per_channel_size, step_size = 0;
90 per_channel_size = size/chans_nb;
97 for (i = 0; i < chans_nb; i++)
98 samples->
linesize[i] = planar > 0 ? per_channel_size : sample_size;
99 memset(&samples->
linesize[chans_nb], 0, (8-chans_nb) *
sizeof(samples->
linesize[0]));
102 bufsize = (size + 15)&~15;
110 samples->
data[0] = buf;
112 for (i = 1; i < chans_nb; i++) {
113 step_size += per_channel_size;
114 samples->
data[i] = buf + step_size;
117 for (i = 1; i < chans_nb; i++)
118 samples->
data[i] = buf;
121 memset(&samples->
data[chans_nb], 0, (8-chans_nb) *
sizeof(samples->
data[0]));
295 uint64_t channel_layout,
int packed)
298 size, channel_layout, packed);
uint8_t * data[8]
buffer data for each plane/channel
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
AVFilterBufferRef * avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
Request a picture buffer with a specific set of permissions.
int size
audio buffer size
int nb_samples
number of audio samples
AVFilterBufferRefAudioProps * audio
audio buffer specific properties
int linesize[8]
number of bytes per line
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.
AVFilterBufferRef * out_buf
Audio specific properties in a reference to an AVFilterBuffer.
A reference-counted buffer data type used by the filter system.
void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
draw_slice() handler for filters which simply pass video along
void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
default handler for freeing audio/video buffer when there are no references left
#define AV_PERM_READ
can read from the buffer
AVFilterLink ** inputs
array of pointers to input links
int linesize[8]
number of bytes per line
void avfilter_null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
filter_samples() handler for filters which simply pass audio along
void avfilter_end_frame(AVFilterLink *link)
Notifie the next filter that the current frame has finished.
unsigned input_count
number of input pads
void avfilter_default_filter_samples(AVFilterLink *inlink, AVFilterBufferRef *samplesref)
default handler for filter_samples() for audio inputs
int64_t pts
presentation timestamp.
audio conversion routines
A link between two filters.
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
AVFilterBuffer * buf
the buffer that this is a reference to
int av_get_channel_layout_nb_channels(uint64_t channel_layout)
Return the number of channels in the channel layout.
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link...
AVFilterFormats * in_formats
Lists of formats supported by the input and output filters respectively.
AVFilterBufferRef * avfilter_default_get_video_buffer(AVFilterLink *link, int perms, int w, int h)
default handler for get_video_buffer() for video inputs
void avfilter_default_start_frame(AVFilterLink *inlink, AVFilterBufferRef *picref)
default handler for start_frame() for video inputs
int w
agreed upon image width
unsigned output_count
number of output pads
int av_image_alloc(uint8_t *pointers[4], int linesizes[4], int w, int h, enum PixelFormat pix_fmt, int align)
Allocate an image with size w and h and pixel format pix_fmt, and fill pointers and linesizes accordi...
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.
int avfilter_default_config_output_link(AVFilterLink *link)
default config_link() implementation for output video links to simplify the implementation of one inp...
unsigned refcount
number of references to this buffer
void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
start_frame() handler for filters which simply pass video along
AVFilterContext * src
source filter
void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir)
Send a slice to the next filter.
void avfilter_null_end_frame(AVFilterLink *link)
end_frame() handler for filters which simply pass video along
int format
agreed upon media format
void(* free)(struct AVFilterBuffer *buf)
A pointer to the function to deallocate this buffer if the default function is not sufficient...
int av_get_bytes_per_sample(enum AVSampleFormat sample_fmt)
Return number of bytes per sample.
int64_t sample_rate
samples per second
void avfilter_unref_buffer(AVFilterBufferRef *ref)
Remove a reference to a buffer.
A reference to an AVFilterBuffer.
int avfilter_default_query_formats(AVFilterContext *ctx)
Default handler for query_formats()
int perms
permissions, see the AV_PERM_* flags
uint32_t sample_rate
audio buffer sample rate
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
void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref)
Add *ref as a new reference to formats.
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
AVFilterBufferRef * avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask)
Add a new reference to a buffer.
void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref)
Notify the next filter of the start of a frame.
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.
uint64_t channel_layout
channel layout of audio buffer
AVFilterLink ** outputs
array of pointers to output links
int planar
audio buffer - planar or packed
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
enum AVMediaType type
filter media type
void avfilter_default_draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
default handler for draw_slice() for video inputs
AVSampleFormat
all in native-endian format
uint64_t channel_layout
channel layout of current buffer (see libavutil/audioconvert.h)
void avfilter_default_end_frame(AVFilterLink *inlink)
default handler for end_frame() for video inputs
#define AV_PERM_WRITE
can write to the buffer
AVFilterBufferRef * avfilter_null_get_audio_buffer(AVFilterLink *link, int perms, enum AVSampleFormat sample_fmt, int size, uint64_t channel_layout, int packed)
get_audio_buffer() handler for filters which simply pass audio along
AVFilterContext * dst
dest filter
void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats)
A helper for query_formats() which sets all links to the same list of formats.
uint8_t * data[8]
picture/audio data for each plane
AVFilterBufferRef * cur_buf
void avfilter_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
Send a buffer of audio samples to the next filter.
AVFilterFormats * out_formats