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 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 query_formats (AVFilterContext *ctx)
 
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 []
 
AVFilter ff_af_drmeter
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 46 of file af_drmeter.c.

◆ FLAGS

Definition at line 47 of file af_drmeter.c.

◆ SQR

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

Definition at line 157 of file af_drmeter.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( drmeter  )

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 56 of file af_drmeter.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 86 of file af_drmeter.c.

◆ finish_block()

static void finish_block ( ChannelStats p)
static

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

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink inlink,
AVFrame buf 
)
static

Definition at line 128 of file af_drmeter.c.

◆ print_stats()

static void print_stats ( AVFilterContext ctx)
static

Definition at line 159 of file af_drmeter.c.

Referenced by uninit().

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

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

◆ drmeter_inputs

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

Definition at line 211 of file af_drmeter.c.

◆ drmeter_outputs

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

Definition at line 220 of file af_drmeter.c.

◆ ff_af_drmeter

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

Definition at line 229 of file af_drmeter.c.

uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: af_drmeter.c:202
filter_frame
static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
Definition: af_drmeter.c:128
AV_OPT_TYPE_DOUBLE
@ AV_OPT_TYPE_DOUBLE
Definition: opt.h:225
AVMEDIA_TYPE_AUDIO
@ AVMEDIA_TYPE_AUDIO
Definition: avutil.h:202
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_drmeter.c:86
DRMeterContext
Definition: af_drmeter.c:38
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:188
FLAGS
#define FLAGS
Definition: af_drmeter.c:47
OFFSET
#define OFFSET(x)
Definition: af_drmeter.c:46
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: af_drmeter.c:56
drmeter_outputs
static const AVFilterPad drmeter_outputs[]
Definition: af_drmeter.c:220
drmeter_inputs
static const AVFilterPad drmeter_inputs[]
Definition: af_drmeter.c:211