FFmpeg
Loading...
Searching...
No Matches
af_compensationdelay.c File Reference
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "avfilter.h"
#include "audio.h"
#include "filters.h"

Go to the source code of this file.

Data Structures

struct  CompensationDelayContext
 

Macros

#define OFFSET(x)
 
#define A   (AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM)
 
#define COMP_DELAY_MAX_DISTANCE   (100.0 * 100.0 + 100.0 * 1.0 + 1.0)
 
#define COMP_DELAY_SOUND_SPEED_KM_H(temp)
 
#define COMP_DELAY_SOUND_SPEED_CM_S(temp)
 
#define COMP_DELAY_SOUND_FRONT_DELAY(temp)
 
#define COMP_DELAY_MAX_DELAY   (COMP_DELAY_MAX_DISTANCE * COMP_DELAY_SOUND_FRONT_DELAY(50))
 

Functions

 AVFILTER_DEFINE_CLASS (compensationdelay)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption compensationdelay_options []
 
static const AVFilterPad compensationdelay_inputs []
 
const FFFilter ff_af_compensationdelay
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)

◆ A

◆ COMP_DELAY_MAX_DISTANCE

#define COMP_DELAY_MAX_DISTANCE   (100.0 * 100.0 + 100.0 * 1.0 + 1.0)

Definition at line 58 of file af_compensationdelay.c.

◆ COMP_DELAY_SOUND_SPEED_KM_H

#define COMP_DELAY_SOUND_SPEED_KM_H ( temp)
Value:
1.85325 * (643.95 * sqrt(((temp + 273.15) / 273.15)))
else temp
Definition vf_mcdeint.c:275

Definition at line 60 of file af_compensationdelay.c.

◆ COMP_DELAY_SOUND_SPEED_CM_S

#define COMP_DELAY_SOUND_SPEED_CM_S ( temp)
Value:
(COMP_DELAY_SOUND_SPEED_KM_H(temp) * (1000.0 * 100.0) /* cm/km */ / (60.0 * 60.0) /* s/h */)
#define COMP_DELAY_SOUND_SPEED_KM_H(temp)

Definition at line 61 of file af_compensationdelay.c.

◆ COMP_DELAY_SOUND_FRONT_DELAY

#define COMP_DELAY_SOUND_FRONT_DELAY ( temp)
Value:
#define COMP_DELAY_SOUND_SPEED_CM_S(temp)

Definition at line 62 of file af_compensationdelay.c.

Referenced by config_input(), and process_command().

◆ COMP_DELAY_MAX_DELAY

#define COMP_DELAY_MAX_DELAY   (COMP_DELAY_MAX_DISTANCE * COMP_DELAY_SOUND_FRONT_DELAY(50))

Definition at line 64 of file af_compensationdelay.c.

Referenced by config_input().

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( compensationdelay )

◆ config_input()

static int config_input ( AVFilterLink * inlink)
static

Definition at line 66 of file af_compensationdelay.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink * inlink,
AVFrame * in )
static

Definition at line 87 of file af_compensationdelay.c.

◆ process_command()

static int process_command ( AVFilterContext * ctx,
const char * cmd,
const char * args,
char * res,
int res_len,
int flags )
static

Definition at line 136 of file af_compensationdelay.c.

◆ uninit()

static av_cold void uninit ( AVFilterContext * ctx)
static

Definition at line 153 of file af_compensationdelay.c.

Variable Documentation

◆ compensationdelay_options

const AVOption compensationdelay_options[]
static
Initial value:
= {
{ "mm", "set mm distance", OFFSET(distance_mm), AV_OPT_TYPE_INT, {.i64=0}, 0, 10, A },
{ "cm", "set cm distance", OFFSET(distance_cm), AV_OPT_TYPE_INT, {.i64=0}, 0, 100, A },
{ "m", "set meter distance", OFFSET(distance_m), AV_OPT_TYPE_INT, {.i64=0}, 0, 100, A },
{ "dry", "set dry amount", OFFSET(dry), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, 1, A },
{ "wet", "set wet amount", OFFSET(wet), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, A },
{ "temp", "set temperature °C", OFFSET(temp), AV_OPT_TYPE_INT, {.i64=20}, -50, 50, A },
{ NULL }
}
#define A(x)
Definition vpx_arith.h:28
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition opt.h:266

Definition at line 45 of file af_compensationdelay.c.

◆ compensationdelay_inputs

const AVFilterPad compensationdelay_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
}
static int config_input(AVFilterLink *inlink)
static int filter_frame(DBEDecodeContext *s, AVFrame *frame)
Definition dolby_e.c:1067
@ AVMEDIA_TYPE_AUDIO
Definition avutil.h:201

Definition at line 160 of file af_compensationdelay.c.

◆ ff_af_compensationdelay

const FFFilter ff_af_compensationdelay
Initial value:
= {
.p.name = "compensationdelay",
.p.description = NULL_IF_CONFIG_SMALL("Audio Compensation Delay Line."),
.p.priv_class = &compensationdelay_class,
.priv_size = sizeof(CompensationDelayContext),
.process_command = process_command,
}
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
static const AVFilterPad compensationdelay_inputs[]
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
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition avfilter.h:204
@ AV_SAMPLE_FMT_DBLP
double, planar
Definition samplefmt.h:67
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_)
Definition filters.h:257
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88

Definition at line 169 of file af_compensationdelay.c.