From 34efd430e4b30b68804ca5b8dc7da9aa126385c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 17 May 2025 15:24:29 +0300 Subject: [PATCH] videobalance: Implement basetransform meta transform function This makes sure we can pass through more metas correctly, e.g. GstVideoOverlayComposition meta. Part-of: --- .../gst/videofilter/gstvideobalance.c | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/subprojects/gst-plugins-good/gst/videofilter/gstvideobalance.c b/subprojects/gst-plugins-good/gst/videofilter/gstvideobalance.c index 55656abffa..7a4544c238 100644 --- a/subprojects/gst-plugins-good/gst/videofilter/gstvideobalance.c +++ b/subprojects/gst-plugins-good/gst/videofilter/gstvideobalance.c @@ -541,6 +541,32 @@ not_negotiated: } } +static gboolean +gst_video_balance_transform_meta (GstBaseTransform * bt, + GstBuffer * outbuf, GstMeta * meta, GstBuffer * inbuf) +{ + const GstMetaInfo *info = meta->info; + gboolean should_copy = TRUE; + const gchar *valid_tags[] = { + GST_META_TAG_VIDEO_STR, + GST_META_TAG_VIDEO_ORIENTATION_STR, + GST_META_TAG_VIDEO_SIZE_STR, + GST_META_TAG_VIDEO_COLORSPACE_STR, + NULL + }; + + should_copy = gst_meta_api_type_tags_contain_only (info->api, valid_tags); + + /* Can't handle the tags in this meta, let the parent class handle it */ + if (!should_copy) { + return GST_BASE_TRANSFORM_CLASS (parent_class)->transform_meta (bt, + outbuf, meta, inbuf); + } + + /* No need to transform, we can safely copy this meta */ + return TRUE; +} + static void gst_video_balance_finalize (GObject * object) { @@ -610,6 +636,8 @@ gst_video_balance_class_init (GstVideoBalanceClass * klass) trans_class->transform_ip_on_passthrough = FALSE; trans_class->transform_caps = GST_DEBUG_FUNCPTR (gst_video_balance_transform_caps); + trans_class->transform_meta = + GST_DEBUG_FUNCPTR (gst_video_balance_transform_meta); vfilter_class->set_info = GST_DEBUG_FUNCPTR (gst_video_balance_set_info); vfilter_class->transform_frame_ip =