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 "vulkan_filter.h"
#include "vulkan_spirv.h"
#include "internal.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 322 of file vsrc_testsrc_vulkan.c.

◆ FLAGS

Definition at line 323 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 325 of file vsrc_testsrc_vulkan.c.

Enumeration Type Documentation

◆ TestSrcVulkanMode

Enumerator
TESTSRC_COLOR 

Definition at line 31 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 67 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 201 of file vsrc_testsrc_vulkan.c.

◆ testsrc_vulkan_config_props()

static int testsrc_vulkan_config_props ( AVFilterLink outlink)
static

Definition at line 266 of file vsrc_testsrc_vulkan.c.

◆ testsrc_vulkan_uninit()

static void testsrc_vulkan_uninit ( AVFilterContext avctx)
static

Definition at line 306 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 339 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 355 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 363 of file vsrc_testsrc_vulkan.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:343
testsrc_vulkan_uninit
static void testsrc_vulkan_uninit(AVFilterContext *avctx)
Definition: vsrc_testsrc_vulkan.c:306
AV_OPT_TYPE_VIDEO_RATE
@ AV_OPT_TYPE_VIDEO_RATE
offset must point to AVRational
Definition: opt.h:238
ff_vk_filter_init
int ff_vk_filter_init(AVFilterContext *avctx)
General lavfi IO functions.
Definition: vulkan_filter.c:219
w
uint8_t w
Definition: llviddspenc.c:38
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:687
AV_OPT_TYPE_DURATION
@ AV_OPT_TYPE_DURATION
Definition: opt.h:239
AV_OPT_TYPE_RATIONAL
@ AV_OPT_TYPE_RATIONAL
Definition: opt.h:230
AV_PIX_FMT_VULKAN
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition: pixfmt.h:383
COMMON_OPTS
#define COMMON_OPTS
Definition: vsrc_testsrc_vulkan.c:325
OFFSET
#define OFFSET(x)
Definition: vsrc_testsrc_vulkan.c:322
FLAGS
#define FLAGS
Definition: vsrc_testsrc_vulkan.c:323
duration
int64_t duration
Definition: movenc.c:64
testsrc_vulkan_activate
static int testsrc_vulkan_activate(AVFilterContext *ctx)
Definition: vsrc_testsrc_vulkan.c:201
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
Definition: opt.h:240
AV_OPT_TYPE_IMAGE_SIZE
@ AV_OPT_TYPE_IMAGE_SIZE
offset must point to two consecutive integers
Definition: opt.h:235
testsrc_vulkan_outputs
static const AVFilterPad testsrc_vulkan_outputs[]
Definition: vsrc_testsrc_vulkan.c:355
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:653
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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
FILTER_SINGLE_PIXFMT
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition: internal.h:172
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:670
TestSrcVulkanContext
Definition: vsrc_testsrc_vulkan.c:39
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
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:266
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:183
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Definition: opt.h:229
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:234