FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
avf_showvolume.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/eval.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavutil/xga_font_data.h"
#include "avfilter.h"
#include "formats.h"
#include "audio.h"
#include "video.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  ShowVolumeContext
 

Macros

#define OFFSET(x)   offsetof(ShowVolumeContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  { VAR_VOLUME, VAR_CHANNEL, VAR_VARS_NB }
 

Functions

 AVFILTER_DEFINE_CLASS (showvolume)
 
static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static void drawtext (AVFrame *pic, int x, int y, const char *txt)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *insamples)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption showvolume_options []
 
static const char *const var_names [] = { "VOLUME", "CHANNEL", NULL }
 
static const AVFilterPad showvolume_inputs []
 
static const AVFilterPad showvolume_outputs []
 
AVFilter ff_avf_showvolume
 

Macro Definition Documentation

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

Definition at line 45 of file avf_showvolume.c.

Definition at line 46 of file avf_showvolume.c.

Enumeration Type Documentation

anonymous enum
Enumerator
VAR_VOLUME 
VAR_CHANNEL 
VAR_VARS_NB 

Definition at line 63 of file avf_showvolume.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( showvolume  )
static av_cold int init ( AVFilterContext ctx)
static

Definition at line 65 of file avf_showvolume.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 80 of file avf_showvolume.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 112 of file avf_showvolume.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 126 of file avf_showvolume.c.

static void drawtext ( AVFrame pic,
int  x,
int  y,
const char *  txt 
)
static

Definition at line 139 of file avf_showvolume.c.

Referenced by avfilter_register_all(), and filter_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame insamples 
)
static

Definition at line 162 of file avf_showvolume.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 224 of file avf_showvolume.c.

Variable Documentation

const AVOption showvolume_options[]
static
Initial value:
= {
{ "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, 0, FLAGS },
{ "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, 0, FLAGS },
{ "b", "set border width", OFFSET(b), AV_OPT_TYPE_INT, {.i64=1}, 0, 5, FLAGS },
{ "w", "set channel width", OFFSET(w), AV_OPT_TYPE_INT, {.i64=400}, 40, 1080, FLAGS },
{ "h", "set channel height", OFFSET(h), AV_OPT_TYPE_INT, {.i64=20}, 1, 100, FLAGS },
{ "f", "set fade", OFFSET(f), AV_OPT_TYPE_INT, {.i64=20}, 1, 255, FLAGS },
{ "c", "set volume color expression", OFFSET(color), AV_OPT_TYPE_STRING, {.str="if(gte(VOLUME,-2), if(gte(VOLUME,-1),0xff0000ff, 0xff00ffff),0xff00ff00)"}, 0, 0, FLAGS },
{ "t", "display channel names", OFFSET(draw_text), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
const char * b
Definition: vf_curves.c:109
static int draw_text(AVFilterContext *ctx, AVFrame *frame, int width, int height)
Definition: vf_drawtext.c:1125
#define OFFSET(x)
offset must point to AVRational
Definition: opt.h:235
#define FLAGS

Definition at line 48 of file avf_showvolume.c.

const char* const var_names[] = { "VOLUME", "CHANNEL", NULL }
static

Definition at line 62 of file avf_showvolume.c.

Referenced by init().

const AVFilterPad showvolume_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.filter_frame = filter_frame,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
static int config_input(AVFilterLink *inlink)

Definition at line 232 of file avf_showvolume.c.

const AVFilterPad showvolume_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_output,
},
{ NULL }
}
#define NULL
Definition: coverity.c:32
static int config_output(AVFilterLink *outlink)

Definition at line 242 of file avf_showvolume.c.

AVFilter ff_avf_showvolume
Initial value:
= {
.name = "showvolume",
.description = NULL_IF_CONFIG_SMALL("Convert input audio volume to video output."),
.init = init,
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(ShowVolumeContext),
.priv_class = &showvolume_class,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:248
static const AVFilterPad showvolume_outputs[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
static const AVFilterPad showvolume_inputs[]
static int query_formats(AVFilterContext *ctx)
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:239
static av_cold int init(AVFilterContext *ctx)
static av_cold void uninit(AVFilterContext *ctx)

Definition at line 251 of file avf_showvolume.c.