History

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.

Lynne committed 4 years ago

Commit f6dd30d1 parent e7f327913 files · +240 −200Browse files

Unified · Split

13 files
  1. libavfilter/Makefile +6 −6
  2. libavfilter/vf_avgblur_vulkan.c +1 −1
  3. libavfilter/vf_chromaber_vulkan.c +1 −1
  4. libavfilter/vf_gblur_vulkan.c +1 −1
  5. libavfilter/vf_libplacebo.c +1 −1
  6. libavfilter/vf_overlay_vulkan.c +1 −1
  7. libavfilter/vf_scale_vulkan.c +1 −1
  8. libavfilter/vulkan.c +0 −173
  9. libavfilter/vulkan.h +0 −9
  10. libavfilter/vulkan_filter.c +191 −0
  11. libavfilter/vulkan_filter.h +34 −0
  12. libavutil/vulkan.c +2 −2
  13. libavutil/vulkan.h +1 −4
libavfilter/Makefile+6−6
@@ -180,7 +180,7 @@ OBJS-$(CONFIG_ATADENOISE_FILTER) += vf_atadenoise.o · 179 unmodified lines
180180 OBJS-$(CONFIG_AVGBLUR_FILTER) += vf_avgblur.o
181181 OBJS-$(CONFIG_AVGBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o opencl.o \
182182 opencl/avgblur.o boxblur.o
183−OBJS-$(CONFIG_AVGBLUR_VULKAN_FILTER) += vf_avgblur_vulkan.o vulkan.o
183+OBJS-$(CONFIG_AVGBLUR_VULKAN_FILTER) += vf_avgblur_vulkan.o vulkan.o vulkan_filter.o
184184 OBJS-$(CONFIG_BBOX_FILTER) += bbox.o vf_bbox.o
185185 OBJS-$(CONFIG_BENCH_FILTER) += f_bench.o
186186 OBJS-$(CONFIG_BILATERAL_FILTER) += vf_bilateral.o
@@ -194,7 +194,7 @@ OBJS-$(CONFIG_BOXBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o opencl.o \ · 7 unmodified lines
194194 opencl/avgblur.o boxblur.o
195195 OBJS-$(CONFIG_BWDIF_FILTER) += vf_bwdif.o yadif_common.o
196196 OBJS-$(CONFIG_CAS_FILTER) += vf_cas.o
197−OBJS-$(CONFIG_CHROMABER_VULKAN_FILTER) += vf_chromaber_vulkan.o vulkan.o
197+OBJS-$(CONFIG_CHROMABER_VULKAN_FILTER) += vf_chromaber_vulkan.o vulkan.o vulkan_filter.o
198198 OBJS-$(CONFIG_CHROMAHOLD_FILTER) += vf_chromakey.o
199199 OBJS-$(CONFIG_CHROMAKEY_FILTER) += vf_chromakey.o
200200 OBJS-$(CONFIG_CHROMANR_FILTER) += vf_chromanr.o
@@ -289,7 +289,7 @@ OBJS-$(CONFIG_FREEZEFRAMES_FILTER) += vf_freezeframes.o · 88 unmodified lines
289289 OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o
290290 OBJS-$(CONFIG_FSPP_FILTER) += vf_fspp.o qp_table.o
291291 OBJS-$(CONFIG_GBLUR_FILTER) += vf_gblur.o
292−OBJS-$(CONFIG_GBLUR_VULKAN_FILTER) += vf_gblur_vulkan.o vulkan.o
292+OBJS-$(CONFIG_GBLUR_VULKAN_FILTER) += vf_gblur_vulkan.o vulkan.o vulkan_filter.o
293293 OBJS-$(CONFIG_GEQ_FILTER) += vf_geq.o
294294 OBJS-$(CONFIG_GRADFUN_FILTER) += vf_gradfun.o
295295 OBJS-$(CONFIG_GRAPHMONITOR_FILTER) += f_graphmonitor.o
@@ -324,7 +324,7 @@ OBJS-$(CONFIG_LAGFUN_FILTER) += vf_lagfun.o · 28 unmodified lines
324324 OBJS-$(CONFIG_LATENCY_FILTER) += f_latency.o
325325 OBJS-$(CONFIG_LENSCORRECTION_FILTER) += vf_lenscorrection.o
326326 OBJS-$(CONFIG_LENSFUN_FILTER) += vf_lensfun.o
327−OBJS-$(CONFIG_LIBPLACEBO_FILTER) += vf_libplacebo.o vulkan.o
327+OBJS-$(CONFIG_LIBPLACEBO_FILTER) += vf_libplacebo.o vulkan.o vulkan_filter.o
328328 OBJS-$(CONFIG_LIBVMAF_FILTER) += vf_libvmaf.o framesync.o
329329 OBJS-$(CONFIG_LIMITDIFF_FILTER) += vf_limitdiff.o framesync.o
330330 OBJS-$(CONFIG_LIMITER_FILTER) += vf_limiter.o
@@ -370,7 +370,7 @@ OBJS-$(CONFIG_OVERLAY_CUDA_FILTER) += vf_overlay_cuda.o framesync.o vf · 39 unmodified lines
370370 OBJS-$(CONFIG_OVERLAY_OPENCL_FILTER) += vf_overlay_opencl.o opencl.o \
371371 opencl/overlay.o framesync.o
372372 OBJS-$(CONFIG_OVERLAY_QSV_FILTER) += vf_overlay_qsv.o framesync.o
373−OBJS-$(CONFIG_OVERLAY_VULKAN_FILTER) += vf_overlay_vulkan.o vulkan.o
373+OBJS-$(CONFIG_OVERLAY_VULKAN_FILTER) += vf_overlay_vulkan.o vulkan.o vulkan_filter.o
374374 OBJS-$(CONFIG_OWDENOISE_FILTER) += vf_owdenoise.o
375375 OBJS-$(CONFIG_PAD_FILTER) += vf_pad.o
376376 OBJS-$(CONFIG_PAD_OPENCL_FILTER) += vf_pad_opencl.o opencl.o opencl/pad.o
@@ -415,7 +415,7 @@ OBJS-$(CONFIG_SCALE_CUDA_FILTER) += vf_scale_cuda.o scale_eval.o \ · 38 unmodified lines
415415 OBJS-$(CONFIG_SCALE_NPP_FILTER) += vf_scale_npp.o scale_eval.o
416416 OBJS-$(CONFIG_SCALE_QSV_FILTER) += vf_scale_qsv.o
417417 OBJS-$(CONFIG_SCALE_VAAPI_FILTER) += vf_scale_vaapi.o scale_eval.o vaapi_vpp.o
418−OBJS-$(CONFIG_SCALE_VULKAN_FILTER) += vf_scale_vulkan.o vulkan.o
418+OBJS-$(CONFIG_SCALE_VULKAN_FILTER) += vf_scale_vulkan.o vulkan.o vulkan_filter.o
419419 OBJS-$(CONFIG_SCALE2REF_FILTER) += vf_scale.o scale_eval.o
420420 OBJS-$(CONFIG_SCALE2REF_NPP_FILTER) += vf_scale_npp.o scale_eval.o
421421 OBJS-$(CONFIG_SCDET_FILTER) += vf_scdet.o
libavfilter/vf_avgblur_vulkan.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818
1919 #include "libavutil/random_seed.h"
2020 #include "libavutil/opt.h"
21−#include "vulkan.h"
21+#include "vulkan_filter.h"
2222 #include "internal.h"
2323
2424 #define CGS 32
libavfilter/vf_chromaber_vulkan.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818
1919 #include "libavutil/random_seed.h"
2020 #include "libavutil/opt.h"
21−#include "vulkan.h"
21+#include "vulkan_filter.h"
2222 #include "internal.h"
2323
2424 #define CGROUPS (int [3]){ 32, 32, 1 }
libavfilter/vf_gblur_vulkan.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919
2020 #include "libavutil/random_seed.h"
2121 #include "libavutil/opt.h"
22−#include "vulkan.h"
22+#include "vulkan_filter.h"
2323 #include "internal.h"
2424
2525 #define CGS 32
libavfilter/vf_libplacebo.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include "libavutil/file.h"
2020 #include "libavutil/opt.h"
2121 #include "internal.h"
22−#include "vulkan.h"
22+#include "vulkan_filter.h"
2323 #include "scale_eval.h"
2424
2525 #include <libplacebo/renderer.h>
libavfilter/vf_overlay_vulkan.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818
1919 #include "libavutil/random_seed.h"
2020 #include "libavutil/opt.h"
21−#include "vulkan.h"
21+#include "vulkan_filter.h"
2222 #include "internal.h"
2323 #include "framesync.h"
2424
libavfilter/vf_scale_vulkan.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818
1919 #include "libavutil/random_seed.h"
2020 #include "libavutil/opt.h"
21−#include "vulkan.h"
21+#include "vulkan_filter.h"
2222 #include "scale_eval.h"
2323 #include "internal.h"
2424 #include "colorspace.h"
libavfilter/vulkan.c+0−173
@@ -16,177 +16,4 @@ · 15 unmodified lines
1616 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1717 */
1818
19−#include "vulkan.h"
2019 #include "libavutil/vulkan.c"
21−
22−static int vulkan_filter_set_device(AVFilterContext *avctx,
23− AVBufferRef *device)
24−{
25− FFVulkanContext *s = avctx->priv;
26−
27− av_buffer_unref(&s->device_ref);
28−
29− s->device_ref = av_buffer_ref(device);
30− if (!s->device_ref)
31− return AVERROR(ENOMEM);
32−
33− s->device = (AVHWDeviceContext*)s->device_ref->data;
34− s->hwctx = s->device->hwctx;
35−
36− return 0;
37−}
38−
39−static int vulkan_filter_set_frames(AVFilterContext *avctx,
40− AVBufferRef *frames)
41−{
42− FFVulkanContext *s = avctx->priv;
43−
44− av_buffer_unref(&s->frames_ref);
45−
46− s->frames_ref = av_buffer_ref(frames);
47− if (!s->frames_ref)
48− return AVERROR(ENOMEM);
49−
50− return 0;
51−}
52−
53−int ff_vk_filter_config_input(AVFilterLink *inlink)
54−{
55− int err;
56− AVFilterContext *avctx = inlink->dst;
57− FFVulkanContext *s = avctx->priv;
58− FFVulkanFunctions *vk = &s->vkfn;
59− AVHWFramesContext *input_frames;
60−
61− if (!inlink->hw_frames_ctx) {
62− av_log(avctx, AV_LOG_ERROR, "Vulkan filtering requires a "
63− "hardware frames context on the input.\n");
64− return AVERROR(EINVAL);
65− }
66−
67− /* Extract the device and default output format from the first input. */
68− if (avctx->inputs[0] != inlink)
69− return 0;
70−
71− input_frames = (AVHWFramesContext *)inlink->hw_frames_ctx->data;
72− if (input_frames->format != AV_PIX_FMT_VULKAN)
73− return AVERROR(EINVAL);
74−
75− err = vulkan_filter_set_device(avctx, input_frames->device_ref);
76− if (err < 0)
77− return err;
78− err = vulkan_filter_set_frames(avctx, inlink->hw_frames_ctx);
79− if (err < 0)
80− return err;
81−
82− s->extensions = ff_vk_extensions_to_mask(s->hwctx->enabled_dev_extensions,
83− s->hwctx->nb_enabled_dev_extensions);
84−
85− err = ff_vk_load_functions(s->device, &s->vkfn, s->extensions, 1, 1);
86− if (err < 0)
87− return err;
88−
89− vk->GetPhysicalDeviceProperties(s->hwctx->phys_dev, &s->props);
90− vk->GetPhysicalDeviceMemoryProperties(s->hwctx->phys_dev, &s->mprops);
91−
92− /* Default output parameters match input parameters. */
93− s->input_format = input_frames->sw_format;
94− if (s->output_format == AV_PIX_FMT_NONE)
95− s->output_format = input_frames->sw_format;
96− if (!s->output_width)
97− s->output_width = inlink->w;
98− if (!s->output_height)
99− s->output_height = inlink->h;
100−
101− return 0;
102−}
103−
104−int ff_vk_filter_config_output_inplace(AVFilterLink *outlink)
105−{
106− int err;
107− AVFilterContext *avctx = outlink->src;
108− FFVulkanContext *s = avctx->priv;
109−
110− av_buffer_unref(&outlink->hw_frames_ctx);
111−
112− if (!s->device_ref) {
113− if (!avctx->hw_device_ctx) {
114− av_log(avctx, AV_LOG_ERROR, "Vulkan filtering requires a "
115− "Vulkan device.\n");
116− return AVERROR(EINVAL);
117− }
118−
119− err = vulkan_filter_set_device(avctx, avctx->hw_device_ctx);
120− if (err < 0)
121− return err;
122− }
123−
124− outlink->hw_frames_ctx = av_buffer_ref(s->frames_ref);
125− if (!outlink->hw_frames_ctx)
126− return AVERROR(ENOMEM);
127−
128− outlink->w = s->output_width;
129− outlink->h = s->output_height;
130−
131− return 0;
132−}
133−
134−int ff_vk_filter_config_output(AVFilterLink *outlink)
135−{
136− int err;
137− AVFilterContext *avctx = outlink->src;
138− FFVulkanContext *s = avctx->priv;
139− AVBufferRef *output_frames_ref;
140− AVHWFramesContext *output_frames;
141−
142− av_buffer_unref(&outlink->hw_frames_ctx);
143−
144− if (!s->device_ref) {
145− if (!avctx->hw_device_ctx) {
146− av_log(avctx, AV_LOG_ERROR, "Vulkan filtering requires a "
147− "Vulkan device.\n");
148− return AVERROR(EINVAL);
149− }
150−
151− err = vulkan_filter_set_device(avctx, avctx->hw_device_ctx);
152− if (err < 0)
153− return err;
154− }
155−
156− output_frames_ref = av_hwframe_ctx_alloc(s->device_ref);
157− if (!output_frames_ref) {
158− err = AVERROR(ENOMEM);
159− goto fail;
160− }
161− output_frames = (AVHWFramesContext*)output_frames_ref->data;
162−
163− output_frames->format = AV_PIX_FMT_VULKAN;
164− output_frames->sw_format = s->output_format;
165− output_frames->width = s->output_width;
166− output_frames->height = s->output_height;
167−
168− err = av_hwframe_ctx_init(output_frames_ref);
169− if (err < 0) {
170− av_log(avctx, AV_LOG_ERROR, "Failed to initialise output "
171− "frames: %d.\n", err);
172− goto fail;
173− }
174−
175− outlink->hw_frames_ctx = output_frames_ref;
176− outlink->w = s->output_width;
177− outlink->h = s->output_height;
178−
179− return 0;
180−fail:
181− av_buffer_unref(&output_frames_ref);
182− return err;
183−}
184−
185−int ff_vk_filter_init(AVFilterContext *avctx)
186−{
187− FFVulkanContext *s = avctx->priv;
188−
189− s->output_format = AV_PIX_FMT_NONE;
190−
191− return 0;
192−}
libavfilter/vulkan.h+0−9
@@ -19,15 +19,6 @@ · 18 unmodified lines
1919 #ifndef AVFILTER_VULKAN_H
2020 #define AVFILTER_VULKAN_H
2121
22−#include "avfilter.h"
2322 #include "libavutil/vulkan.h"
2423
25−/**
26− * General lavfi IO functions
27− */
28−int ff_vk_filter_init (AVFilterContext *avctx);
29−int ff_vk_filter_config_input (AVFilterLink *inlink);
30−int ff_vk_filter_config_output (AVFilterLink *outlink);
31−int ff_vk_filter_config_output_inplace(AVFilterLink *outlink);
32−
3324 #endif /* AVFILTER_VULKAN_H */
libavfilter/vulkan_filter.c+191−0
@@ -0,0 +1,191 @@
1+/*
2+ * This file is part of FFmpeg.
3+ *
4+ * FFmpeg is free software; you can redistribute it and/or
5+ * modify it under the terms of the GNU Lesser General Public
6+ * License as published by the Free Software Foundation; either
7+ * version 2.1 of the License, or (at your option) any later version.
8+ *
9+ * FFmpeg is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * Lesser General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Lesser General Public
15+ * License along with FFmpeg; if not, write to the Free Software
16+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+ */
18+
19+#include "vulkan_filter.h"
20+
21+static int vulkan_filter_set_device(AVFilterContext *avctx,
22+ AVBufferRef *device)
23+{
24+ FFVulkanContext *s = avctx->priv;
25+
26+ av_buffer_unref(&s->device_ref);
27+
28+ s->device_ref = av_buffer_ref(device);
29+ if (!s->device_ref)
30+ return AVERROR(ENOMEM);
31+
32+ s->device = (AVHWDeviceContext*)s->device_ref->data;
33+ s->hwctx = s->device->hwctx;
34+
35+ return 0;
36+}
37+
38+static int vulkan_filter_set_frames(AVFilterContext *avctx,
39+ AVBufferRef *frames)
40+{
41+ FFVulkanContext *s = avctx->priv;
42+
43+ av_buffer_unref(&s->frames_ref);
44+
45+ s->frames_ref = av_buffer_ref(frames);
46+ if (!s->frames_ref)
47+ return AVERROR(ENOMEM);
48+
49+ return 0;
50+}
51+
52+int ff_vk_filter_config_input(AVFilterLink *inlink)
53+{
54+ int err;
55+ AVFilterContext *avctx = inlink->dst;
56+ FFVulkanContext *s = avctx->priv;
57+ FFVulkanFunctions *vk = &s->vkfn;
58+ AVHWFramesContext *input_frames;
59+
60+ if (!inlink->hw_frames_ctx) {
61+ av_log(avctx, AV_LOG_ERROR, "Vulkan filtering requires a "
62+ "hardware frames context on the input.\n");
63+ return AVERROR(EINVAL);
64+ }
65+
66+ /* Extract the device and default output format from the first input. */
67+ if (avctx->inputs[0] != inlink)
68+ return 0;
69+
70+ input_frames = (AVHWFramesContext *)inlink->hw_frames_ctx->data;
71+ if (input_frames->format != AV_PIX_FMT_VULKAN)
72+ return AVERROR(EINVAL);
73+
74+ err = vulkan_filter_set_device(avctx, input_frames->device_ref);
75+ if (err < 0)
76+ return err;
77+ err = vulkan_filter_set_frames(avctx, inlink->hw_frames_ctx);
78+ if (err < 0)
79+ return err;
80+
81+ s->extensions = ff_vk_extensions_to_mask(s->hwctx->enabled_dev_extensions,
82+ s->hwctx->nb_enabled_dev_extensions);
83+
84+ err = ff_vk_load_functions(s->device, &s->vkfn, s->extensions, 1, 1);
85+ if (err < 0)
86+ return err;
87+
88+ vk->GetPhysicalDeviceProperties(s->hwctx->phys_dev, &s->props);
89+ vk->GetPhysicalDeviceMemoryProperties(s->hwctx->phys_dev, &s->mprops);
90+
91+ /* Default output parameters match input parameters. */
92+ s->input_format = input_frames->sw_format;
93+ if (s->output_format == AV_PIX_FMT_NONE)
94+ s->output_format = input_frames->sw_format;
95+ if (!s->output_width)
96+ s->output_width = inlink->w;
97+ if (!s->output_height)
98+ s->output_height = inlink->h;
99+
100+ return 0;
101+}
102+
103+int ff_vk_filter_config_output_inplace(AVFilterLink *outlink)
104+{
105+ int err;
106+ AVFilterContext *avctx = outlink->src;
107+ FFVulkanContext *s = avctx->priv;
108+
109+ av_buffer_unref(&outlink->hw_frames_ctx);
110+
111+ if (!s->device_ref) {
112+ if (!avctx->hw_device_ctx) {
113+ av_log(avctx, AV_LOG_ERROR, "Vulkan filtering requires a "
114+ "Vulkan device.\n");
115+ return AVERROR(EINVAL);
116+ }
117+
118+ err = vulkan_filter_set_device(avctx, avctx->hw_device_ctx);
119+ if (err < 0)
120+ return err;
121+ }
122+
123+ outlink->hw_frames_ctx = av_buffer_ref(s->frames_ref);
124+ if (!outlink->hw_frames_ctx)
125+ return AVERROR(ENOMEM);
126+
127+ outlink->w = s->output_width;
128+ outlink->h = s->output_height;
129+
130+ return 0;
131+}
132+
133+int ff_vk_filter_config_output(AVFilterLink *outlink)
134+{
135+ int err;
136+ AVFilterContext *avctx = outlink->src;
137+ FFVulkanContext *s = avctx->priv;
138+ AVBufferRef *output_frames_ref;
139+ AVHWFramesContext *output_frames;
140+
141+ av_buffer_unref(&outlink->hw_frames_ctx);
142+
143+ if (!s->device_ref) {
144+ if (!avctx->hw_device_ctx) {
145+ av_log(avctx, AV_LOG_ERROR, "Vulkan filtering requires a "
146+ "Vulkan device.\n");
147+ return AVERROR(EINVAL);
148+ }
149+
150+ err = vulkan_filter_set_device(avctx, avctx->hw_device_ctx);
151+ if (err < 0)
152+ return err;
153+ }
154+
155+ output_frames_ref = av_hwframe_ctx_alloc(s->device_ref);
156+ if (!output_frames_ref) {
157+ err = AVERROR(ENOMEM);
158+ goto fail;
159+ }
160+ output_frames = (AVHWFramesContext*)output_frames_ref->data;
161+
162+ output_frames->format = AV_PIX_FMT_VULKAN;
163+ output_frames->sw_format = s->output_format;
164+ output_frames->width = s->output_width;
165+ output_frames->height = s->output_height;
166+
167+ err = av_hwframe_ctx_init(output_frames_ref);
168+ if (err < 0) {
169+ av_log(avctx, AV_LOG_ERROR, "Failed to initialise output "
170+ "frames: %d.\n", err);
171+ goto fail;
172+ }
173+
174+ outlink->hw_frames_ctx = output_frames_ref;
175+ outlink->w = s->output_width;
176+ outlink->h = s->output_height;
177+
178+ return 0;
179+fail:
180+ av_buffer_unref(&output_frames_ref);
181+ return err;
182+}
183+
184+int ff_vk_filter_init(AVFilterContext *avctx)
185+{
186+ FFVulkanContext *s = avctx->priv;
187+
188+ s->output_format = AV_PIX_FMT_NONE;
189+
190+ return 0;
191+}
libavfilter/vulkan_filter.h+34−0
@@ -0,0 +1,34 @@
1+/*
2+ * This file is part of FFmpeg.
3+ *
4+ * FFmpeg is free software; you can redistribute it and/or
5+ * modify it under the terms of the GNU Lesser General Public
6+ * License as published by the Free Software Foundation; either
7+ * version 2.1 of the License, or (at your option) any later version.
8+ *
9+ * FFmpeg is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * Lesser General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Lesser General Public
15+ * License along with FFmpeg; if not, write to the Free Software
16+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+ */
18+
19+#ifndef AVFILTER_VULKAN_FILTER_H
20+#define AVFILTER_VULKAN_FILTER_H
21+
22+#include "avfilter.h"
23+
24+#include "vulkan.h"
25+
26+/**
27+ * General lavfi IO functions
28+ */
29+int ff_vk_filter_init (AVFilterContext *avctx);
30+int ff_vk_filter_config_input (AVFilterLink *inlink);
31+int ff_vk_filter_config_output (AVFilterLink *outlink);
32+int ff_vk_filter_config_output_inplace(AVFilterLink *outlink);
33+
34+#endif /* AVFILTER_VULKAN_FILTER_H */
libavutil/vulkan.c+2−2
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #include "vulkan.h"
2222 #include "vulkan_loader.h"
2323
24−#if FF_VK_ENABLE_SHADER_COMPILATION && CONFIG_LIBGLSLANG
24+#if CONFIG_LIBGLSLANG
2525 #include "vulkan_glslang.c"
2626 #endif
2727
@@ -857,7 +857,7 @@ int ff_vk_compile_shader(FFVulkanContext *s, FFVkSPIRVShader *shd, · 829 unmodified lines
857857 shd->shader.pName = entrypoint;
858858
859859 if (!s->spirv_compiler) {
860−#if FF_VK_ENABLE_SHADER_COMPILATION && CONFIG_LIBGLSLANG
860+#if CONFIG_LIBGLSLANG
861861 s->spirv_compiler = ff_vk_glslang_init();
862862 #else
863863 return AVERROR(ENOSYS);
libavutil/vulkan.h+1−4
@@ -22,15 +22,12 @@ · 21 unmodified lines
2222 #define VK_NO_PROTOTYPES
2323 #define VK_ENABLE_BETA_EXTENSIONS
2424
25−#ifndef FF_VK_ENABLE_SHADER_COMPILATION
26−#define FF_VK_ENABLE_SHADER_COMPILATION 1
27−#endif
28−
2925 #include "pixdesc.h"
3026 #include "bprint.h"
3127 #include "hwcontext.h"
3228 #include "hwcontext_vulkan.h"
3329 #include "vulkan_functions.h"
30+#include "vulkan_loader.h"
3431
3532 #define FF_VK_DEFAULT_USAGE_FLAGS (VK_IMAGE_USAGE_SAMPLED_BIT | \
3633 VK_IMAGE_USAGE_STORAGE_BIT | \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t