FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_overlay.c File Reference
#include "avfilter.h"
#include "formats.h"
#include "libavutil/common.h"
#include "libavutil/eval.h"
#include "libavutil/avstring.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/timestamp.h"
#include "internal.h"
#include "drawutils.h"
#include "framesync.h"
#include "video.h"
#include "vf_overlay.h"

Go to the source code of this file.

Data Structures

struct  ThreadData
 Used for passing data between threads. More...
 

Macros

#define MAIN   0
 
#define OVERLAY   1
 
#define R   0
 
#define G   1
 
#define B   2
 
#define A   3
 
#define Y   0
 
#define U   1
 
#define V   2
 
#define FAST_DIV255(x)   ((((x) + 128) * 257) >> 16)
 
#define UNPREMULTIPLY_ALPHA(x, y)   ((((x) << 16) - ((x) << 9) + (x)) / ((((x) + (y)) << 8) - ((x) + (y)) - (y) * (x)))
 
#define DEFINE_BLEND_PLANE(depth, nbits)
 
#define DEFINE_ALPHA_COMPOSITE(depth, nbits)
 
#define DEFINE_BLEND_SLICE_YUV(depth, nbits)
 
#define OFFSET(x)   offsetof(OverlayContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Enumerations

enum  EvalMode {
  EVAL_MODE_ONCE, EVAL_MODE_FRAME, EVAL_MODE_NB, EVAL_MODE_INIT,
  EVAL_MODE_FRAME, EVAL_MODE_NB, EVAL_MODE_INIT, EVAL_MODE_FRAME,
  EVAL_MODE_NB, EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB,
  EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB, EVAL_MODE_INIT,
  EVAL_MODE_FRAME, EVAL_MODE_NB, EVAL_MODE_INIT, EVAL_MODE_FRAME,
  EVAL_MODE_NB, EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB,
  EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB
}
 

Functions

static av_cold void uninit (AVFilterContext *ctx)
 
static int normalize_xy (double d, int chroma_sub)
 
static void eval_expr (AVFilterContext *ctx)
 
static int set_expr (AVExpr **pexpr, const char *expr, const char *option, void *log_ctx)
 
static int process_command (AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
 
static int query_formats (AVFilterContext *ctx)
 
static int config_input_overlay (AVFilterLink *inlink)
 
static int config_output (AVFilterLink *outlink)
 
static av_always_inline void blend_slice_packed_rgb (AVFilterContext *ctx, AVFrame *dst, const AVFrame *src, int main_has_alpha, int x, int y, int is_straight, int jobnr, int nb_jobs)
 Blend image in src to destination buffer dst at position (x, y). More...
 
static av_always_inline void blend_slice_planar_rgb (AVFilterContext *ctx, AVFrame *dst, const AVFrame *src, int hsub, int vsub, int main_has_alpha, int x, int y, int is_straight, int jobnr, int nb_jobs)
 
static int blend_slice_yuv420 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuva420 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuv420p10 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuva420p10 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuv422p10 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuva422p10 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuv422 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuva422 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuv444 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuva444 (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_gbrp (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_gbrap (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuv420_pm (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuva420_pm (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuv422_pm (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuva422_pm (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuv444_pm (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_yuva444_pm (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_gbrp_pm (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_gbrap_pm (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_rgb (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_rgba (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_rgb_pm (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int blend_slice_rgba_pm (AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
 
static int config_input_main (AVFilterLink *inlink)
 
static int do_blend (FFFrameSync *fs)
 
static av_cold int init (AVFilterContext *ctx)
 
static int activate (AVFilterContext *ctx)
 
 FRAMESYNC_DEFINE_CLASS (overlay, OverlayContext, fs)
 

Variables

static const char *const var_names []
 
static enum AVPixelFormat alpha_pix_fmts []
 
static const AVOption overlay_options []
 
static const AVFilterPad avfilter_vf_overlay_inputs []
 
static const AVFilterPad avfilter_vf_overlay_outputs []
 
const AVFilter ff_vf_overlay
 

Detailed Description

overlay one video on top of another

Definition in file vf_overlay.c.

Macro Definition Documentation

◆ MAIN

#define MAIN   0

Definition at line 63 of file vf_overlay.c.

◆ OVERLAY

#define OVERLAY   1

Definition at line 64 of file vf_overlay.c.

◆ R

#define R   0

Definition at line 66 of file vf_overlay.c.

◆ G

#define G   1

Definition at line 67 of file vf_overlay.c.

◆ B

#define B   2

Definition at line 68 of file vf_overlay.c.

◆ A

#define A   3

Definition at line 69 of file vf_overlay.c.

◆ Y

#define Y   0

Definition at line 71 of file vf_overlay.c.

◆ U

#define U   1

Definition at line 72 of file vf_overlay.c.

◆ V

#define V   2

Definition at line 73 of file vf_overlay.c.

◆ FAST_DIV255

#define FAST_DIV255 (   x)    ((((x) + 128) * 257) >> 16)

Definition at line 337 of file vf_overlay.c.

◆ UNPREMULTIPLY_ALPHA

#define UNPREMULTIPLY_ALPHA (   x,
 
)    ((((x) << 16) - ((x) << 9) + (x)) / ((((x) + (y)) << 8) - ((x) + (y)) - (y) * (x)))

Definition at line 343 of file vf_overlay.c.

◆ DEFINE_BLEND_PLANE

#define DEFINE_BLEND_PLANE (   depth,
  nbits 
)

Definition at line 436 of file vf_overlay.c.

◆ DEFINE_ALPHA_COMPOSITE

#define DEFINE_ALPHA_COMPOSITE (   depth,
  nbits 
)

Definition at line 564 of file vf_overlay.c.

◆ DEFINE_BLEND_SLICE_YUV

#define DEFINE_BLEND_SLICE_YUV (   depth,
  nbits 
)
Value:
static av_always_inline void blend_slice_yuv_##depth##_##nbits##bits(AVFilterContext *ctx, \
AVFrame *dst, const AVFrame *src, \
int hsub, int vsub, \
int main_has_alpha, \
int x, int y, \
int is_straight, \
int jobnr, int nb_jobs) \
{ \
OverlayContext *s = ctx->priv; \
const int src_w = src->width; \
const int src_h = src->height; \
const int dst_w = dst->width; \
const int dst_h = dst->height; \
\
blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 0, 0, 0, \
x, y, main_has_alpha, s->main_desc->comp[0].plane, s->main_desc->comp[0].offset, \
s->main_desc->comp[0].step, is_straight, 1, jobnr, nb_jobs); \
blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 1, hsub, vsub, \
x, y, main_has_alpha, s->main_desc->comp[1].plane, s->main_desc->comp[1].offset, \
s->main_desc->comp[1].step, is_straight, 1, jobnr, nb_jobs); \
blend_plane_##depth##_##nbits##bits(ctx, dst, src, src_w, src_h, dst_w, dst_h, 2, hsub, vsub, \
x, y, main_has_alpha, s->main_desc->comp[2].plane, s->main_desc->comp[2].offset, \
s->main_desc->comp[2].step, is_straight, 1, jobnr, nb_jobs); \
if (main_has_alpha) \
alpha_composite_##depth##_##nbits##bits(src, dst, src_w, src_h, dst_w, dst_h, x, y, \
jobnr, nb_jobs); \
}

Definition at line 617 of file vf_overlay.c.

◆ OFFSET

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

Definition at line 1055 of file vf_overlay.c.

◆ FLAGS

Definition at line 1056 of file vf_overlay.c.

Enumeration Type Documentation

◆ EvalMode

enum EvalMode
Enumerator
EVAL_MODE_ONCE 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 
EVAL_MODE_INIT 
EVAL_MODE_FRAME 
EVAL_MODE_NB 

Definition at line 75 of file vf_overlay.c.

Function Documentation

◆ uninit()

static av_cold void uninit ( AVFilterContext ctx)
static

Definition at line 81 of file vf_overlay.c.

◆ normalize_xy()

static int normalize_xy ( double  d,
int  chroma_sub 
)
inlinestatic

Definition at line 90 of file vf_overlay.c.

Referenced by eval_expr().

◆ eval_expr()

static void eval_expr ( AVFilterContext ctx)
static

Definition at line 97 of file vf_overlay.c.

Referenced by config_input_overlay(), do_blend(), and process_command().

◆ set_expr()

static int set_expr ( AVExpr **  pexpr,
const char *  expr,
const char *  option,
void *  log_ctx 
)
static

Definition at line 109 of file vf_overlay.c.

Referenced by config_input_overlay(), and process_command().

◆ process_command()

static int process_command ( AVFilterContext ctx,
const char *  cmd,
const char *  args,
char *  res,
int  res_len,
int  flags 
)
static

Definition at line 130 of file vf_overlay.c.

◆ query_formats()

static int query_formats ( AVFilterContext ctx)
static

Definition at line 162 of file vf_overlay.c.

◆ config_input_overlay()

static int config_input_overlay ( AVFilterLink inlink)
static

Definition at line 272 of file vf_overlay.c.

◆ config_output()

static int config_output ( AVFilterLink outlink)
static

Definition at line 319 of file vf_overlay.c.

◆ blend_slice_packed_rgb()

static av_always_inline void blend_slice_packed_rgb ( AVFilterContext ctx,
AVFrame dst,
const AVFrame src,
int  main_has_alpha,
int  x,
int  y,
int  is_straight,
int  jobnr,
int  nb_jobs 
)
static

Blend image in src to destination buffer dst at position (x, y).

< the amount of overlay to blend on to main

Definition at line 349 of file vf_overlay.c.

Referenced by blend_slice_rgb(), blend_slice_rgb_pm(), blend_slice_rgba(), and blend_slice_rgba_pm().

◆ blend_slice_planar_rgb()

static av_always_inline void blend_slice_planar_rgb ( AVFilterContext ctx,
AVFrame dst,
const AVFrame src,
int  hsub,
int  vsub,
int  main_has_alpha,
int  x,
int  y,
int  is_straight,
int  jobnr,
int  nb_jobs 
)
static

◆ blend_slice_yuv420()

static int blend_slice_yuv420 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 678 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuva420()

static int blend_slice_yuva420 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 686 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuv420p10()

static int blend_slice_yuv420p10 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 694 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuva420p10()

static int blend_slice_yuva420p10 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 702 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuv422p10()

static int blend_slice_yuv422p10 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 710 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuva422p10()

static int blend_slice_yuva422p10 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 718 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuv422()

static int blend_slice_yuv422 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 726 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuva422()

static int blend_slice_yuva422 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 734 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuv444()

static int blend_slice_yuv444 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 742 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuva444()

static int blend_slice_yuva444 ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 750 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_gbrp()

static int blend_slice_gbrp ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 758 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_gbrap()

static int blend_slice_gbrap ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 766 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuv420_pm()

static int blend_slice_yuv420_pm ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 774 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuva420_pm()

static int blend_slice_yuva420_pm ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 782 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuv422_pm()

static int blend_slice_yuv422_pm ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 790 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuva422_pm()

static int blend_slice_yuva422_pm ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 798 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuv444_pm()

static int blend_slice_yuv444_pm ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 806 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_yuva444_pm()

static int blend_slice_yuva444_pm ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 814 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_gbrp_pm()

static int blend_slice_gbrp_pm ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 822 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_gbrap_pm()

static int blend_slice_gbrap_pm ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 830 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_rgb()

static int blend_slice_rgb ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 838 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_rgba()

static int blend_slice_rgba ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 846 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_rgb_pm()

static int blend_slice_rgb_pm ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 854 of file vf_overlay.c.

Referenced by config_input_main().

◆ blend_slice_rgba_pm()

static int blend_slice_rgba_pm ( AVFilterContext ctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 862 of file vf_overlay.c.

Referenced by config_input_main().

◆ config_input_main()

static int config_input_main ( AVFilterLink inlink)
static

Definition at line 870 of file vf_overlay.c.

◆ do_blend()

static int do_blend ( FFFrameSync fs)
static

Definition at line 995 of file vf_overlay.c.

Referenced by init().

◆ init()

static av_cold int init ( AVFilterContext ctx)
static

Definition at line 1041 of file vf_overlay.c.

◆ activate()

static int activate ( AVFilterContext ctx)
static

Definition at line 1049 of file vf_overlay.c.

◆ FRAMESYNC_DEFINE_CLASS()

FRAMESYNC_DEFINE_CLASS ( overlay  ,
OverlayContext  ,
fs   
)

Variable Documentation

◆ var_names

const char* const var_names[]
static
Initial value:
= {
"main_w", "W",
"main_h", "H",
"overlay_w", "w",
"overlay_h", "h",
"hsub",
"vsub",
"x",
"y",
"n",
"pos",
"t",
}

Definition at line 48 of file vf_overlay.c.

Referenced by set_expr().

◆ alpha_pix_fmts

enum AVPixelFormat alpha_pix_fmts[]
static

◆ overlay_options

const AVOption overlay_options[]
static
Initial value:
= {
{ "x", "set the x expression", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str = "0"}, 0, 0, FLAGS },
{ "y", "set the y expression", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str = "0"}, 0, 0, FLAGS },
{ "eof_action", "Action to take when encountering EOF from secondary input ",
OFFSET(fs.opt_eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_REPEAT },
EOF_ACTION_REPEAT, EOF_ACTION_PASS, .flags = FLAGS, "eof_action" },
{ "repeat", "Repeat the previous frame.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_REPEAT }, .flags = FLAGS, "eof_action" },
{ "endall", "End both streams.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ENDALL }, .flags = FLAGS, "eof_action" },
{ "pass", "Pass through the main input.", 0, AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS }, .flags = FLAGS, "eof_action" },
{ "eval", "specify when to evaluate expressions", OFFSET(eval_mode), AV_OPT_TYPE_INT, {.i64 = EVAL_MODE_FRAME}, 0, EVAL_MODE_NB-1, FLAGS, "eval" },
{ "init", "eval expressions once during initialization", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_INIT}, .flags = FLAGS, .unit = "eval" },
{ "frame", "eval expressions per-frame", 0, AV_OPT_TYPE_CONST, {.i64=EVAL_MODE_FRAME}, .flags = FLAGS, .unit = "eval" },
{ "shortest", "force termination when the shortest input terminates", OFFSET(fs.opt_shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ "format", "set output format", OFFSET(format), AV_OPT_TYPE_INT, {.i64=OVERLAY_FORMAT_YUV420}, 0, OVERLAY_FORMAT_NB-1, FLAGS, "format" },
{ "yuv420", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV420}, .flags = FLAGS, .unit = "format" },
{ "yuv420p10", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV420P10}, .flags = FLAGS, .unit = "format" },
{ "yuv422", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV422}, .flags = FLAGS, .unit = "format" },
{ "yuv422p10", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV422P10}, .flags = FLAGS, .unit = "format" },
{ "yuv444", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_YUV444}, .flags = FLAGS, .unit = "format" },
{ "rgb", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_RGB}, .flags = FLAGS, .unit = "format" },
{ "gbrp", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_GBRP}, .flags = FLAGS, .unit = "format" },
{ "auto", "", 0, AV_OPT_TYPE_CONST, {.i64=OVERLAY_FORMAT_AUTO}, .flags = FLAGS, .unit = "format" },
{ "repeatlast", "repeat overlay of the last overlay frame", OFFSET(fs.opt_repeatlast), AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, FLAGS },
{ "alpha", "alpha format", OFFSET(alpha_format), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "alpha_format" },
{ "straight", "", 0, AV_OPT_TYPE_CONST, {.i64=0}, .flags = FLAGS, .unit = "alpha_format" },
{ "premultiplied", "", 0, AV_OPT_TYPE_CONST, {.i64=1}, .flags = FLAGS, .unit = "alpha_format" },
{ NULL }
}

Definition at line 1058 of file vf_overlay.c.

◆ avfilter_vf_overlay_inputs

const AVFilterPad avfilter_vf_overlay_inputs[]
static
Initial value:
= {
{
.name = "main",
.config_props = config_input_main,
},
{
.name = "overlay",
.config_props = config_input_overlay,
},
}

Definition at line 1089 of file vf_overlay.c.

◆ avfilter_vf_overlay_outputs

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

Definition at line 1102 of file vf_overlay.c.

◆ ff_vf_overlay

const AVFilter ff_vf_overlay
Initial value:
= {
.name = "overlay",
.description = NULL_IF_CONFIG_SMALL("Overlay a video source on top of the input."),
.preinit = overlay_framesync_preinit,
.init = init,
.uninit = uninit,
.priv_size = sizeof(OverlayContext),
.priv_class = &overlay_class,
}

Definition at line 1110 of file vf_overlay.c.

avfilter_vf_overlay_outputs
static const AVFilterPad avfilter_vf_overlay_outputs[]
Definition: vf_overlay.c:1102
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:325
AV_PIX_FMT_YUVA420P10
#define AV_PIX_FMT_YUVA420P10
Definition: pixfmt.h:443
EOF_ACTION_ENDALL
@ EOF_ACTION_ENDALL
Definition: framesync.h:28
FILTER_QUERY_FUNC
#define FILTER_QUERY_FUNC(func)
Definition: internal.h:167
AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
AV_PIX_FMT_YUVA422P10
#define AV_PIX_FMT_YUVA422P10
Definition: pixfmt.h:444
hsub
static void hsub(htype *dst, const htype *src, int bins)
Definition: vf_median.c:74
OVERLAY_FORMAT_RGB
@ OVERLAY_FORMAT_RGB
Definition: vf_overlay.h:48
AV_PIX_FMT_GBRAP
@ AV_PIX_FMT_GBRAP
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:205
OVERLAY_FORMAT_YUV422P10
@ OVERLAY_FORMAT_YUV422P10
Definition: vf_overlay.h:46
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: vf_overlay.c:162
config_input_main
static int config_input_main(AVFilterLink *inlink)
Definition: vf_overlay.c:870
EVAL_MODE_FRAME
@ EVAL_MODE_FRAME
Definition: vf_overlay.c:77
s
#define s(width, name)
Definition: cbs_vp9.c:256
AV_PIX_FMT_YUVA420P
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
Definition: pixfmt.h:101
OVERLAY_FORMAT_YUV422
@ OVERLAY_FORMAT_YUV422
Definition: vf_overlay.h:45
format
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
bits
uint8_t bits
Definition: vp3data.h:141
ctx
AVFormatContext * ctx
Definition: movenc.c:48
EOF_ACTION_PASS
@ EOF_ACTION_PASS
Definition: framesync.h:29
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:190
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:93
if
if(ret)
Definition: filter_design.txt:179
config_input_overlay
static int config_input_overlay(AVFilterLink *inlink)
Definition: vf_overlay.c:272
NULL
#define NULL
Definition: coverity.c:32
EVAL_MODE_NB
@ EVAL_MODE_NB
Definition: vf_overlay.c:78
fs
#define fs(width, name, subs,...)
Definition: cbs_vp9.c:258
uninit
static av_cold void uninit(AVFilterContext *ctx)
Definition: vf_overlay.c:81
OverlayContext
Definition: vf_overlay.h:54
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
avfilter_vf_overlay_inputs
static const AVFilterPad avfilter_vf_overlay_inputs[]
Definition: vf_overlay.c:1089
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:117
OVERLAY_FORMAT_NB
@ OVERLAY_FORMAT_NB
Definition: vf_overlay.h:51
OVERLAY_FORMAT_YUV420P10
@ OVERLAY_FORMAT_YUV420P10
Definition: vf_overlay.h:44
OVERLAY_FORMAT_YUV420
@ OVERLAY_FORMAT_YUV420
Definition: vf_overlay.h:43
config_output
static int config_output(AVFilterLink *outlink)
Definition: vf_overlay.c:319
AV_PIX_FMT_YUVA444P
@ AV_PIX_FMT_YUVA444P
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:167
OVERLAY_FORMAT_AUTO
@ OVERLAY_FORMAT_AUTO
Definition: vf_overlay.h:50
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:92
FLAGS
#define FLAGS
Definition: vf_overlay.c:1056
av_always_inline
#define av_always_inline
Definition: attributes.h:49
process_command
static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, char *res, int res_len, int flags)
Definition: vf_overlay.c:130
EOF_ACTION_REPEAT
@ EOF_ACTION_REPEAT
Definition: framesync.h:27
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
activate
static int activate(AVFilterContext *ctx)
Definition: vf_overlay.c:1049
AVFilterContext
An instance of a filter.
Definition: avfilter.h:408
OVERLAY_FORMAT_GBRP
@ OVERLAY_FORMAT_GBRP
Definition: vf_overlay.h:49
AVFILTER_FLAG_SLICE_THREADS
#define AVFILTER_FLAG_SLICE_THREADS
The filter supports multithreading by splitting frames into multiple parts and processing them concur...
Definition: avfilter.h:127
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
OVERLAY_FORMAT_YUV444
@ OVERLAY_FORMAT_YUV444
Definition: vf_overlay.h:47
_
#define _
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:191
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
EVAL_MODE_INIT
@ EVAL_MODE_INIT
Definition: vf_overlay.c:76
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
#define AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
Same as AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC, except that the filter will have its filter_frame() c...
Definition: avfilter.h:160
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
OFFSET
#define OFFSET(x)
Definition: vf_overlay.c:1055
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:166
init
static av_cold int init(AVFilterContext *ctx)
Definition: vf_overlay.c:1041