FFmpeg  4.3
Data Structures | Macros | Functions | Variables
vf_overlay_vulkan.c File Reference
#include "libavutil/random_seed.h"
#include "libavutil/opt.h"
#include "vulkan.h"
#include "internal.h"
#include "framesync.h"

Go to the source code of this file.

Data Structures

struct  OverlayVulkanContext
 

Macros

#define CGROUPS   (int [3]){ 32, 32, 1 }
 
#define OFFSET(x)   offsetof(OverlayVulkanContext, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

static av_cold int init_filter (AVFilterContext *ctx)
 
static int process_frames (AVFilterContext *avctx, AVFrame *out_f, AVFrame *main_f, AVFrame *overlay_f)
 
static int overlay_vulkan_blend (FFFrameSync *fs)
 
static int overlay_vulkan_config_output (AVFilterLink *outlink)
 
static int overlay_vulkan_activate (AVFilterContext *avctx)
 
static av_cold int overlay_vulkan_init (AVFilterContext *avctx)
 
static void overlay_vulkan_uninit (AVFilterContext *avctx)
 
 AVFILTER_DEFINE_CLASS (overlay_vulkan)
 

Variables

static const char overlay_noalpha []
 
static const char overlay_alpha []
 
static const AVOption overlay_vulkan_options []
 
static const AVFilterPad overlay_vulkan_inputs []
 
static const AVFilterPad overlay_vulkan_outputs []
 
AVFilter ff_vf_overlay_vulkan
 

Macro Definition Documentation

◆ CGROUPS

#define CGROUPS   (int [3]){ 32, 32, 1 }

Definition at line 25 of file vf_overlay_vulkan.c.

◆ OFFSET

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

Definition at line 445 of file vf_overlay_vulkan.c.

◆ FLAGS

Definition at line 446 of file vf_overlay_vulkan.c.

Function Documentation

◆ init_filter()

static av_cold int init_filter ( AVFilterContext ctx)
static

Definition at line 79 of file vf_overlay_vulkan.c.

Referenced by overlay_vulkan_blend().

◆ process_frames()

static int process_frames ( AVFilterContext avctx,
AVFrame out_f,
AVFrame main_f,
AVFrame overlay_f 
)
static

Definition at line 229 of file vf_overlay_vulkan.c.

Referenced by overlay_vulkan_blend().

◆ overlay_vulkan_blend()

static int overlay_vulkan_blend ( FFFrameSync fs)
static

Definition at line 349 of file vf_overlay_vulkan.c.

Referenced by overlay_vulkan_init().

◆ overlay_vulkan_config_output()

static int overlay_vulkan_config_output ( AVFilterLink outlink)
static

Definition at line 400 of file vf_overlay_vulkan.c.

◆ overlay_vulkan_activate()

static int overlay_vulkan_activate ( AVFilterContext avctx)
static

Definition at line 417 of file vf_overlay_vulkan.c.

◆ overlay_vulkan_init()

static av_cold int overlay_vulkan_init ( AVFilterContext avctx)
static

Definition at line 424 of file vf_overlay_vulkan.c.

◆ overlay_vulkan_uninit()

static void overlay_vulkan_uninit ( AVFilterContext avctx)
static

Definition at line 433 of file vf_overlay_vulkan.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( overlay_vulkan  )

Variable Documentation

◆ overlay_noalpha

const char overlay_noalpha[]
static
Initial value:
= {
C(0, void overlay_noalpha(int i, ivec2 pos) )
C(0, { )
C(1, if ((o_offset[i].x <= pos.x) && (o_offset[i].y <= pos.y) &&
(pos.x < (o_offset[i].x + o_size[i].x)) &&
(pos.y < (o_offset[i].y + o_size[i].y))) { )
C(2, vec4 res = texture(overlay_img[i], pos - o_offset[i]); )
C(2, imageStore(output_img[i], pos, res); )
C(1, } else { )
C(2, vec4 res = texture(main_img[i], pos); )
C(2, imageStore(output_img[i], pos, res); )
C(1, } )
C(0, } )
}

Definition at line 48 of file vf_overlay_vulkan.c.

Referenced by init_filter().

◆ overlay_alpha

const char overlay_alpha[]
static
Initial value:
= {
C(0, void overlay_alpha_opaque(int i, ivec2 pos) )
C(0, { )
C(1, vec4 res = texture(main_img[i], pos); )
C(1, if ((o_offset[i].x <= pos.x) && (o_offset[i].y <= pos.y) &&
(pos.x < (o_offset[i].x + o_size[i].x)) &&
(pos.y < (o_offset[i].y + o_size[i].y))) { )
C(2, vec4 ovr = texture(overlay_img[i], pos - o_offset[i]); )
C(2, res = ovr * ovr.a + res * (1.0f - ovr.a); )
C(2, res.a = 1.0f; )
C(2, imageStore(output_img[i], pos, res); )
C(1, } )
C(1, imageStore(output_img[i], pos, res); )
C(0, } )
}

Definition at line 63 of file vf_overlay_vulkan.c.

Referenced by init_filter().

◆ overlay_vulkan_options

const AVOption overlay_vulkan_options[]
static
Initial value:
= {
{ "x", "Set horizontal offset", OFFSET(overlay_x), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, .flags = FLAGS },
{ "y", "Set vertical offset", OFFSET(overlay_y), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, .flags = FLAGS },
{ NULL },
}

Definition at line 447 of file vf_overlay_vulkan.c.

◆ overlay_vulkan_inputs

const AVFilterPad overlay_vulkan_inputs[]
static
Initial value:
= {
{
.name = "main",
.config_props = &ff_vk_filter_config_input,
},
{
.name = "overlay",
.config_props = &ff_vk_filter_config_input,
},
{ NULL }
}

Definition at line 455 of file vf_overlay_vulkan.c.

◆ overlay_vulkan_outputs

const AVFilterPad overlay_vulkan_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = &overlay_vulkan_config_output,
},
{ NULL }
}

Definition at line 469 of file vf_overlay_vulkan.c.

◆ ff_vf_overlay_vulkan

AVFilter ff_vf_overlay_vulkan
Initial value:
= {
.name = "overlay_vulkan",
.description = NULL_IF_CONFIG_SMALL("Overlay a source on top of another"),
.priv_size = sizeof(OverlayVulkanContext),
.priv_class = &overlay_vulkan_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 478 of file vf_overlay_vulkan.c.

ff_vk_filter_query_formats
int ff_vk_filter_query_formats(AVFilterContext *avctx)
General lavfi IO functions.
Definition: vulkan.c:592
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
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:365
overlay_noalpha
static const char overlay_noalpha[]
Definition: vf_overlay_vulkan.c:48
overlay_vulkan_activate
static int overlay_vulkan_activate(AVFilterContext *avctx)
Definition: vf_overlay_vulkan.c:417
overlay_vulkan_config_output
static int overlay_vulkan_config_output(AVFilterLink *outlink)
Definition: vf_overlay_vulkan.c:400
overlay_vulkan_outputs
static const AVFilterPad overlay_vulkan_outputs[]
Definition: vf_overlay_vulkan.c:469
x
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo x
Definition: fate.txt:150
C
s EdgeDetect Foobar g libavfilter vf_edgedetect c libavfilter vf_foobar c edit libavfilter and add an entry for foobar following the pattern of the other filters edit libavfilter allfilters and add an entry for foobar following the pattern of the other filters configure make j< whatever > ffmpeg ffmpeg i you should get a foobar png with Lena edge detected That s your new playground is ready Some little details about what s going which in turn will define variables for the build system and the C
Definition: writing_filters.txt:58
ff_vk_filter_config_input
int ff_vk_filter_config_input(AVFilterLink *inlink)
Definition: vulkan.c:635
FLAGS
#define FLAGS
Definition: vf_overlay_vulkan.c:446
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
OFFSET
#define OFFSET(x)
Definition: vf_overlay_vulkan.c:445
NULL
#define NULL
Definition: coverity.c:32
overlay_vulkan_inputs
static const AVFilterPad overlay_vulkan_inputs[]
Definition: vf_overlay_vulkan.c:455
activate
filter_frame For filters that do not use the activate() callback
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
overlay_vulkan_init
static av_cold int overlay_vulkan_init(AVFilterContext *avctx)
Definition: vf_overlay_vulkan.c:424
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:186
OverlayVulkanContext
Definition: vf_overlay_vulkan.c:27
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
pos
unsigned int pos
Definition: spdifenc.c:410
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:223
overlay_vulkan_uninit
static void overlay_vulkan_uninit(AVFilterContext *avctx)
Definition: vf_overlay_vulkan.c:433
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
query_formats
static int query_formats(AVFilterContext *ctx)
Definition: aeval.c:244
uninit
static av_cold int uninit(AVCodecContext *avctx)
Definition: crystalhd.c:279