libavfilter/vf_overlay.c File Reference

overlay one video on top of another More...

#include "avfilter.h"
#include "libavutil/eval.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/mathematics.h"
#include "libavutil/timestamp.h"
#include "internal.h"
#include "drawutils.h"

Go to the source code of this file.

Data Structures

struct  OverlayContext

Defines

#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 OFFSET(x)   offsetof(OverlayContext, x)
#define FAST_DIV255(x)   ((((x) + 128) * 257) >> 16)

Enumerations

enum  var_name {
  VAR_B1, VAR_B2, VAR_S1, VAR_S2,
  VAR_T1, VAR_T2, VAR_NB, VAR_N,
  VAR_T, VAR_S, VAR_VARS_NB, VAR_W,
  VAR_H, VAR_CW, VAR_CH, VAR_HSUB,
  VAR_VSUB, VARS_NB, VAR_IN_W, VAR_IW,
  VAR_IN_H, VAR_IH, VAR_OUT_W, VAR_OW,
  VAR_OUT_H, VAR_OH, VAR_A, VAR_SAR,
  VAR_DAR, VAR_HSUB, VAR_VSUB, VAR_X,
  VAR_Y, VAR_N, VAR_POS, VAR_T,
  VAR_VARS_NB, VAR_DAR, VAR_HSUB, VAR_VSUB,
  VAR_LINE_H, VAR_LH, VAR_MAIN_H, VAR_h,
  VAR_H, VAR_MAIN_W, VAR_w, VAR_W,
  VAR_MAX_GLYPH_A, VAR_ASCENT, VAR_MAX_GLYPH_D, VAR_DESCENT,
  VAR_MAX_GLYPH_H, VAR_MAX_GLYPH_W, VAR_N, VAR_SAR,
  VAR_T, VAR_TEXT_H, VAR_TH, VAR_TEXT_W,
  VAR_TW, VAR_X, VAR_Y, VAR_VARS_NB,
  VAR_W, VAR_H, VAR_VAL, VAR_MAXVAL,
  VAR_MINVAL, VAR_NEGVAL, VAR_CLIPVAL, VAR_VARS_NB,
  VAR_MAIN_W, VAR_MW, VAR_MAIN_H, VAR_MH,
  VAR_OVERLAY_W, VAR_OW, VAR_OVERLAY_H, VAR_OH,
  VAR_VARS_NB, VAR_IN_W, VAR_IW, VAR_IN_H,
  VAR_IH, VAR_OUT_W, VAR_OW, VAR_OUT_H,
  VAR_OH, VAR_X, VAR_Y, VAR_A,
  VAR_SAR, VAR_DAR, VAR_HSUB, VAR_VSUB,
  VARS_NB, VAR_IN_W, VAR_IW, VAR_IN_H,
  VAR_IH, VAR_OUT_W, VAR_OW, VAR_OUT_H,
  VAR_OH, VAR_A, VAR_SAR, VAR_DAR,
  VAR_HSUB, VAR_VSUB, VARS_NB, VAR_TB,
  VAR_PTS, VAR_START_PTS, VAR_PREV_PTS, VAR_PREV_SELECTED_PTS,
  VAR_T, VAR_START_T, VAR_PREV_T, VAR_PREV_SELECTED_T,
  VAR_PICT_TYPE, VAR_PICT_TYPE_I, VAR_PICT_TYPE_P, VAR_PICT_TYPE_B,
  VAR_PICT_TYPE_S, VAR_PICT_TYPE_SI, VAR_PICT_TYPE_SP, VAR_PICT_TYPE_BI,
  VAR_INTERLACE_TYPE, VAR_INTERLACE_TYPE_P, VAR_INTERLACE_TYPE_T, VAR_INTERLACE_TYPE_B,
  VAR_N, VAR_SELECTED_N, VAR_PREV_SELECTED_N, VAR_KEY,
  VAR_POS, VAR_VARS_NB, VAR_INTERLACED, VAR_N,
  VAR_POS, VAR_PREV_INPTS, VAR_PREV_OUTPTS, VAR_PTS,
  VAR_STARTPTS, VAR_TB, VAR_VARS_NB, VAR_AVTB,
  VAR_INTB, VAR_VARS_NB, VAR_X, VAR_Y,
  VAR_W, VAR_H, VAR_TIME, VAR_SPEED,
  VAR_TEMPO, VAR_ORDER, VAR_PATTERN, VAR_ROW,
  VAR_VARS_NB
}

Functions

static const char * overlay_get_name (void *ctx)
static av_cold int init (AVFilterContext *ctx, const char *args, void *opaque)
static av_cold void uninit (AVFilterContext *ctx)
static int query_formats (AVFilterContext *ctx)
static int config_input_main (AVFilterLink *inlink)
static int config_input_overlay (AVFilterLink *inlink)
static int config_output (AVFilterLink *outlink)
static AVFilterBufferRefget_video_buffer (AVFilterLink *link, int perms, int w, int h)
static void start_frame (AVFilterLink *inlink, AVFilterBufferRef *inpicref)
static void start_frame_overlay (AVFilterLink *inlink, AVFilterBufferRef *inpicref)
static void blend_slice (AVFilterContext *ctx, AVFilterBufferRef *dst, AVFilterBufferRef *src, int x, int y, int w, int h, int slice_y, int slice_w, int slice_h)
static void draw_slice (AVFilterLink *inlink, int y, int h, int slice_dir)
static void end_frame (AVFilterLink *inlink)
static void null_draw_slice (AVFilterLink *inlink, int y, int h, int slice_dir)
static void null_end_frame (AVFilterLink *inlink)
static int poll_frame (AVFilterLink *link)

Variables

static const char *const var_names []
static const AVOption overlay_options []
static const AVClass overlay_class
static enum PixelFormat alpha_pix_fmts []
AVFilter avfilter_vf_overlay


Detailed Description

overlay one video on top of another

Definition in file vf_overlay.c.


Define Documentation

#define A   3

Definition at line 63 of file vf_overlay.c.

#define B   2

Definition at line 62 of file vf_overlay.c.

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

Definition at line 354 of file vf_overlay.c.

Referenced by blend_slice(), and fill_picture_rgb().

#define G   1

Definition at line 61 of file vf_overlay.c.

#define MAIN   0

#define OFFSET (  )     offsetof(OverlayContext, x)

Definition at line 90 of file vf_overlay.c.

#define OVERLAY   1

#define R   0

Definition at line 60 of file vf_overlay.c.

#define U   1

Definition at line 66 of file vf_overlay.c.

#define V   2

Definition at line 67 of file vf_overlay.c.

#define Y   0

Definition at line 65 of file vf_overlay.c.


Enumeration Type Documentation

enum var_name

Enumerator:
VAR_B1 
VAR_B2 
VAR_S1 
VAR_S2 
VAR_T1 
VAR_T2 
VAR_NB 
VAR_N 
VAR_T 
VAR_S 
VAR_VARS_NB 
VAR_W 
VAR_H 
VAR_CW 
VAR_CH 
VAR_HSUB 
VAR_VSUB 
VARS_NB 
VAR_IN_W 
VAR_IW 
VAR_IN_H 
VAR_IH 
VAR_OUT_W 
VAR_OW 
VAR_OUT_H 
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_SI 
VAR_PICT_TYPE_SP 
VAR_PICT_TYPE_BI 
VAR_INTERLACE_TYPE 
VAR_INTERLACE_TYPE_P 
VAR_INTERLACE_TYPE_T 
VAR_INTERLACE_TYPE_B 
VAR_N 
VAR_SELECTED_N 
VAR_PREV_SELECTED_N 
VAR_KEY 
VAR_POS 
VAR_VARS_NB 
VAR_INTERLACED 
VAR_N 
VAR_POS 
VAR_PREV_INPTS 
VAR_PREV_OUTPTS 
VAR_PTS 
VAR_STARTPTS 
VAR_TB 
VAR_VARS_NB 
VAR_AVTB 
VAR_INTB 
VAR_VARS_NB 
VAR_X 
VAR_Y 
VAR_W 
VAR_H 
VAR_TIME 
VAR_SPEED 
VAR_TEMPO 
VAR_ORDER 
VAR_PATTERN 
VAR_ROW 
VAR_VARS_NB 

Definition at line 49 of file vf_overlay.c.


Function Documentation

static void blend_slice ( AVFilterContext ctx,
AVFilterBufferRef dst,
AVFilterBufferRef src,
int  x,
int  y,
int  w,
int  h,
int  slice_y,
int  slice_w,
int  slice_h 
) [static]

< the amount of overlay to blend on to main

Definition at line 356 of file vf_overlay.c.

Referenced by draw_slice().

static int config_input_main ( AVFilterLink inlink  )  [static]

Definition at line 198 of file vf_overlay.c.

static int config_input_overlay ( AVFilterLink inlink  )  [static]

Definition at line 214 of file vf_overlay.c.

static int config_output ( AVFilterLink outlink  )  [static]

Definition at line 277 of file vf_overlay.c.

static void draw_slice ( AVFilterLink inlink,
int  y,
int  h,
int  slice_dir 
) [static]

Definition at line 486 of file vf_overlay.c.

static void end_frame ( AVFilterLink inlink  )  [static]

Definition at line 503 of file vf_overlay.c.

static AVFilterBufferRef* get_video_buffer ( AVFilterLink link,
int  perms,
int  w,
int  h 
) [static]

Definition at line 302 of file vf_overlay.c.

static av_cold int init ( AVFilterContext ctx,
const char *  args,
void *  opaque 
) [static]

Definition at line 110 of file vf_overlay.c.

static void null_draw_slice ( AVFilterLink inlink,
int  y,
int  h,
int  slice_dir 
) [static]

Definition at line 509 of file vf_overlay.c.

static void null_end_frame ( AVFilterLink inlink  )  [static]

Definition at line 511 of file vf_overlay.c.

static const char* overlay_get_name ( void *  ctx  )  [static]

Definition at line 99 of file vf_overlay.c.

static int poll_frame ( AVFilterLink link  )  [static]

Definition at line 513 of file vf_overlay.c.

static int query_formats ( AVFilterContext ctx  )  [static]

Definition at line 156 of file vf_overlay.c.

static void start_frame ( AVFilterLink inlink,
AVFilterBufferRef inpicref 
) [static]

Definition at line 307 of file vf_overlay.c.

static void start_frame_overlay ( AVFilterLink inlink,
AVFilterBufferRef inpicref 
) [static]

Definition at line 340 of file vf_overlay.c.

static av_cold void uninit ( AVFilterContext ctx  )  [static]

Definition at line 143 of file vf_overlay.c.


Variable Documentation

enum PixelFormat alpha_pix_fmts[] [static]

Initial value:

Definition at line 193 of file vf_overlay.c.

Definition at line 525 of file vf_overlay.c.

const AVClass overlay_class [static]

Initial value:

 {
    "OverlayContext",
    overlay_get_name,
    overlay_options
}

Definition at line 104 of file vf_overlay.c.

const AVOption overlay_options[] [static]

Initial value:

 {
    { "x", "set the x expression", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str = "0"}, CHAR_MIN, CHAR_MAX },
    { "y", "set the y expression", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str = "0"}, CHAR_MIN, CHAR_MAX },
    {"rgb", "force packed RGB in input and output", OFFSET(allow_packed_rgb), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 },
    {NULL},
}

Definition at line 92 of file vf_overlay.c.

const char* const var_names[] [static]

Initial value:

 {
    "main_w",    "W", 
    "main_h",    "H", 
    "overlay_w", "w", 
    "overlay_h", "h", 
    NULL
}

Definition at line 41 of file vf_overlay.c.


Generated on Fri Oct 26 02:48:01 2012 for FFmpeg by  doxygen 1.5.8