FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
avf_showwaves.c File Reference

audio to video multimedia filter More...

#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.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  ShowWavesContext
 

Macros

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

Enumerations

enum  ShowWavesMode {
  MODE_POINT, MODE_LINE, MODE_P2P, MODE_CENTERED_LINE,
  MODE_NB
}
 

Functions

 AVFILTER_DEFINE_CLASS (showwaves)
 
static av_cold void uninit (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_output (AVFilterLink *outlink)
 
static int push_frame (AVFilterLink *outlink)
 
static int request_frame (AVFilterLink *outlink)
 
static void draw_sample_point (uint8_t *buf, int height, int linesize, int16_t sample, int16_t *prev_y, int intensity)
 
static void draw_sample_line (uint8_t *buf, int height, int linesize, int16_t sample, int16_t *prev_y, int intensity)
 
static void draw_sample_p2p (uint8_t *buf, int height, int linesize, int16_t sample, int16_t *prev_y, int intensity)
 
static void draw_sample_cline (uint8_t *buf, int height, int linesize, int16_t sample, int16_t *prev_y, int intensity)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *insamples)
 
static av_cold int init (AVFilterContext *ctx)
 

Variables

static const AVOption showwaves_options []
 
static const AVFilterPad showwaves_inputs []
 
static const AVFilterPad showwaves_outputs []
 
AVFilter ff_avf_showwaves
 

Detailed Description

audio to video multimedia filter

Definition in file avf_showwaves.c.

Macro Definition Documentation

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

Definition at line 59 of file avf_showwaves.c.

Definition at line 60 of file avf_showwaves.c.

Enumeration Type Documentation

Enumerator:
MODE_POINT 
MODE_LINE 
MODE_P2P 
MODE_CENTERED_LINE 
MODE_NB 

Definition at line 35 of file avf_showwaves.c.

Function Documentation

AVFILTER_DEFINE_CLASS ( showwaves  )
static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 79 of file avf_showwaves.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 87 of file avf_showwaves.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 121 of file avf_showwaves.c.

static int push_frame ( AVFilterLink outlink)
inlinestatic

Definition at line 148 of file avf_showwaves.c.

Referenced by filter_frame(), and request_frame().

static int request_frame ( AVFilterLink outlink)
static

Definition at line 165 of file avf_showwaves.c.

static void draw_sample_point ( uint8_t buf,
int  height,
int  linesize,
int16_t  sample,
int16_t *  prev_y,
int  intensity 
)
static

Definition at line 181 of file avf_showwaves.c.

Referenced by init().

static void draw_sample_line ( uint8_t buf,
int  height,
int  linesize,
int16_t  sample,
int16_t *  prev_y,
int  intensity 
)
static

Definition at line 189 of file avf_showwaves.c.

Referenced by init().

static void draw_sample_p2p ( uint8_t buf,
int  height,
int  linesize,
int16_t  sample,
int16_t *  prev_y,
int  intensity 
)
static

Definition at line 202 of file avf_showwaves.c.

Referenced by init().

static void draw_sample_cline ( uint8_t buf,
int  height,
int  linesize,
int16_t  sample,
int16_t *  prev_y,
int  intensity 
)
static

Definition at line 221 of file avf_showwaves.c.

Referenced by init().

static int filter_frame ( AVFilterLink inlink,
AVFrame insamples 
)
static

Definition at line 232 of file avf_showwaves.c.

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 287 of file avf_showwaves.c.

Variable Documentation

const AVOption showwaves_options[]
static
Initial value:
= {
{ "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "600x240"}, 0, 0, FLAGS },
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "600x240"}, 0, 0, FLAGS },
{ "mode", "select display mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=MODE_POINT}, 0, MODE_NB-1, FLAGS, "mode"},
{ "point", "draw a point for each sample", 0, AV_OPT_TYPE_CONST, {.i64=MODE_POINT}, .flags=FLAGS, .unit="mode"},
{ "line", "draw a line for each sample", 0, AV_OPT_TYPE_CONST, {.i64=MODE_LINE}, .flags=FLAGS, .unit="mode"},
{ "p2p", "draw a line between samples", 0, AV_OPT_TYPE_CONST, {.i64=MODE_P2P}, .flags=FLAGS, .unit="mode"},
{ "cline", "draw a centered line for each sample", 0, AV_OPT_TYPE_CONST, {.i64=MODE_CENTERED_LINE}, .flags=FLAGS, .unit="mode"},
{ "n", "set how many samples to show in the same point", OFFSET(n), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
{ "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, FLAGS },
{ "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_VIDEO_RATE, {.str = "25"}, 0, 0, FLAGS },
{ "split_channels", "draw channels separately", OFFSET(split_channels), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, FLAGS },
{ NULL }
}

Definition at line 62 of file avf_showwaves.c.

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

Definition at line 302 of file avf_showwaves.c.

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

Definition at line 311 of file avf_showwaves.c.

AVFilter ff_avf_showwaves
Initial value:
= {
.name = "showwaves",
.description = NULL_IF_CONFIG_SMALL("Convert input audio to a video output."),
.init = init,
.uninit = uninit,
.query_formats = query_formats,
.priv_size = sizeof(ShowWavesContext),
.priv_class = &showwaves_class,
}

Definition at line 321 of file avf_showwaves.c.