Doxygen Book
nnstreamer_internal.h File Reference

Internal header for NNStreamer plugins and native single-shot APIs. More...

#include <glib.h>
#include <nnstreamer_plugin_api_filter.h>
Include dependency graph for nnstreamer_internal.h:

Go to the source code of this file.

Functions

G_BEGIN_DECLS gchar * nnsconf_get_custom_value_string (const gchar *group, const gchar *key)
 Get the custom configuration value from .ini and envvar. @detail For predefined configurations defined in this header, use the given enum for faster configuration processing. For custom configurations not defined in this header, you may use this API to access your own custom configurations. Configuration values may be loaded only once during runtime, thus, if the values are changed in run-time, the changes are not guaranteed to be reflected. The ENVVAR is supposed to be NNSTREAMER_${group}_${key}, which has higher priority than the .ini configuration. Be careful not to use special characters in group name ([, ], _). More...
 
gboolean nnsconf_get_custom_value_bool (const gchar *group, const gchar *key, gboolean def)
 Get the custom configuration value from .ini and envvar. @detail For predefined configurations defined in this header, use the given enum for faster configuration processing. For custom configurations not defined in this header, you may use this API to access your own custom configurations. Configuration values may be loaded only once during runtime, thus, if the values are changed in run-time, the changes are not guaranteed to be reflected. The ENVVAR is supposed to be NNSTREAMER_${group}_${key}, which has higher priority than the .ini configuration. Be careful not to use special characters in group name ([, ], _). More...
 
gchar * gst_tensor_filter_detect_framework (const gchar *const *model_files, const guint num_models, const gboolean load_conf)
 Get neural network framework name from given model file. This does not guarantee the framework is available on the target device. More...
 
gboolean gst_tensor_filter_check_hw_availability (const gchar *name, const accl_hw hw, const char *custom)
 Check if the given hw is supported by the framework. More...
 

Detailed Description

Internal header for NNStreamer plugins and native single-shot APIs.

Copyright (c) 2021 Samsung Electronics Co., Ltd. All Rights Reserved.

Date
28 Jan 2021
See also
http://github.com/nnstreamer/nnstreamer
Author
Jaeyun Jung jy121.nosp@m.0.ju.nosp@m.ng@sa.nosp@m.msun.nosp@m.g.com
Bug:
No known bugs except for NYI items

Definition in file nnstreamer_internal.h.

Function Documentation

◆ gst_tensor_filter_check_hw_availability()

gboolean gst_tensor_filter_check_hw_availability ( const gchar *  name,
const accl_hw  hw,
const char *  custom 
)

Check if the given hw is supported by the framework.

Parameters
[in]nameThe name of filter sub-plugin.
[in]hwBackend accelerator hardware.
[in]customUser-defined string to handle detailed hardware option.
Returns
TRUE if given hw is available.
Note
This function is included in nnstreamer internal header for native APIs. When changing the declaration, you should update the internal header (nnstreamer_internal.h).

Only check for specific HW, DEFAULT/AUTO are always supported

Definition at line 2923 of file tensor_filter_common.c.

◆ gst_tensor_filter_detect_framework()

gchar* gst_tensor_filter_detect_framework ( const gchar *const *  model_files,
const guint  num_models,
const gboolean  load_conf 
)

Get neural network framework name from given model file. This does not guarantee the framework is available on the target device.

Parameters
[in]model_filesthe prediction model paths
[in]num_modelsthe number of model files
[in]load_confflag to load configuration for the priority of framework
Returns
Possible framework name (NULL if it fails to detect automatically). Caller should free returned value using g_free().
Parameters
[in]model_filesthe prediction model paths
[in]num_modelsthe number of model files
[in]load_confflag to load configuration for the priority of framework
Returns
Possible framework name (NULL if it fails to detect automatically). Caller should free returned value using g_free().
Note
This function is included in nnstreamer internal header for native APIs. When changing the declaration, you should update the internal header (nnstreamer_internal.h).
Note
When adding new file extension for auto fw detection, you should check the condition to validate model file - ml_validate_model_file() in ML-API.

Definition at line 1232 of file tensor_filter_common.c.

◆ nnsconf_get_custom_value_bool()

gboolean nnsconf_get_custom_value_bool ( const gchar *  group,
const gchar *  key,
gboolean  def 
)

Get the custom configuration value from .ini and envvar. @detail For predefined configurations defined in this header, use the given enum for faster configuration processing. For custom configurations not defined in this header, you may use this API to access your own custom configurations. Configuration values may be loaded only once during runtime, thus, if the values are changed in run-time, the changes are not guaranteed to be reflected. The ENVVAR is supposed to be NNSTREAMER_${group}_${key}, which has higher priority than the .ini configuration. Be careful not to use special characters in group name ([, ], _).

Parameters
[in]groupThe group name, [group], in .ini file.
[in]keyThe key name, key = value, in .ini file.
[in]defThe default return value in case there is no value available.
Returns
The value interpreted as TRUE/FALSE.

Get the custom configuration value from .ini and envvar. @detail For predefined configurations defined in this header, use the given enum for faster configuration processing. For custom configurations not defined in this header, you may use this API to access your own custom configurations. Configuration values may be loaded only once during runtime, thus, if the values are changed in run-time, the changes are not guaranteed to be reflected. The ENVVAR is supposed to be NNSTREAMER_${group}_${key}, which has higher priority than the .ini configuration. Be careful not to use special characters in group name ([, ], _).

Note
This function is included in nnstreamer internal header for native APIs. When changing the declaration, you should update the internal header (nnstreamer_internal.h).

Definition at line 609 of file nnstreamer_conf.c.

Here is the call graph for this function:

◆ nnsconf_get_custom_value_string()

G_BEGIN_DECLS gchar* nnsconf_get_custom_value_string ( const gchar *  group,
const gchar *  key 
)

Get the custom configuration value from .ini and envvar. @detail For predefined configurations defined in this header, use the given enum for faster configuration processing. For custom configurations not defined in this header, you may use this API to access your own custom configurations. Configuration values may be loaded only once during runtime, thus, if the values are changed in run-time, the changes are not guaranteed to be reflected. The ENVVAR is supposed to be NNSTREAMER_${group}_${key}, which has higher priority than the .ini configuration. Be careful not to use special characters in group name ([, ], _).

Parameters
[in]groupThe group name, [group], in .ini file.
[in]keyThe key name, key = value, in .ini file.
Returns
The newly allocated string. A caller must free it. NULL if it's not available.

Get the custom configuration value from .ini and envvar. @detail For predefined configurations defined in this header, use the given enum for faster configuration processing. For custom configurations not defined in this header, you may use this API to access your own custom configurations. Configuration values may be loaded only once during runtime, thus, if the values are changed in run-time, the changes are not guaranteed to be reflected. The ENVVAR is supposed to be NNSTREAMER_${group}_${key}, which has higher priority than the .ini configuration. Be careful not to use special characters in group name ([, ], _).

Note
This function is included in nnstreamer internal header for native APIs. When changing the declaration, you should update the internal header (nnstreamer_internal.h).

Internal lib error? out-of-memory?

Definition at line 557 of file nnstreamer_conf.c.

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