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

Go to the source code of this file.

Data Structures

struct  DrawGraphContext
 

Macros

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

Enumerations

enum  { VAR_MAX, VAR_MIN, VAR_VAL, VAR_VARS_NB }
 

Functions

static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static void clear_image (DrawGraphContext *s, AVFrame *out, AVFilterLink *outlink)
 
static void draw_dot (int fg, int x, int y, AVFrame *out)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *in)
 
static int request_frame (AVFilterLink *outlink)
 
static int config_output (AVFilterLink *outlink)
 
static av_cold void uninit (AVFilterContext *ctx)
 

Variables

static const AVOption drawgraph_options []
 
static const char *const var_names [] = { "MAX", "MIN", "VAL", NULL }
 

Macro Definition Documentation

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

Definition at line 52 of file f_drawgraph.c.

Definition at line 53 of file f_drawgraph.c.

Enumeration Type Documentation

anonymous enum
Enumerator
VAR_MAX 
VAR_MIN 
VAR_VAL 
VAR_VARS_NB 

Definition at line 83 of file f_drawgraph.c.

Function Documentation

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 85 of file f_drawgraph.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 122 of file f_drawgraph.c.

static void clear_image ( DrawGraphContext s,
AVFrame out,
AVFilterLink outlink 
)
static

Definition at line 138 of file f_drawgraph.c.

Referenced by filter_frame().

static void draw_dot ( int  fg,
int  x,
int  y,
AVFrame out 
)
inlinestatic

Definition at line 148 of file f_drawgraph.c.

Referenced by filter_frame(), and request_frame().

static int filter_frame ( AVFilterLink inlink,
AVFrame in 
)
static

Definition at line 153 of file f_drawgraph.c.

static int request_frame ( AVFilterLink outlink)
static

Definition at line 319 of file f_drawgraph.c.

static int config_output ( AVFilterLink outlink)
static

Definition at line 401 of file f_drawgraph.c.

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 412 of file f_drawgraph.c.

Variable Documentation

const AVOption drawgraph_options[]
static
Initial value:
= {
{ "m1", "set 1st metadata key", OFFSET(key[0]), AV_OPT_TYPE_STRING, {.str=""}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "fg1", "set 1st foreground color expression", OFFSET(fg_str[0]), AV_OPT_TYPE_STRING, {.str="0xffff0000"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "m2", "set 2nd metadata key", OFFSET(key[1]), AV_OPT_TYPE_STRING, {.str=""}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "fg2", "set 2nd foreground color expression", OFFSET(fg_str[1]), AV_OPT_TYPE_STRING, {.str="0xff00ff00"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "m3", "set 3rd metadata key", OFFSET(key[2]), AV_OPT_TYPE_STRING, {.str=""}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "fg3", "set 3rd foreground color expression", OFFSET(fg_str[2]), AV_OPT_TYPE_STRING, {.str="0xffff00ff"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "m4", "set 4th metadata key", OFFSET(key[3]), AV_OPT_TYPE_STRING, {.str=""}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "fg4", "set 4th foreground color expression", OFFSET(fg_str[3]), AV_OPT_TYPE_STRING, {.str="0xffffff00"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "bg", "set background color", OFFSET(bg), AV_OPT_TYPE_COLOR, {.str="white"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "min", "set minimal value", OFFSET(min), AV_OPT_TYPE_FLOAT, {.dbl=-1.}, INT_MIN, INT_MAX, FLAGS },
{ "max", "set maximal value", OFFSET(max), AV_OPT_TYPE_FLOAT, {.dbl=1.}, INT_MIN, INT_MAX, FLAGS },
{ "mode", "set graph mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=2}, 0, 2, FLAGS, "mode" },
{"bar", "draw bars", OFFSET(mode), AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "mode"},
{"dot", "draw dots", OFFSET(mode), AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "mode"},
{"line", "draw lines", OFFSET(mode), AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "mode"},
{ "slide", "set slide mode", OFFSET(slide), AV_OPT_TYPE_INT, {.i64=0}, 0, 4, FLAGS, "slide" },
{"frame", "draw new frames", OFFSET(slide), AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "slide"},
{"replace", "replace old columns with new", OFFSET(slide), AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "slide"},
{"scroll", "scroll from right to left", OFFSET(slide), AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "slide"},
{"rscroll", "scroll from left to right", OFFSET(slide), AV_OPT_TYPE_CONST, {.i64=3}, 0, 0, FLAGS, "slide"},
{"picture", "display graph in single frame", OFFSET(slide), AV_OPT_TYPE_CONST, {.i64=4}, 0, 0, FLAGS, "slide"},
{ "size", "set graph size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="900x256"}, 0, 0, FLAGS },
{ "s", "set graph size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="900x256"}, 0, 0, FLAGS },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define FLAGS
Definition: f_drawgraph.c:53
#define OFFSET(x)
Definition: f_drawgraph.c:52
offset must point to two consecutive integers
Definition: opt.h:233
float min
mode
Use these values in ebur128_init (or'ed).
Definition: ebur128.h:83

Definition at line 55 of file f_drawgraph.c.

const char* const var_names[] = { "MAX", "MIN", "VAL", NULL }
static

Definition at line 82 of file f_drawgraph.c.

Referenced by init().