mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
analytics: Replace type quark with opaque struct pointer
This way, we can add function pointers in there for things like transformations. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5863>
This commit is contained in:
parent
91815710dd
commit
5d3035553c
10 changed files with 192 additions and 208 deletions
|
@ -9,7 +9,7 @@ and/or use gtk-doc annotations. -->
|
|||
<alias name="MtdType" c:type="GstAnalyticsMtdType">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h">Type of analytics meta data</doc>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
||||
<type name="guint32" c:type="guint32"/>
|
||||
<type name="guintptr" c:type="guintptr"/>
|
||||
</alias>
|
||||
<constant name="AN_RELATION_META_TAG" value="GST-ANALYSIS-RELATION-META-TAG" c:type="GST_AN_RELATION_META_TAG">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
||||
|
@ -97,19 +97,11 @@ Get quark of the class at @index</doc>
|
|||
</parameter>
|
||||
</parameters>
|
||||
</method>
|
||||
<function name="get_type_name" c:identifier="gst_analytics_cls_mtd_get_type_name" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">Get the static string representing #GstAnalyticsMtd type.</doc>
|
||||
<function name="get_mtd_type" c:identifier="gst_analytics_cls_mtd_get_mtd_type" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">Get a id identifying #GstAnalyticsMtd type.</doc>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">#GstAnalyticsMtd type name.</doc>
|
||||
<type name="utf8" c:type="const gchar*"/>
|
||||
</return-value>
|
||||
</function>
|
||||
<function name="get_type_quark" c:identifier="gst_analytics_cls_mtd_get_type_quark" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">Get a quark identifying #GstAnalyticsMtd type.</doc>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">Quark of #GstAnalyticsMtd type</doc>
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">opaque id of #GstAnalyticsMtd type</doc>
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
</return-value>
|
||||
</function>
|
||||
|
@ -157,6 +149,20 @@ Get instance id</doc>
|
|||
</instance-parameter>
|
||||
</parameters>
|
||||
</method>
|
||||
<method name="get_mtd_type" c:identifier="gst_analytics_mtd_get_mtd_type" version="1.24">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">opaque id of the type</doc>
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
</return-value>
|
||||
<parameters>
|
||||
<instance-parameter name="instance" transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">Instance of #GstAnalyticsMtd
|
||||
Get analysis result type.</doc>
|
||||
<type name="Mtd" c:type="GstAnalyticsMtd*"/>
|
||||
</instance-parameter>
|
||||
</parameters>
|
||||
</method>
|
||||
<method name="get_size" c:identifier="gst_analytics_mtd_get_size" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">@instance Instance of #GstAnalyticsRelatableMtd
|
||||
Get instance size</doc>
|
||||
|
@ -171,20 +177,53 @@ Get instance size</doc>
|
|||
</instance-parameter>
|
||||
</parameters>
|
||||
</method>
|
||||
<method name="get_type_quark" c:identifier="gst_analytics_mtd_get_type_quark" version="1.24">
|
||||
<function name="type_get_name" c:identifier="gst_analytics_mtd_type_get_name">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">quark associated with type.</doc>
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
<type name="utf8" c:type="const gchar*"/>
|
||||
</return-value>
|
||||
<parameters>
|
||||
<instance-parameter name="instance" transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">Instance of #GstAnalyticsMtd
|
||||
Get analysis result type.</doc>
|
||||
<type name="Mtd" c:type="GstAnalyticsMtd*"/>
|
||||
</instance-parameter>
|
||||
<parameter name="type" transfer-ownership="none">
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</method>
|
||||
</function>
|
||||
</record>
|
||||
<record name="MtdImpl" c:type="GstAnalyticsMtdImpl">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
||||
<field name="name" writable="1">
|
||||
<type name="utf8" c:type="const char*"/>
|
||||
</field>
|
||||
<field name="mtd_meta_transform">
|
||||
<callback name="mtd_meta_transform">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<type name="gboolean" c:type="gboolean"/>
|
||||
</return-value>
|
||||
<parameters>
|
||||
<parameter name="transbuf" transfer-ownership="none">
|
||||
<type name="Gst.Buffer" c:type="GstBuffer*"/>
|
||||
</parameter>
|
||||
<parameter name="mtd" transfer-ownership="none">
|
||||
<type name="Mtd" c:type="GstAnalyticsMtd*"/>
|
||||
</parameter>
|
||||
<parameter name="buffer" transfer-ownership="none">
|
||||
<type name="Gst.Buffer" c:type="GstBuffer*"/>
|
||||
</parameter>
|
||||
<parameter name="type" transfer-ownership="none">
|
||||
<type name="GLib.Quark" c:type="GQuark"/>
|
||||
</parameter>
|
||||
<parameter name="data" transfer-ownership="none">
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</callback>
|
||||
</field>
|
||||
<field name="_reserved" writable="1">
|
||||
<array zero-terminated="0" fixed-size="20">
|
||||
<type name="gpointer" c:type="gpointer"/>
|
||||
</array>
|
||||
</field>
|
||||
</record>
|
||||
<record name="ODMtd" c:type="GstAnalyticsODMtd" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.h">Handle containing data required to use gst_analytics_od_mtd APIs. This type
|
||||
|
@ -233,7 +272,8 @@ identified by @id is stored.</doc>
|
|||
</parameter>
|
||||
</parameters>
|
||||
</method>
|
||||
<method name="get_type" c:identifier="gst_analytics_od_mtd_get_type" version="1.24">
|
||||
<method name="get_obj_type" c:identifier="gst_analytics_od_mtd_get_obj_type" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Quark of the class of object associated with this location.</doc>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Quark different from on success and 0 on failure.</doc>
|
||||
|
@ -241,25 +281,16 @@ identified by @id is stored.</doc>
|
|||
</return-value>
|
||||
<parameters>
|
||||
<instance-parameter name="handle" transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Instance handle
|
||||
Quark of the class of object associated with this location.</doc>
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Instance handle</doc>
|
||||
<type name="ODMtd" c:type="GstAnalyticsODMtd*"/>
|
||||
</instance-parameter>
|
||||
</parameters>
|
||||
</method>
|
||||
<function name="get_type_name" c:identifier="gst_analytics_od_mtd_get_type_name" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Get a text representing object-detection metadata type.</doc>
|
||||
<function name="get_mtd_type" c:identifier="gst_analytics_od_mtd_get_mtd_type" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Get an id that represent object-detection metadata type</doc>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">#GstAnalyticsMtd type name.</doc>
|
||||
<type name="utf8" c:type="const gchar*"/>
|
||||
</return-value>
|
||||
</function>
|
||||
<function name="get_type_quark" c:identifier="gst_analytics_od_mtd_get_type_quark" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Get a quark that represent object-detection metadata type</doc>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Quark of #GstAnalyticsMtd type</doc>
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Opaqu id of the #GstAnalyticsMtd type</doc>
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
</return-value>
|
||||
</function>
|
||||
|
@ -337,9 +368,9 @@ Since 1.24</doc>
|
|||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">Instance</doc>
|
||||
<type name="RelationMeta" c:type="GstAnalyticsRelationMeta*"/>
|
||||
</instance-parameter>
|
||||
<parameter name="type" transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">Type of relatable (#GstAnalyticsRelatableMtd)</doc>
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
<parameter name="impl" transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">Implementation of relatable (#GstAnalyticsRelatableMtd)</doc>
|
||||
<type name="MtdImpl" c:type="const GstAnalyticsMtdImpl*"/>
|
||||
</parameter>
|
||||
<parameter name="size" transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">Size required</doc>
|
||||
|
@ -839,19 +870,13 @@ Set tracking to lost</doc>
|
|||
</parameter>
|
||||
</parameters>
|
||||
</method>
|
||||
<function name="get_type_name" c:identifier="gst_analytics_tracking_mtd_get_type_name">
|
||||
<function name="get_mtd_type" c:identifier="gst_analytics_tracking_mtd_get_mtd_type" version="1.24">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjecttrackingmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<type name="utf8" c:type="const gchar*"/>
|
||||
</return-value>
|
||||
</function>
|
||||
<function name="get_type_quark" c:identifier="gst_analytics_tracking_mtd_get_type_quark" version="1.24">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjecttrackingmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjecttrackingmtd.c">Quark representing the type of GstAnalyticsRelatableMtd
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjecttrackingmtd.c">id representing the type of GstAnalyticsRelatableMtd
|
||||
|
||||
Get the quark identifying the relatable type</doc>
|
||||
<type name="GLib.Quark" c:type="GQuark"/>
|
||||
Get the opaque id identifying the relatable type</doc>
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
</return-value>
|
||||
</function>
|
||||
</record>
|
||||
|
@ -912,35 +937,30 @@ Since 1.24</doc>
|
|||
</parameter>
|
||||
</parameters>
|
||||
</function>
|
||||
<function name="cls_mtd_get_type_name" c:identifier="gst_analytics_cls_mtd_get_type_name" moved-to="ClsMtd.get_type_name" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">Get the static string representing #GstAnalyticsMtd type.</doc>
|
||||
<function name="cls_mtd_get_mtd_type" c:identifier="gst_analytics_cls_mtd_get_mtd_type" moved-to="ClsMtd.get_mtd_type" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">Get a id identifying #GstAnalyticsMtd type.</doc>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">#GstAnalyticsMtd type name.</doc>
|
||||
<type name="utf8" c:type="const gchar*"/>
|
||||
</return-value>
|
||||
</function>
|
||||
<function name="cls_mtd_get_type_quark" c:identifier="gst_analytics_cls_mtd_get_type_quark" moved-to="ClsMtd.get_type_quark" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">Get a quark identifying #GstAnalyticsMtd type.</doc>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">Quark of #GstAnalyticsMtd type</doc>
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsclassificationmtd.c">opaque id of #GstAnalyticsMtd type</doc>
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
</return-value>
|
||||
</function>
|
||||
<function name="od_mtd_get_type_name" c:identifier="gst_analytics_od_mtd_get_type_name" moved-to="ODMtd.get_type_name" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Get a text representing object-detection metadata type.</doc>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.h"/>
|
||||
<function name="mtd_type_get_name" c:identifier="gst_analytics_mtd_type_get_name" moved-to="Mtd.type_get_name">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">#GstAnalyticsMtd type name.</doc>
|
||||
<type name="utf8" c:type="const gchar*"/>
|
||||
</return-value>
|
||||
<parameters>
|
||||
<parameter name="type" transfer-ownership="none">
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</function>
|
||||
<function name="od_mtd_get_type_quark" c:identifier="gst_analytics_od_mtd_get_type_quark" moved-to="ODMtd.get_type_quark" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Get a quark that represent object-detection metadata type</doc>
|
||||
<function name="od_mtd_get_mtd_type" c:identifier="gst_analytics_od_mtd_get_mtd_type" moved-to="ODMtd.get_mtd_type" version="1.24">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Get an id that represent object-detection metadata type</doc>
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Quark of #GstAnalyticsMtd type</doc>
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjectdetectionmtd.c">Opaqu id of the #GstAnalyticsMtd type</doc>
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
</return-value>
|
||||
</function>
|
||||
|
@ -972,19 +992,13 @@ instance.</doc>
|
|||
<type name="Gst.MetaInfo" c:type="const GstMetaInfo*"/>
|
||||
</return-value>
|
||||
</function>
|
||||
<function name="tracking_mtd_get_type_name" c:identifier="gst_analytics_tracking_mtd_get_type_name" moved-to="TrackingMtd.get_type_name">
|
||||
<function name="tracking_mtd_get_mtd_type" c:identifier="gst_analytics_tracking_mtd_get_mtd_type" moved-to="TrackingMtd.get_mtd_type" version="1.24">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjecttrackingmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<type name="utf8" c:type="const gchar*"/>
|
||||
</return-value>
|
||||
</function>
|
||||
<function name="tracking_mtd_get_type_quark" c:identifier="gst_analytics_tracking_mtd_get_type_quark" moved-to="TrackingMtd.get_type_quark" version="1.24">
|
||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjecttrackingmtd.h"/>
|
||||
<return-value transfer-ownership="none">
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjecttrackingmtd.c">Quark representing the type of GstAnalyticsRelatableMtd
|
||||
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsobjecttrackingmtd.c">id representing the type of GstAnalyticsRelatableMtd
|
||||
|
||||
Get the quark identifying the relatable type</doc>
|
||||
<type name="GLib.Quark" c:type="GQuark"/>
|
||||
Get the opaque id identifying the relatable type</doc>
|
||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
</return-value>
|
||||
</function>
|
||||
</namespace>
|
||||
|
|
|
@ -24,9 +24,10 @@
|
|||
|
||||
#include "gstanalyticsclassificationmtd.h"
|
||||
|
||||
#define GST_RELATABLE_MTD_CLASSIFICATION_TYPE_NAME "classification"
|
||||
|
||||
static char type[] = GST_RELATABLE_MTD_CLASSIFICATION_TYPE_NAME;
|
||||
static const GstAnalyticsMtdImpl cls_impl = {
|
||||
"classification",
|
||||
NULL
|
||||
};
|
||||
|
||||
typedef struct _GstAnalyticsClsConfLvlAndClass GstAnalyticsClsConfLvlAndClass;
|
||||
typedef struct _GstAnalyticsClsMtdData GstAnalyticsClsMtdData;
|
||||
|
@ -53,31 +54,17 @@ struct _GstAnalyticsClsMtdData
|
|||
};
|
||||
|
||||
/**
|
||||
* gst_analytics_cls_mtd_get_type_quark:
|
||||
* Get a quark identifying #GstAnalyticsMtd type.
|
||||
* gst_analytics_cls_mtd_get_mtd_type:
|
||||
* Get a id identifying #GstAnalyticsMtd type.
|
||||
*
|
||||
* Returns: Quark of #GstAnalyticsMtd type
|
||||
* Returns: opaque id of #GstAnalyticsMtd type
|
||||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
GstAnalyticsMtdType
|
||||
gst_analytics_cls_mtd_get_type_quark (void)
|
||||
gst_analytics_cls_mtd_get_mtd_type (void)
|
||||
{
|
||||
return g_quark_from_static_string (type);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_analytics_cls_mtd_get_type_name:
|
||||
* Get the static string representing #GstAnalyticsMtd type.
|
||||
*
|
||||
* Returns: #GstAnalyticsMtd type name.
|
||||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
const gchar *
|
||||
gst_analytics_cls_mtd_get_type_name (void)
|
||||
{
|
||||
return GST_RELATABLE_MTD_CLASSIFICATION_TYPE_NAME;
|
||||
return (GstAnalyticsMtdType) & cls_impl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -191,7 +178,6 @@ gst_analytics_relation_meta_add_cls_mtd (GstAnalyticsRelationMeta *
|
|||
instance, gsize length, gfloat * confidence_levels, GQuark * class_quarks,
|
||||
GstAnalyticsClsMtd * cls_mtd)
|
||||
{
|
||||
GQuark type = gst_analytics_cls_mtd_get_type_quark ();
|
||||
g_return_val_if_fail (instance, FALSE);
|
||||
gsize confidence_levels_size =
|
||||
(sizeof (GstAnalyticsClsConfLvlAndClass) * length);
|
||||
|
@ -199,7 +185,7 @@ gst_analytics_relation_meta_add_cls_mtd (GstAnalyticsRelationMeta *
|
|||
GstAnalyticsClsConfLvlAndClass *conf_lvls_and_classes;
|
||||
|
||||
GstAnalyticsClsMtdData *cls_mtd_data = (GstAnalyticsClsMtdData *)
|
||||
gst_analytics_relation_meta_add_mtd (instance, type, size, cls_mtd);
|
||||
gst_analytics_relation_meta_add_mtd (instance, &cls_impl, size, cls_mtd);
|
||||
if (cls_mtd_data) {
|
||||
cls_mtd_data->length = length;
|
||||
for (gsize i = 0; i < length; i++) {
|
||||
|
@ -255,5 +241,5 @@ gst_analytics_relation_meta_get_cls_mtd (GstAnalyticsRelationMeta * meta,
|
|||
guint an_meta_id, GstAnalyticsClsMtd * rlt)
|
||||
{
|
||||
return gst_analytics_relation_meta_get_mtd (meta, an_meta_id,
|
||||
gst_analytics_cls_mtd_get_type_quark (), (GstAnalyticsClsMtd *) rlt);
|
||||
gst_analytics_cls_mtd_get_mtd_type (), (GstAnalyticsClsMtd *) rlt);
|
||||
}
|
||||
|
|
|
@ -42,10 +42,7 @@ G_BEGIN_DECLS
|
|||
typedef struct _GstAnalyticsMtd GstAnalyticsClsMtd;
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
GstAnalyticsMtdType gst_analytics_cls_mtd_get_type_quark (void);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
const gchar *gst_analytics_cls_mtd_get_type_name (void);
|
||||
GstAnalyticsMtdType gst_analytics_cls_mtd_get_mtd_type (void);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
gfloat gst_analytics_cls_mtd_get_level (GstAnalyticsClsMtd * handle,
|
||||
|
|
|
@ -39,7 +39,7 @@ GST_DEBUG_CATEGORY_STATIC (an_relation_meta_debug);
|
|||
*/
|
||||
typedef struct
|
||||
{
|
||||
GstAnalyticsMtdType analysis_type;
|
||||
const GstAnalyticsMtdImpl *impl;
|
||||
guint id;
|
||||
gsize size;
|
||||
gpointer data[];
|
||||
|
@ -88,8 +88,6 @@ typedef struct _GstAnalyticsRelationMeta
|
|||
|
||||
} GstAnalyticsRelationMeta;
|
||||
|
||||
static char invalid_type_name[] = "_invalid";
|
||||
|
||||
static guint
|
||||
gst_analytics_relation_meta_get_next_id (GstAnalyticsRelationMeta * meta);
|
||||
|
||||
|
@ -111,25 +109,24 @@ gst_analytics_relation_meta_get_mtd_data_internal (GstAnalyticsRelationMeta *
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_analytics_mtd_get_type_quark:
|
||||
* gst_analytics_mtd_get_mtd_type:
|
||||
* @instance: Instance of #GstAnalyticsMtd
|
||||
* Get analysis result type.
|
||||
*
|
||||
* Returns: quark associated with type.
|
||||
* Returns: opaque id of the type
|
||||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
GstAnalyticsMtdType
|
||||
gst_analytics_mtd_get_type_quark (GstAnalyticsMtd * handle)
|
||||
gst_analytics_mtd_get_mtd_type (GstAnalyticsMtd * handle)
|
||||
{
|
||||
GstAnalyticsRelatableMtdData *rlt;
|
||||
rlt = gst_analytics_relation_meta_get_mtd_data_internal (handle->meta,
|
||||
handle->id);
|
||||
|
||||
g_return_val_if_fail (rlt != NULL,
|
||||
g_quark_from_static_string (invalid_type_name));
|
||||
g_return_val_if_fail (rlt != NULL, 0);
|
||||
|
||||
return rlt->analysis_type;
|
||||
return (GstAnalyticsMtdType) rlt->impl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,6 +167,15 @@ gst_analytics_mtd_get_size (GstAnalyticsMtd * handle)
|
|||
return rlt->size;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
gst_analytics_mtd_type_get_name (GstAnalyticsMtdType type)
|
||||
{
|
||||
GstAnalyticsMtdImpl *impl = (GstAnalyticsMtdImpl *) type;
|
||||
|
||||
g_return_val_if_fail (impl != NULL, NULL);
|
||||
|
||||
return impl->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_analytics_relation_get_length:
|
||||
|
@ -801,7 +807,7 @@ gst_buffer_get_analytics_relation_meta (GstBuffer * buffer)
|
|||
/**
|
||||
* gst_analytics_relation_meta_add_mtd: (skip)
|
||||
* @meta: Instance
|
||||
* @type: Type of relatable (#GstAnalyticsRelatableMtd)
|
||||
* @impl: Implementation of relatable (#GstAnalyticsRelatableMtd)
|
||||
* @size: Size required
|
||||
* @rlt_mtd: Updated handle
|
||||
*
|
||||
|
@ -814,7 +820,7 @@ gst_buffer_get_analytics_relation_meta (GstBuffer * buffer)
|
|||
*/
|
||||
gpointer
|
||||
gst_analytics_relation_meta_add_mtd (GstAnalyticsRelationMeta * meta,
|
||||
GstAnalyticsMtdType type, gsize size, GstAnalyticsMtd * rlt_mtd)
|
||||
const GstAnalyticsMtdImpl * impl, gsize size, GstAnalyticsMtd * rlt_mtd)
|
||||
{
|
||||
gsize object_size;
|
||||
gsize new_size;
|
||||
|
@ -860,7 +866,7 @@ gst_analytics_relation_meta_add_mtd (GstAnalyticsRelationMeta * meta,
|
|||
dest =
|
||||
(GstAnalyticsRelatableMtdData *) (meta->analysis_results +
|
||||
meta->offset);
|
||||
dest->analysis_type = type;
|
||||
dest->impl = impl;
|
||||
dest->id = gst_analytics_relation_meta_get_next_id (meta);
|
||||
dest->size = size;
|
||||
meta->mtd_data_lookup[dest->id] = meta->offset;
|
||||
|
@ -870,7 +876,7 @@ gst_analytics_relation_meta_add_mtd (GstAnalyticsRelationMeta * meta,
|
|||
rlt_mtd->meta = meta;
|
||||
GST_CAT_TRACE (GST_CAT_AN_RELATION, "Add %p relatable type=%s (%"
|
||||
G_GSIZE_FORMAT " / %" G_GSIZE_FORMAT ").", dest,
|
||||
g_quark_to_string (type), new_size, meta->max_size);
|
||||
impl->name, new_size, meta->max_size);
|
||||
} else {
|
||||
GST_CAT_ERROR (GST_CAT_AN_RELATION,
|
||||
"Failed to add relatable, out-of-space (%" G_GSIZE_FORMAT " / %"
|
||||
|
@ -915,11 +921,12 @@ gst_analytics_relation_meta_get_mtd (GstAnalyticsRelationMeta * meta,
|
|||
if (d == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (d->analysis_type == 0) {
|
||||
if (d->impl == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (type != GST_ANALYTICS_MTD_TYPE_ANY && d->analysis_type != type) {
|
||||
if (type != GST_ANALYTICS_MTD_TYPE_ANY &&
|
||||
d->impl != (GstAnalyticsMtdImpl *) type) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -976,8 +983,8 @@ gst_analytics_relation_meta_get_direct_related (GstAnalyticsRelationMeta * meta,
|
|||
gsize i;
|
||||
|
||||
GST_CAT_TRACE (GST_CAT_AN_RELATION,
|
||||
"Looking for %s related to %u by %d", g_quark_to_string (type),
|
||||
an_meta_id, relation_type);
|
||||
"Looking for %s related to %u by %d",
|
||||
gst_analytics_mtd_type_get_name (type), an_meta_id, relation_type);
|
||||
|
||||
g_return_val_if_fail (rmeta != NULL, FALSE);
|
||||
g_return_val_if_fail (type != 0, FALSE);
|
||||
|
@ -1009,7 +1016,7 @@ gst_analytics_relation_meta_get_direct_related (GstAnalyticsRelationMeta * meta,
|
|||
rlt_mtd_data = (GstAnalyticsRelatableMtdData *)
|
||||
(meta->mtd_data_lookup[i] + meta->analysis_results);
|
||||
rlt_mtd->id = rlt_mtd_data->id;
|
||||
if (gst_analytics_mtd_get_type_quark (rlt_mtd) == type) {
|
||||
if (gst_analytics_mtd_get_mtd_type (rlt_mtd) == type) {
|
||||
if (state) {
|
||||
*state = GSIZE_TO_POINTER (G_MINSSIZE | i);
|
||||
}
|
||||
|
@ -1059,7 +1066,7 @@ gst_analytics_relation_meta_iterate (GstAnalyticsRelationMeta * meta,
|
|||
rlt_mtd->id = rlt_mtd_data->id;
|
||||
rlt_mtd->meta = meta;
|
||||
if (type == GST_ANALYTICS_MTD_TYPE_ANY ||
|
||||
gst_analytics_mtd_get_type_quark (rlt_mtd) == type) {
|
||||
gst_analytics_mtd_get_mtd_type (rlt_mtd) == type) {
|
||||
*state = GSIZE_TO_POINTER (G_MINSSIZE | index);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ typedef struct _GstAnalyticsMtd GstAnalyticsMtd;
|
|||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
typedef guint32 GstAnalyticsMtdType;
|
||||
typedef guintptr GstAnalyticsMtdType;
|
||||
|
||||
/**
|
||||
* GST_ANALYTICS_MTD_TYPE_ANY:
|
||||
|
@ -75,8 +75,18 @@ struct _GstAnalyticsMtd
|
|||
GstAnalyticsRelationMeta *meta;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
const char *name;
|
||||
|
||||
gboolean (*mtd_meta_transform) (GstBuffer *transbuf, GstAnalyticsMtd *mtd,
|
||||
GstBuffer *buffer, GQuark type,
|
||||
gpointer data);
|
||||
|
||||
gpointer _reserved[GST_PADDING_LARGE];
|
||||
} GstAnalyticsMtdImpl;
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
GstAnalyticsMtdType gst_analytics_mtd_get_type_quark (GstAnalyticsMtd * instance);
|
||||
GstAnalyticsMtdType gst_analytics_mtd_get_mtd_type (GstAnalyticsMtd * instance);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
guint gst_analytics_mtd_get_id (GstAnalyticsMtd * instance);
|
||||
|
@ -84,6 +94,9 @@ guint gst_analytics_mtd_get_id (GstAnalyticsMtd * instance);
|
|||
GST_ANALYTICS_META_API
|
||||
gsize gst_analytics_mtd_get_size (GstAnalyticsMtd * instance);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
const gchar *gst_analytics_mtd_type_get_name (GstAnalyticsMtdType type);
|
||||
|
||||
typedef struct _GstAnalyticsRelationMetaInitParams
|
||||
GstAnalyticsRelationMetaInitParams;
|
||||
|
||||
|
@ -174,7 +187,7 @@ gst_buffer_get_analytics_relation_meta (GstBuffer * buffer);
|
|||
GST_ANALYTICS_META_API
|
||||
gpointer
|
||||
gst_analytics_relation_meta_add_mtd (GstAnalyticsRelationMeta * meta,
|
||||
GstAnalyticsMtdType type, gsize size, GstAnalyticsMtd * rlt_mtd);
|
||||
const GstAnalyticsMtdImpl * impl, gsize size, GstAnalyticsMtd * rlt_mtd);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
gboolean
|
||||
|
|
|
@ -24,10 +24,6 @@
|
|||
|
||||
#include "gstanalyticsobjectdetectionmtd.h"
|
||||
|
||||
#define GST_RELATABLE_MTD_OD_TYPE_NAME "object-detection"
|
||||
|
||||
static char type[] = GST_RELATABLE_MTD_OD_TYPE_NAME;
|
||||
|
||||
typedef struct _GstAnalyticsODMtdData GstAnalyticsODMtdData;
|
||||
|
||||
/**
|
||||
|
@ -53,33 +49,23 @@ struct _GstAnalyticsODMtdData
|
|||
gfloat location_confidence_lvl;
|
||||
};
|
||||
|
||||
static const GstAnalyticsMtdImpl od_impl = {
|
||||
"object-detection",
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
* gst_analytics_od_mtd_get_type_quark:
|
||||
* Get a quark that represent object-detection metadata type
|
||||
* gst_analytics_od_mtd_get_mtd_type:
|
||||
* Get an id that represent object-detection metadata type
|
||||
*
|
||||
* Returns: Quark of #GstAnalyticsMtd type
|
||||
* Returns: Opaqu id of the #GstAnalyticsMtd type
|
||||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
GstAnalyticsMtdType
|
||||
gst_analytics_od_mtd_get_type_quark (void)
|
||||
gst_analytics_od_mtd_get_mtd_type (void)
|
||||
{
|
||||
return g_quark_from_static_string (type);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_analytics_od_mtd_get_type_name:
|
||||
* Get a text representing object-detection metadata type.
|
||||
*
|
||||
* Returns: #GstAnalyticsMtd type name.
|
||||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
const gchar *
|
||||
gst_analytics_od_mtd_get_type_name (void)
|
||||
{
|
||||
return GST_RELATABLE_MTD_OD_TYPE_NAME;
|
||||
return (GstAnalyticsMtdType) & od_impl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -121,20 +107,21 @@ gst_analytics_od_mtd_get_location (GstAnalyticsODMtd * instance,
|
|||
}
|
||||
|
||||
/**
|
||||
* gst_analytics_od_mtd_get_type:
|
||||
* gst_analytics_od_mtd_get_obj_type:
|
||||
* @handle: Instance handle
|
||||
*
|
||||
* Quark of the class of object associated with this location.
|
||||
*
|
||||
* Returns: Quark different from on success and 0 on failure.
|
||||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
GQuark
|
||||
gst_analytics_od_mtd_get_type (GstAnalyticsODMtd * handle)
|
||||
gst_analytics_od_mtd_get_obj_type (GstAnalyticsODMtd * handle)
|
||||
{
|
||||
GstAnalyticsODMtdData *data;
|
||||
g_return_val_if_fail (handle != NULL, 0);
|
||||
data = gst_analytics_relation_meta_get_mtd_data (handle->meta,
|
||||
handle->id);
|
||||
data = gst_analytics_relation_meta_get_mtd_data (handle->meta, handle->id);
|
||||
g_return_val_if_fail (data != NULL, 0);
|
||||
return data->object_type;
|
||||
}
|
||||
|
@ -161,10 +148,9 @@ gst_analytics_relation_meta_add_od_mtd (GstAnalyticsRelationMeta *
|
|||
gfloat loc_conf_lvl, GstAnalyticsODMtd * od_mtd)
|
||||
{
|
||||
g_return_val_if_fail (instance != NULL, FALSE);
|
||||
GstAnalyticsMtdType mtd_type = gst_analytics_od_mtd_get_type_quark ();
|
||||
gsize size = sizeof (GstAnalyticsODMtdData);
|
||||
GstAnalyticsODMtdData *od_mtd_data = (GstAnalyticsODMtdData *)
|
||||
gst_analytics_relation_meta_add_mtd (instance, mtd_type, size, od_mtd);
|
||||
gst_analytics_relation_meta_add_mtd (instance, &od_impl, size, od_mtd);
|
||||
if (od_mtd_data) {
|
||||
od_mtd_data->x = x;
|
||||
od_mtd_data->y = y;
|
||||
|
@ -195,5 +181,5 @@ gst_analytics_relation_meta_get_od_mtd (GstAnalyticsRelationMeta * meta,
|
|||
guint an_meta_id, GstAnalyticsODMtd * rlt)
|
||||
{
|
||||
return gst_analytics_relation_meta_get_mtd (meta, an_meta_id,
|
||||
gst_analytics_od_mtd_get_type_quark (), (GstAnalyticsODMtd *) rlt);
|
||||
gst_analytics_od_mtd_get_mtd_type (), (GstAnalyticsODMtd *) rlt);
|
||||
}
|
||||
|
|
|
@ -46,17 +46,14 @@ G_BEGIN_DECLS
|
|||
typedef struct _GstAnalyticsMtd GstAnalyticsODMtd;
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
GstAnalyticsMtdType gst_analytics_od_mtd_get_type_quark (void);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
const gchar *gst_analytics_od_mtd_get_type_name (void);
|
||||
GstAnalyticsMtdType gst_analytics_od_mtd_get_mtd_type (void);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
gboolean gst_analytics_od_mtd_get_location (GstAnalyticsODMtd * instance,
|
||||
gint * x, gint * y, gint * w, gint * h, gfloat * loc_conf_lvl);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
GQuark gst_analytics_od_mtd_get_type (GstAnalyticsODMtd * handle);
|
||||
GQuark gst_analytics_od_mtd_get_obj_type (GstAnalyticsODMtd * handle);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
gboolean gst_analytics_relation_meta_add_od_mtd (
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
|
||||
#include "gstanalyticsobjecttrackingmtd.h"
|
||||
|
||||
#define GST_RELATABLE_MTD_TRACKING_TYPE_NAME "object-tracking"
|
||||
|
||||
typedef struct _GstAnalyticsTrackingMtdData GstAnalyticsTrackingMtdData;
|
||||
|
||||
/**
|
||||
|
@ -48,34 +46,23 @@ struct _GstAnalyticsTrackingMtdData
|
|||
};
|
||||
|
||||
|
||||
static char type[] = GST_RELATABLE_MTD_TRACKING_TYPE_NAME;
|
||||
static const GstAnalyticsMtdImpl tracking_impl = {
|
||||
"object-tracking",
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
* gst_analytics_tracking_mtd_get_type_quark:
|
||||
* Returns: Quark representing the type of GstAnalyticsRelatableMtd
|
||||
* gst_analytics_tracking_mtd_get_mtd_type:
|
||||
* Returns: id representing the type of GstAnalyticsRelatableMtd
|
||||
*
|
||||
* Get the quark identifying the relatable type
|
||||
* Get the opaque id identifying the relatable type
|
||||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
GstAnalyticsMtdType
|
||||
gst_analytics_tracking_mtd_get_type_quark (void)
|
||||
gst_analytics_tracking_mtd_get_mtd_type (void)
|
||||
{
|
||||
return g_quark_from_static_string (type);
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_an_od_mtd_get_type_name:
|
||||
* Returns: #GstAnalyticsMtd type name.
|
||||
*
|
||||
* Get the name identifying relatable type name
|
||||
*
|
||||
* Since: 1.24
|
||||
*/
|
||||
const gchar *
|
||||
gst_analytics_tracking_mtd_get_type_name (void)
|
||||
{
|
||||
return GST_RELATABLE_MTD_TRACKING_TYPE_NAME;
|
||||
return (GstAnalyticsMtdType) & tracking_impl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -176,11 +163,10 @@ gst_analytics_relation_meta_add_tracking_mtd (GstAnalyticsRelationMeta *
|
|||
{
|
||||
g_return_val_if_fail (instance, FALSE);
|
||||
|
||||
GstAnalyticsMtdType type = gst_analytics_tracking_mtd_get_type_quark ();
|
||||
gsize size = sizeof (GstAnalyticsTrackingMtdData);
|
||||
GstAnalyticsTrackingMtdData *trk_mtd_data = (GstAnalyticsTrackingMtdData *)
|
||||
gst_analytics_relation_meta_add_mtd (instance,
|
||||
type, size, trk_mtd);
|
||||
gst_analytics_relation_meta_add_mtd (instance, &tracking_impl, size,
|
||||
trk_mtd);
|
||||
|
||||
if (trk_mtd_data) {
|
||||
trk_mtd_data->tracking_id = tracking_id;
|
||||
|
@ -210,6 +196,6 @@ gst_analytics_relation_meta_get_tracking_mtd (GstAnalyticsRelationMeta * meta,
|
|||
guint an_meta_id, GstAnalyticsTrackingMtd * rlt)
|
||||
{
|
||||
return gst_analytics_relation_meta_get_mtd (meta, an_meta_id,
|
||||
gst_analytics_tracking_mtd_get_type_quark (),
|
||||
gst_analytics_tracking_mtd_get_mtd_type (),
|
||||
(GstAnalyticsTrackingMtd *) rlt);
|
||||
}
|
||||
|
|
|
@ -46,10 +46,7 @@ G_BEGIN_DECLS
|
|||
typedef struct _GstAnalyticsMtd GstAnalyticsTrackingMtd;
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
GQuark gst_analytics_tracking_mtd_get_type_quark (void);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
const gchar *gst_analytics_tracking_mtd_get_type_name (void);
|
||||
GstAnalyticsMtdType gst_analytics_tracking_mtd_get_mtd_type (void);
|
||||
|
||||
GST_ANALYTICS_META_API
|
||||
gboolean gst_analytics_tracking_mtd_update_last_seen (GstAnalyticsTrackingMtd * instance,
|
||||
|
|
|
@ -654,10 +654,10 @@ GST_START_TEST (test_od_cls_relation)
|
|||
exist = gst_analytics_relation_meta_get_mtd (rmeta, ids[0], 0, &rlt_mtd);
|
||||
fail_unless (exist == TRUE);
|
||||
|
||||
GQuark mtd_type = gst_analytics_mtd_get_type_quark (&rlt_mtd);
|
||||
GstAnalyticsMtdType mtd_type = gst_analytics_mtd_get_mtd_type (&rlt_mtd);
|
||||
|
||||
/* Verify relatable meta with id == 1 is of type Object Detection */
|
||||
fail_unless (mtd_type == gst_analytics_od_mtd_get_type_quark ());
|
||||
fail_unless (mtd_type == gst_analytics_od_mtd_get_mtd_type ());
|
||||
|
||||
gst_analytics_od_mtd_get_location ((GstAnalyticsODMtd *) & rlt_mtd, &_x, &_y,
|
||||
&_w, &_h, &_loc_conf_lvl);
|
||||
|
@ -667,14 +667,14 @@ GST_START_TEST (test_od_cls_relation)
|
|||
fail_unless (_h == h);
|
||||
fail_unless (_loc_conf_lvl == loc_conf_lvl);
|
||||
|
||||
GST_LOG ("mtd_type:%s", g_quark_to_string (mtd_type));
|
||||
GST_LOG ("mtd_type:%s", gst_analytics_mtd_type_get_name (mtd_type));
|
||||
|
||||
exist = gst_analytics_relation_meta_get_mtd (rmeta, ids[1], 0, &rlt_mtd);
|
||||
fail_unless (exist == TRUE);
|
||||
mtd_type = gst_analytics_mtd_get_type_quark (&rlt_mtd);
|
||||
mtd_type = gst_analytics_mtd_get_mtd_type (&rlt_mtd);
|
||||
|
||||
/* Verify relatable meta with id == 0 is of type classification */
|
||||
fail_unless (mtd_type == gst_analytics_cls_mtd_get_type_quark ());
|
||||
fail_unless (mtd_type == gst_analytics_cls_mtd_get_mtd_type ());
|
||||
gint index =
|
||||
gst_analytics_cls_mtd_get_index_by_quark ((GstAnalyticsClsMtd *) &
|
||||
rlt_mtd,
|
||||
|
@ -691,7 +691,7 @@ GST_START_TEST (test_od_cls_relation)
|
|||
gst_analytics_cls_mtd_get_level ((GstAnalyticsClsMtd *) & rlt_mtd, index);
|
||||
fail_unless (lvl == 0.3f);
|
||||
|
||||
GST_LOG ("mtd_type:%s", g_quark_to_string (mtd_type));
|
||||
GST_LOG ("mtd_type:%s", gst_analytics_mtd_type_get_name (mtd_type));
|
||||
GST_LOG ("cat %f [%d, %d %d, %d", lvl, _x, _y, _w, _h);
|
||||
|
||||
gst_buffer_unref (buf);
|
||||
|
@ -714,7 +714,8 @@ GST_START_TEST (test_multi_od_cls_relation)
|
|||
GArray *path = NULL;
|
||||
gfloat _loc_conf_lvl;
|
||||
gint x, _x, y, _y, w, _w, h, _h;
|
||||
GQuark mtd_type, cls_type;
|
||||
GstAnalyticsMtdType mtd_type;
|
||||
GQuark cls_type;
|
||||
GstAnalyticsMtd mtd;
|
||||
gpointer state = NULL;
|
||||
GQuark class_quarks[2];
|
||||
|
@ -810,8 +811,8 @@ GST_START_TEST (test_multi_od_cls_relation)
|
|||
* the correct data.
|
||||
*/
|
||||
gst_analytics_relation_meta_get_mtd (rmeta, ids[0], 0, &mtd);
|
||||
mtd_type = gst_analytics_mtd_get_type_quark (&mtd);
|
||||
fail_unless (mtd_type == gst_analytics_od_mtd_get_type_quark ());
|
||||
mtd_type = gst_analytics_mtd_get_mtd_type (&mtd);
|
||||
fail_unless (mtd_type == gst_analytics_od_mtd_get_mtd_type ());
|
||||
|
||||
gst_analytics_od_mtd_get_location ((GstAnalyticsODMtd *) & mtd, &_x, &_y, &_w,
|
||||
&_h, &_loc_conf_lvl);
|
||||
|
@ -821,14 +822,14 @@ GST_START_TEST (test_multi_od_cls_relation)
|
|||
fail_unless (_h == 16);
|
||||
fail_unless (_loc_conf_lvl == 0.7f);
|
||||
|
||||
GST_LOG ("mtd_type:%s", g_quark_to_string (mtd_type));
|
||||
GST_LOG ("mtd_type:%s", gst_analytics_mtd_type_get_name (mtd_type));
|
||||
|
||||
/* Verify the relatable metadata 2 is of correct type
|
||||
* (ObjectDetection).
|
||||
*/
|
||||
gst_analytics_relation_meta_get_mtd (rmeta, ids[1], 0, &mtd);
|
||||
mtd_type = gst_analytics_mtd_get_type_quark (&mtd);
|
||||
fail_unless (mtd_type == gst_analytics_cls_mtd_get_type_quark ());
|
||||
mtd_type = gst_analytics_mtd_get_mtd_type (&mtd);
|
||||
fail_unless (mtd_type == gst_analytics_cls_mtd_get_mtd_type ());
|
||||
|
||||
/* Verify data of the CLASSIFICATION retrieved */
|
||||
gint index =
|
||||
|
@ -843,7 +844,7 @@ GST_START_TEST (test_multi_od_cls_relation)
|
|||
gst_analytics_cls_mtd_get_index_by_quark ((GstAnalyticsClsMtd *) & mtd,
|
||||
g_quark_from_string ("cat"));
|
||||
lvl = gst_analytics_cls_mtd_get_level ((GstAnalyticsClsMtd *) & mtd, index);
|
||||
GST_LOG ("mtd_type:%s", g_quark_to_string (mtd_type));
|
||||
GST_LOG ("mtd_type:%s", gst_analytics_mtd_type_get_name (mtd_type));
|
||||
GST_LOG ("cat %f [%d, %d %d, %d", lvl, _x, _y, _w, _h);
|
||||
fail_unless (lvl == 0.9f);
|
||||
|
||||
|
@ -852,7 +853,7 @@ GST_START_TEST (test_multi_od_cls_relation)
|
|||
* Verify it's the first classification metadata
|
||||
*/
|
||||
gst_analytics_relation_meta_get_direct_related (rmeta, od_mtd[0].id,
|
||||
GST_ANALYTICS_REL_TYPE_CONTAIN, gst_analytics_cls_mtd_get_type_quark (),
|
||||
GST_ANALYTICS_REL_TYPE_CONTAIN, gst_analytics_cls_mtd_get_mtd_type (),
|
||||
&state, &mtd);
|
||||
|
||||
cls_id = gst_analytics_mtd_get_id (&mtd);
|
||||
|
@ -865,7 +866,7 @@ GST_START_TEST (test_multi_od_cls_relation)
|
|||
* Verify it's the first classification metadata
|
||||
*/
|
||||
gst_analytics_relation_meta_get_direct_related (rmeta, od_mtd[1].id,
|
||||
GST_ANALYTICS_REL_TYPE_CONTAIN, gst_analytics_cls_mtd_get_type_quark (),
|
||||
GST_ANALYTICS_REL_TYPE_CONTAIN, gst_analytics_cls_mtd_get_mtd_type (),
|
||||
&state, &mtd);
|
||||
cls_id = gst_analytics_mtd_get_id (&mtd);
|
||||
|
||||
|
@ -884,7 +885,7 @@ GST_START_TEST (test_multi_od_cls_relation)
|
|||
|
||||
state = NULL;
|
||||
ret = gst_analytics_relation_meta_get_direct_related (rmeta, od_mtd[1].id,
|
||||
GST_ANALYTICS_REL_TYPE_CONTAIN, gst_analytics_od_mtd_get_type_quark (),
|
||||
GST_ANALYTICS_REL_TYPE_CONTAIN, gst_analytics_od_mtd_get_mtd_type (),
|
||||
&state, &mtd);
|
||||
|
||||
fail_unless (ret == FALSE);
|
||||
|
|
Loading…
Reference in a new issue