FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vsrc_testsrc_vulkan.c File Reference
#include "libavutil/random_seed.h"
#include "libavutil/csp.h"
#include "libavutil/opt.h"
#include "libavutil/vulkan_spirv.h"
#include "vulkan_filter.h"
#include "filters.h"
#include "colorspace.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  TestSrcVulkanPushData
 
struct  TestSrcVulkanContext
 

Macros

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

Enumerations

enum  TestSrcVulkanMode { TESTSRC_COLOR }
 

Functions

static av_cold int init_filter (AVFilterContext *ctx, enum TestSrcVulkanMode mode)
 
static int testsrc_vulkan_activate (AVFilterContext *ctx)
 
static int testsrc_vulkan_config_props (AVFilterLink *outlink)
 
static void testsrc_vulkan_uninit (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (color_vulkan)
 

Variables

static const AVOption color_vulkan_options []
 
static const AVFilterPad testsrc_vulkan_outputs []
 
const AVFilter ff_vsrc_color_vulkan
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 320 of file vsrc_testsrc_vulkan.c.

◆ FLAGS

Definition at line 321 of file vsrc_testsrc_vulkan.c.

◆ COMMON_OPTS

#define COMMON_OPTS
Value:
{ "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, { .str = "1920x1080" }, 0, 0, FLAGS }, \
{ "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, { .str = "1920x1080" }, 0, 0, FLAGS }, \
\
{ "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, { .str = "60" }, 0, INT_MAX, FLAGS }, \
{ "r", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, { .str = "60" }, 0, INT_MAX, FLAGS }, \
\
{ "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, FLAGS }, \
{ "d", "set video duration", OFFSET(duration), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT64_MAX, FLAGS }, \
\
{ "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, { .dbl = 1 }, 0, INT_MAX, FLAGS }, \
\
{ "format", "Output video format (software format of hardware frames)", OFFSET(out_format_string), AV_OPT_TYPE_STRING, .flags = FLAGS },

Definition at line 323 of file vsrc_testsrc_vulkan.c.

Enumeration Type Documentation

◆ TestSrcVulkanMode

Enumerator
TESTSRC_COLOR 

Definition at line 30 of file vsrc_testsrc_vulkan.c.

Function Documentation

◆ init_filter()

static av_cold int init_filter ( AVFilterContext ctx,
enum TestSrcVulkanMode  mode 
)
static

Definition at line 65 of file vsrc_testsrc_vulkan.c.

Referenced by testsrc_vulkan_activate().

◆ testsrc_vulkan_activate()

static int testsrc_vulkan_activate ( AVFilterContext ctx)
static

Definition at line 199 of file vsrc_testsrc_vulkan.c.

◆ testsrc_vulkan_config_props()

static int testsrc_vulkan_config_props ( AVFilterLink outlink)
static

Definition at line 264 of file vsrc_testsrc_vulkan.c.

◆ testsrc_vulkan_uninit()

static void testsrc_vulkan_uninit ( AVFilterContext avctx)
static

Definition at line 305 of file vsrc_testsrc_vulkan.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( color_vulkan  )

Variable Documentation

◆ color_vulkan_options

const AVOption color_vulkan_options[]
static
Initial value:
= {
{ "color", "set color", OFFSET(color_rgba), AV_OPT_TYPE_COLOR, {.str = "black"}, 0, 0, FLAGS },
{ "c", "set color", OFFSET(color_rgba), AV_OPT_TYPE_COLOR, {.str = "black"}, 0, 0, FLAGS },
{ "out_range", "Output colour range (from 0 to 2) (default 0)", OFFSET(out_range), AV_OPT_TYPE_INT, {.i64 = AVCOL_RANGE_UNSPECIFIED}, AVCOL_RANGE_UNSPECIFIED, AVCOL_RANGE_JPEG, .flags = FLAGS, .unit = "range" },
{ "full", "Full range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, .unit = "range" },
{ "limited", "Limited range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, .unit = "range" },
{ "jpeg", "Full range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, .unit = "range" },
{ "mpeg", "Limited range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, .unit = "range" },
{ "tv", "Limited range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_MPEG }, 0, 0, FLAGS, .unit = "range" },
{ "pc", "Full range", 0, AV_OPT_TYPE_CONST, { .i64 = AVCOL_RANGE_JPEG }, 0, 0, FLAGS, .unit = "range" },
{ NULL },
}

Definition at line 337 of file vsrc_testsrc_vulkan.c.

◆ testsrc_vulkan_outputs

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

Definition at line 353 of file vsrc_testsrc_vulkan.c.

◆ ff_vsrc_color_vulkan

const AVFilter ff_vsrc_color_vulkan
Initial value:
= {
.name = "color_vulkan",
.description = NULL_IF_CONFIG_SMALL("Generate a constant color (Vulkan)"),
.priv_size = sizeof(TestSrcVulkanContext),
.priv_class = &color_vulkan_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 361 of file vsrc_testsrc_vulkan.c.

testsrc_vulkan_uninit
static void testsrc_vulkan_uninit(AVFilterContext *avctx)
Definition: vsrc_testsrc_vulkan.c:305
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
Underlying C type is AVRational.
Definition: opt.h:315
ff_vk_filter_init
int ff_vk_filter_init(AVFilterContext *avctx)
General lavfi IO functions.
Definition: vulkan_filter.c:233
w
uint8_t w
Definition: llviddspenc.c:38
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:717
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Underlying C type is int64_t.
Definition: opt.h:319
AV_OPT_TYPE_RATIONAL
@ AV_OPT_TYPE_RATIONAL
Underlying C type is AVRational.
Definition: opt.h:280
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:379
COMMON_OPTS
#define COMMON_OPTS
Definition: vsrc_testsrc_vulkan.c:323
OFFSET
#define OFFSET(x)
Definition: vsrc_testsrc_vulkan.c:320
FLAGS
#define FLAGS
Definition: vsrc_testsrc_vulkan.c:321
duration
int64_t duration
Definition: movenc.c:65
testsrc_vulkan_activate
static int testsrc_vulkan_activate(AVFilterContext *ctx)
Definition: vsrc_testsrc_vulkan.c:199
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: filters.h:263
NULL
#define NULL
Definition: coverity.c:32
activate
filter_frame For filters that do not use the activate() callback
AV_OPT_TYPE_COLOR
@ AV_OPT_TYPE_COLOR
Underlying C type is uint8_t[4].
Definition: opt.h:323
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
Underlying C type is two consecutive integers.
Definition: opt.h:303
testsrc_vulkan_outputs
static const AVFilterPad testsrc_vulkan_outputs[]
Definition: vsrc_testsrc_vulkan.c:353
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
AVCOL_RANGE_UNSPECIFIED
@ AVCOL_RANGE_UNSPECIFIED
Definition: pixfmt.h:683
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
AVFILTER_FLAG_HWDEVICE
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition: avfilter.h:173
uninit
static void uninit(AVBSFContext *ctx)
Definition: pcm_rechunk.c:68
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:700
TestSrcVulkanContext
Definition: vsrc_testsrc_vulkan.c:38
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
testsrc_vulkan_config_props
static int testsrc_vulkan_config_props(AVFilterLink *outlink)
Definition: vsrc_testsrc_vulkan.c:264
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
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
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: filters.h:252