103 AVFrame *frame,
int nb_samples)
140 #if FF_API_AVFILTERBUFFER
150 AVFilterBufferRef **pbuf,
int nb_samples)
152 AVFilterBufferRef *buf;
177 buf = avfilter_get_audio_buffer_ref_from_arrays(frame->
extended_data,
188 avfilter_copy_frame_props(buf, frame);
190 buf->buf->priv = frame;
203 return compat_read(ctx, buf, 0);
209 return compat_read(ctx, buf, nb_samples);
225 .
name =
"buffersink",
226 .description =
NULL_IF_CONFIG_SMALL(
"Buffer video frames, and make them available to the end of the filter graph."),
230 .
inputs = avfilter_vsink_buffer_inputs,
245 .
name =
"abuffersink",
246 .description =
NULL_IF_CONFIG_SMALL(
"Buffer audio frames, and make them available to the end of the filter graph."),
250 .
inputs = avfilter_asink_abuffer_inputs,
int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples)
Write data to an AVAudioFifo.
This structure describes decoded (raw) audio or video data.
static const AVFilterPad outputs[]
static av_cold void uninit(AVFilterContext *ctx)
Main libavfilter public API header.
static int read_from_fifo(AVFilterContext *ctx, AVFrame *frame, int nb_samples)
AVBufferRef * buf[AV_NUM_DATA_POINTERS]
AVBuffer references backing the data for this frame.
void av_frame_move_ref(AVFrame *dst, AVFrame *src)
Move everythnig contained in src to dst and reset src.
void av_audio_fifo_free(AVAudioFifo *af)
Free an AVAudioFifo.
const char * name
Pad name.
int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples)
Read data from an AVAudioFifo.
AVFilterLink ** inputs
array of pointers to input links
#define av_assert0(cond)
assert() equivalent, that is always enabled.
AVAudioFifo * audio_fifo
FIFO for audio samples.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
#define AVERROR_EOF
End of file.
int av_audio_fifo_size(AVAudioFifo *af)
Get the current number of samples in the AVAudioFifo available for reading.
A filter pad used for either input or output.
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)
Rescale a 64-bit integer by 2 rational numbers.
A link between two filters.
int width
width and height of the video frame
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
AVAudioFifo * av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels, int nb_samples)
Allocate an AVAudioFifo.
int sample_rate
samples per second
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void * priv
private data for use by the filter
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...
simple assert() macros that are a bit more flexible than ISO C assert().
static const AVFilterPad avfilter_asink_abuffer_inputs[]
Context for an Audio FIFO Buffer.
uint64_t channel_layout
Channel layout of the audio data.
common internal API header
audio channel layout utility functions
int attribute_align_arg av_buffersink_get_samples(AVFilterContext *ctx, AVFrame *frame, int nb_samples)
Same as av_buffersink_get_frame(), but with the ability to specify the number of samples read...
int format
agreed upon media format
AVFilter ff_asink_abuffer
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
#define attribute_align_arg
AVFrame * cur_frame
last frame delivered on the sink
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
static const AVFilterPad inputs[]
rational number numerator/denominator
const char * name
Filter name.
enum AVMediaType type
filter media type
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int64_t next_pts
interpolating audio pts
#define FF_DISABLE_DEPRECATION_WARNINGS
common internal and external API header
AVFilterBufferRef * avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms, int w, int h, enum AVPixelFormat format)
uint64_t channel_layout
channel layout of current buffer (see libavutil/channel_layout.h)
#define FF_ENABLE_DEPRECATION_WARNINGS
static int filter_frame(AVFilterLink *link, AVFrame *frame)
AVFilterContext * dst
dest filter
static const AVFilterPad avfilter_vsink_buffer_inputs[]
int ff_request_frame(AVFilterLink *link)
Request an input frame from the filter at the other end of the link.
uint8_t ** extended_data
pointers to the data planes/channels.
int ff_poll_frame(AVFilterLink *link)
Poll a frame from the filter chain.
int attribute_align_arg av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame)
Get a frame with filtered data from sink and put it in frame.
int nb_samples
number of audio samples (per channel) described by this frame
#define AV_NOPTS_VALUE
Undefined timestamp value.
static void compat_free_buffer(void *opaque, uint8_t *data)