1 /*
2 * Copyright 2010 S.N. Hemanth Meenakshisundaram <smeenaks ucsd edu>
3 * Copyright 2010 Stefano Sabatini <stefano.sabatini-lala poste it>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /**
23 * @file
24 * null audio source
25 */
26
27 #include <inttypes.h>
28 #include <stdio.h>
29
36
43 int nb_samples;
///< number of samples per requested frame
46
47 #define OFFSET(x) offsetof(ANullContext, x)
48 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
49
55 {
"nb_samples",
"set the number of samples per requested frame",
OFFSET(nb_samples),
AV_OPT_TYPE_INT, {.i64 = 1024}, 0, INT_MAX,
FLAGS },
56 {
"n",
"set the number of samples per requested frame",
OFFSET(nb_samples),
AV_OPT_TYPE_INT, {.i64 = 1024}, 0, INT_MAX,
FLAGS },
58 };
59
61
63 {
66
70
74
75 return 0;
76 }
77
79 {
83
87
88 return 0;
89 }
90
92 {
95
98 "sample_rate:%d channel_layout:'%s' nb_samples:%d\n",
100
101 return 0;
102 }
103
105 {
109
111 if (!samplesref)
113
114 samplesref->
pts = null->
pts;
117
120 if (ret < 0)
122
125 }
126
128 {
133 },
135 };
136
144 .
outputs = avfilter_asrc_anullsrc_outputs,
145 .priv_class = &anullsrc_class,
146 };