2 * This file is part of FFmpeg.
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef AVFILTER_ASRC_ABUFFER_H
20 #define AVFILTER_ASRC_ABUFFER_H
26 * memory buffer source for audio
30 * Queue an audio buffer to the audio buffer source.
32 * @param abuffersrc audio source buffer context
33 * @param data pointers to the samples planes
34 * @param linesize linesizes of each audio buffer plane
35 * @param nb_samples number of samples per channel
36 * @param sample_fmt sample format of the audio data
37 * @param ch_layout channel layout of the audio data
38 * @param planar flag to indicate if audio data is planar or packed
39 * @param pts presentation timestamp of the audio buffer
42 int av_asrc_buffer_add_samples(AVFilterContext *abuffersrc,
43 uint8_t *data[8], int linesize[8],
44 int nb_samples, int sample_rate,
45 int sample_fmt, int64_t ch_layout, int planar,
46 int64_t pts, int av_unused flags);
49 * Queue an audio buffer to the audio buffer source.
51 * This is similar to av_asrc_buffer_add_samples(), but the samples
52 * are stored in a buffer with known size.
54 * @param abuffersrc audio source buffer context
55 * @param buf pointer to the samples data, packed is assumed
56 * @param size the size in bytes of the buffer, it must contain an
57 * integer number of samples
58 * @param sample_fmt sample format of the audio data
59 * @param ch_layout channel layout of the audio data
60 * @param pts presentation timestamp of the audio buffer
63 int av_asrc_buffer_add_buffer(AVFilterContext *abuffersrc,
64 uint8_t *buf, int buf_size,
66 int sample_fmt, int64_t ch_layout, int planar,
67 int64_t pts, int av_unused flags);
70 * Queue an audio buffer to the audio buffer source.
72 * @param abuffersrc audio source buffer context
73 * @param samplesref buffer ref to queue
76 int av_asrc_buffer_add_audio_buffer_ref(AVFilterContext *abuffersrc,
77 AVFilterBufferRef *samplesref,
80 #endif /* AVFILTER_ASRC_ABUFFER_H */