39 int planes = planar ? nb_channels : 1;
42 if (!(data =
av_mallocz(
sizeof(*data) * planes)))
81 int linesize,
int perms,
84 uint64_t channel_layout)
90 if (!samples || !samplesref)
111 memcpy(samples->
data, data,
113 memcpy(samplesref->
data, samples->
data,
sizeof(samples->
data));
126 memcpy(samples-> extended_data, data,
sizeof(*data)*planes);
127 memcpy(samplesref->
extended_data, data,
sizeof(*data)*planes);
uint8_t * data[8]
buffer data for each plane/channel
uint8_t ** extended_data
pointers to the data planes/channels.
AVFilterBufferRef * ff_get_audio_buffer(AVFilterLink *link, int perms, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
int nb_samples
number of audio samples
AVFilterBufferRefAudioProps * audio
audio buffer specific properties
int linesize[8]
number of bytes per line
enum AVMediaType type
media type of buffer data
A reference-counted buffer data type used by the filter system.
AVFilterPad * dstpad
input pad on the dest filter
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
#define AV_PERM_READ
can read from the buffer
int linesize[8]
number of bytes per line
int64_t pts
presentation timestamp.
A link between two filters.
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.
void ff_avfilter_default_free_buffer(AVFilterBuffer *ptr)
default handler for freeing audio/video buffer when there are no references left
audio channel layout utility functions
unsigned refcount
number of references to this buffer
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...
A reference to an AVFilterBuffer.
AVFilterBufferRef *(* get_audio_buffer)(AVFilterLink *link, int perms, int nb_samples)
Callback function to get an audio buffer.
int av_samples_alloc(uint8_t **audio_data, int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align)
Allocate a samples buffer for nb_samples samples, and fill data pointers and linesize accordingly...
int perms
permissions, see the AV_PERM_* flags
AVFilterBufferRef * ff_default_get_audio_buffer(AVFilterLink *link, int perms, int nb_samples)
default handler for get_audio_buffer() for audio inputs
#define FF_ARRAY_ELEMS(a)
int av_sample_fmt_is_planar(enum AVSampleFormat sample_fmt)
Check if the sample format is planar.
uint8_t ** extended_data
pointers to the data planes/channels.
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_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.
common internal and external API header
AVSampleFormat
Audio Sample Formats.
uint64_t channel_layout
channel layout of current buffer (see libavutil/channel_layout.h)
AVFilterContext * dst
dest filter
uint8_t * data[8]
picture/audio data for each plane
AVFilterBufferRef * ff_null_get_audio_buffer(AVFilterLink *link, int perms, int nb_samples)
get_audio_buffer() handler for filters which simply pass audio along
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...