FFmpeg
Data Structures | Macros | Functions | Variables
af_drmeter.c File Reference
#include <float.h>
#include "libavutil/ffmath.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "audio.h"
#include "avfilter.h"
#include "filters.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 30 of file af_drmeter.c.

◆ OFFSET

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

Definition at line 49 of file af_drmeter.c.

◆ FLAGS

Definition at line 50 of file af_drmeter.c.

◆ SQR

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

Definition at line 127 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 59 of file af_drmeter.c.

◆ finish_block()

static void finish_block ( ChannelStats p)
static

Definition at line 72 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 90 of file af_drmeter.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 99 of file af_drmeter.c.

◆ print_stats()

static void print_stats ( AVFilterContext ctx)
static

Definition at line 129 of file af_drmeter.c.

Referenced by uninit().

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 175 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 52 of file af_drmeter.c.

◆ drmeter_inputs

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

Definition at line 184 of file af_drmeter.c.

◆ drmeter_outputs

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

Definition at line 192 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 200 of file af_drmeter.c.

AV_SAMPLE_FMT_FLTP
@ AV_SAMPLE_FMT_FLTP
float, planar
Definition: samplefmt.h:66
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_drmeter.c:175
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: af_drmeter.c:99
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: filters.h:262
FILTER_SAMPLEFMTS
#define FILTER_SAMPLEFMTS(...)
Definition: filters.h:250
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Underlying C type is double.
Definition: opt.h:267
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
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_drmeter.c:59
DRMeterContext
Definition: af_drmeter.c:41
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
FLAGS
#define FLAGS
Definition: af_drmeter.c:50
OFFSET
#define OFFSET(x)
Definition: af_drmeter.c:49
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
drmeter_outputs
static const AVFilterPad drmeter_outputs[]
Definition: af_drmeter.c:192
AV_SAMPLE_FMT_FLT
@ AV_SAMPLE_FMT_FLT
float
Definition: samplefmt.h:60
drmeter_inputs
static const AVFilterPad drmeter_inputs[]
Definition: af_drmeter.c:184