NVIDIA DeepStream SDK API Reference

8.0 Release
plugin.h File Reference

Detailed Description

Convinient macros for custom plugin creation

Definition in file plugin.h.

Go to the source code of this file.

Macros

: name of the plugin

DS_CUSTOM_PLUGIN_DEFINE:

@description: description of the plugin

Version
: version string @license: license type

Utility macro to create a custom plugin

#define DS_CUSTOM_PLUGIN_DEFINE(name, description, version, license)
 
#define DS_CUSTOM_FACTORY_DEFINE_PARAMS_BEGIN(param_spec)   static const char* param_spec = "["
 Parameter Specification. More...
 
#define DS_CUSTOM_FACTORY_DEFINE_PARAM(name, type, brief, description, default_value)   "{name: "#name", type: "#type", brief: "#brief", description: "#description", default_value: "#default_value"},"
 
#define DS_CUSTOM_FACTORY_DEFINE_PARAMS_END   "]";
 
#define DS_CUSTOM_FACTORY_DEFINE_FULL(factory_name, long_name, klass, description, author, signals, param_spec, object_class, ...)
 DS_CUSTOM_FACTORY_DEFINE_FULL: @factory_name: name of the factory @long_name: long name of the factory @klass: category string @description: detailed information. More...
 
#define DS_CUSTOM_FACTORY_DEFINE_WITH_PARAMS(factory_name, long_name, klass, description, author, signals, param_spec, object_class, implementation)   DS_CUSTOM_FACTORY_DEFINE_FULL(factory_name, long_name, klass, description, author, signals, param_spec, object_class, new implementation)
 convinient macro for DS_CUSTOM_FACTORY_DEFINE_FULL More...
 
#define DS_CUSTOM_FACTORY_DEFINE_WITH_SIGNALS(factory_name, long_name, klass, description, author, signals, object_class, implementation)
 convinient macro for DS_CUSTOM_FACTORY_DEFINE_FULL More...
 
#define DS_CUSTOM_FACTORY_DEFINE(factory_name, long_name, klass, description, author, object_class, implementation)
 convinient macro for DS_CUSTOM_FACTORY_DEFINE_FULL More...
 

Macro Definition Documentation

◆ DS_CUSTOM_FACTORY_DEFINE

#define DS_CUSTOM_FACTORY_DEFINE (   factory_name,
  long_name,
  klass,
  description,
  author,
  object_class,
  implementation 
)
Value:
static const char* param_spec = ""; \
DS_CUSTOM_FACTORY_DEFINE_FULL(factory_name, long_name, klass, description, author, "", param_spec, object_class, new implementation)

convinient macro for DS_CUSTOM_FACTORY_DEFINE_FULL

Definition at line 102 of file plugin.h.

◆ DS_CUSTOM_FACTORY_DEFINE_FULL

#define DS_CUSTOM_FACTORY_DEFINE_FULL (   factory_name,
  long_name,
  klass,
  description,
  author,
  signals,
  param_spec,
  object_class,
  ... 
)
Value:
class object_class##Factory : public deepstream::CustomFactory { \
public: \
object_class##Factory() : \
CustomFactory(factory_name, gst_custom_factory_get_type(factory_name)) {} \
deepstream::CustomObject* createObject(const std::string& name) { \
return new object_class(name, factory_name, __VA_ARGS__); \
} \
}; \
extern "C" const FactoryMetadata get_custom_factory_info(void); \
extern "C" const FactoryMetadata get_custom_factory_info(void) { \
return {factory_name, long_name, klass, description, author, object_class::type(), signals}; \
} \
extern "C" const char* get_custom_factory_product_param_spec(); \
extern "C" const char* get_custom_factory_product_param_spec() { return param_spec; } \
extern "C" void register_component_factory(const char *name); \
extern "C" void register_component_factory(const char* name) { \
deepstream::CommonFactory& factory = \
factory.addCustomFactory(new object_class##Factory(), name); \
}

DS_CUSTOM_FACTORY_DEFINE_FULL: @factory_name: name of the factory @long_name: long name of the factory @klass: category string @description: detailed information.

Author
: author @signals: supported signal, required if the type of the object to be created is signal handler @param_spec: the parameter spec for the object created to be created, define with macros from above @object_class: class name of the object to be created

Utility macro to create a custom factory

Definition at line 67 of file plugin.h.

◆ DS_CUSTOM_FACTORY_DEFINE_PARAM

#define DS_CUSTOM_FACTORY_DEFINE_PARAM (   name,
  type,
  brief,
  description,
  default_value 
)    "{name: "#name", type: "#type", brief: "#brief", description: "#description", default_value: "#default_value"},"

Definition at line 49 of file plugin.h.

◆ DS_CUSTOM_FACTORY_DEFINE_PARAMS_BEGIN

#define DS_CUSTOM_FACTORY_DEFINE_PARAMS_BEGIN (   param_spec)    static const char* param_spec = "["

Parameter Specification.

Utility macro to specify a group of parameter spec for a custom factory. Must start with DS_CUSTOM_FACTORY_DEFINE_PARAMS_BEGIN and ends with DS_CUSTOM_FACTORY_DEFINE_PARAMS_END

Multiple entries are allowed between

Definition at line 48 of file plugin.h.

◆ DS_CUSTOM_FACTORY_DEFINE_PARAMS_END

#define DS_CUSTOM_FACTORY_DEFINE_PARAMS_END   "]";

Definition at line 51 of file plugin.h.

◆ DS_CUSTOM_FACTORY_DEFINE_WITH_PARAMS

#define DS_CUSTOM_FACTORY_DEFINE_WITH_PARAMS (   factory_name,
  long_name,
  klass,
  description,
  author,
  signals,
  param_spec,
  object_class,
  implementation 
)    DS_CUSTOM_FACTORY_DEFINE_FULL(factory_name, long_name, klass, description, author, signals, param_spec, object_class, new implementation)

convinient macro for DS_CUSTOM_FACTORY_DEFINE_FULL

Definition at line 91 of file plugin.h.

◆ DS_CUSTOM_FACTORY_DEFINE_WITH_SIGNALS

#define DS_CUSTOM_FACTORY_DEFINE_WITH_SIGNALS (   factory_name,
  long_name,
  klass,
  description,
  author,
  signals,
  object_class,
  implementation 
)
Value:
static const char* param_spec = ""; \
DS_CUSTOM_FACTORY_DEFINE_FULL(factory_name, long_name, klass, description, author, signals, param_spec, object_class, new implementation)

convinient macro for DS_CUSTOM_FACTORY_DEFINE_FULL

Definition at line 96 of file plugin.h.

◆ DS_CUSTOM_PLUGIN_DEFINE

#define DS_CUSTOM_PLUGIN_DEFINE (   name,
  description,
  version,
  license 
)
Value:
extern "C" void *ds_stub_define_custom_plugin(const char *, const char *, const char *, const char *); \
extern "C" void *gst_plugin_##name##_get_desc(void); \
extern "C" void *gst_plugin_##name##_get_desc(void) \
{ \
return ds_stub_define_custom_plugin(#name, description, version, license); \
}

Definition at line 31 of file plugin.h.

deepstream::CustomFactory::createObject
virtual CustomObject * createObject(const std::string &name)=0
Virtual method for creating custom object.
get_custom_factory_info
const FactoryMetadata get_custom_factory_info(void)
deepstream::CommonFactory::getInstance
static CommonFactory & getInstance()
Acquire the reference of the singleton.
get_custom_factory_product_param_spec
const char * get_custom_factory_product_param_spec(void)
_FactoryMetadata
Information required by a custom factory.
Definition: factory_metadata.h:26
deepstream::CustomFactory
Interface definition for a custom factory.
Definition: custom_factory.hpp:32
gst_custom_factory_get_type
unsigned long gst_custom_factory_get_type(const char *name)