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 "formats.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 []
 
const AVFilter ff_af_asr
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 48 of file af_asr.c.

◆ FLAGS

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

◆ config_input()

static int config_input ( AVFilterLink inlink)
static

Definition at line 87 of file af_asr.c.

◆ asr_init()

static av_cold int asr_init ( AVFilterContext ctx)
static

Definition at line 97 of file af_asr.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 124 of file af_asr.c.

◆ asr_uninit()

static av_cold void asr_uninit ( AVFilterContext ctx)
static

Definition at line 143 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 50 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 153 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 162 of file af_asr.c.

query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_asr.c:124
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:159
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
Definition: af_asr.c:63
FLAGS
#define FLAGS
Definition: af_asr.c:49
ASRContext
Definition: af_asr.c:31
config_input
static int config_input(AVFilterLink *inlink)
Definition: af_asr.c:87
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
asr_init
static av_cold int asr_init(AVFilterContext *ctx)
Definition: af_asr.c:97
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:33
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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:106
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
asr_uninit
static av_cold void asr_uninit(AVFilterContext *ctx)
Definition: af_asr.c:143
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
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:133
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
asr_inputs
static const AVFilterPad asr_inputs[]
Definition: af_asr.c:153
OFFSET
#define OFFSET(x)
Definition: af_asr.c:48
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229