[FFmpeg-devel] [PATCH 6/6] lavfi: add a Vulkan overlay filter

Mark Thompson sw at jkqxz.net
Mon Sep 3 00:50:02 EEST 2018


On 21/06/18 17:55, Rostislav Pehlivanov wrote:
> Could be done in-plane with the main image but framesync segfaults.

Is this framesync not working with hardware frames, so it tries to clone an image but can't?

(I have had vague plans for a while to clean that up by adding an av_hwframe_clone() call to hwcontext and making the read/write refcounting work as expected, but there are few real use-cases for it so have yet to bother.)

> Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>
> ---
>  configure                       |   1 +
>  libavfilter/Makefile            |   1 +
>  libavfilter/allfilters.c        |   1 +
>  libavfilter/vf_overlay_vulkan.c | 461 ++++++++++++++++++++++++++++++++
>  4 files changed, 464 insertions(+)
>  create mode 100644 libavfilter/vf_overlay_vulkan.c
> 
> diff --git a/configure b/configure
> index d1ceb9e38d..2edd4e36aa 100755
> --- a/configure
> +++ b/configure
> @@ -3370,6 +3370,7 @@ ocr_filter_deps="libtesseract"
>  ocv_filter_deps="libopencv"
>  openclsrc_filter_deps="opencl"
>  overlay_opencl_filter_deps="opencl"
> +overlay_vulkan_filter_deps="vulkan libshaderc"

'q' < 'v'

>  overlay_qsv_filter_deps="libmfx"
>  overlay_qsv_filter_select="qsvvpp"
>  owdenoise_filter_deps="gpl"
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 6e2d3681ec..c51add5cb4 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -280,6 +280,7 @@ OBJS-$(CONFIG_OSCILLOSCOPE_FILTER)           += vf_datascope.o
>  OBJS-$(CONFIG_OVERLAY_FILTER)                += vf_overlay.o framesync.o
>  OBJS-$(CONFIG_OVERLAY_OPENCL_FILTER)         += vf_overlay_opencl.o opencl.o \
>                                                  opencl/overlay.o framesync.o
> +OBJS-$(CONFIG_OVERLAY_VULKAN_FILTER)         += vf_overlay_vulkan.o

Also here.

>  OBJS-$(CONFIG_OVERLAY_QSV_FILTER)            += vf_overlay_qsv.o framesync.o
>  OBJS-$(CONFIG_OWDENOISE_FILTER)              += vf_owdenoise.o
>  OBJS-$(CONFIG_PAD_FILTER)                    += vf_pad.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index ee58cc9eee..7c9ff0ab41 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -269,6 +269,7 @@ extern AVFilter ff_vf_ocv;
>  extern AVFilter ff_vf_oscilloscope;
>  extern AVFilter ff_vf_overlay;
>  extern AVFilter ff_vf_overlay_opencl;
> +extern AVFilter ff_vf_overlay_vulkan;

And here.

>  extern AVFilter ff_vf_overlay_qsv;
>  extern AVFilter ff_vf_owdenoise;
>  extern AVFilter ff_vf_pad;
> diff --git a/libavfilter/vf_overlay_vulkan.c b/libavfilter/vf_overlay_vulkan.c
> new file mode 100644
> index 0000000000..a7d8cc3cf2
> --- /dev/null
> +++ b/libavfilter/vf_overlay_vulkan.c

Code all looks fine.

Are you planning to add alpha as well?


More information about the ffmpeg-devel mailing list