Doxygen Book
nnstreamer_plugin_api_util.h File Reference

Optional/Additional NNStreamer APIs for sub-plugin writers. (No GStreamer dependency) More...

#include <glib.h>
#include <tensor_typedef.h>
#include <nnstreamer_version.h>
Include dependency graph for nnstreamer_plugin_api_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _STR_NULL(str)   ((str) ? (str) : "(NULL)")
 If the given string is NULL, print "(NULL)". Copied from GST_STR_NULL More...
 
#define gst_tensors_config_is_static(c)   ((c)->info.format == _NNS_TENSOR_FORMAT_STATIC)
 Macro to check stream format (static tensors for caps negotiation) More...
 
#define gst_tensors_config_is_flexible(c)   ((c)->info.format == _NNS_TENSOR_FORMAT_FLEXIBLE)
 Macro to check stream format (flexible tensors for caps negotiation) More...
 
#define gst_tensors_config_is_sparse(c)   ((c)->info.format == _NNS_TENSOR_FORMAT_SPARSE)
 Macro to check stream format (sparse tensors for caps negotiation) More...
 

Functions

void gst_tensor_info_init (GstTensorInfo *info)
 Initialize the tensor info structure. More...
 
void gst_tensor_info_free (GstTensorInfo *info)
 Free allocated data in tensor info structure. More...
 
gsize gst_tensor_info_get_size (const GstTensorInfo *info)
 Get data size of single tensor. More...
 
gboolean gst_tensor_info_validate (const GstTensorInfo *info)
 Check the tensor info is valid. More...
 
gboolean gst_tensor_info_is_equal (const GstTensorInfo *i1, const GstTensorInfo *i2)
 Compare tensor info. More...
 
void gst_tensor_info_copy_n (GstTensorInfo *dest, const GstTensorInfo *src, const guint n)
 Copy tensor info up to n elements. More...
 
void gst_tensor_info_copy (GstTensorInfo *dest, const GstTensorInfo *src)
 Copy tensor info. More...
 
gboolean gst_tensor_info_convert_to_meta (GstTensorInfo *info, GstTensorMetaInfo *meta)
 Convert GstTensorInfo structure to GstTensorMetaInfo. More...
 
guint gst_tensor_info_get_rank (const GstTensorInfo *info)
 Get tensor rank. More...
 
GstTensorInfogst_tensors_info_get_nth_info (GstTensorsInfo *info, guint index)
 Get the pointer of nth tensor information. More...
 
void gst_tensors_info_init (GstTensorsInfo *info)
 Initialize the tensors info structure. More...
 
void gst_tensors_info_free (GstTensorsInfo *info)
 Free allocated data in tensors info structure. More...
 
gsize gst_tensors_info_get_size (const GstTensorsInfo *info, gint index)
 Get data size of single tensor. More...
 
guint gst_tensors_info_parse_dimensions_string (GstTensorsInfo *info, const gchar *dim_string)
 Parse the string of dimensions. More...
 
guint gst_tensors_info_parse_types_string (GstTensorsInfo *info, const gchar *type_string)
 Parse the string of types. More...
 
guint gst_tensors_info_parse_names_string (GstTensorsInfo *info, const gchar *name_string)
 Parse the string of names. More...
 
gchar * gst_tensors_info_get_dimensions_string (const GstTensorsInfo *info)
 Get the string of dimensions in tensors info. More...
 
gchar * gst_tensors_info_get_rank_dimensions_string (const GstTensorsInfo *info, const unsigned int rank)
 Get the string of dimensions in tensors info and rank count. More...
 
gchar * gst_tensors_info_get_types_string (const GstTensorsInfo *info)
 Get the string of types in tensors info. More...
 
gchar * gst_tensors_info_get_names_string (const GstTensorsInfo *info)
 Get the string of tensor names in tensors info. More...
 
gboolean gst_tensors_info_validate (const GstTensorsInfo *info)
 Check the tensors info is valid. More...
 
gboolean gst_tensors_info_is_equal (const GstTensorsInfo *i1, const GstTensorsInfo *i2)
 Compare tensors info. More...
 
void gst_tensors_info_copy (GstTensorsInfo *dest, const GstTensorsInfo *src)
 Copy tensor info. More...
 
gchar * gst_tensors_info_to_string (const GstTensorsInfo *info)
 GstTensorsInfo represented as a string. Caller should free it. More...
 
void gst_tensors_config_init (GstTensorsConfig *config)
 Initialize the tensors config info structure (for other/tensors) More...
 
void gst_tensors_config_free (GstTensorsConfig *config)
 Free allocated data in tensors config structure. More...
 
gboolean gst_tensors_config_validate (const GstTensorsConfig *config)
 Check the tensors are all configured (for other/tensors) More...
 
gboolean gst_tensors_config_is_equal (const GstTensorsConfig *c1, const GstTensorsConfig *c2)
 Compare tensor config info (for other/tensors) More...
 
void gst_tensors_config_copy (GstTensorsConfig *dest, const GstTensorsConfig *src)
 Copy tensors config. More...
 
gchar * gst_tensors_config_to_string (const GstTensorsConfig *config)
 Tensor config represented as a string. Caller should free it. More...
 
gboolean gst_tensor_dimension_is_valid (const tensor_dim dim)
 Check the tensor dimension is valid. More...
 
gboolean gst_tensor_dimension_is_equal (const tensor_dim dim1, const tensor_dim dim2)
 Compare the tensor dimension. More...
 
guint gst_tensor_dimension_get_rank (const tensor_dim dim)
 Get the rank of tensor dimension. More...
 
guint gst_tensor_dimension_get_min_rank (const tensor_dim dim)
 Get the minimum rank of tensor dimension. More...
 
guint gst_tensor_parse_dimension (const gchar *dimstr, tensor_dim dim)
 Parse tensor dimension parameter string. More...
 
gchar * gst_tensor_get_dimension_string (const tensor_dim dim)
 Get dimension string from given tensor dimension. More...
 
gchar * gst_tensor_get_rank_dimension_string (const tensor_dim dim, const unsigned int rank)
 Get dimension string from given tensor dimension and rank count. More...
 
gboolean gst_tensor_dimension_string_is_equal (const gchar *dimstr1, const gchar *dimstr2)
 Compare dimension strings. More...
 
gulong gst_tensor_get_element_count (const tensor_dim dim)
 Count the number of elements of a tensor. More...
 
gsize gst_tensor_get_element_size (tensor_type type)
 Get element size of tensor type (byte per element) More...
 
tensor_type gst_tensor_get_type (const gchar *typestr)
 Get tensor type from string input. More...
 
const gchar * gst_tensor_get_type_string (tensor_type type)
 Get type string of tensor type. More...
 
tensor_format gst_tensor_get_format (const gchar *format_str)
 Get tensor format from string input. More...
 
const gchar * gst_tensor_get_format_string (tensor_format format)
 Get tensor format string. More...
 
gint find_key_strv (const gchar **strv, const gchar *key)
 Find the index value of the given key string array. More...
 
void gst_tensor_meta_info_init (GstTensorMetaInfo *meta)
 Initialize the tensor meta info structure. More...
 
void gst_tensor_meta_info_get_version (GstTensorMetaInfo *meta, guint *major, guint *minor)
 Get the version of tensor meta. More...
 
gboolean gst_tensor_meta_info_validate (GstTensorMetaInfo *meta)
 Check the meta info is valid. More...
 
gsize gst_tensor_meta_info_get_header_size (GstTensorMetaInfo *meta)
 Get the header size to handle a tensor meta. More...
 
gsize gst_tensor_meta_info_get_data_size (GstTensorMetaInfo *meta)
 Get the data size calculated from tensor meta. More...
 
gboolean gst_tensor_meta_info_update_header (GstTensorMetaInfo *meta, gpointer header)
 Update header from tensor meta. More...
 
gboolean gst_tensor_meta_info_parse_header (GstTensorMetaInfo *meta, gpointer header)
 Parse header and fill the tensor meta. More...
 
gboolean gst_tensor_meta_info_convert (GstTensorMetaInfo *meta, GstTensorInfo *info)
 Convert GstTensorMetaInfo structure to GstTensorInfo. More...
 
gchar * nnstreamer_version_string (void)
 Get the version of NNStreamer. More...
 
void nnstreamer_version_fetch (guint *major, guint *minor, guint *micro)
 Get the version of NNStreamer (int, divided). More...
 

Detailed Description

Optional/Additional NNStreamer APIs for sub-plugin writers. (No GStreamer dependency)

NNStreamer Common API Header for sub-plugin writers Copyright (C) 2022 Gichan Jang gicha.nosp@m.n2.j.nosp@m.ang@s.nosp@m.amsu.nosp@m.ng.co.nosp@m.m

Date
28 Jan 2022
See also
https://github.com/nnstreamer/nnstreamer
Author
Gichan Jang gicha.nosp@m.n2.j.nosp@m.ang@s.nosp@m.amsu.nosp@m.ng.co.nosp@m.m
Bug:
No known bugs except for NYI items

Definition in file nnstreamer_plugin_api_util.h.

Macro Definition Documentation

◆ _STR_NULL

#define _STR_NULL (   str)    ((str) ? (str) : "(NULL)")

If the given string is NULL, print "(NULL)". Copied from GST_STR_NULL

Definition at line 26 of file nnstreamer_plugin_api_util.h.

◆ gst_tensors_config_is_flexible

#define gst_tensors_config_is_flexible (   c)    ((c)->info.format == _NNS_TENSOR_FORMAT_FLEXIBLE)

Macro to check stream format (flexible tensors for caps negotiation)

Definition at line 279 of file nnstreamer_plugin_api_util.h.

◆ gst_tensors_config_is_sparse

#define gst_tensors_config_is_sparse (   c)    ((c)->info.format == _NNS_TENSOR_FORMAT_SPARSE)

Macro to check stream format (sparse tensors for caps negotiation)

Definition at line 284 of file nnstreamer_plugin_api_util.h.

◆ gst_tensors_config_is_static

#define gst_tensors_config_is_static (   c)    ((c)->info.format == _NNS_TENSOR_FORMAT_STATIC)

Macro to check stream format (static tensors for caps negotiation)

Definition at line 274 of file nnstreamer_plugin_api_util.h.

Function Documentation

◆ find_key_strv()

gint find_key_strv ( const gchar **  strv,
const gchar *  key 
)

Find the index value of the given key string array.

Returns
Corresponding index
Parameters
strvNull terminated array of gchar *
keyThe key string value
Returns
Corresponding index. Returns -1 if not found.
Parameters
strvNull terminated array of gchar *
keyThe key string value

Definition at line 1586 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_dimension_get_min_rank()

guint gst_tensor_dimension_get_min_rank ( const tensor_dim  dim)

Get the minimum rank of tensor dimension.

The C-arrays with dim 4:4:4 and 4:4:4:1 have same data. In this case, this function returns min rank 3.

Parameters
dimtensor dimension.
Returns
tensor rank (Minimum rank is 1 if given dimension is valid)

Definition at line 1017 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_dimension_get_rank()

guint gst_tensor_dimension_get_rank ( const tensor_dim  dim)

Get the rank of tensor dimension.

Parameters
dimtensor dimension.
Returns
tensor rank (Minimum rank is 1 if given info is valid)
Parameters
dimtensor dimension.
Returns
tensor rank (Minimum rank is 1 if given dimension is valid)

Definition at line 998 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_dimension_is_equal()

gboolean gst_tensor_dimension_is_equal ( const tensor_dim  dim1,
const tensor_dim  dim2 
)

Compare the tensor dimension.

Returns
TRUE if given tensors have same dimension.

Definition at line 972 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_dimension_is_valid()

gboolean gst_tensor_dimension_is_valid ( const tensor_dim  dim)

Check the tensor dimension is valid.

Parameters
dimtensor dimension
Returns
TRUE if dimension is valid

Definition at line 940 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_dimension_string_is_equal()

gboolean gst_tensor_dimension_string_is_equal ( const gchar *  dimstr1,
const gchar *  dimstr2 
)

Compare dimension strings.

Returns
TRUE if equal, FALSE if given dimension strings are invalid or not equal.

Definition at line 1140 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_get_dimension_string()

gchar* gst_tensor_get_dimension_string ( const tensor_dim  dim)

Get dimension string from given tensor dimension.

Parameters
dimtensor dimension
Returns
Formatted string of given dimension (d1:d2:d3:...:d15:d16).
Note
The returned value should be freed with g_free()

Definition at line 1083 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_get_element_count()

gulong gst_tensor_get_element_count ( const tensor_dim  dim)

Count the number of elements of a tensor.

Returns
The number of elements. 0 if error.
Parameters
dimThe tensor dimension

Definition at line 1186 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_get_element_size()

gsize gst_tensor_get_element_size ( tensor_type  type)

Get element size of tensor type (byte per element)

Definition at line 1205 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_get_format()

tensor_format gst_tensor_get_format ( const gchar *  format_str)

Get tensor format from string input.

Parameters
format_strThe string format name, supposed to be one of tensor_format_name[].
Returns
Corresponding tensor_format. _NNS_TENSOR_FORMAT_END if unrecognized value is there.

Definition at line 1309 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_get_format_string()

const gchar* gst_tensor_get_format_string ( tensor_format  format)

Get tensor format string.

Definition at line 1325 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_get_rank_dimension_string()

gchar* gst_tensor_get_rank_dimension_string ( const tensor_dim  dim,
const unsigned int  rank 
)

Get dimension string from given tensor dimension and rank count.

Parameters
dimtensor dimension
rankrank count of given tensor dimension
Returns
Formatted string of given dimension
Note
If rank count is 3, then returned string is 'd1:d2:d3`. The returned value should be freed with g_free().

Definition at line 1107 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_get_type()

tensor_type gst_tensor_get_type ( const gchar *  typestr)

Get tensor type from string input.

Returns
Corresponding tensor_type. _NNS_END if unrecognized value is there.
Parameters
typestrThe string type name, supposed to be one of tensor_element_typename[]

Definition at line 1218 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_get_type_string()

const gchar* gst_tensor_get_type_string ( tensor_type  type)

Get type string of tensor type.

Definition at line 1296 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_info_convert_to_meta()

gboolean gst_tensor_info_convert_to_meta ( GstTensorInfo info,
GstTensorMetaInfo meta 
)

Convert GstTensorInfo structure to GstTensorMetaInfo.

Parameters
[in]infoGstTensorInfo to be converted
[out]metatensor meta structure to be filled
Returns
TRUE if successfully set the meta
Todo:
handle rank from info.dimension

Definition at line 260 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_info_copy()

void gst_tensor_info_copy ( GstTensorInfo dest,
const GstTensorInfo src 
)

Copy tensor info.

Note
Copied info should be freed with gst_tensor_info_free()

Definition at line 248 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_info_copy_n()

void gst_tensor_info_copy_n ( GstTensorInfo dest,
const GstTensorInfo src,
const guint  n 
)

Copy tensor info up to n elements.

Note
Copied info should be freed with gst_tensor_info_free()

Definition at line 227 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_info_free()

void gst_tensor_info_free ( GstTensorInfo info)

Free allocated data in tensor info structure.

Parameters
infotensor info structure

Definition at line 140 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_info_get_rank()

guint gst_tensor_info_get_rank ( const GstTensorInfo info)

Get tensor rank.

Parameters
infotensor info structure
Returns
tensor rank (Minimum rank is 1 if given info is valid)

Definition at line 285 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_info_get_size()

gsize gst_tensor_info_get_size ( const GstTensorInfo info)

Get data size of single tensor.

Parameters
infotensor info structure
Returns
data size

Definition at line 156 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_info_init()

void gst_tensor_info_init ( GstTensorInfo info)

Initialize the tensor info structure.

Parameters
infotensor info structure to be initialized

Definition at line 121 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_info_is_equal()

gboolean gst_tensor_info_is_equal ( const GstTensorInfo i1,
const GstTensorInfo i2 
)

Compare tensor info.

Returns
TRUE if equal, FALSE if given tensor infos are invalid or not equal.

Definition at line 197 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_info_validate()

gboolean gst_tensor_info_validate ( const GstTensorInfo info)

Check the tensor info is valid.

Parameters
infotensor info structure
Returns
TRUE if info is valid

Definition at line 174 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_meta_info_convert()

gboolean gst_tensor_meta_info_convert ( GstTensorMetaInfo meta,
GstTensorInfo info 
)

Convert GstTensorMetaInfo structure to GstTensorInfo.

Parameters
[in]metatensor meta structure to be converted
[out]infoGstTensorInfo to be filled
Returns
TRUE if successfully set the info

Definition at line 1562 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_meta_info_get_data_size()

gsize gst_tensor_meta_info_get_data_size ( GstTensorMetaInfo meta)

Get the data size calculated from tensor meta.

Parameters
[in]metatensor meta structure
Returns
The data size for meta info (0 if meta is invalid)

Definition at line 1477 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_meta_info_get_header_size()

gsize gst_tensor_meta_info_get_header_size ( GstTensorMetaInfo meta)

Get the header size to handle a tensor meta.

Parameters
[in]metatensor meta structure
Returns
Header size for meta info (0 if meta is invalid)

Definition at line 1456 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_meta_info_get_version()

void gst_tensor_meta_info_get_version ( GstTensorMetaInfo meta,
guint *  major,
guint *  minor 
)

Get the version of tensor meta.

Parameters
[in]metatensor meta structure
[out]majorpointer to get the major version number
[out]minorpointer to get the minor version number

Definition at line 1393 of file nnstreamer_plugin_api_util_impl.c.

◆ gst_tensor_meta_info_init()

void gst_tensor_meta_info_init ( GstTensorMetaInfo meta)

Initialize the tensor meta info structure.

Parameters
[in,out]metatensor meta structure to be initialized

Definition at line 1372 of file nnstreamer_plugin_api_util_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_meta_info_parse_header()

gboolean gst_tensor_meta_info_parse_header ( GstTensorMetaInfo meta,
gpointer  header 
)

Parse header and fill the tensor meta.

Parameters
[out]metatensor meta structure to be filled
[in]headerpointer to header to be parsed
Returns
TRUE if successfully set the meta
Todo:
update meta info for each version

Definition at line 1527 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_meta_info_update_header()

gboolean gst_tensor_meta_info_update_header ( GstTensorMetaInfo meta,
gpointer  header 
)

Update header from tensor meta.

Parameters
[in]metatensor meta structure
[out]headerpointer to header to be updated
Returns
TRUE if successfully set the header
Note
User should allocate enough memory for header (see gst_tensor_meta_info_get_header_size()).

Definition at line 1505 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_meta_info_validate()

gboolean gst_tensor_meta_info_validate ( GstTensorMetaInfo meta)

Check the meta info is valid.

Parameters
[in]metatensor meta structure
Returns
TRUE if given meta is valid

Definition at line 1414 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_parse_dimension()

guint gst_tensor_parse_dimension ( const gchar *  dimstr,
tensor_dim  dim 
)

Parse tensor dimension parameter string.

Returns
The Rank. 0 if error.
Parameters
dimstrThe dimension string in the format of d1:...:d16, d1:d2:d3, d1:d2, or d1, where dN is a positive integer and d1 is the innermost dimension; i.e., dim[d16]...[d1];
dimdimension to be filled.

Definition at line 1040 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_config_copy()

void gst_tensors_config_copy ( GstTensorsConfig dest,
const GstTensorsConfig src 
)

Copy tensors config.

Definition at line 904 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_config_free()

void gst_tensors_config_free ( GstTensorsConfig config)

Free allocated data in tensors config structure.

Parameters
configtensors config structure

Definition at line 845 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_config_init()

void gst_tensors_config_init ( GstTensorsConfig config)

Initialize the tensors config info structure (for other/tensors)

Parameters
configtensors config structure to be initialized

Definition at line 830 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_config_is_equal()

gboolean gst_tensors_config_is_equal ( const GstTensorsConfig c1,
const GstTensorsConfig c2 
)

Compare tensor config info (for other/tensors)

Parameters
TRUEif equal

Compare tensor config info (for other/tensors)

Parameters
TRUEif equal

Definition at line 881 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_config_to_string()

gchar* gst_tensors_config_to_string ( const GstTensorsConfig config)

Tensor config represented as a string. Caller should free it.

Parameters
configtensor config structure
Returns
The newly allocated string representing the config. Free after use.

Definition at line 920 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_config_validate()

gboolean gst_tensors_config_validate ( const GstTensorsConfig config)

Check the tensors are all configured (for other/tensors)

Parameters
configtensor config structure
Returns
TRUE if configured

Check the tensors are all configured (for other/tensors)

Parameters
configtensor config structure
Returns
TRUE if configured

Definition at line 858 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_copy()

void gst_tensors_info_copy ( GstTensorsInfo dest,
const GstTensorsInfo src 
)

Copy tensor info.

Note
Copied info should be freed with gst_tensors_info_free()

Definition at line 502 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_free()

void gst_tensors_info_free ( GstTensorsInfo info)

Free allocated data in tensors info structure.

Parameters
infotensors info structure

Definition at line 347 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_get_dimensions_string()

gchar* gst_tensors_info_get_dimensions_string ( const GstTensorsInfo info)

Get the string of dimensions in tensors info.

Parameters
infotensors info structure
Returns
string of dimensions in tensors info (NULL if the number of tensors is 0)
Note
The returned value should be freed with g_free()

Definition at line 661 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_get_names_string()

gchar* gst_tensors_info_get_names_string ( const GstTensorsInfo info)

Get the string of tensor names in tensors info.

Parameters
infotensors info structure
Returns
string of names in tensors info (NULL if the number of tensors is 0)
Note
The returned value should be freed with g_free()

Definition at line 749 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_get_nth_info()

GstTensorInfo* gst_tensors_info_get_nth_info ( GstTensorsInfo info,
guint  index 
)

Get the pointer of nth tensor information.

Parameters
infotensors info structure
indexthe index of tensor to be fetched
Returns
The pointer to tensor info structure

Definition at line 296 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:

◆ gst_tensors_info_get_rank_dimensions_string()

gchar* gst_tensors_info_get_rank_dimensions_string ( const GstTensorsInfo info,
const unsigned int  rank 
)

Get the string of dimensions in tensors info and rank count.

Parameters
infotensors info structure
rankrank count of given tensor dimension
Returns
Formatted string of given dimension
Note
If rank count is 3, then returned string is 'd1:d2:d3`. The returned value should be freed with g_free()

Definition at line 676 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_get_size()

gsize gst_tensors_info_get_size ( const GstTensorsInfo info,
gint  index 
)

Get data size of single tensor.

Parameters
infotensors info structure
indexthe index of tensor (-1 to get total size of tensors)
Returns
data size

Definition at line 376 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_get_types_string()

gchar* gst_tensors_info_get_types_string ( const GstTensorsInfo info)

Get the string of types in tensors info.

Parameters
infotensors info structure
Returns
string of types in tensors info (NULL if the number of tensors is 0)
Note
The returned value should be freed with g_free()

Definition at line 714 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_init()

void gst_tensors_info_init ( GstTensorsInfo info)

Initialize the tensors info structure.

Parameters
infotensors info structure to be initialized
Note
default format is static

Definition at line 325 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_is_equal()

gboolean gst_tensors_info_is_equal ( const GstTensorsInfo i1,
const GstTensorsInfo i2 
)

Compare tensors info.

Returns
TRUE if equal, FALSE if given tensor infos are invalid or not equal.

Definition at line 454 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_parse_dimensions_string()

guint gst_tensors_info_parse_dimensions_string ( GstTensorsInfo info,
const gchar *  dim_string 
)

Parse the string of dimensions.

Parameters
infotensors info structure
dim_stringstring of dimensions
Returns
number of parsed dimensions

Definition at line 532 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_parse_names_string()

guint gst_tensors_info_parse_names_string ( GstTensorsInfo info,
const gchar *  name_string 
)

Parse the string of names.

Parameters
infotensors info structure
name_stringstring of names
Returns
number of parsed names

Definition at line 612 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_parse_types_string()

guint gst_tensors_info_parse_types_string ( GstTensorsInfo info,
const gchar *  type_string 
)

Parse the string of types.

Parameters
infotensors info structure
type_stringstring of types
Returns
number of parsed types

Definition at line 572 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_to_string()

gchar* gst_tensors_info_to_string ( const GstTensorsInfo info)

GstTensorsInfo represented as a string. Caller should free it.

Parameters
infoGstTensorsInfo structure
Returns
The newly allocated string representing the tensors info. Free after use.

Definition at line 783 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_info_validate()

gboolean gst_tensors_info_validate ( const GstTensorsInfo info)

Check the tensors info is valid.

Parameters
infotensors info structure
Returns
TRUE if info is valid

Definition at line 404 of file nnstreamer_plugin_api_util_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nnstreamer_version_fetch()

void nnstreamer_version_fetch ( guint *  major,
guint *  minor,
guint *  micro 
)

Get the version of NNStreamer (int, divided).

Parameters
[out]majorMAJOR.minor.micro, won't set if it's null.
[out]minormajor.MINOR.micro, won't set if it's null.
[out]micromajor.minor.MICRO, won't set if it's null.

Definition at line 1624 of file nnstreamer_plugin_api_util_impl.c.

◆ nnstreamer_version_string()

gchar* nnstreamer_version_string ( void  )

Get the version of NNStreamer.

Returns
Newly allocated string. The returned string should be freed with g_free().

Get the version of NNStreamer.

Returns
Newly allocated string. The returned string should be freed with g_free().

Definition at line 1609 of file nnstreamer_plugin_api_util_impl.c.