lavfi/vulkan: split off lavfi-specific code into vulkan_filter.c
The issue is that libavfilter depends on libavcodec, and when doing a
static build, if libavcodec also includes "libavfilter/vulkan.c", then
during link-time, compiling programs will fail as there would be multiple
definitions of the same symbols in both libavfilter and libavcodec's
object files.
Linkers are, however, more permitting if both files that include
a common file that's used as a template are one-to-one identical.
Hence, to make both files the same in the future, export all avfilter
specific functions to a separate file.
There is some work in progress to make templated files like this be
compiled only once, so this is not a long-term solution.
This also removes a macro that could be used to toggle SPIRV compilation
capability on #include-time, as this could cause the files to be different.
2021-11-19 16:13:35 +02:00
|
|
|
/*
|
2023-02-17 04:10:58 +02:00
|
|
|
* Copyright (c) Lynne
|
|
|
|
*
|
lavfi/vulkan: split off lavfi-specific code into vulkan_filter.c
The issue is that libavfilter depends on libavcodec, and when doing a
static build, if libavcodec also includes "libavfilter/vulkan.c", then
during link-time, compiling programs will fail as there would be multiple
definitions of the same symbols in both libavfilter and libavcodec's
object files.
Linkers are, however, more permitting if both files that include
a common file that's used as a template are one-to-one identical.
Hence, to make both files the same in the future, export all avfilter
specific functions to a separate file.
There is some work in progress to make templated files like this be
compiled only once, so this is not a long-term solution.
This also removes a macro that could be used to toggle SPIRV compilation
capability on #include-time, as this could cause the files to be different.
2021-11-19 16:13:35 +02:00
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AVFILTER_VULKAN_FILTER_H
|
|
|
|
#define AVFILTER_VULKAN_FILTER_H
|
|
|
|
|
|
|
|
#include "avfilter.h"
|
|
|
|
|
|
|
|
#include "vulkan.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* General lavfi IO functions
|
|
|
|
*/
|
2023-02-17 04:10:58 +02:00
|
|
|
int ff_vk_filter_init (AVFilterContext *avctx);
|
|
|
|
int ff_vk_filter_config_input (AVFilterLink *inlink);
|
|
|
|
int ff_vk_filter_config_output(AVFilterLink *outlink);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Can be called manually, if not using ff_vk_filter_config_output.
|
|
|
|
*/
|
|
|
|
int ff_vk_filter_init_context(AVFilterContext *avctx, FFVulkanContext *s,
|
|
|
|
AVBufferRef *frames_ref,
|
|
|
|
int width, int height, enum AVPixelFormat sw_format);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Submit a compute shader with a zero/one input and single out for execution.
|
|
|
|
*/
|
|
|
|
int ff_vk_filter_process_simple(FFVulkanContext *vkctx, FFVkExecPool *e,
|
|
|
|
FFVulkanPipeline *pl, AVFrame *out_f, AVFrame *in_f,
|
|
|
|
VkSampler sampler, void *push_src, size_t push_size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Submit a compute shader with a single in and single out with 2 stages.
|
|
|
|
*/
|
|
|
|
int ff_vk_filter_process_2pass(FFVulkanContext *vkctx, FFVkExecPool *e,
|
|
|
|
FFVulkanPipeline *pls[2],
|
|
|
|
AVFrame *out, AVFrame *tmp, AVFrame *in,
|
|
|
|
VkSampler sampler, void *push_src, size_t push_size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Up to 16 inputs, one output
|
|
|
|
*/
|
|
|
|
int ff_vk_filter_process_Nin(FFVulkanContext *vkctx, FFVkExecPool *e,
|
|
|
|
FFVulkanPipeline *pl,
|
|
|
|
AVFrame *out, AVFrame *in[], int nb_in,
|
|
|
|
VkSampler sampler, void *push_src, size_t push_size);
|
lavfi/vulkan: split off lavfi-specific code into vulkan_filter.c
The issue is that libavfilter depends on libavcodec, and when doing a
static build, if libavcodec also includes "libavfilter/vulkan.c", then
during link-time, compiling programs will fail as there would be multiple
definitions of the same symbols in both libavfilter and libavcodec's
object files.
Linkers are, however, more permitting if both files that include
a common file that's used as a template are one-to-one identical.
Hence, to make both files the same in the future, export all avfilter
specific functions to a separate file.
There is some work in progress to make templated files like this be
compiled only once, so this is not a long-term solution.
This also removes a macro that could be used to toggle SPIRV compilation
capability on #include-time, as this could cause the files to be different.
2021-11-19 16:13:35 +02:00
|
|
|
|
|
|
|
#endif /* AVFILTER_VULKAN_FILTER_H */
|