]> git.sesse.net Git - ffmpeg/blob - libavfilter/asrc_abuffer.h
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / libavfilter / asrc_abuffer.h
1 /*
2  * This file is part of FFmpeg.
3  *
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.
8  *
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.
13  *
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
17  */
18
19 #ifndef AVFILTER_ASRC_ABUFFER_H
20 #define AVFILTER_ASRC_ABUFFER_H
21
22 #include "avfilter.h"
23
24 /**
25  * @file
26  * memory buffer source for audio
27  */
28
29 /**
30  * Queue an audio buffer to the audio buffer source.
31  *
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
40  * @param flags unused
41  */
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);
47
48 /**
49  * Queue an audio buffer to the audio buffer source.
50  *
51  * This is similar to av_asrc_buffer_add_samples(), but the samples
52  * are stored in a buffer with known size.
53  *
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
61  * @param flags unused
62  */
63 int av_asrc_buffer_add_buffer(AVFilterContext *abuffersrc,
64                               uint8_t *buf, int buf_size,
65                               int sample_rate,
66                               int sample_fmt, int64_t ch_layout, int planar,
67                               int64_t pts, int av_unused flags);
68
69 /**
70  * Queue an audio buffer to the audio buffer source.
71  *
72  * @param abuffersrc audio source buffer context
73  * @param samplesref buffer ref to queue
74  * @param flags unused
75  */
76 int av_asrc_buffer_add_audio_buffer_ref(AVFilterContext *abuffersrc,
77                                         AVFilterBufferRef *samplesref,
78                                         int av_unused flags);
79
80 #endif /* AVFILTER_ASRC_ABUFFER_H */