yading@10
|
1 /*
|
yading@10
|
2 * Copyright (c) Stefano Sabatini | stefasab at gmail.com
|
yading@10
|
3 * Copyright (c) S.N. Hemanth Meenakshisundaram | smeenaks at ucsd.edu
|
yading@10
|
4 *
|
yading@10
|
5 * This file is part of FFmpeg.
|
yading@10
|
6 *
|
yading@10
|
7 * FFmpeg is free software; you can redistribute it and/or
|
yading@10
|
8 * modify it under the terms of the GNU Lesser General Public
|
yading@10
|
9 * License as published by the Free Software Foundation; either
|
yading@10
|
10 * version 2.1 of the License, or (at your option) any later version.
|
yading@10
|
11 *
|
yading@10
|
12 * FFmpeg is distributed in the hope that it will be useful,
|
yading@10
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
yading@10
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
yading@10
|
15 * Lesser General Public License for more details.
|
yading@10
|
16 *
|
yading@10
|
17 * You should have received a copy of the GNU Lesser General Public
|
yading@10
|
18 * License along with FFmpeg; if not, write to the Free Software
|
yading@10
|
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
yading@10
|
20 */
|
yading@10
|
21
|
yading@10
|
22 #ifndef AVFILTER_AUDIO_H
|
yading@10
|
23 #define AVFILTER_AUDIO_H
|
yading@10
|
24
|
yading@10
|
25 #include "avfilter.h"
|
yading@10
|
26 #include "internal.h"
|
yading@10
|
27
|
yading@10
|
28 static const enum AVSampleFormat ff_packed_sample_fmts_array[] = {
|
yading@10
|
29 AV_SAMPLE_FMT_U8,
|
yading@10
|
30 AV_SAMPLE_FMT_S16,
|
yading@10
|
31 AV_SAMPLE_FMT_S32,
|
yading@10
|
32 AV_SAMPLE_FMT_FLT,
|
yading@10
|
33 AV_SAMPLE_FMT_DBL,
|
yading@10
|
34 AV_SAMPLE_FMT_NONE
|
yading@10
|
35 };
|
yading@10
|
36
|
yading@10
|
37 static const enum AVSampleFormat ff_planar_sample_fmts_array[] = {
|
yading@10
|
38 AV_SAMPLE_FMT_U8P,
|
yading@10
|
39 AV_SAMPLE_FMT_S16P,
|
yading@10
|
40 AV_SAMPLE_FMT_S32P,
|
yading@10
|
41 AV_SAMPLE_FMT_FLTP,
|
yading@10
|
42 AV_SAMPLE_FMT_DBLP,
|
yading@10
|
43 AV_SAMPLE_FMT_NONE
|
yading@10
|
44 };
|
yading@10
|
45
|
yading@10
|
46 /** default handler for get_audio_buffer() for audio inputs */
|
yading@10
|
47 AVFrame *ff_default_get_audio_buffer(AVFilterLink *link, int nb_samples);
|
yading@10
|
48
|
yading@10
|
49 /** get_audio_buffer() handler for filters which simply pass audio along */
|
yading@10
|
50 AVFrame *ff_null_get_audio_buffer(AVFilterLink *link, int nb_samples);
|
yading@10
|
51
|
yading@10
|
52 /**
|
yading@10
|
53 * Request an audio samples buffer with a specific set of permissions.
|
yading@10
|
54 *
|
yading@10
|
55 * @param link the output link to the filter from which the buffer will
|
yading@10
|
56 * be requested
|
yading@10
|
57 * @param nb_samples the number of samples per channel
|
yading@10
|
58 * @return A reference to the samples. This must be unreferenced with
|
yading@10
|
59 * avfilter_unref_buffer when you are finished with it.
|
yading@10
|
60 */
|
yading@10
|
61 AVFrame *ff_get_audio_buffer(AVFilterLink *link, int nb_samples);
|
yading@10
|
62
|
yading@10
|
63 /**
|
yading@10
|
64 * Send a buffer of audio samples to the next filter.
|
yading@10
|
65 *
|
yading@10
|
66 * @param link the output link over which the audio samples are being sent
|
yading@10
|
67 * @param samplesref a reference to the buffer of audio samples being sent. The
|
yading@10
|
68 * receiving filter will free this reference when it no longer
|
yading@10
|
69 * needs it or pass it on to the next filter.
|
yading@10
|
70 *
|
yading@10
|
71 * @return >= 0 on success, a negative AVERROR on error. The receiving filter
|
yading@10
|
72 * is responsible for unreferencing samplesref in case of error.
|
yading@10
|
73 */
|
yading@10
|
74 int ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref);
|
yading@10
|
75
|
yading@10
|
76 /**
|
yading@10
|
77 * Send a buffer of audio samples to the next link, without checking
|
yading@10
|
78 * min_samples.
|
yading@10
|
79 */
|
yading@10
|
80 int ff_filter_samples_framed(AVFilterLink *link,
|
yading@10
|
81 AVFilterBufferRef *samplesref);
|
yading@10
|
82
|
yading@10
|
83 #endif /* AVFILTER_AUDIO_H */
|