FFmpeg
Data Structures | Macros | Functions | Variables
vf_colorkey.c File Reference
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  ColorkeyContext
 

Macros

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

Functions

static uint8_t do_colorkey_pixel (ColorkeyContext *ctx, uint8_t r, uint8_t g, uint8_t b)
 
static int do_colorkey_slice (AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs)
 
static int do_colorhold_slice (AVFilterContext *avctx, void *arg, int jobnr, int nb_jobs)
 
static av_cold int init_filter (AVFilterContext *avctx)
 
static int filter_frame (AVFilterLink *link, AVFrame *frame)
 
static av_cold int config_output (AVFilterLink *outlink)
 

Variables

static enum AVPixelFormat pixel_fmts []
 
static const AVFilterPad colorkey_inputs []
 
static const AVFilterPad colorkey_outputs []
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 187 of file vf_colorkey.c.

◆ FLAGS

Definition at line 188 of file vf_colorkey.c.

Function Documentation

◆ do_colorkey_pixel()

static uint8_t do_colorkey_pixel ( ColorkeyContext ctx,
uint8_t  r,
uint8_t  g,
uint8_t  b 
)
static

Definition at line 42 of file vf_colorkey.c.

Referenced by do_colorhold_slice(), and do_colorkey_slice().

◆ do_colorkey_slice()

static int do_colorkey_slice ( AVFilterContext avctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 57 of file vf_colorkey.c.

Referenced by init_filter().

◆ do_colorhold_slice()

static int do_colorhold_slice ( AVFilterContext avctx,
void *  arg,
int  jobnr,
int  nb_jobs 
)
static

Definition at line 83 of file vf_colorkey.c.

Referenced by init_filter().

◆ init_filter()

static av_cold int init_filter ( AVFilterContext avctx)
static

Definition at line 119 of file vf_colorkey.c.

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame frame 
)
static

Definition at line 132 of file vf_colorkey.c.

◆ config_output()

static av_cold int config_output ( AVFilterLink outlink)
static

Definition at line 145 of file vf_colorkey.c.

Variable Documentation

◆ pixel_fmts

enum AVPixelFormat pixel_fmts[]
static

◆ colorkey_inputs

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

Definition at line 170 of file vf_colorkey.c.

◆ colorkey_outputs

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

Definition at line 179 of file vf_colorkey.c.

AV_PIX_FMT_BGRA
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
Definition: pixfmt.h:95
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *frame)
Definition: vf_colorkey.c:132
AV_PIX_FMT_RGBA
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
Definition: pixfmt.h:93
AV_PIX_FMT_ABGR
@ AV_PIX_FMT_ABGR
packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
Definition: pixfmt.h:94
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:92
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
config_output
static av_cold int config_output(AVFilterLink *outlink)
Definition: vf_colorkey.c:145
AVFILTERPAD_FLAG_NEEDS_WRITABLE
#define AVFILTERPAD_FLAG_NEEDS_WRITABLE
The filter expects writable frames from its input link, duplicating data buffers if needed.
Definition: internal.h:69