FFmpeg
Data Structures | Macros | Functions | Variables
af_drmeter.c File Reference
#include <float.h>
#include "libavutil/ffmath.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  ChannelStats
 
struct  DRMeterContext
 

Macros

#define BINS   32768
 
#define OFFSET(x)   offsetof(DRMeterContext, x)
 
#define FLAGS   AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
#define SQR(a)   ((a)*(a))
 

Functions

 AVFILTER_DEFINE_CLASS (drmeter)
 
static int config_output (AVFilterLink *outlink)
 
static void finish_block (ChannelStats *p)
 
static void update_stat (DRMeterContext *s, ChannelStats *p, float sample)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *buf)
 
static void print_stats (AVFilterContext *ctx)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption drmeter_options []
 
static const AVFilterPad drmeter_inputs []
 
static const AVFilterPad drmeter_outputs []
 
const AVFilter ff_af_drmeter
 

Macro Definition Documentation

◆ BINS

#define BINS   32768

Definition at line 29 of file af_drmeter.c.

◆ OFFSET

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

Definition at line 48 of file af_drmeter.c.

◆ FLAGS

Definition at line 49 of file af_drmeter.c.

◆ SQR

#define SQR (   a)    ((a)*(a))

Definition at line 129 of file af_drmeter.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( drmeter  )

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 58 of file af_drmeter.c.

◆ finish_block()

static void finish_block ( ChannelStats p)
static

Definition at line 71 of file af_drmeter.c.

Referenced by print_stats(), and update_stat().

◆ update_stat()

static void update_stat ( DRMeterContext s,
ChannelStats p,
float  sample 
)
static

Definition at line 89 of file af_drmeter.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 100 of file af_drmeter.c.

◆ print_stats()

static void print_stats ( AVFilterContext ctx)
static

Definition at line 131 of file af_drmeter.c.

Referenced by uninit().

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 174 of file af_drmeter.c.

Variable Documentation

◆ drmeter_options

const AVOption drmeter_options[]
static
Initial value:
= {
{ "length", "set the window length", OFFSET(time_constant), AV_OPT_TYPE_DOUBLE, {.dbl=3}, .01, 10, FLAGS },
{ NULL }
}

Definition at line 51 of file af_drmeter.c.

◆ drmeter_inputs

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

Definition at line 183 of file af_drmeter.c.

◆ drmeter_outputs

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

Definition at line 191 of file af_drmeter.c.

◆ ff_af_drmeter

const AVFilter ff_af_drmeter
Initial value:
= {
.name = "drmeter",
.description = NULL_IF_CONFIG_SMALL("Measure audio dynamic range."),
.priv_size = sizeof(DRMeterContext),
.priv_class = &drmeter_class,
}

Definition at line 199 of file af_drmeter.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:69
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_drmeter.c:174
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: af_drmeter.c:100
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:226
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
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_drmeter.c:58
DRMeterContext
Definition: af_drmeter.c:40
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
FLAGS
#define FLAGS
Definition: af_drmeter.c:49
OFFSET
#define OFFSET(x)
Definition: af_drmeter.c:48
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
drmeter_outputs
static const AVFilterPad drmeter_outputs[]
Definition: af_drmeter.c:191
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:63
drmeter_inputs
static const AVFilterPad drmeter_inputs[]
Definition: af_drmeter.c:183
FILTER_SAMPLEFMTS
#define FILTER_SAMPLEFMTS(...)
Definition: internal.h:179