diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index 8f6e5ab042..b9ecc8d36b 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -1208,14 +1208,24 @@ gst_audio_decoder_transform_meta_default (GstAudioDecoder * { const GstMetaInfo *info = meta->info; const gchar *const *tags; + const gchar *const supported_tags[] = { + GST_META_TAG_AUDIO_STR, + GST_META_TAG_AUDIO_CHANNELS_STR, + NULL, + }; 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_AUDIO))) + if (!tags) return TRUE; - return FALSE; + while (*tags) { + if (!g_strv_contains (supported_tags, *tags)) + return FALSE; + tags++; + } + + return TRUE; } typedef struct diff --git a/gst-libs/gst/audio/gstaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c index 10c1b67e4b..68cb069b21 100644 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -670,14 +670,24 @@ gst_audio_encoder_transform_meta_default (GstAudioEncoder * { const GstMetaInfo *info = meta->info; const gchar *const *tags; + const gchar *const supported_tags[] = { + GST_META_TAG_AUDIO_STR, + GST_META_TAG_AUDIO_CHANNELS_STR, + NULL, + }; 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_AUDIO))) + if (!tags) return TRUE; - return FALSE; + while (*tags) { + if (!g_strv_contains (supported_tags, *tags)) + return FALSE; + tags++; + } + + return TRUE; } typedef struct diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c index 300d181834..e69074a8d8 100644 --- a/gst-libs/gst/video/gstvideodecoder.c +++ b/gst-libs/gst/video/gstvideodecoder.c @@ -3032,14 +3032,25 @@ gst_video_decoder_transform_meta_default (GstVideoDecoder * { const GstMetaInfo *info = meta->info; const gchar *const *tags; + const gchar *const supported_tags[] = { + GST_META_TAG_VIDEO_STR, + GST_META_TAG_VIDEO_ORIENTATION_STR, + GST_META_TAG_VIDEO_SIZE_STR, + NULL, + }; 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))) + if (!tags) return TRUE; - return FALSE; + while (*tags) { + if (!g_strv_contains (supported_tags, *tags)) + return FALSE; + tags++; + } + + return TRUE; } typedef struct diff --git a/gst-libs/gst/video/gstvideoencoder.c b/gst-libs/gst/video/gstvideoencoder.c index a3b55495df..d45a4f6e70 100644 --- a/gst-libs/gst/video/gstvideoencoder.c +++ b/gst-libs/gst/video/gstvideoencoder.c @@ -2139,14 +2139,25 @@ gst_video_encoder_transform_meta_default (GstVideoEncoder * { const GstMetaInfo *info = meta->info; const gchar *const *tags; + const gchar *const supported_tags[] = { + GST_META_TAG_VIDEO_STR, + GST_META_TAG_VIDEO_ORIENTATION_STR, + GST_META_TAG_VIDEO_SIZE_STR, + NULL, + }; 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))) + if (!tags) return TRUE; - return FALSE; + while (*tags) { + if (!g_strv_contains (supported_tags, *tags)) + return FALSE; + tags++; + } + + return TRUE; } typedef struct