FFmpeg
Macros | Functions | Variables
stack_internal.c File Reference

Go to the source code of this file.

Macros

#define OFFSET(x)   offsetof(StackHWContext, x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_FILTERING_PARAM)
 
#define SET_OUTPUT_REGION(region, rx, ry, rw, rh)
 
#define STACK_COMMON_OPTS
 
#define DEFINE_HSTACK_OPTIONS(api)
 
#define DEFINE_VSTACK_OPTIONS(api)
 
#define DEFINE_XSTACK_OPTIONS(api)
 
#define DEFINE_STACK_FILTER(category, api, capi, filter_flags)
 

Functions

static int init_framesync (AVFilterContext *avctx)
 
static int config_comm_output (AVFilterLink *outlink)
 
static int stack_init (AVFilterContext *avctx)
 
static av_cold void stack_uninit (AVFilterContext *avctx)
 
static int stack_activate (AVFilterContext *avctx)
 

Variables

static const AVFilterPad stack_outputs []
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 19 of file stack_internal.c.

◆ FLAGS

Definition at line 20 of file stack_internal.c.

◆ SET_OUTPUT_REGION

#define SET_OUTPUT_REGION (   region,
  rx,
  ry,
  rw,
  rh 
)
Value:
do { \
region->x = rx; \
region->y = ry; \
region->width = rw; \
region->height = rh; \
} while (0)

Definition at line 22 of file stack_internal.c.

◆ STACK_COMMON_OPTS

#define STACK_COMMON_OPTS
Value:
{ "inputs", "Set number of inputs", OFFSET(base.nb_inputs), AV_OPT_TYPE_INT, { .i64 = 2 }, 2, UINT16_MAX, .flags = FLAGS }, \
{ "shortest", "Force termination when the shortest input terminates", OFFSET(base.shortest), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },

Definition at line 310 of file stack_internal.c.

◆ DEFINE_HSTACK_OPTIONS

#define DEFINE_HSTACK_OPTIONS (   api)
Value:
static const AVOption hstack_##api##_options[] = { \
STACK_COMMON_OPTS \
{ "height", "Set output height (0 to use the height of input 0)", OFFSET(base.tile_height), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, FLAGS }, \
{ NULL } \
}

Definition at line 314 of file stack_internal.c.

◆ DEFINE_VSTACK_OPTIONS

#define DEFINE_VSTACK_OPTIONS (   api)
Value:
static const AVOption vstack_##api##_options[] = { \
STACK_COMMON_OPTS \
{ "width", "Set output width (0 to use the width of input 0)", OFFSET(base.tile_width), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, FLAGS }, \
{ NULL } \
}

Definition at line 321 of file stack_internal.c.

◆ DEFINE_XSTACK_OPTIONS

#define DEFINE_XSTACK_OPTIONS (   api)
Value:
static const AVOption xstack_##api##_options[] = { \
STACK_COMMON_OPTS \
{ "layout", "Set custom layout", OFFSET(base.layout), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, .flags = FLAGS }, \
{ "grid", "set fixed size grid layout", OFFSET(base.nb_grid_columns), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, .flags = FLAGS }, \
{ "grid_tile_size", "set tile size in grid layout", OFFSET(base.tile_width), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, .flags = FLAGS }, \
{ "fill", "Set the color for unused pixels", OFFSET(base.fillcolor_str), AV_OPT_TYPE_STRING, {.str = "none"}, .flags = FLAGS }, \
{ NULL } \
}

Definition at line 328 of file stack_internal.c.

◆ DEFINE_STACK_FILTER

#define DEFINE_STACK_FILTER (   category,
  api,
  capi,
  filter_flags 
)
Value:
static const AVClass category##_##api##_class = { \
.class_name = #category "_" #api, \
.item_name = av_default_item_name, \
.option = category##_##api##_options, \
.version = LIBAVUTIL_VERSION_INT, \
}; \
const AVFilter ff_vf_##category##_##api = { \
.name = #category "_" #api, \
.description = NULL_IF_CONFIG_SMALL(#capi " " #category), \
.priv_size = sizeof(StackHWContext), \
.priv_class = &category##_##api##_class, \
.init = api##_stack_init, \
.uninit = api##_stack_uninit, \
FILTER_PIXFMTS_ARRAY(api ## _stack_pix_fmts), \
FILTER_OUTPUTS(stack_outputs), \
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, \
.flags = AVFILTER_FLAG_DYNAMIC_INPUTS | filter_flags, \
}

Definition at line 338 of file stack_internal.c.

Function Documentation

◆ init_framesync()

static int init_framesync ( AVFilterContext avctx)
static

Definition at line 29 of file stack_internal.c.

Referenced by config_comm_output().

◆ config_comm_output()

static int config_comm_output ( AVFilterLink outlink)
static

Definition at line 53 of file stack_internal.c.

Referenced by config_output().

◆ stack_init()

static int stack_init ( AVFilterContext avctx)
static

Definition at line 225 of file stack_internal.c.

Referenced by qsv_stack_init(), and vaapi_stack_init().

◆ stack_uninit()

static av_cold void stack_uninit ( AVFilterContext avctx)
static

Definition at line 288 of file stack_internal.c.

Referenced by qsv_stack_uninit(), and vaapi_stack_uninit().

◆ stack_activate()

static int stack_activate ( AVFilterContext avctx)
static

Definition at line 296 of file stack_internal.c.

Variable Documentation

◆ stack_outputs

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

Definition at line 302 of file stack_internal.c.

FILTER_PIXFMTS_ARRAY
#define FILTER_PIXFMTS_ARRAY(array)
Definition: filters.h:242
AVOption
AVOption.
Definition: opt.h:429
base
uint8_t base
Definition: vp3data.h:128
category
category
Definition: openal-dec.c:249
OFFSET
#define OFFSET(x)
Definition: stack_internal.c:19
FLAGS
#define FLAGS
Definition: stack_internal.c:20
AVFILTER_FLAG_DYNAMIC_INPUTS
#define AVFILTER_FLAG_DYNAMIC_INPUTS
The number of the filter inputs is not determined just by AVFilter.inputs.
Definition: avfilter.h:141
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:75
NULL
#define NULL
Definition: coverity.c:32
activate
filter_frame For filters that do not use the activate() callback
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition: opt.h:303
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
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: filters.h:206
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
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:94
config_output
static int config_output(AVFilterLink *outlink)
Definition: af_aap.c:190
stack_outputs
static const AVFilterPad stack_outputs[]
Definition: stack_internal.c:302
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
AVFilter
Filter definition.
Definition: avfilter.h:201
stack_activate
static int stack_activate(AVFilterContext *avctx)
Definition: stack_internal.c:296
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
_
#define _
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276
StackHWContext
#define StackHWContext
Definition: vf_stack_qsv.c:49