meta: Add gst_meta_api_type_tags_contain_only()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9004>
This commit is contained in:
Sebastian Dröge 2025-05-18 11:28:29 +03:00 committed by GStreamer Marge Bot
parent 8099c7e186
commit bd3c267adb
3 changed files with 71 additions and 0 deletions

View File

@ -27326,6 +27326,25 @@ write the result back into @aggregated_params.</doc>
</parameter>
</parameters>
</function>
<function name="api_type_tags_contain_only" c:identifier="gst_meta_api_type_tags_contain_only" version="1.28">
<source-position filename="../subprojects/gstreamer/gst/gstmeta.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmeta.c">%TRUE if @api only contains tags from @valid_tags.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="api" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmeta.c">an API</doc>
<type name="GType" c:type="GType"/>
</parameter>
<parameter name="valid_tags" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmeta.c">a list of valid tags</doc>
<array c:type="const gchar**">
<type name="utf8"/>
</array>
</parameter>
</parameters>
</function>
<function name="deserialize" c:identifier="gst_meta_deserialize" version="1.24">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmeta.c">Recreate a #GstMeta from serialized data returned by
gst_meta_serialize() and add it to @buffer.
@ -55380,6 +55399,25 @@ write the result back into @aggregated_params.</doc>
</parameter>
</parameters>
</function>
<function name="meta_api_type_tags_contain_only" c:identifier="gst_meta_api_type_tags_contain_only" moved-to="Meta.api_type_tags_contain_only" version="1.28">
<source-position filename="../subprojects/gstreamer/gst/gstmeta.h"/>
<return-value transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmeta.c">%TRUE if @api only contains tags from @valid_tags.</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<parameter name="api" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmeta.c">an API</doc>
<type name="GType" c:type="GType"/>
</parameter>
<parameter name="valid_tags" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmeta.c">a list of valid tags</doc>
<array c:type="const gchar**">
<type name="utf8"/>
</array>
</parameter>
</parameters>
</function>
<function name="meta_deserialize" c:identifier="gst_meta_deserialize" moved-to="Meta.deserialize" version="1.24">
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstmeta.c">Recreate a #GstMeta from serialized data returned by
gst_meta_serialize() and add it to @buffer.

View File

@ -412,6 +412,36 @@ gst_meta_api_type_get_tags (GType api)
return (const gchar * const *) tags;
}
/**
* gst_meta_api_type_tags_contain_only:
* @api: an API
* @valid_tags: (array zero-terminated=1) (element-type utf8): a list of valid tags
*
* Returns: %TRUE if @api only contains tags from @valid_tags.
*
* Since: 1.28
*/
gboolean
gst_meta_api_type_tags_contain_only (GType api, const gchar ** valid_tags)
{
const gchar **tags, **curr;
g_return_val_if_fail (api != 0, FALSE);
tags = g_type_get_qdata (api, _gst_meta_tags_quark);
if (!tags)
return TRUE;
for (curr = tags; *curr; ++curr) {
if (!g_strv_contains (valid_tags, *curr)) {
return FALSE;
}
}
return TRUE;
}
/**
* gst_meta_api_type_aggregate_params:
* @api: the GType of the API for which the parameters are being aggregated.

View File

@ -424,6 +424,9 @@ const GstMetaInfo * gst_meta_get_info (const gchar * impl);
GST_API
const gchar* const* gst_meta_api_type_get_tags (GType api);
GST_API
gboolean gst_meta_api_type_tags_contain_only (GType api, const gchar ** valid_tags);
GST_API
guint64 gst_meta_get_seqnum (const GstMeta * meta);