Libav
Data Structures | Macros | Enumerations | Functions | Variables
vf_drawbox.c File Reference

Box drawing filter. More...

#include "libavutil/colorspace.h"
#include "libavutil/common.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/parseutils.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  DrawBoxContext
 

Macros

#define OFFSET(x)   offsetof(DrawBoxContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM
 

Enumerations

enum  { Y, U, V, A }
 

Functions

static av_cold int init (AVFilterContext *ctx)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input (AVFilterLink *inlink)
 
static int filter_frame (AVFilterLink *inlink, AVFrame *frame)
 

Variables

static const AVOption options []
 
static const AVClass drawbox_class
 
static const AVFilterPad avfilter_vf_drawbox_inputs []
 
static const AVFilterPad avfilter_vf_drawbox_outputs []
 
AVFilter ff_vf_drawbox
 

Detailed Description

Box drawing filter.

Also a nice template for a filter that needs to write in the input frame.

Definition in file vf_drawbox.c.

Macro Definition Documentation

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

Definition at line 123 of file vf_drawbox.c.

#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM

Definition at line 124 of file vf_drawbox.c.

Enumeration Type Documentation

anonymous enum
Enumerator
Y 
U 
V 
A 

Definition at line 37 of file vf_drawbox.c.

Function Documentation

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 47 of file vf_drawbox.c.

static int query_formats ( AVFilterContext ctx)
static

Definition at line 63 of file vf_drawbox.c.

static int config_input ( AVFilterLink inlink)
static

Definition at line 77 of file vf_drawbox.c.

static int filter_frame ( AVFilterLink inlink,
AVFrame frame 
)
static

Definition at line 95 of file vf_drawbox.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "x", "Horizontal position of the left box edge", OFFSET(x), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FLAGS },
{ "y", "Vertical position of the top box edge", OFFSET(y), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FLAGS },
{ "width", "Width of the box", OFFSET(w_opt), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
{ "height", "Height of the box", OFFSET(h_opt), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
{ "color", "Color of the box", OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" }, .flags = FLAGS },
{ NULL },
}
#define OFFSET(x)
Definition: vf_drawbox.c:123
#define FLAGS
Definition: vf_drawbox.c:124
NULL
Definition: eval.c:55

Definition at line 125 of file vf_drawbox.c.

const AVClass drawbox_class
static
Initial value:
= {
.class_name = "drawbox",
.item_name = av_default_item_name,
.option = options,
}
LIBAVUTIL_VERSION_INT
Definition: eval.c:55
av_default_item_name
Definition: dnxhdenc.c:45
static const AVOption options[]
Definition: vf_drawbox.c:125

Definition at line 134 of file vf_drawbox.c.

const AVFilterPad avfilter_vf_drawbox_inputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = config_input,
.get_video_buffer = ff_null_get_video_buffer,
.filter_frame = filter_frame,
.needs_writable = 1,
},
{ NULL }
}
AVFrame * ff_null_get_video_buffer(AVFilterLink *link, int w, int h)
Definition: video.c:30
static int config_input(AVFilterLink *inlink)
Definition: vf_drawbox.c:77
NULL
Definition: eval.c:55
static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
Definition: vf_drawbox.c:95

Definition at line 141 of file vf_drawbox.c.

const AVFilterPad avfilter_vf_drawbox_outputs[]
static
Initial value:
= {
{
.name = "default",
},
{ NULL }
}
NULL
Definition: eval.c:55

Definition at line 153 of file vf_drawbox.c.

AVFilter ff_vf_drawbox
Initial value:
= {
.name = "drawbox",
.description = NULL_IF_CONFIG_SMALL("Draw a colored box on the input video."),
.priv_size = sizeof(DrawBoxContext),
.priv_class = &drawbox_class,
.init = init,
}
static const AVFilterPad outputs[]
Definition: af_ashowinfo.c:122
static int query_formats(AVFilterContext *ctx)
Definition: vf_drawbox.c:63
static const AVFilterPad avfilter_vf_drawbox_outputs[]
Definition: vf_drawbox.c:153
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:142
static const AVFilterPad avfilter_vf_drawbox_inputs[]
Definition: vf_drawbox.c:141
static const AVFilterPad inputs[]
Definition: af_ashowinfo.c:111
static const AVClass drawbox_class
Definition: vf_drawbox.c:134
static av_cold int init(AVFilterContext *ctx)
Definition: vf_drawbox.c:47

Definition at line 161 of file vf_drawbox.c.