diff mbox series

[FFmpeg-devel,1/2] lavfi: add a flag for filters able to work with hw_device_ctx

Message ID 20230317124230.8835-1-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel,1/2] lavfi: add a flag for filters able to work with hw_device_ctx | expand

Commit Message

Anton Khirnov March 17, 2023, 12:42 p.m. UTC
This way the caller can set it just on the filters that can make use of
it.
---
 doc/APIchanges                      | 3 +++
 libavfilter/avfilter.h              | 9 +++++++++
 libavfilter/stack_internal.c        | 4 ++--
 libavfilter/version.h               | 2 +-
 libavfilter/vf_avgblur_opencl.c     | 1 +
 libavfilter/vf_avgblur_vulkan.c     | 1 +
 libavfilter/vf_blend_vulkan.c       | 1 +
 libavfilter/vf_chromaber_vulkan.c   | 1 +
 libavfilter/vf_colorkey_opencl.c    | 3 ++-
 libavfilter/vf_convolution_opencl.c | 4 ++++
 libavfilter/vf_deshake_opencl.c     | 3 ++-
 libavfilter/vf_flip_vulkan.c        | 1 +
 libavfilter/vf_gblur_vulkan.c       | 1 +
 libavfilter/vf_libplacebo.c         | 1 +
 libavfilter/vf_neighbor_opencl.c    | 1 +
 libavfilter/vf_nlmeans_opencl.c     | 1 +
 libavfilter/vf_overlay_opencl.c     | 1 +
 libavfilter/vf_overlay_qsv.c        | 1 +
 libavfilter/vf_overlay_vulkan.c     | 1 +
 libavfilter/vf_pad_opencl.c         | 3 ++-
 libavfilter/vf_program_opencl.c     | 4 +++-
 libavfilter/vf_remap_opencl.c       | 1 +
 libavfilter/vf_scale_vulkan.c       | 1 +
 libavfilter/vf_stack_qsv.c          | 6 +++---
 libavfilter/vf_stack_vaapi.c        | 6 +++---
 libavfilter/vf_tonemap_opencl.c     | 1 +
 libavfilter/vf_transpose_opencl.c   | 1 +
 libavfilter/vf_transpose_vulkan.c   | 1 +
 libavfilter/vf_unsharp_opencl.c     | 1 +
 libavfilter/vf_vpp_qsv.c            | 1 +
 libavfilter/vf_xfade_opencl.c       | 1 +
 libavfilter/vsrc_ddagrab.c          | 1 +
 32 files changed, 55 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/doc/APIchanges b/doc/APIchanges
index 14737223cb0..eeb2f1c49c4 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@  The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2023-03-xx - xxxxxxxxxx - lavfi 9.5.100 - avfilter.h
+  Add AVFILTER_FLAG_HWDEVICE.
+
 2023-03-02 - xxxxxxxxxx - lavc 60.6.100 - avcodec.h
   Add FF_PROFILE_EAC3_DDP_ATMOS, FF_PROFILE_TRUEHD_ATMOS,
   FF_PROFILE_DTS_HD_MA_X and FF_PROFILE_DTS_HD_MA_X_IMAX.
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index d0d45844681..d69381aed4f 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -131,6 +131,11 @@  enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx);
  *   received by the filter on one of its inputs.
  */
 #define AVFILTER_FLAG_METADATA_ONLY         (1 << 3)
+
+/**
+ * The filter can create hardware frames using AVFilterContext.hw_device_ctx.
+ */
+#define AVFILTER_FLAG_HWDEVICE              (1 << 4)
 /**
  * Some filters support a generic "enable" expression option that can be used
  * to enable or disable a filter in the timeline. Filters supporting this
@@ -444,6 +449,10 @@  struct AVFilterContext {
      * in particular, a filter which consumes or processes hardware frames will
      * instead use the hw_frames_ctx field in AVFilterLink to carry the
      * hardware context information.
+     *
+     * May be set by the caller on filters flagged with AVFILTER_FLAG_HWDEVICE
+     * before initializing the filter with avfilter_init_str() or
+     * avfilter_init_dict().
      */
     AVBufferRef *hw_device_ctx;
 
diff --git a/libavfilter/stack_internal.c b/libavfilter/stack_internal.c
index 0697ebdd12c..1ee20d66cf2 100644
--- a/libavfilter/stack_internal.c
+++ b/libavfilter/stack_internal.c
@@ -333,7 +333,7 @@  static const AVFilterPad stack_outputs[] = {
         { NULL }                                                        \
     }
 
-#define DEFINE_STACK_FILTER(category, api, capi)                        \
+#define DEFINE_STACK_FILTER(category, api, capi, filter_flags)          \
     static const AVClass category##_##api##_class = {                   \
         .class_name = #category "_" #api,                               \
         .item_name  = av_default_item_name,                             \
@@ -351,5 +351,5 @@  static const AVFilterPad stack_outputs[] = {
         FILTER_QUERY_FUNC(api##_stack_query_formats),                   \
         FILTER_OUTPUTS(stack_outputs),                                  \
         .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,                 \
-        .flags          = AVFILTER_FLAG_DYNAMIC_INPUTS,                 \
+        .flags          = AVFILTER_FLAG_DYNAMIC_INPUTS | filter_flags,  \
     }
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 4d8f28e5127..523a7fe0a6e 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -31,7 +31,7 @@ 
 
 #include "version_major.h"
 
-#define LIBAVFILTER_VERSION_MINOR   4
+#define LIBAVFILTER_VERSION_MINOR   5
 #define LIBAVFILTER_VERSION_MICRO 100
 
 
diff --git a/libavfilter/vf_avgblur_opencl.c b/libavfilter/vf_avgblur_opencl.c
index 7c0578b694b..68f3a632492 100644
--- a/libavfilter/vf_avgblur_opencl.c
+++ b/libavfilter/vf_avgblur_opencl.c
@@ -390,6 +390,7 @@  const AVFilter ff_vf_boxblur_opencl = {
     FILTER_OUTPUTS(avgblur_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
 
 #endif /* CONFIG_BOXBLUR_OPENCL_FILTER */
diff --git a/libavfilter/vf_avgblur_vulkan.c b/libavfilter/vf_avgblur_vulkan.c
index d118ce802ca..6a54d158ce1 100644
--- a/libavfilter/vf_avgblur_vulkan.c
+++ b/libavfilter/vf_avgblur_vulkan.c
@@ -418,4 +418,5 @@  const AVFilter ff_vf_avgblur_vulkan = {
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VULKAN),
     .priv_class     = &avgblur_vulkan_class,
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_blend_vulkan.c b/libavfilter/vf_blend_vulkan.c
index fcc21cbc8d5..4cee688a22f 100644
--- a/libavfilter/vf_blend_vulkan.c
+++ b/libavfilter/vf_blend_vulkan.c
@@ -500,5 +500,6 @@  const AVFilter ff_vf_blend_vulkan = {
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VULKAN),
     .priv_class      = &blend_vulkan_class,
     .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
     .process_command = &process_command,
 };
diff --git a/libavfilter/vf_chromaber_vulkan.c b/libavfilter/vf_chromaber_vulkan.c
index b9423e417e3..62b99cc4d91 100644
--- a/libavfilter/vf_chromaber_vulkan.c
+++ b/libavfilter/vf_chromaber_vulkan.c
@@ -349,4 +349,5 @@  const AVFilter ff_vf_chromaber_vulkan = {
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VULKAN),
     .priv_class     = &chromaber_vulkan_class,
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_colorkey_opencl.c b/libavfilter/vf_colorkey_opencl.c
index 84be1999a89..2b019b290c1 100644
--- a/libavfilter/vf_colorkey_opencl.c
+++ b/libavfilter/vf_colorkey_opencl.c
@@ -238,5 +238,6 @@  const AVFilter ff_vf_colorkey_opencl = {
     FILTER_INPUTS(colorkey_opencl_inputs),
     FILTER_OUTPUTS(colorkey_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
-    .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE
+    .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_convolution_opencl.c b/libavfilter/vf_convolution_opencl.c
index de3d38b553b..bf721a7416b 100644
--- a/libavfilter/vf_convolution_opencl.c
+++ b/libavfilter/vf_convolution_opencl.c
@@ -373,6 +373,7 @@  const AVFilter ff_vf_convolution_opencl = {
     FILTER_OUTPUTS(convolution_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
 
 #endif /* CONFIG_CONVOLUTION_OPENCL_FILTER */
@@ -399,6 +400,7 @@  const AVFilter ff_vf_sobel_opencl = {
     FILTER_OUTPUTS(convolution_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
 
 #endif /* CONFIG_SOBEL_OPENCL_FILTER */
@@ -425,6 +427,7 @@  const AVFilter ff_vf_prewitt_opencl = {
     FILTER_OUTPUTS(convolution_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
 
 #endif /* CONFIG_PREWITT_OPENCL_FILTER */
@@ -451,6 +454,7 @@  const AVFilter ff_vf_roberts_opencl = {
     FILTER_OUTPUTS(convolution_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
 
 #endif /* CONFIG_ROBERTS_OPENCL_FILTER */
diff --git a/libavfilter/vf_deshake_opencl.c b/libavfilter/vf_deshake_opencl.c
index d488da7fa0c..e670a4cc234 100644
--- a/libavfilter/vf_deshake_opencl.c
+++ b/libavfilter/vf_deshake_opencl.c
@@ -2169,5 +2169,6 @@  const AVFilter ff_vf_deshake_opencl = {
     FILTER_INPUTS(deshake_opencl_inputs),
     FILTER_OUTPUTS(deshake_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
-    .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE
+    .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_flip_vulkan.c b/libavfilter/vf_flip_vulkan.c
index 0223786ef1f..6868e39ee63 100644
--- a/libavfilter/vf_flip_vulkan.c
+++ b/libavfilter/vf_flip_vulkan.c
@@ -366,4 +366,5 @@  const AVFilter ff_vf_flip_vulkan = {
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VULKAN),
     .priv_class     = &flip_vulkan_class,
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_gblur_vulkan.c b/libavfilter/vf_gblur_vulkan.c
index d61f3c778c0..e6ffc8c0735 100644
--- a/libavfilter/vf_gblur_vulkan.c
+++ b/libavfilter/vf_gblur_vulkan.c
@@ -503,4 +503,5 @@  const AVFilter ff_vf_gblur_vulkan = {
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VULKAN),
     .priv_class     = &gblur_vulkan_class,
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index 757dc519e9a..ba852de08d6 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -893,4 +893,5 @@  const AVFilter ff_vf_libplacebo = {
     FILTER_QUERY_FUNC(libplacebo_query_format),
     .priv_class     = &libplacebo_class,
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_neighbor_opencl.c b/libavfilter/vf_neighbor_opencl.c
index 3b83cee3da6..d2d93cd2405 100644
--- a/libavfilter/vf_neighbor_opencl.c
+++ b/libavfilter/vf_neighbor_opencl.c
@@ -312,6 +312,7 @@  const AVFilter ff_vf_dilation_opencl = {
     FILTER_OUTPUTS(neighbor_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
 
 #endif /* CONFIG_DILATION_OPENCL_FILTER */
diff --git a/libavfilter/vf_nlmeans_opencl.c b/libavfilter/vf_nlmeans_opencl.c
index c0ac8bf95dd..ca3ec45d7a3 100644
--- a/libavfilter/vf_nlmeans_opencl.c
+++ b/libavfilter/vf_nlmeans_opencl.c
@@ -438,4 +438,5 @@  const AVFilter ff_vf_nlmeans_opencl = {
     FILTER_OUTPUTS(nlmeans_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_overlay_opencl.c b/libavfilter/vf_overlay_opencl.c
index 1e3ad903e11..38a3fc8795a 100644
--- a/libavfilter/vf_overlay_opencl.c
+++ b/libavfilter/vf_overlay_opencl.c
@@ -322,4 +322,5 @@  const AVFilter ff_vf_overlay_opencl = {
     FILTER_OUTPUTS(overlay_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_overlay_qsv.c b/libavfilter/vf_overlay_qsv.c
index 5bec7dd414c..edc7f79c865 100644
--- a/libavfilter/vf_overlay_qsv.c
+++ b/libavfilter/vf_overlay_qsv.c
@@ -429,4 +429,5 @@  const AVFilter ff_vf_overlay_qsv = {
     FILTER_QUERY_FUNC(overlay_qsv_query_formats),
     .priv_class     = &overlay_qsv_class,
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_overlay_vulkan.c b/libavfilter/vf_overlay_vulkan.c
index e87ee830007..6db7baddfdd 100644
--- a/libavfilter/vf_overlay_vulkan.c
+++ b/libavfilter/vf_overlay_vulkan.c
@@ -494,4 +494,5 @@  const AVFilter ff_vf_overlay_vulkan = {
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VULKAN),
     .priv_class     = &overlay_vulkan_class,
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_pad_opencl.c b/libavfilter/vf_pad_opencl.c
index 728e850f720..d6b71765eeb 100644
--- a/libavfilter/vf_pad_opencl.c
+++ b/libavfilter/vf_pad_opencl.c
@@ -391,5 +391,6 @@  const AVFilter ff_vf_pad_opencl = {
     FILTER_INPUTS(pad_opencl_inputs),
     FILTER_OUTPUTS(pad_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
-    .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE
+    .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_program_opencl.c b/libavfilter/vf_program_opencl.c
index 55c1e6547c4..8a4881b38e4 100644
--- a/libavfilter/vf_program_opencl.c
+++ b/libavfilter/vf_program_opencl.c
@@ -362,7 +362,8 @@  const AVFilter ff_vf_program_opencl = {
     .description    = NULL_IF_CONFIG_SMALL("Filter video using an OpenCL program"),
     .priv_size      = sizeof(ProgramOpenCLContext),
     .priv_class     = &program_opencl_class,
-    .flags          = AVFILTER_FLAG_DYNAMIC_INPUTS,
+    .flags          = AVFILTER_FLAG_DYNAMIC_INPUTS |
+                      AVFILTER_FLAG_HWDEVICE,
     .preinit        = &program_opencl_framesync_preinit,
     .init           = &program_opencl_init,
     .uninit         = &program_opencl_uninit,
@@ -421,6 +422,7 @@  const AVFilter ff_vsrc_openclsrc = {
     FILTER_OUTPUTS(openclsrc_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
 
 #endif
diff --git a/libavfilter/vf_remap_opencl.c b/libavfilter/vf_remap_opencl.c
index f3f84bde64a..eeb1eb5d69d 100644
--- a/libavfilter/vf_remap_opencl.c
+++ b/libavfilter/vf_remap_opencl.c
@@ -351,4 +351,5 @@  const AVFilter ff_vf_remap_opencl = {
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .priv_class    = &remap_opencl_class,
     .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_scale_vulkan.c b/libavfilter/vf_scale_vulkan.c
index c1404208962..3b09f0dcc12 100644
--- a/libavfilter/vf_scale_vulkan.c
+++ b/libavfilter/vf_scale_vulkan.c
@@ -531,4 +531,5 @@  const AVFilter ff_vf_scale_vulkan = {
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VULKAN),
     .priv_class     = &scale_vulkan_class,
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_stack_qsv.c b/libavfilter/vf_stack_qsv.c
index 9eb0748bd61..3e6aefe44bf 100644
--- a/libavfilter/vf_stack_qsv.c
+++ b/libavfilter/vf_stack_qsv.c
@@ -235,20 +235,20 @@  static int qsv_stack_query_formats(AVFilterContext *ctx)
 #if CONFIG_HSTACK_QSV_FILTER
 
 DEFINE_HSTACK_OPTIONS(qsv);
-DEFINE_STACK_FILTER(hstack, qsv, "Quick Sync Video");
+DEFINE_STACK_FILTER(hstack, qsv, "Quick Sync Video", AVFILTER_FLAG_HWDEVICE);
 
 #endif
 
 #if CONFIG_VSTACK_QSV_FILTER
 
 DEFINE_VSTACK_OPTIONS(qsv);
-DEFINE_STACK_FILTER(vstack, qsv, "Quick Sync Video");
+DEFINE_STACK_FILTER(vstack, qsv, "Quick Sync Video", AVFILTER_FLAG_HWDEVICE);
 
 #endif
 
 #if CONFIG_XSTACK_QSV_FILTER
 
 DEFINE_XSTACK_OPTIONS(qsv);
-DEFINE_STACK_FILTER(xstack, qsv, "Quick Sync Video");
+DEFINE_STACK_FILTER(xstack, qsv, "Quick Sync Video", AVFILTER_FLAG_HWDEVICE);
 
 #endif
diff --git a/libavfilter/vf_stack_vaapi.c b/libavfilter/vf_stack_vaapi.c
index 26dbe3f7aa7..8e9471e6d7b 100644
--- a/libavfilter/vf_stack_vaapi.c
+++ b/libavfilter/vf_stack_vaapi.c
@@ -234,20 +234,20 @@  static int vaapi_stack_query_formats(AVFilterContext *avctx)
 #if CONFIG_HSTACK_VAAPI_FILTER
 
 DEFINE_HSTACK_OPTIONS(vaapi);
-DEFINE_STACK_FILTER(hstack, vaapi, "VA-API");
+DEFINE_STACK_FILTER(hstack, vaapi, "VA-API", 0);
 
 #endif
 
 #if CONFIG_VSTACK_VAAPI_FILTER
 
 DEFINE_VSTACK_OPTIONS(vaapi);
-DEFINE_STACK_FILTER(vstack, vaapi, "VA-API");
+DEFINE_STACK_FILTER(vstack, vaapi, "VA-API", 0);
 
 #endif
 
 #if CONFIG_XSTACK_VAAPI_FILTER
 
 DEFINE_XSTACK_OPTIONS(vaapi);
-DEFINE_STACK_FILTER(xstack, vaapi, "VA-API");
+DEFINE_STACK_FILTER(xstack, vaapi, "VA-API", 0);
 
 #endif
diff --git a/libavfilter/vf_tonemap_opencl.c b/libavfilter/vf_tonemap_opencl.c
index f6ebb694a81..883eb043427 100644
--- a/libavfilter/vf_tonemap_opencl.c
+++ b/libavfilter/vf_tonemap_opencl.c
@@ -547,4 +547,5 @@  const AVFilter ff_vf_tonemap_opencl = {
     FILTER_OUTPUTS(tonemap_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_transpose_opencl.c b/libavfilter/vf_transpose_opencl.c
index c6e8bd2f531..56d34d193bc 100644
--- a/libavfilter/vf_transpose_opencl.c
+++ b/libavfilter/vf_transpose_opencl.c
@@ -281,4 +281,5 @@  const AVFilter ff_vf_transpose_opencl = {
     FILTER_OUTPUTS(transpose_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_transpose_vulkan.c b/libavfilter/vf_transpose_vulkan.c
index 30d052e08cc..3b2ce4fb693 100644
--- a/libavfilter/vf_transpose_vulkan.c
+++ b/libavfilter/vf_transpose_vulkan.c
@@ -343,4 +343,5 @@  const AVFilter ff_vf_transpose_vulkan = {
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_VULKAN),
     .priv_class     = &transpose_vulkan_class,
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_unsharp_opencl.c b/libavfilter/vf_unsharp_opencl.c
index 53e310de099..2c3ac14050d 100644
--- a/libavfilter/vf_unsharp_opencl.c
+++ b/libavfilter/vf_unsharp_opencl.c
@@ -407,4 +407,5 @@  const AVFilter ff_vf_unsharp_opencl = {
     FILTER_OUTPUTS(unsharp_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index ac77f7bb4ba..814a4322ae7 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -648,6 +648,7 @@  const AVFilter ff_vf_##sn##_qsv = { \
     fmts, \
     .activate       = activate, \
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE, \
+    .flags          = AVFILTER_FLAG_HWDEVICE,       \
 };
 
 #if CONFIG_VPP_QSV_FILTER
diff --git a/libavfilter/vf_xfade_opencl.c b/libavfilter/vf_xfade_opencl.c
index cca4980e012..415cf7ac35d 100644
--- a/libavfilter/vf_xfade_opencl.c
+++ b/libavfilter/vf_xfade_opencl.c
@@ -433,4 +433,5 @@  const AVFilter ff_vf_xfade_opencl = {
     FILTER_OUTPUTS(xfade_opencl_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_OPENCL),
     .flags_internal  = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };
diff --git a/libavfilter/vsrc_ddagrab.c b/libavfilter/vsrc_ddagrab.c
index 00c72187eaa..042842104f0 100644
--- a/libavfilter/vsrc_ddagrab.c
+++ b/libavfilter/vsrc_ddagrab.c
@@ -1056,4 +1056,5 @@  const AVFilter ff_vsrc_ddagrab = {
     FILTER_OUTPUTS(ddagrab_outputs),
     FILTER_SINGLE_PIXFMT(AV_PIX_FMT_D3D11),
     .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
+    .flags          = AVFILTER_FLAG_HWDEVICE,
 };