mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 08:17:01 +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>
|
||||
</parameters>
|
||||
</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"/>
|
||||
<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*"/>
|
||||
</return-value>
|
||||
<parameters>
|
||||
<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"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
|
@ -963,13 +966,16 @@ Since 1.24</doc>
|
|||
<type name="MtdType" c:type="GstAnalyticsMtdType"/>
|
||||
</return-value>
|
||||
</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"/>
|
||||
<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*"/>
|
||||
</return-value>
|
||||
<parameters>
|
||||
<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"/>
|
||||
</parameter>
|
||||
</parameters>
|
||||
|
|
|
@ -169,6 +169,16 @@ gst_analytics_mtd_get_size (GstAnalyticsMtd * handle)
|
|||
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 *
|
||||
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);
|
||||
|
||||
return impl->name;
|
||||
if (type == GST_ANALYTICS_MTD_TYPE_ANY)
|
||||
return "ANY";
|
||||
else
|
||||
return impl->name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue