From a1e623d200280e589bb3f5363bf74548600b76ea Mon Sep 17 00:00:00 2001 From: Daniel Morin Date: Fri, 6 Dec 2024 00:04:45 -0500 Subject: [PATCH] analytics: add _N_TO_N relation type This relation type define relations between each components of two groups. First component of first group relate to first component of second group, Second component of second group relate to second component of second group, and so on. It's a denser way to express relations in this context. Part-of: --- .gitlab-image-tags.yml | 2 +- girs/GstAnalytics-1.0.gir | 7 ++++++- .../gst-libs/gst/analytics/gstanalyticsmeta.c | 2 +- .../gst-libs/gst/analytics/gstanalyticsmeta.h | 16 +++++++++++++--- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/.gitlab-image-tags.yml b/.gitlab-image-tags.yml index c229ed9e7d..751d6cfa02 100644 --- a/.gitlab-image-tags.yml +++ b/.gitlab-image-tags.yml @@ -13,6 +13,6 @@ variables: LINT_TAG: '2024-02-20.0' - ABI_CHECK_TAG: '2024-12-04.0' + ABI_CHECK_TAG: '2024-12-09.0' WINDOWS_TAG: '2024-11-29.0' diff --git a/girs/GstAnalytics-1.0.gir b/girs/GstAnalytics-1.0.gir index 3dbbdaafd4..7fc10dfe31 100644 --- a/girs/GstAnalytics-1.0.gir +++ b/girs/GstAnalytics-1.0.gir @@ -353,7 +353,12 @@ identified by @id is stored. - + + Used to express relations between two groups + where each group's components correspond to the respective component in the + other group. Since: 1.26 + + reserved diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c b/subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c index 4877f6808a..da2f1c7b6e 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c @@ -649,7 +649,7 @@ gboolean gst_analytics_relation_meta_set_relation (GstAnalyticsRelationMeta * meta, GstAnalyticsRelTypes type, guint an_meta_first_id, guint an_meta_second_id) { - g_return_val_if_fail (type < GST_ANALYTICS_REL_TYPE_LAST, FALSE); + g_return_val_if_fail (type <= 0xFF, FALSE); g_return_val_if_fail (meta, FALSE); if (an_meta_first_id >= meta->rel_order || an_meta_second_id >= meta->rel_order) { diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h b/subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h index 1bb761c097..a6e9ab816b 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h @@ -169,8 +169,10 @@ GstAnalyticsRelationMetaInitParams; * @GST_ANALYTICS_REL_TYPE_NONE: No relation * @GST_ANALYTICS_REL_TYPE_IS_PART_OF: First analysis-meta is part of second analysis-meta * @GST_ANALYTICS_REL_TYPE_CONTAIN: First analysis-meta contain second analysis-meta. - * @GST_ANALYTICS_REL_TYPE_RELATE: First analysis-meta relate to second analysis-meta. - * @GST_ANALYTICS_REL_TYPE_LAST: reserved + * @GST_ANALYTICS_REL_TYPE_RELATE_TO: First analysis-meta relate to second analysis-meta. + * @GST_ANALYTICS_REL_TYPE_N_TO_N: Used to express relations between two groups + * where each group's components correspond to the respective component in the + * other group. Since: 1.26 * @GST_ANALYTICS_REL_TYPE_ANY: Only use for criteria. * * Since: 1.24 @@ -181,7 +183,15 @@ typedef enum GST_ANALYTICS_REL_TYPE_IS_PART_OF = (1 << 1), GST_ANALYTICS_REL_TYPE_CONTAIN = (1 << 2), GST_ANALYTICS_REL_TYPE_RELATE_TO = (1 << 3), - GST_ANALYTICS_REL_TYPE_LAST = (1 << 4), + /** + * GST_ANALYTICS_REL_TYPE_N_TO_N: + * + * Used to express relations between two groups where each group's components + * correspond to the respective component in the other group. + * + * Since: 1.26 + */ + GST_ANALYTICS_REL_TYPE_N_TO_N = (1 << 4), GST_ANALYTICS_REL_TYPE_ANY = G_MAXINT } GstAnalyticsRelTypes;