gstreamer: Add new meta_api_type_tags_contain_only()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1743>
This commit is contained in:
Sebastian Dröge 2025-06-26 18:40:21 +03:00
parent 1a75edba3f
commit 7daf6d9625

View file

@ -215,6 +215,12 @@ impl<'a, T> MetaRef<'a, T> {
meta_api_type_has_tag_by_quark(self.api(), tag)
}
#[inline]
#[doc(alias = "gst_meta_api_type_tags_contain_only")]
pub fn tags_contain_only(&self, tags: &[&str]) -> bool {
meta_api_type_tags_contain_only(self.api(), tags)
}
#[inline]
#[doc(alias = "gst_meta_api_type_get_tags")]
pub fn tags<'b>(&self) -> &'b [glib::GStringPtr] {
@ -450,6 +456,12 @@ impl<'a, T, U> MetaRefMut<'a, T, U> {
self.as_meta_ref().has_tag_by_quark(tag)
}
#[inline]
#[doc(alias = "gst_meta_api_type_tags_contain_only")]
pub fn tags_contain_only(&self, tags: &[&str]) -> bool {
self.as_meta_ref().tags_contain_only(tags)
}
#[inline]
#[doc(alias = "gst_meta_api_type_get_tags")]
pub fn tags<'b>(&self) -> &'b [glib::GStringPtr] {
@ -1128,6 +1140,17 @@ pub fn meta_api_type_has_tag_by_quark(type_: glib::Type, tag: glib::Quark) -> bo
}
}
#[inline]
#[doc(alias = "gst_meta_api_type_tags_contain_only")]
pub fn meta_api_type_tags_contain_only(type_: glib::Type, tags: &[&str]) -> bool {
skip_assert_initialized!();
let meta_tags = meta_api_type_get_tags(type_);
meta_tags
.iter()
.all(|tag| tags.iter().any(|t| *t == tag.as_str()))
}
#[inline]
#[doc(alias = "gst_meta_api_type_get_tags")]
pub fn meta_api_type_get_tags<'b>(type_: glib::Type) -> &'b [glib::GStringPtr] {