FFmpeg
Data Structures | Macros | Functions | Variables
vf_overlay_opencl.c File Reference
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "framesync.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  OverlayOpenCLContext
 

Macros

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

Functions

static int overlay_opencl_load (AVFilterContext *avctx, enum AVPixelFormat main_format, enum AVPixelFormat overlay_format)
 
static int overlay_opencl_blend (FFFrameSync *fs)
 
static int overlay_opencl_config_output (AVFilterLink *outlink)
 
static av_cold int overlay_opencl_init (AVFilterContext *avctx)
 
static int overlay_opencl_activate (AVFilterContext *avctx)
 
static av_cold void overlay_opencl_uninit (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (overlay_opencl)
 

Variables

static const AVOption overlay_opencl_options []
 
static const AVFilterPad overlay_opencl_inputs []
 
static const AVFilterPad overlay_opencl_outputs []
 
const AVFilter ff_vf_overlay_opencl
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 280 of file vf_overlay_opencl.c.

◆ FLAGS

Definition at line 281 of file vf_overlay_opencl.c.

Function Documentation

◆ overlay_opencl_load()

static int overlay_opencl_load ( AVFilterContext avctx,
enum AVPixelFormat  main_format,
enum AVPixelFormat  overlay_format 
)
static

Definition at line 48 of file vf_overlay_opencl.c.

Referenced by overlay_opencl_blend().

◆ overlay_opencl_blend()

static int overlay_opencl_blend ( FFFrameSync fs)
static

Definition at line 119 of file vf_overlay_opencl.c.

Referenced by overlay_opencl_init().

◆ overlay_opencl_config_output()

static int overlay_opencl_config_output ( AVFilterLink outlink)
static

Definition at line 223 of file vf_overlay_opencl.c.

◆ overlay_opencl_init()

static av_cold int overlay_opencl_init ( AVFilterContext avctx)
static

Definition at line 240 of file vf_overlay_opencl.c.

◆ overlay_opencl_activate()

static int overlay_opencl_activate ( AVFilterContext avctx)
static

Definition at line 249 of file vf_overlay_opencl.c.

◆ overlay_opencl_uninit()

static av_cold void overlay_opencl_uninit ( AVFilterContext avctx)
static

Definition at line 256 of file vf_overlay_opencl.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( overlay_opencl  )

Variable Documentation

◆ overlay_opencl_options

const AVOption overlay_opencl_options[]
static
Initial value:
= {
{ "x", "Overlay x position",
OFFSET(x_position), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
{ "y", "Overlay y position",
OFFSET(y_position), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
{ NULL },
}

Definition at line 282 of file vf_overlay_opencl.c.

◆ overlay_opencl_inputs

const AVFilterPad overlay_opencl_inputs[]
static
Initial value:
= {
{
.name = "main",
},
{
.name = "overlay",
},
}

Definition at line 292 of file vf_overlay_opencl.c.

◆ overlay_opencl_outputs

const AVFilterPad overlay_opencl_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = &overlay_opencl_config_output,
},
}

Definition at line 305 of file vf_overlay_opencl.c.

◆ ff_vf_overlay_opencl

const AVFilter ff_vf_overlay_opencl
Initial value:
= {
.name = "overlay_opencl",
.description = NULL_IF_CONFIG_SMALL("Overlay one video on top of another"),
.priv_size = sizeof(OverlayOpenCLContext),
.priv_class = &overlay_opencl_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 313 of file vf_overlay_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:351
overlay_opencl_activate
static int overlay_opencl_activate(AVFilterContext *avctx)
Definition: vf_overlay_opencl.c:249
OverlayOpenCLContext
Definition: vf_overlay_opencl.c:30
overlay_opencl_inputs
static const AVFilterPad overlay_opencl_inputs[]
Definition: vf_overlay_opencl.c:292
overlay_opencl_init
static av_cold int overlay_opencl_init(AVFilterContext *avctx)
Definition: vf_overlay_opencl.c:240
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:182
NULL
#define NULL
Definition: coverity.c:32
activate
filter_frame For filters that do not use the activate() callback
OFFSET
#define OFFSET(x)
Definition: vf_overlay_opencl.c:280
AV_PIX_FMT_OPENCL
@ AV_PIX_FMT_OPENCL
Hardware surfaces for OpenCL.
Definition: pixfmt.h:358
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
overlay_opencl_config_output
static int overlay_opencl_config_output(AVFilterLink *outlink)
Definition: vf_overlay_opencl.c:223
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:106
AVFILTER_FLAG_HWDEVICE
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition: avfilter.h:138
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
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: internal.h:172
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
FLAGS
#define FLAGS
Definition: vf_overlay_opencl.c:281
overlay_opencl_uninit
static av_cold void overlay_opencl_uninit(AVFilterContext *avctx)
Definition: vf_overlay_opencl.c:256
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:235
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
overlay_opencl_outputs
static const AVFilterPad overlay_opencl_outputs[]
Definition: vf_overlay_opencl.c:305