Internal header for conf/env-var management. More...
#include <glib.h>
Go to the source code of this file.
Classes | |
struct | subplugin_info_s |
Macros | |
#define | NNSTREAMER_SYS_ROOT_PATH_PREFIX "/" |
#define | NNSTREAMER_SO_FILE_EXTENSION ".so" |
#define | NNSTREAMER_DEFAULT_CONF_FILE "/etc/nnstreamer.ini" |
#define | NNSTREAMER_CONF_FILE NNSTREAMER_DEFAULT_CONF_FILE |
#define | NNSTREAMER_ENVVAR_CONF_FILE "NNSTREAMER_CONF" |
Functions | |
gboolean | nnsconf_loadconf (gboolean force_reload) |
Load the .ini file. More... | |
const gchar * | nnsconf_get_fullpath (const gchar *subpluginname, nnsconf_type_path type) |
Get the configured paths for the type with sub-plugin name. More... | |
gboolean | nnsconf_validate_file (nnsconf_type_path type, const gchar *fullpath) |
Public function to validate sub-plugin library is available. More... | |
const gchar * | nnsconf_get_subplugin_name_prefix (nnsconf_type_path type) |
Get sub-plugin's name prefix. More... | |
guint | nnsconf_get_subplugin_info (nnsconf_type_path type, subplugin_info_s *info) |
Public function to get the list of sub-plugins name and path. More... | |
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... | |
void | nnsconf_dump (gchar *str, gulong size) |
NNStreamer configuration dump as string. More... | |
void | nnsconf_subplugin_dump (gchar *str, gulong size) |
Print out the information of registered sub-plugins. More... | |
Internal header for conf/env-var management.
NNStreamer Configurations / Environmental Variable Manager. Copyright (C) 2018 MyungJoo Ham myung joo. ham@s amsu ng.co m
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; version 2.1 of the License.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
If there are duplicated configurations for the same element, the one with higher priority may override (if it cannot be stacked up),
Do not export this to devel package. This is an internal header.
Definition in file nnstreamer_conf.h.
#define NNSTREAMER_CONF_FILE NNSTREAMER_DEFAULT_CONF_FILE |
Definition at line 59 of file nnstreamer_conf.h.
#define NNSTREAMER_DEFAULT_CONF_FILE "/etc/nnstreamer.ini" |
Definition at line 57 of file nnstreamer_conf.h.
#define NNSTREAMER_ENVVAR_CONF_FILE "NNSTREAMER_CONF" |
Definition at line 61 of file nnstreamer_conf.h.
#define NNSTREAMER_SO_FILE_EXTENSION ".so" |
Hard-coded system-dependent file extension string of shared (dynamic loadable) object
Definition at line 53 of file nnstreamer_conf.h.
#define NNSTREAMER_SYS_ROOT_PATH_PREFIX "/" |
Definition at line 43 of file nnstreamer_conf.h.
enum nnsconf_type_path |
Enumerator | |
---|---|
NNSCONF_PATH_FILTERS | |
NNSCONF_PATH_DECODERS | |
NNSCONF_PATH_CUSTOM_FILTERS | |
NNSCONF_PATH_EASY_CUSTOM_FILTERS | |
NNSCONF_PATH_CONVERTERS | |
NNSCONF_PATH_TRAINERS | |
NNSCONF_PATH_END |
Definition at line 63 of file nnstreamer_conf.h.
void nnsconf_dump | ( | gchar * | str, |
gulong | size | ||
) |
NNStreamer configuration dump as string.
[out] | str | Preallocated string for the output (dump). |
[in] | size | The size of given str. |
NNStreamer configuration dump as string.
Definition at line 628 of file nnstreamer_conf.c.
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 ([, ], _).
[in] | group | The group name, [group], in .ini file. |
[in] | key | The key name, key = value, in .ini file. |
[in] | def | The default return value in case there is no value 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 ([, ], _).
Definition at line 609 of file nnstreamer_conf.c.
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 ([, ], _).
[in] | group | The group name, [group], in .ini file. |
[in] | key | The key name, key = value, in .ini file. |
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 ([, ], _).
Internal lib error? out-of-memory?
Definition at line 557 of file nnstreamer_conf.c.
const gchar* nnsconf_get_fullpath | ( | const gchar * | subpluginname, |
nnsconf_type_path | type | ||
) |
Get the configured paths for the type with sub-plugin name.
[in] | The | subplugin name except for the prefix and postfix (.so) to find |
[in] | type | The type (FILTERS/DECODERS/CUSTOM_FILTERS) |
This is mainly supposed to be used by CUSTOM_FILTERS
Get the configured paths for the type with sub-plugin name.
Definition at line 483 of file nnstreamer_conf.c.
guint nnsconf_get_subplugin_info | ( | nnsconf_type_path | type, |
subplugin_info_s * | info | ||
) |
Public function to get the list of sub-plugins name and path.
[in] | type | The type (FILTERS/DECODERS/CUSTOM_FILTERS) |
[out] | info | The data structure which contains the name and full path of sub-plugins |
Definition at line 528 of file nnstreamer_conf.c.
const gchar* nnsconf_get_subplugin_name_prefix | ( | nnsconf_type_path | type | ) |
Get sub-plugin's name prefix.
[in] | type | The type (FILTERS/DECODERS/CUSTOM_FILTERS) |
Definition at line 516 of file nnstreamer_conf.c.
gboolean nnsconf_loadconf | ( | gboolean | force_reload | ) |
Load the .ini file.
[in] | force_reload | TRUE if you want to clean up and load conf again. |
Load the .ini file.
if it's not Tizen, configuration from env-var has a higher priority
Priority of reading a conf file 1) read from NNSTREAMER_CONF_FILE 2) read from NNSTREAMER_DEFAULT_CONF_FILE 3) read from env-var
default value of 'sysconfdir' in meson is 'etc'
Internal lib error? out-of-memory?
Internal lib error? out-of-memory?
Failed to get the configuration. Note that Android API does not use the configuration.
Definition at line 342 of file nnstreamer_conf.c.
void nnsconf_subplugin_dump | ( | gchar * | str, |
gulong | size | ||
) |
Print out the information of registered sub-plugins.
Definition at line 695 of file nnstreamer_conf.c.
gboolean nnsconf_validate_file | ( | nnsconf_type_path | type, |
const gchar * | fullpath | ||
) |
Public function to validate sub-plugin library is available.
[in] | type | The type (FILTERS/DECODERS/CUSTOM_FILTERS) |
[in] | fullpath | The full path to the file. |
Definition at line 503 of file nnstreamer_conf.c.