From 3b9f050600287d2ae7cc429e07f79809b4d5d8b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 30 Aug 2024 18:57:03 +0300 Subject: [PATCH] common: Stop using GQuark-based GstCapsFeatures API Part-of: --- .../gst-plugins-bad/sys/va/gstvabasedec.c | 18 +++++++++--------- subprojects/gst-plugins-bad/sys/va/gstvavpp.c | 15 ++++++++------- .../gst-libs/gst/gl/gstglupload.c | 6 +++--- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c b/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c index adfbbfa3af..bffb75337a 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c @@ -848,13 +848,13 @@ gst_va_base_dec_get_preferred_format_and_caps_features (GstVaBaseDec * base, GstCapsFeatures *features; guint num_structures, i, j; gboolean is_any; - /* array designators might not be supported by some compilers */ - const GQuark feats[] = { - /* [VA] = */ g_quark_from_string (GST_CAPS_FEATURE_MEMORY_VA), - /* [DMABUF] = */ g_quark_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF), - /* [SYSMEM] = */ - g_quark_from_string (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY), - }; + GstIdStr sysmem = GST_ID_STR_INIT, dmabuf = GST_ID_STR_INIT, va = + GST_ID_STR_INIT; + const GstIdStr *feats[] = { &va, &dmabuf, &sysmem }; + + gst_id_str_set_static_str (&sysmem, GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY); + gst_id_str_set_static_str (&dmabuf, GST_CAPS_FEATURE_MEMORY_DMABUF); + gst_id_str_set_static_str (&va, GST_CAPS_FEATURE_MEMORY_VA); g_return_if_fail (base); @@ -897,7 +897,7 @@ gst_va_base_dec_get_preferred_format_and_caps_features (GstVaBaseDec * base, guint64 mod = 0; features = gst_caps_get_features (allowed_caps, j); - if (!gst_caps_features_contains_id (features, feats[i])) + if (!gst_caps_features_contains_id_str (features, feats[i])) continue; structure = gst_caps_get_structure (allowed_caps, j); @@ -918,7 +918,7 @@ gst_va_base_dec_get_preferred_format_and_caps_features (GstVaBaseDec * base, if (i == DMABUF && modifier) *modifier = mod; if (capsfeatures) - *capsfeatures = gst_caps_features_new_id (feats[i], NULL); + *capsfeatures = gst_caps_features_new_id_str (feats[i], NULL); goto bail; } diff --git a/subprojects/gst-plugins-bad/sys/va/gstvavpp.c b/subprojects/gst-plugins-bad/sys/va/gstvavpp.c index 247ba412ab..a1e96824a3 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvavpp.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvavpp.c @@ -944,11 +944,12 @@ gst_va_vpp_caps_remove_fields (GstCaps * caps) GstStructure *structure; GstCapsFeatures *features; gint i, n; - guint sysmem, dmabuf, va; + GstIdStr sysmem = GST_ID_STR_INIT, dmabuf = GST_ID_STR_INIT, va = + GST_ID_STR_INIT; - sysmem = g_quark_from_static_string (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY); - dmabuf = g_quark_from_static_string (GST_CAPS_FEATURE_MEMORY_DMABUF); - va = g_quark_from_static_string (GST_CAPS_FEATURE_MEMORY_VA); + gst_id_str_set_static_str (&sysmem, GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY); + gst_id_str_set_static_str (&dmabuf, GST_CAPS_FEATURE_MEMORY_DMABUF); + gst_id_str_set_static_str (&va, GST_CAPS_FEATURE_MEMORY_VA); ret = gst_caps_new_empty (); @@ -964,9 +965,9 @@ gst_va_vpp_caps_remove_fields (GstCaps * caps) structure = gst_structure_copy (structure); - if (gst_caps_features_contains_id (features, sysmem) - || gst_caps_features_contains_id (features, dmabuf) - || gst_caps_features_contains_id (features, va)) { + if (gst_caps_features_contains_id_str (features, &sysmem) + || gst_caps_features_contains_id_str (features, &dmabuf) + || gst_caps_features_contains_id_str (features, &va)) { /* rangify frame size */ gst_structure_set (structure, "width", GST_TYPE_INT_RANGE, 1, G_MAXINT, "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL); diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c index c1a0a295bb..7072cf42ac 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/gstglupload.c @@ -131,7 +131,7 @@ filter_features (GstCapsFeatures * features, G_GNUC_UNUSED GstStructure * structure, gpointer user_data) { const GstCapsFeatures *user_features = user_data; - GQuark feature; + const GstIdStr *feature; guint i, num; if (gst_caps_features_is_any (features)) @@ -139,8 +139,8 @@ filter_features (GstCapsFeatures * features, num = gst_caps_features_get_size (user_features); for (i = 0; i < num; i++) { - feature = gst_caps_features_get_nth_id (user_features, i); - if (gst_caps_features_contains_id (features, feature)) + feature = gst_caps_features_get_nth_id_str (user_features, i); + if (gst_caps_features_contains_id_str (features, feature)) return TRUE; }