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/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "internal.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 (AVFilterContext *ctx)
 
static av_cold void asr_uninit (AVFilterContext *ctx)
 

Variables

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

Macro Definition Documentation

◆ OFFSET

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

Definition at line 47 of file af_asr.c.

◆ FLAGS

Definition at line 48 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 62 of file af_asr.c.

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 86 of file af_asr.c.

◆ asr_init()

static av_cold int asr_init ( AVFilterContext ctx)
static

Definition at line 96 of file af_asr.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 123 of file af_asr.c.

◆ asr_uninit()

static av_cold void asr_uninit ( AVFilterContext ctx)
static

Definition at line 142 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 49 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 152 of file af_asr.c.

◆ asr_outputs

const AVFilterPad asr_outputs[]
static
Initial value:
= {
{
.name = "default",
},
}

Definition at line 161 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 168 of file af_asr.c.

query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_asr.c:123
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:168
init
static int init
Definition: av_tx.c:47
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_asr.c:62
FLAGS
#define FLAGS
Definition: af_asr.c:48
ASRContext
Definition: af_asr.c:30
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_asr.c:86
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
NULL
#define NULL
Definition: coverity.c:32
asr_init
static av_cold int asr_init(AVFilterContext *ctx)
Definition: af_asr.c:96
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:117
asr_uninit
static av_cold void asr_uninit(AVFilterContext *ctx)
Definition: af_asr.c:142
asr_outputs
static const AVFilterPad asr_outputs[]
Definition: af_asr.c:161
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
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:137
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
asr_inputs
static const AVFilterPad asr_inputs[]
Definition: af_asr.c:152
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:282
OFFSET
#define OFFSET(x)
Definition: af_asr.c:47
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:228