Subplugin Manager for NNStreamer. More...
#include <glib.h>
#include <gmodule.h>
#include "nnstreamer_log.h"
#include "nnstreamer_subplugin.h"
#include "nnstreamer_conf.h"
#include <nnstreamer_util.h>
Go to the source code of this file.
Enumerations | |
enum | subpluginSearchLogic { NNS_SEARCH_FILENAME, NNS_SEARCH_GETALL, NNS_SEARCH_NO_OP } |
Functions | |
static void | init_subplugin (void) |
Create handles at the start of library. More... | |
G_LOCK_DEFINE_STATIC (splock) | |
Protects handles and subplugins. More... | |
static void | _spdata_destroy (gpointer _data) |
Private function for g_hash_table data destructor, GDestroyNotify. More... | |
static subpluginData * | _get_subplugin_data (subpluginType type, const gchar *name) |
Internal function to get sub-plugin data. More... | |
static subpluginData * | _search_subplugin (subpluginType type, const gchar *name, const gchar *path) |
Internal function to scan sub-plugin. More... | |
const void * | get_subplugin (subpluginType type, const char *name) |
Public function defined in the header. More... | |
gchar ** | get_all_subplugins (subpluginType type) |
Public function defined in the header. More... | |
gboolean | register_subplugin (subpluginType type, const char *name, const void *data) |
Public function defined in the header. More... | |
gboolean | unregister_subplugin (subpluginType type, const char *name) |
Public function defined in the header. More... | |
static void | _close_handle (gpointer data) |
dealloc function for handles More... | |
void | subplugin_set_custom_property_desc (subpluginType type, const char *name, const gchar *prop, va_list varargs) |
common interface to set custom property description of a sub-plugin. More... | |
GData * | subplugin_get_custom_property_desc (subpluginType type, const char *name) |
common interface to get custom property description of a sub-plugin. More... | |
static void | fini_subplugin (void) |
Free handles at the start of library. More... | |
Variables | |
static GPtrArray * | handles = NULL |
Array of dynamic loaded handles. More... | |
subpluginData | |
static GHashTable * | subplugins [NNS_SUBPLUGIN_END] = { 0 } |
static subpluginSearchLogic | searchAlgorithm [] |
Subplugin Manager for NNStreamer.
NNStreamer Subplugin 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.
Definition in file nnstreamer_subplugin.c.
enum subpluginSearchLogic |
Enumerator | |
---|---|
NNS_SEARCH_FILENAME | |
NNS_SEARCH_GETALL | |
NNS_SEARCH_NO_OP |
Definition at line 64 of file nnstreamer_subplugin.c.
|
static |
dealloc function for handles
Ubuntu 16.04 / GLIBC 2.23 Workaround If we do dlclose at exit() function, it may incur https://bugzilla.redhat.com/show_bug.cgi?id=1264556#c42 , which is a GLIBC bug at 2.23. The corresponding error message is: Inconsistency detected by ld.so: dl-close.c: 811: _dl_close: Assertion ‘map->l_init_called’ failed! Note that Tizen 5.5 / GLIBC 2.24 has the same bug!
Definition at line 305 of file nnstreamer_subplugin.c.
|
static |
Internal function to get sub-plugin data.
Definition at line 87 of file nnstreamer_subplugin.c.
|
static |
Internal function to scan sub-plugin.
Definition at line 108 of file nnstreamer_subplugin.c.
|
static |
Private function for g_hash_table data destructor, GDestroyNotify.
Definition at line 54 of file nnstreamer_subplugin.c.
|
static |
Free handles at the start of library.
Internal error (init not called?)
Definition at line 385 of file nnstreamer_subplugin.c.
G_LOCK_DEFINE_STATIC | ( | splock | ) |
Protects handles and subplugins.
gchar** get_all_subplugins | ( | subpluginType | type | ) |
Public function defined in the header.
Get the list of registered subplugins.
Definition at line 176 of file nnstreamer_subplugin.c.
const void* get_subplugin | ( | subpluginType | type, |
const char * | name | ||
) |
Public function defined in the header.
Retrieve the registered data with the subplugin name.
Search and register if found with the conf
Definition at line 141 of file nnstreamer_subplugin.c.
|
static |
Create handles at the start of library.
< The name of subplugin
< subplugin specific data forwarded from the subplugin
< [OPTIONAL] subplugin specific custom property desc list
Internal error (duplicated init call?)
Definition at line 37 of file nnstreamer_subplugin.c.
gboolean register_subplugin | ( | subpluginType | type, |
const char * | name, | ||
const void * | data | ||
) |
Public function defined in the header.
Register the subplugin. If duplicated name exists, it is rejected.
Definition at line 225 of file nnstreamer_subplugin.c.
GData* subplugin_get_custom_property_desc | ( | subpluginType | type, |
const char * | name | ||
) |
common interface to get custom property description of a sub-plugin.
Definition at line 359 of file nnstreamer_subplugin.c.
void subplugin_set_custom_property_desc | ( | subpluginType | type, |
const char * | name, | ||
const gchar * | prop, | ||
va_list | varargs | ||
) |
common interface to set custom property description of a sub-plugin.
Definition at line 329 of file nnstreamer_subplugin.c.
gboolean unregister_subplugin | ( | subpluginType | type, |
const char * | name | ||
) |
Public function defined in the header.
Unregister the subplugin.
Definition at line 289 of file nnstreamer_subplugin.c.
|
static |
Array of dynamic loaded handles.
Definition at line 35 of file nnstreamer_subplugin.c.
|
static |
Definition at line 71 of file nnstreamer_subplugin.c.
subpluginData |
Definition at line 45 of file nnstreamer_subplugin.c.
|
static |
Definition at line 47 of file nnstreamer_subplugin.c.