FFmpeg
asrc_flite.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Stefano Sabatini
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /**
22  * @file
23  * flite voice synth source
24  */
25 
26 #include <flite/flite.h>
27 #include "libavutil/audio_fifo.h"
28 #include "libavutil/avstring.h"
30 #include "libavutil/file.h"
31 #include "libavutil/mem.h"
32 #include "libavutil/opt.h"
33 #include "libavutil/thread.h"
34 #include "avfilter.h"
35 #include "filters.h"
36 #include "audio.h"
37 #include "formats.h"
38 
39 typedef struct FliteContext {
40  const AVClass *class;
41  char *voice_str;
42  char *textfile;
43  char *text;
44  char *text_p;
45  char *text_saveptr;
50  cst_voice *voice;
51  cst_audio_streaming_info *asi;
54  int frame_nb_samples; ///< number of samples per frame
55 } FliteContext;
56 
57 #define OFFSET(x) offsetof(FliteContext, x)
58 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
59 
60 static const AVOption flite_options[] = {
61  { "list_voices", "list voices and exit", OFFSET(list_voices), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS },
62  { "nb_samples", "set number of samples per frame", OFFSET(frame_nb_samples), AV_OPT_TYPE_INT, {.i64=512}, 0, INT_MAX, FLAGS },
63  { "n", "set number of samples per frame", OFFSET(frame_nb_samples), AV_OPT_TYPE_INT, {.i64=512}, 0, INT_MAX, FLAGS },
64  { "text", "set text to speak", OFFSET(text), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
65  { "textfile", "set filename of the text to speak", OFFSET(textfile), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 0, FLAGS },
66  { "v", "set voice", OFFSET(voice_str), AV_OPT_TYPE_STRING, {.str="kal"}, 0, 0, FLAGS },
67  { "voice", "set voice", OFFSET(voice_str), AV_OPT_TYPE_STRING, {.str="kal"}, 0, 0, FLAGS },
68  { NULL }
69 };
70 
72 
74 
75 static int flite_inited = 0;
76 
77 /* declare functions for all the supported voices */
78 #define DECLARE_REGISTER_VOICE_FN(name) \
79  cst_voice *register_cmu_us_## name(const char *); \
80  void unregister_cmu_us_## name(cst_voice *)
86 
87 struct voice_entry {
88  const char *name;
89  cst_voice * (*register_fn)(const char *);
90  void (*unregister_fn)(cst_voice *);
91  cst_voice *voice;
92  unsigned usage_count;
93 };
94 
95 #define MAKE_VOICE_STRUCTURE(voice_name) { \
96  .name = #voice_name, \
97  .register_fn = register_cmu_us_ ## voice_name, \
98  .unregister_fn = unregister_cmu_us_ ## voice_name, \
99 }
100 static struct voice_entry voice_entries[] = {
103  MAKE_VOICE_STRUCTURE(kal16),
106 };
107 
108 static void list_voices(void *log_ctx, const char *sep)
109 {
110  int i, n = FF_ARRAY_ELEMS(voice_entries);
111  for (i = 0; i < n; i++)
112  av_log(log_ctx, AV_LOG_INFO, "%s%s",
113  voice_entries[i].name, i < (n-1) ? sep : "\n");
114 }
115 
116 static int select_voice(struct voice_entry **entry_ret, const char *voice_name, void *log_ctx)
117 {
118  int i;
119 
120  for (i = 0; i < FF_ARRAY_ELEMS(voice_entries); i++) {
121  struct voice_entry *entry = &voice_entries[i];
122  if (!strcmp(entry->name, voice_name)) {
123  cst_voice *voice;
125  if (!entry->voice)
126  entry->voice = entry->register_fn(NULL);
127  voice = entry->voice;
128  if (voice)
129  entry->usage_count++;
131  if (!voice) {
132  av_log(log_ctx, AV_LOG_ERROR,
133  "Could not register voice '%s'\n", voice_name);
134  return AVERROR_UNKNOWN;
135  }
136  *entry_ret = entry;
137  return 0;
138  }
139  }
140 
141  av_log(log_ctx, AV_LOG_ERROR, "Could not find voice '%s'\n", voice_name);
142  av_log(log_ctx, AV_LOG_INFO, "Choose between the voices: ");
143  list_voices(log_ctx, ", ");
144 
145  return AVERROR(EINVAL);
146 }
147 
148 static int audio_stream_chunk_by_word(const cst_wave *wave, int start, int size,
149  int last, cst_audio_streaming_info *asi)
150 {
151  FliteContext *flite = asi->userdata;
152  void *const ptr[8] = { &wave->samples[start] };
153 
154  flite->nb_channels = wave->num_channels;
155  flite->sample_rate = wave->sample_rate;
156  if (!flite->fifo) {
158  if (!flite->fifo)
159  return CST_AUDIO_STREAM_STOP;
160  }
161 
162  av_audio_fifo_write(flite->fifo, ptr, size);
163 
164  return CST_AUDIO_STREAM_CONT;
165 }
166 
168 {
169  FliteContext *flite = ctx->priv;
170  int ret = 0;
171  char *text;
172 
173  if (flite->list_voices) {
174  list_voices(ctx, "\n");
175  return AVERROR_EXIT;
176  }
177 
179  if (!flite_inited) {
180  if ((ret = flite_init()) >= 0)
181  flite_inited = 1;
182  }
184  if (ret < 0) {
185  av_log(ctx, AV_LOG_ERROR, "flite initialization failed\n");
186  return AVERROR_EXTERNAL;
187  }
188 
189  if ((ret = select_voice(&flite->voice_entry, flite->voice_str, ctx)) < 0)
190  return ret;
191  flite->voice = flite->voice_entry->voice;
192 
193  if (flite->textfile && flite->text) {
195  "Both text and textfile options set: only one must be specified\n");
196  return AVERROR(EINVAL);
197  }
198 
199  if (flite->textfile) {
200  uint8_t *textbuf;
201  size_t textbuf_size;
202 
203  if ((ret = av_file_map(flite->textfile, &textbuf, &textbuf_size, 0, ctx)) < 0) {
205  "The text file '%s' could not be read: %s\n",
206  flite->textfile, av_err2str(ret));
207  return ret;
208  }
209 
210  if (!(flite->text = av_malloc(textbuf_size+1))) {
211  av_file_unmap(textbuf, textbuf_size);
212  return AVERROR(ENOMEM);
213  }
214  memcpy(flite->text, textbuf, textbuf_size);
215  flite->text[textbuf_size] = 0;
216  av_file_unmap(textbuf, textbuf_size);
217  }
218 
219  if (!flite->text) {
221  "No speech text specified, specify the 'text' or 'textfile' option\n");
222  return AVERROR(EINVAL);
223  }
224 
225  flite->asi = new_audio_streaming_info();
226  if (!flite->asi)
227  return AVERROR_BUG;
228 
229  flite->asi->asc = audio_stream_chunk_by_word;
230  flite->asi->userdata = flite;
231  feat_set(flite->voice->features, "streaming_info", audio_streaming_info_val(flite->asi));
232 
233  flite->text_p = flite->text;
234  if (!(text = av_strtok(flite->text_p, "\n", &flite->text_saveptr)))
235  return AVERROR(EINVAL);
236  flite->text_p = NULL;
237 
238  flite_text_to_speech(text, flite->voice, "none");
239 
240  return 0;
241 }
242 
244 {
245  FliteContext *flite = ctx->priv;
246 
247  if (flite->voice_entry) {
249  if (!--flite->voice_entry->usage_count) {
250  flite->voice_entry->unregister_fn(flite->voice);
251  flite->voice_entry->voice = NULL;
252  }
254  }
255  av_audio_fifo_free(flite->fifo);
256 }
257 
259  AVFilterFormatsConfig **cfg_in,
260  AVFilterFormatsConfig **cfg_out)
261 {
262  const FliteContext *flite = ctx->priv;
263 
264  static const enum AVSampleFormat formats[] = {
267  };
268  int sample_rates[] = { flite->sample_rate, -1 };
269  AVChannelLayout layouts[2] = {
270  { .nb_channels = 0 },
271  };
272 
273  int ret;
274 
276 
278  if (ret < 0)
279  return ret;
280 
281  ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, formats);
282  if (ret < 0)
283  return ret;
284 
286  if (ret < 0)
287  return ret;
288 
289  return 0;
290 }
291 
292 static int config_props(AVFilterLink *outlink)
293 {
294  AVFilterContext *ctx = outlink->src;
295  FliteContext *flite = ctx->priv;
296 
297  outlink->sample_rate = flite->sample_rate;
298  outlink->time_base = (AVRational){1, flite->sample_rate};
299 
300  av_log(ctx, AV_LOG_VERBOSE, "voice:%s fmt:%s sample_rate:%d\n",
301  flite->voice_str,
302  av_get_sample_fmt_name(outlink->format), outlink->sample_rate);
303 
304  return 0;
305 }
306 
308 {
309  AVFilterLink *outlink = ctx->outputs[0];
310  FliteContext *flite = ctx->priv;
311  AVFrame *samplesref;
312  int nb_samples;
313 
314  if (!ff_outlink_frame_wanted(outlink))
315  return FFERROR_NOT_READY;
316 
317  nb_samples = FFMIN(av_audio_fifo_size(flite->fifo), flite->frame_nb_samples);
318  if (!nb_samples) {
319  char *text;
320 
321  if (!(text = av_strtok(flite->text_p, "\n", &flite->text_saveptr))) {
322  ff_outlink_set_status(outlink, AVERROR_EOF, flite->pts);
323  return 0;
324  }
325 
326  flite_text_to_speech(text, flite->voice, "none");
327  ff_filter_set_ready(ctx, 100);
328  return 0;
329  }
330 
331  samplesref = ff_get_audio_buffer(outlink, nb_samples);
332  if (!samplesref)
333  return AVERROR(ENOMEM);
334 
335  av_audio_fifo_read(flite->fifo, (void **)samplesref->extended_data,
336  nb_samples);
337 
338  samplesref->pts = flite->pts;
339  samplesref->sample_rate = flite->sample_rate;
340  flite->pts += nb_samples;
341 
342  return ff_filter_frame(outlink, samplesref);
343 }
344 
345 static const AVFilterPad flite_outputs[] = {
346  {
347  .name = "default",
348  .type = AVMEDIA_TYPE_AUDIO,
349  .config_props = config_props,
350  },
351 };
352 
354  .name = "flite",
355  .description = NULL_IF_CONFIG_SMALL("Synthesize voice from text using libflite."),
356  .init = init,
357  .uninit = uninit,
358  .priv_size = sizeof(FliteContext),
359  .activate = activate,
360  .inputs = NULL,
363  .priv_class = &flite_class,
364 };
OFFSET
#define OFFSET(x)
Definition: asrc_flite.c:57
av_audio_fifo_free
void av_audio_fifo_free(AVAudioFifo *af)
Free an AVAudioFifo.
Definition: audio_fifo.c:48
formats
formats
Definition: signature.h:47
ff_asrc_flite
const AVFilter ff_asrc_flite
Definition: asrc_flite.c:353
ff_get_audio_buffer
AVFrame * ff_get_audio_buffer(AVFilterLink *link, int nb_samples)
Request an audio samples buffer with a specific set of permissions.
Definition: audio.c:98
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
entry
#define entry
Definition: aom_film_grain_template.c:66
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
flite_options
static const AVOption flite_options[]
Definition: asrc_flite.c:60
opt.h
ff_filter_frame
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition: avfilter.c:1025
thread.h
layouts
enum MovChannelLayoutTag * layouts
Definition: mov_chan.c:335
AVERROR_EOF
#define AVERROR_EOF
End of file.
Definition: error.h:57
FFERROR_NOT_READY
return FFERROR_NOT_READY
Definition: filter_design.txt:204
FliteContext::textfile
char * textfile
Definition: asrc_flite.c:42
av_audio_fifo_write
int av_audio_fifo_write(AVAudioFifo *af, void *const *data, int nb_samples)
Write data to an AVAudioFifo.
Definition: audio_fifo.c:119
voice_entry::voice
cst_voice * voice
Definition: asrc_flite.c:91
int64_t
long long int64_t
Definition: coverity.c:34
sample_rates
static const int sample_rates[]
Definition: dcaenc.h:34
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:389
AVFrame::pts
int64_t pts
Presentation timestamp in time_base units (time when frame should be shown to user).
Definition: frame.h:501
AVOption
AVOption.
Definition: opt.h:429
ff_set_common_channel_layouts_from_list2
int ff_set_common_channel_layouts_from_list2(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out, const AVChannelLayout *fmts)
Definition: formats.c:920
voice_entry::usage_count
unsigned usage_count
Definition: asrc_flite.c:92
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:225
AVFilter::name
const char * name
Filter name.
Definition: avfilter.h:205
AVERROR_UNKNOWN
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
Definition: error.h:73
FliteContext::voice_entry
struct voice_entry * voice_entry
Definition: asrc_flite.c:52
FliteContext
Definition: asrc_flite.c:39
AVFILTER_DEFINE_CLASS
AVFILTER_DEFINE_CLASS(flite)
av_malloc
#define av_malloc(s)
Definition: tableprint_vlc.h:30
MAKE_VOICE_STRUCTURE
#define MAKE_VOICE_STRUCTURE(voice_name)
Definition: asrc_flite.c:95
formats.h
flite_mutex
static AVMutex flite_mutex
Definition: asrc_flite.c:73
AVAudioFifo
Context for an Audio FIFO Buffer.
Definition: audio_fifo.c:37
av_file_map
int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, int log_offset, void *log_ctx)
Read the file with name filename, and put its content in a newly allocated buffer or map it with mmap...
Definition: file.c:55
activate
static int activate(AVFilterContext *ctx)
Definition: asrc_flite.c:307
FliteContext::fifo
AVAudioFifo * fifo
Definition: asrc_flite.c:48
FliteContext::asi
cst_audio_streaming_info * asi
Definition: asrc_flite.c:51
AVFilterPad
A filter pad used for either input or output.
Definition: filters.h:38
FliteContext::list_voices
int list_voices
Definition: asrc_flite.c:49
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
av_cold
#define av_cold
Definition: attributes.h:90
AVMutex
#define AVMutex
Definition: thread.h:184
ff_outlink_set_status
static void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts)
Set the status field of a link from the source filter.
Definition: filters.h:424
FliteContext::text_saveptr
char * text_saveptr
Definition: asrc_flite.c:45
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FliteContext::nb_channels
int nb_channels
Definition: asrc_flite.c:46
av_strtok
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok().
Definition: avstring.c:178
filters.h
ff_set_common_samplerates_from_list2
int ff_set_common_samplerates_from_list2(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out, const int *samplerates)
Definition: formats.c:944
list_voices
static void list_voices(void *log_ctx, const char *sep)
Definition: asrc_flite.c:108
ctx
AVFormatContext * ctx
Definition: movenc.c:49
av_get_sample_fmt_name
const char * av_get_sample_fmt_name(enum AVSampleFormat sample_fmt)
Return the name of sample_fmt, or NULL if sample_fmt is not recognized.
Definition: samplefmt.c:51
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
av_file_unmap
void av_file_unmap(uint8_t *bufptr, size_t size)
Unmap or free the buffer bufptr created by av_file_map().
Definition: file.c:142
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
NULL
#define NULL
Definition: coverity.c:32
flite_outputs
static const AVFilterPad flite_outputs[]
Definition: asrc_flite.c:345
voice_entries
static struct voice_entry voice_entries[]
Definition: asrc_flite.c:100
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
av_audio_fifo_alloc
AVAudioFifo * av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels, int nb_samples)
Allocate an AVAudioFifo.
Definition: audio_fifo.c:62
FliteContext::sample_rate
int sample_rate
Definition: asrc_flite.c:47
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
AVFilterFormatsConfig
Lists of formats / etc.
Definition: avfilter.h:111
pthread_mutex_unlock
#define pthread_mutex_unlock(a)
Definition: ffprobe.c:82
voice_entry::unregister_fn
void(* unregister_fn)(cst_voice *)
Definition: asrc_flite.c:90
query_formats
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: asrc_flite.c:258
FliteContext::voice_str
char * voice_str
Definition: asrc_flite.c:41
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
AVChannelLayout
An AVChannelLayout holds information about the channel layout of audio data.
Definition: channel_layout.h:311
av_err2str
#define av_err2str(errnum)
Convenience macro, the return value should be used only directly in function arguments but never stan...
Definition: error.h:122
AVFrame::sample_rate
int sample_rate
Sample rate of the audio data.
Definition: frame.h:588
audio_stream_chunk_by_word
static int audio_stream_chunk_by_word(const cst_wave *wave, int start, int size, int last, cst_audio_streaming_info *asi)
Definition: asrc_flite.c:148
AV_SAMPLE_FMT_NONE
@ AV_SAMPLE_FMT_NONE
Definition: samplefmt.h:56
AV_MUTEX_INITIALIZER
#define AV_MUTEX_INITIALIZER
Definition: thread.h:185
av_audio_fifo_read
int av_audio_fifo_read(AVAudioFifo *af, void *const *data, int nb_samples)
Read data from an AVAudioFifo.
Definition: audio_fifo.c:175
size
int size
Definition: twinvq_data.h:10344
AVERROR_EXTERNAL
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition: error.h:59
av_audio_fifo_size
int av_audio_fifo_size(AVAudioFifo *af)
Get the current number of samples in the AVAudioFifo available for reading.
Definition: audio_fifo.c:222
config_props
static int config_props(AVFilterLink *outlink)
Definition: asrc_flite.c:292
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:220
av_channel_layout_default
void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels)
Get the default channel layout for a given number of channels.
Definition: channel_layout.c:834
FliteContext::pts
int64_t pts
Definition: asrc_flite.c:53
FliteContext::text_p
char * text_p
Definition: asrc_flite.c:44
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AVFrame::extended_data
uint8_t ** extended_data
pointers to the data planes/channels.
Definition: frame.h:450
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:55
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
AV_SAMPLE_FMT_S16
@ AV_SAMPLE_FMT_S16
signed 16 bits
Definition: samplefmt.h:58
audio_fifo.h
FliteContext::text
char * text
Definition: asrc_flite.c:43
AVFilterPad::name
const char * name
Pad name.
Definition: filters.h:44
AVFilter
Filter definition.
Definition: avfilter.h:201
ret
ret
Definition: filter_design.txt:187
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: asrc_flite.c:243
ff_set_common_formats_from_list2
int ff_set_common_formats_from_list2(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out, const int *fmts)
Definition: formats.c:1016
channel_layout.h
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
avfilter.h
init
static av_cold int init(AVFilterContext *ctx)
Definition: asrc_flite.c:167
file.h
AVFilterContext
An instance of a filter.
Definition: avfilter.h:457
flite_inited
static int flite_inited
Definition: asrc_flite.c:75
FLAGS
#define FLAGS
Definition: asrc_flite.c:58
DECLARE_REGISTER_VOICE_FN
#define DECLARE_REGISTER_VOICE_FN(name)
Definition: asrc_flite.c:78
mem.h
audio.h
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
AVERROR_BUG
#define AVERROR_BUG
Internal bug, also see AVERROR_BUG2.
Definition: error.h:52
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
select_voice
static int select_voice(struct voice_entry **entry_ret, const char *voice_name, void *log_ctx)
Definition: asrc_flite.c:116
AVERROR_EXIT
#define AVERROR_EXIT
Immediate exit was requested; the called function should not be restarted.
Definition: error.h:58
ff_outlink_frame_wanted
the definition of that something depends on the semantic of the filter The callback must examine the status of the filter s links and proceed accordingly The status of output links is stored in the status_in and status_out fields and tested by the ff_outlink_frame_wanted() function. If this function returns true
avstring.h
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276
FliteContext::frame_nb_samples
int frame_nb_samples
number of samples per frame
Definition: asrc_flite.c:54
FliteContext::voice
cst_voice * voice
Definition: asrc_flite.c:50
voice_entry
Definition: asrc_flite.c:87
voice_entry::name
const char * name
Definition: asrc_flite.c:88
ff_filter_set_ready
void ff_filter_set_ready(AVFilterContext *filter, unsigned priority)
Mark a filter ready and schedule it for activation.
Definition: avfilter.c:238
pthread_mutex_lock
#define pthread_mutex_lock(a)
Definition: ffprobe.c:78