Doxygen Book
nnstreamer_subplugin.h File Reference

Subplugin Manager for NNStreamer. More...

#include <stdint.h>
#include "nnstreamer_conf.h"
Include dependency graph for nnstreamer_subplugin.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define NNS_SUBPLUGIN_CHECKER   (0xdeadbeef)
 

Enumerations

enum  subpluginType {
  NNS_SUBPLUGIN_FILTER = NNSCONF_PATH_FILTERS, NNS_SUBPLUGIN_DECODER = NNSCONF_PATH_DECODERS, NNS_EASY_CUSTOM_FILTER = NNSCONF_PATH_EASY_CUSTOM_FILTERS, NNS_SUBPLUGIN_CONVERTER = NNSCONF_PATH_CONVERTERS,
  NNS_SUBPLUGIN_TRAINER = NNSCONF_PATH_TRAINERS, NNS_CUSTOM_CONVERTER, NNS_CUSTOM_DECODER, NNS_IF_CUSTOM,
  NNS_SUBPLUGIN_END
}
 

Functions

const void * get_subplugin (subpluginType type, const char *name)
 Retrieve the registered data with the subplugin name. More...
 
gchar ** get_all_subplugins (subpluginType type)
 Get the list of registered subplugins. More...
 
gboolean register_subplugin (subpluginType type, const char *name, const void *data)
 Register the subplugin. If duplicated name exists, it is rejected. More...
 
gboolean unregister_subplugin (subpluginType type, const char *name)
 Unregister the subplugin. 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...
 

Detailed Description

Subplugin Manager for NNStreamer.

NNStreamer Subplugin Manager Copyright (C) 2018 MyungJoo Ham myung.nosp@m.joo..nosp@m.ham@s.nosp@m.amsu.nosp@m.ng.co.nosp@m.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.

Date
27 Nov 2018
See also
http://github.com/nnstreamer/nnstreamer
Author
MyungJoo Ham myung.nosp@m.joo..nosp@m.ham@s.nosp@m.amsu.nosp@m.ng.co.nosp@m.m
Bug:
No known bugs except for NYI items

To Packagers:

This file is to be packaged as "devel" package for NN developers. (subplugin writers)

Note
Any independent subplugin (existing as an independent .so) should call register_subplugin () (or its wrapper) with the subplugin's constructor function.

Definition in file nnstreamer_subplugin.h.

Macro Definition Documentation

◆ NNS_SUBPLUGIN_CHECKER

#define NNS_SUBPLUGIN_CHECKER   (0xdeadbeef)

Definition at line 53 of file nnstreamer_subplugin.h.

Enumeration Type Documentation

◆ subpluginType

Enumerator
NNS_SUBPLUGIN_FILTER 
NNS_SUBPLUGIN_DECODER 
NNS_EASY_CUSTOM_FILTER 
NNS_SUBPLUGIN_CONVERTER 
NNS_SUBPLUGIN_TRAINER 
NNS_CUSTOM_CONVERTER 
NNS_CUSTOM_DECODER 
NNS_IF_CUSTOM 
NNS_SUBPLUGIN_END 

Definition at line 40 of file nnstreamer_subplugin.h.

Function Documentation

◆ get_all_subplugins()

gchar** get_all_subplugins ( subpluginType  type)

Get the list of registered subplugins.

Parameters
[in]typeSubplugin Type
Returns
The list of subplugin name
Note
Caller should free the returned value using g_strfreev()

Get the list of registered subplugins.

Definition at line 176 of file nnstreamer_subplugin.c.

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

◆ get_subplugin()

const void* get_subplugin ( subpluginType  type,
const char *  name 
)

Retrieve the registered data with the subplugin name.

Parameters
[in]typeSubplugin Type
[in]nameSubplugin Name. The filename should be libnnstreamer_${type}_${name}.so
Returns
The registered data

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.

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

◆ register_subplugin()

gboolean register_subplugin ( subpluginType  type,
const char *  name,
const void *  data 
)

Register the subplugin. If duplicated name exists, it is rejected.

Parameters
[in]typeSubplugin Type
[in]nameSubplugin Name. The filename should be subplugin_prefixes[type]${name}.so
[in]dataThe registered data
Returns
TRUE if registered as new. FALSE if duplicated (overwritten/updated).

Register the subplugin. If duplicated name exists, it is rejected.

Todo:
data out of scope at add

Definition at line 225 of file nnstreamer_subplugin.c.

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

◆ subplugin_get_custom_property_desc()

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.

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

◆ subplugin_set_custom_property_desc()

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.

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

◆ unregister_subplugin()

gboolean unregister_subplugin ( subpluginType  type,
const char *  name 
)

Unregister the subplugin.

Parameters
[in]typeSubplugin type
[in]nameSubplugin Name. The filename should be subplugin_prefixes[type]${name}.so
Returns
TRUE if unregistered. FALSE if rejected or error.
Warning
Subplugins checked out with get_subplugins can still be used after unregister.

Unregister the subplugin.

Definition at line 289 of file nnstreamer_subplugin.c.

Here is the caller graph for this function: