FFmpeg
Data Structures | Macros | Functions | Variables
af_asr.c File Reference
#include <pocketsphinx/pocketsphinx.h>
#include "libavutil/avstring.h"
#include "libavutil/channel_layout.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.h"
#include "formats.h"

Go to the source code of this file.

Data Structures

struct  ASRContext
 

Macros

#define OFFSET(x)   offsetof(ASRContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (asr)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int config_input (AVFilterLink *inlink)
 
static av_cold int asr_init (AVFilterContext *ctx)
 
static int query_formats (const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
 
static av_cold void asr_uninit (AVFilterContext *ctx)
 

Variables

static const AVOption asr_options []
 
static const AVFilterPad asr_inputs []
 
const AVFilter ff_af_asr
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(ASRContext, x)

Definition at line 49 of file af_asr.c.

◆ FLAGS

Definition at line 50 of file af_asr.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( asr  )

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 64 of file af_asr.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 88 of file af_asr.c.

◆ asr_init()

static av_cold int asr_init ( AVFilterContext ctx)
static

Definition at line 98 of file af_asr.c.

◆ query_formats()

static int query_formats ( const AVFilterContext ctx,
AVFilterFormatsConfig **  cfg_in,
AVFilterFormatsConfig **  cfg_out 
)
static

Definition at line 125 of file af_asr.c.

◆ asr_uninit()

static av_cold void asr_uninit ( AVFilterContext ctx)
static

Definition at line 157 of file af_asr.c.

Variable Documentation

◆ asr_options

const AVOption asr_options[]
static
Initial value:
= {
{ "rate", "set sampling rate", OFFSET(rate), AV_OPT_TYPE_INT, {.i64=16000}, 0, INT_MAX, .flags = FLAGS },
{ "hmm", "set directory containing acoustic model files", OFFSET(hmm), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "dict", "set pronunciation dictionary", OFFSET(dict), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "lm", "set language model file", OFFSET(lm), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "lmctl", "set language model set", OFFSET(lmctl), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "lmname","set which language model to use", OFFSET(lmname), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS },
{ "logfn", "set output for log messages", OFFSET(logfn), AV_OPT_TYPE_STRING, {.str="/dev/null"}, .flags = FLAGS },
{ NULL }
}

Definition at line 51 of file af_asr.c.

◆ asr_inputs

const AVFilterPad asr_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = filter_frame,
.config_props = config_input,
},
}

Definition at line 167 of file af_asr.c.

◆ ff_af_asr

const AVFilter ff_af_asr
Initial value:
= {
.name = "asr",
.description = NULL_IF_CONFIG_SMALL("Automatic Speech Recognition."),
.priv_size = sizeof(ASRContext),
.priv_class = &asr_class,
}

Definition at line 176 of file af_asr.c.

FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_asr.c:64
FLAGS
#define FLAGS
Definition: af_asr.c:50
ASRContext
Definition: af_asr.c:32
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_asr.c:88
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
NULL
#define NULL
Definition: coverity.c:32
asr_init
static av_cold int asr_init(AVFilterContext *ctx)
Definition: af_asr.c:98
query_formats
static int query_formats(const AVFilterContext *ctx, AVFilterFormatsConfig **cfg_in, AVFilterFormatsConfig **cfg_out)
Definition: af_asr.c:125
ff_audio_default_filterpad
const AVFilterPad ff_audio_default_filterpad[1]
An AVFilterPad array whose only entry has name "default" and is of type AVMEDIA_TYPE_AUDIO.
Definition: audio.c:34
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
FILTER_QUERY_FUNC2
#define FILTER_QUERY_FUNC2(func)
Definition: filters.h:239
asr_uninit
static av_cold void asr_uninit(AVFilterContext *ctx)
Definition: af_asr.c:157
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AVFILTER_FLAG_METADATA_ONLY
#define AVFILTER_FLAG_METADATA_ONLY
The filter is a "metadata" filter - it does not modify the frame data in any way.
Definition: avfilter.h:168
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
asr_inputs
static const AVFilterPad asr_inputs[]
Definition: af_asr.c:167
OFFSET
#define OFFSET(x)
Definition: af_asr.c:49
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