mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
analytics: Always return a string from mtd_type_get_name()
It makes it easier to use in printf() style strings without worrying about getting a NULL. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6035>
This commit is contained in:
parent
0850922104
commit
351f823704
2 changed files with 22 additions and 3 deletions
|
@ -177,13 +177,16 @@ Get instance size</doc>
|
||||||
</instance-parameter>
|
</instance-parameter>
|
||||||
</parameters>
|
</parameters>
|
||||||
</method>
|
</method>
|
||||||
<function name="type_get_name" c:identifier="gst_analytics_mtd_type_get_name">
|
<function name="type_get_name" c:identifier="gst_analytics_mtd_type_get_name" version="1.24">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">Gets the string version of the name of this type of analytics data</doc>
|
||||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
||||||
<return-value transfer-ownership="none">
|
<return-value transfer-ownership="none">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">the name</doc>
|
||||||
<type name="utf8" c:type="const gchar*"/>
|
<type name="utf8" c:type="const gchar*"/>
|
||||||
</return-value>
|
</return-value>
|
||||||
<parameters>
|
<parameters>
|
||||||
<parameter name="type" transfer-ownership="none">
|
<parameter name="type" transfer-ownership="none">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">The type of analytics data</doc>
|
||||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||||
</parameter>
|
</parameter>
|
||||||
</parameters>
|
</parameters>
|
||||||
|
@ -963,13 +966,16 @@ Since 1.24</doc>
|
||||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||||
</return-value>
|
</return-value>
|
||||||
</function>
|
</function>
|
||||||
<function name="mtd_type_get_name" c:identifier="gst_analytics_mtd_type_get_name" moved-to="Mtd.type_get_name">
|
<function name="mtd_type_get_name" c:identifier="gst_analytics_mtd_type_get_name" moved-to="Mtd.type_get_name" version="1.24">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">Gets the string version of the name of this type of analytics data</doc>
|
||||||
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.h"/>
|
||||||
<return-value transfer-ownership="none">
|
<return-value transfer-ownership="none">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">the name</doc>
|
||||||
<type name="utf8" c:type="const gchar*"/>
|
<type name="utf8" c:type="const gchar*"/>
|
||||||
</return-value>
|
</return-value>
|
||||||
<parameters>
|
<parameters>
|
||||||
<parameter name="type" transfer-ownership="none">
|
<parameter name="type" transfer-ownership="none">
|
||||||
|
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/analytics/gstanalyticsmeta.c">The type of analytics data</doc>
|
||||||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||||
</parameter>
|
</parameter>
|
||||||
</parameters>
|
</parameters>
|
||||||
|
|
|
@ -169,6 +169,16 @@ gst_analytics_mtd_get_size (GstAnalyticsMtd * handle)
|
||||||
return rlt->size;
|
return rlt->size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_analytics_mtd_type_get_name:
|
||||||
|
* @type: The type of analytics data
|
||||||
|
*
|
||||||
|
* Gets the string version of the name of this type of analytics data
|
||||||
|
*
|
||||||
|
* Returns: the name
|
||||||
|
*
|
||||||
|
* Since: 1.24
|
||||||
|
*/
|
||||||
const gchar *
|
const gchar *
|
||||||
gst_analytics_mtd_type_get_name (GstAnalyticsMtdType type)
|
gst_analytics_mtd_type_get_name (GstAnalyticsMtdType type)
|
||||||
{
|
{
|
||||||
|
@ -176,7 +186,10 @@ gst_analytics_mtd_type_get_name (GstAnalyticsMtdType type)
|
||||||
|
|
||||||
g_return_val_if_fail (impl != NULL, NULL);
|
g_return_val_if_fail (impl != NULL, NULL);
|
||||||
|
|
||||||
return impl->name;
|
if (type == GST_ANALYTICS_MTD_TYPE_ANY)
|
||||||
|
return "ANY";
|
||||||
|
else
|
||||||
|
return impl->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue