From e4c43db5d51b0d6631cef835cd11c2ddf11ef912 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Thu, 1 Jun 2023 02:13:32 +0900 Subject: [PATCH] d3d11basefilter: Forward video related metas if needed The same as in GstVideoFilter Part-of: --- .../sys/d3d11/gstd3d11basefilter.cpp | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11basefilter.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11basefilter.cpp index 9f6cedd028..8433f41f5a 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11basefilter.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11basefilter.cpp @@ -26,6 +26,9 @@ GST_DEBUG_CATEGORY_STATIC (gst_d3d11_base_filter_debug); #define GST_CAT_DEFAULT gst_d3d11_base_filter_debug +#define META_TAG_VIDEO meta_tag_video_quark +static GQuark meta_tag_video_quark; + enum { PROP_0, @@ -57,6 +60,8 @@ gst_d3d11_base_filter_query (GstBaseTransform * trans, GstPadDirection direction, GstQuery * query); static void gst_d3d11_base_filter_before_transform (GstBaseTransform * trans, GstBuffer * buffer); +static gboolean gst_d3d11_base_filter_transform_meta (GstBaseTransform * trans, + GstBuffer * outbuf, GstMeta * meta, GstBuffer * inbuf); static void gst_d3d11_base_filter_class_init (GstD3D11BaseFilterClass * klass) @@ -96,9 +101,12 @@ gst_d3d11_base_filter_class_init (GstD3D11BaseFilterClass * klass) trans_class->query = GST_DEBUG_FUNCPTR (gst_d3d11_base_filter_query); trans_class->before_transform = GST_DEBUG_FUNCPTR (gst_d3d11_base_filter_before_transform); + trans_class->transform_meta = + GST_DEBUG_FUNCPTR (gst_d3d11_base_filter_transform_meta); gst_type_mark_as_plugin_api (GST_TYPE_D3D11_BASE_FILTER, (GstPluginAPIFlags) 0); + meta_tag_video_quark = g_quark_from_static_string (GST_META_TAG_VIDEO_STR); } static void @@ -341,3 +349,21 @@ out: return; } + +static gboolean +gst_d3d11_base_filter_transform_meta (GstBaseTransform * trans, + GstBuffer * outbuf, GstMeta * meta, GstBuffer * inbuf) +{ + const GstMetaInfo *info = meta->info; + const gchar *const *tags; + + tags = gst_meta_api_type_get_tags (info->api); + + if (!tags || (g_strv_length ((gchar **) tags) == 1 + && gst_meta_api_type_has_tag (info->api, META_TAG_VIDEO))) { + return TRUE; + } + + return GST_BASE_TRANSFORM_CLASS (parent_class)->transform_meta (trans, outbuf, + meta, inbuf); +}