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

Go to the source code of this file.

Data Structures

struct  ColorkeyOpenCLContext
 

Macros

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

Functions

static int colorkey_opencl_init (AVFilterContext *avctx)
 
static int filter_frame (AVFilterLink *link, AVFrame *input_frame)
 
static av_cold void colorkey_opencl_uninit (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (colorkey_opencl)
 

Variables

static const AVFilterPad colorkey_opencl_inputs []
 
static const AVFilterPad colorkey_opencl_outputs []
 
static const AVOption colorkey_opencl_options []
 
const AVFilter ff_vf_colorkey_opencl
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 219 of file vf_colorkey_opencl.c.

◆ FLAGS

Definition at line 220 of file vf_colorkey_opencl.c.

Function Documentation

◆ colorkey_opencl_init()

static int colorkey_opencl_init ( AVFilterContext avctx)
static

Definition at line 49 of file vf_colorkey_opencl.c.

Referenced by filter_frame().

◆ filter_frame()

static int filter_frame ( AVFilterLink link,
AVFrame input_frame 
)
static

Definition at line 91 of file vf_colorkey_opencl.c.

◆ colorkey_opencl_uninit()

static av_cold void colorkey_opencl_uninit ( AVFilterContext avctx)
static

Definition at line 180 of file vf_colorkey_opencl.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( colorkey_opencl  )

Variable Documentation

◆ colorkey_opencl_inputs

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

Definition at line 202 of file vf_colorkey_opencl.c.

◆ colorkey_opencl_outputs

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

Definition at line 211 of file vf_colorkey_opencl.c.

◆ colorkey_opencl_options

const AVOption colorkey_opencl_options[]
static
Initial value:
= {
{ "color", "set the colorkey key color", OFFSET(colorkey_rgba), AV_OPT_TYPE_COLOR, { .str = "black" }, 0, 0, FLAGS },
{ "similarity", "set the colorkey similarity value", OFFSET(similarity), AV_OPT_TYPE_FLOAT, { .dbl = 0.01 }, 0.01, 1.0, FLAGS },
{ "blend", "set the colorkey key blend value", OFFSET(blend), AV_OPT_TYPE_FLOAT, { .dbl = 0.0 }, 0.0, 1.0, FLAGS },
{ NULL }
}

Definition at line 222 of file vf_colorkey_opencl.c.

◆ ff_vf_colorkey_opencl

const AVFilter ff_vf_colorkey_opencl
Initial value:
= {
.name = "colorkey_opencl",
.description = NULL_IF_CONFIG_SMALL("Turns a certain color into transparency. Operates on RGB colors."),
.priv_size = sizeof(ColorkeyOpenCLContext),
.priv_class = &colorkey_opencl_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE
}

Definition at line 231 of file vf_colorkey_opencl.c.

FF_FILTER_FLAG_HWFRAME_AWARE
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:371
OFFSET
#define OFFSET(x)
Definition: vf_colorkey_opencl.c:219
init
static int init
Definition: av_tx.c:47
colorkey_opencl_uninit
static av_cold void colorkey_opencl_uninit(AVFilterContext *avctx)
Definition: vf_colorkey_opencl.c:180
ColorkeyOpenCLContext
Definition: vf_colorkey_opencl.c:28
filter_frame
static int filter_frame(AVFilterLink *link, AVFrame *input_frame)
Definition: vf_colorkey_opencl.c:91
ff_opencl_filter_config_output
int ff_opencl_filter_config_output(AVFilterLink *outlink)
Create a suitable hardware frames context for the output.
Definition: opencl.c:81
colorkey_opencl_inputs
static const AVFilterPad colorkey_opencl_inputs[]
Definition: vf_colorkey_opencl.c:202
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:191
NULL
#define NULL
Definition: coverity.c:32
AV_OPT_TYPE_COLOR
@ AV_OPT_TYPE_COLOR
Definition: opt.h:239
AV_PIX_FMT_OPENCL
@ AV_PIX_FMT_OPENCL
Hardware surfaces for OpenCL.
Definition: pixfmt.h:325
FLAGS
#define FLAGS
Definition: vf_colorkey_opencl.c:220
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
colorkey_opencl_outputs
static const AVFilterPad colorkey_opencl_outputs[]
Definition: vf_colorkey_opencl.c:211
ff_opencl_filter_config_input
int ff_opencl_filter_config_input(AVFilterLink *inlink)
Check that the input link contains a suitable hardware frames context and extract the device from it.
Definition: opencl.c:45
AV_OPT_TYPE_FLOAT
@ AV_OPT_TYPE_FLOAT
Definition: opt.h:227
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: internal.h:181
ff_opencl_filter_init
int ff_opencl_filter_init(AVFilterContext *avctx)
Initialise an OpenCL filter context.
Definition: opencl.c:132
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:192
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:282