Now we have all nnstreamer elements in a single plugin binary.
Note that enabling tensorflow, which is WIP, will break the result.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
tensor_converter
tensor_decoder
tensor_demux
+ tensor_merge
+ tensor_mux
+ tensor_saveload
+ tensor_sink
+ tensor_split
+ tensor_transform
+ tensor_filter
)
-ADD_SUBDIRECTORY(gst/tensor_filter)
-ADD_SUBDIRECTORY(gst/tensor_sink)
-ADD_SUBDIRECTORY(gst/tensor_mux)
-ADD_SUBDIRECTORY(gst/tensor_split)
-ADD_SUBDIRECTORY(gst/tensor_merge)
-ADD_SUBDIRECTORY(gst/tensor_transform)
-ADD_SUBDIRECTORY(gst/tensor_saveload)
ADD_SUBDIRECTORY(nnstreamer_example)
ADD_SUBDIRECTORY(tests/nnstreamer_tensors/tensors_test)
enable_testing()
LIST(APPEND OBJECTS $<TARGET_OBJECTS:${PRJ}OBJ>)
ENDFOREACH(PRJ)
+SET(FILTER_LIB dl)
+SET(FILTER_DEP)
+IF(NOT DISABLE_TENSORFLOW_LITE)
+ LIST(APPEND FILTER_LIB tensor_filter_tflitecore)
+ LIST(APPEND FILTER_DEP tensor_filter_tflitecore)
+ENDIF(NOT DISABLE_TENSORFLOW_LITE)
+IF(NOT DISABLE_TENSORFLOW)
+ LIST(APPEND FILTER_LIB tensor_filter_tfcore)
+ LIST(APPEND FILTER_DEP tensor_filter_tfcore)
+ENDIF(NOT DISABLE_TENSORFLOW)
+LIST(LENGTH FILTER_DEP FILTER_DEP_LEN)
IF (SINGLE_BINARY)
ADD_LIBRARY(nnstreamerStatic STATIC gst/nnstreamer/nnstreamer.c ${OBJECTS})
TARGET_INCLUDE_DIRECTORIES(nnstreamerStatic PUBLIC ${pkgs_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(nnstreamerStatic PUBLIC ${pkgs_CFLAGS_OTHER})
- TARGET_LINK_LIBRARIES(nnstreamerStatic ${pkgs_LIBRARIES})
+ TARGET_LINK_LIBRARIES(nnstreamerStatic ${pkgs_LIBRARIES} ${FILTER_LIB})
ADD_LIBRARY(nnstreamer SHARED gst/nnstreamer/nnstreamer.c ${OBJECTS})
TARGET_INCLUDE_DIRECTORIES(nnstreamer PUBLIC ${pkgs_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(nnstreamer PUBLIC ${pkgs_CFLAGS_OTHER})
- TARGET_LINK_LIBRARIES(nnstreamer ${pkgs_LIBRARIES})
+ TARGET_LINK_LIBRARIES(nnstreamer ${pkgs_LIBRARIES} ${FILTER_LIB})
+
+ IF (FILTER_DEP_LEN GREATER 0)
+ ADD_DEPENDENCIES(nnstreamer ${FILTER_DEP})
+ ADD_DEPENDENCIES(nnstreamerStatic ${FILTER_DEP})
+ ENDIF (FILTER_DEP_LEN GREATER 0)
INSTALL(TARGETS nnstreamerStatic nnstreamer
RUNTIME DESTINATION ${EXEC_PREFIX}
ADD_LIBRARY(${PRJ}Static STATIC $<TARGET_OBJECTS:${PRJ}OBJ>)
TARGET_INCLUDE_DIRECTORIES(${PRJ}Static PUBLIC ${pkgs_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(${PRJ}Static PUBLIC ${pkgs_CFLAGS_OTHER})
- TARGET_LINK_LIBRARIES(${PRJ}Static ${pkgs_LIBRARIES})
+ IF(PRJ STREQUAL "tensor_filter")
+ TARGET_LINK_LIBRARIES(${PRJ}Static ${pkgs_LIBRARIES} ${FILTER_LIB})
+ IF (FILTER_DEP_LEN GREATER 0)
+ ADD_DEPENDENCIES(${PRJ}Static ${FILTER_DEP})
+ ENDIF (FILTER_DEP_LEN GREATER 0)
+ ELSE(PRJ STREQUAL "tensor_filter")
+ TARGET_LINK_LIBRARIES(${PRJ}Static ${pkgs_LIBRARIES})
+ ENDIF(PRJ STREQUAL "tensor_filter")
+
ADD_LIBRARY(${PRJ} SHARED $<TARGET_OBJECTS:${PRJ}OBJ>)
- TARGET_INCLUDE_DIRECTORIES(${PRJ} PUBLIC ${pkgs_INCLUDE_DIRS})
- TARGET_COMPILE_OPTIONS(${PRJ} PUBLIC ${pkgs_CFLAGS_OTHER})
- TARGET_LINK_LIBRARIES(${PRJ} ${pkgs_LIBRARIES})
+ TARGET_INCLUDE_DIRECTORIES(${PRJ} PUBLIC ${pkgs_INCLUDE_DIRS} ${NNSTREAMER_ADDITIONAL_INCDIR})
+ TARGET_COMPILE_OPTIONS(${PRJ} PUBLIC ${pkgs_CFLAGS_OTHER} ${NNSTREAMER_ADDITIONAL_FLAGS})
+ IF(PRJ STREQUAL "tensor_filter")
+ TARGET_LINK_LIBRARIES(${PRJ} ${pkgs_LIBRARIES} ${FILTER_LIB})
+ IF (FILTER_DEP_LEN GREATER 0)
+ ADD_DEPENDENCIES(${PRJ} ${FILTER_DEP})
+ ENDIF (FILTER_DEP_LEN GREATER 0)
+ ELSE(PRJ STREQUAL "tensor_filter")
+ TARGET_LINK_LIBRARIES(${PRJ} ${pkgs_LIBRARIES})
+ ENDIF(PRJ STREQUAL "tensor_filter")
INSTALL(TARGETS ${PRJ}Static ${PRJ}
RUNTIME DESTINATION ${EXEC_PREFIX}
ENDFOREACH(PRJ)
ENDIF (SINGLE_BINARY)
-
CONFIGURE_FILE(nnstreamer.pc.in nnstreamer.pc @ONLY)
# For nnstreamer users (gst app developers using via gstreamer API)
NNSTREAMER_PLUGIN (tensor_aggregator);
NNSTREAMER_PLUGIN (tensor_decoder);
NNSTREAMER_PLUGIN (tensor_demux);
+NNSTREAMER_PLUGIN (tensor_merge);
+NNSTREAMER_PLUGIN (tensor_mux);
+NNSTREAMER_PLUGIN (tensor_load);
+/* NNSTREAMER_PLUGIN (tensor_save); */
+NNSTREAMER_PLUGIN (tensor_sink);
+NNSTREAMER_PLUGIN (tensor_split);
+NNSTREAMER_PLUGIN (tensor_transform);
+NNSTREAMER_PLUGIN (tensor_filter);
#define NNSTREAMER_INIT(name, plugin) \
do { \
NNSTREAMER_INIT (tensor_aggregator, plugin);
NNSTREAMER_INIT (tensor_decoder, plugin);
NNSTREAMER_INIT (tensor_demux, plugin);
+ NNSTREAMER_INIT (tensor_merge, plugin);
+ NNSTREAMER_INIT (tensor_mux, plugin);
+ NNSTREAMER_INIT (tensor_load, plugin);
+ /* NNSTREAMER_INIT (tensor_save, plugin); */
+ NNSTREAMER_INIT (tensor_sink, plugin);
+ NNSTREAMER_INIT (tensor_split, plugin);
+ NNSTREAMER_INIT (tensor_transform, plugin);
+ NNSTREAMER_INIT (tensor_filter, plugin);
return TRUE;
}
tensor_converter,
"GStreamer plugin to convert media types to tensors",
gst_tensor_converter_plugin_init, VERSION, "LGPL", "nnstreamer",
- "http://github.com/nnsuite/nnstreamer/");
+ "https://github.com/nnsuite/nnstreamer/");
#endif
# DISABLE_TENSORFLOW_LITE is defined at /debian/rules according to the build environment
set(FILTER_SOURCE tensor_filter.c tensor_filter_custom.c)
-set(FILTER_LIB )
-set(FILTER_TARGET tensor_filter tensor_filterStatic)
-
-IF(NOT DISABLE_TENSORFLOW_LITE)
- list(APPEND FILTER_SOURCE tensor_filter_tensorflow_lite.c)
- list(APPEND FILTER_LIB tensor_filter_tflitecore)
- list(APPEND FILTER_TARGET tensor_filter_tflitecore)
- list(APPEND FILTER_TARGET tensor_filter_tflitecoreStatic)
- PKG_CHECK_MODULES(TENSORFLOW_LITE REQUIRED tensorflow-lite)
- LINK_DIRECTORIES(${TENSORFLOW_LITE_LIBRARY_DIRS})
-ENDIF(NOT DISABLE_TENSORFLOW_LITE)
-
-IF(NOT DISABLE_TENSORFLOW)
- list(APPEND FILTER_SOURCE tensor_filter_tensorflow.c)
- list(APPEND FILTER_LIB tensor_filter_tfcore)
- list(APPEND FILTER_TARGET tensor_filter_tfcore)
- list(APPEND FILTER_TARGET tensor_filter_tfcoreStatic)
- PKG_CHECK_MODULES(TENSORFLOW REQUIRED tensorflow)
- LINK_DIRECTORIES(${TENSORFLOW_LIBRARY_DIRS})
-ENDIF(NOT DISABLE_TENSORFLOW)
-
-ADD_LIBRARY(tensor_filter SHARED
- ${FILTER_SOURCE}
- )
-ADD_LIBRARY(tensor_filterStatic STATIC
- ${FILTER_SOURCE}
- )
-TARGET_LINK_LIBRARIES(tensor_filter ${FILTER_LIB} dl ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_filter PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_filter PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(tensor_filterStatic ${FILTER_LIB} dl ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_filterStatic PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_filterStatic PUBLIC ${pkgs_CFLAGS_OTHER})
+set(FILTER_TARGET)
IF(DISABLE_TENSORFLOW_LITE) # NOT AVAILABLE
ADD_DEFINITIONS(-DDISABLE_TENSORFLOW_LITE)
ADD_DEFINITIONS(-DDISABLE_TENSORFLOW)
ENDIF(DISABLE_TENSORFLOW)
-IF(NOT DISABLE_TENSORFLOW_LITE) # AVAILABLE
+IF(NOT DISABLE_TENSORFLOW_LITE)
+ list(APPEND FILTER_SOURCE tensor_filter_tensorflow_lite.c)
+ list(APPEND FILTER_TARGET tensor_filter_tflitecore)
+ list(APPEND FILTER_TARGET tensor_filter_tflitecoreStatic)
PKG_CHECK_MODULES(TENSORFLOW_LITE REQUIRED tensorflow-lite)
- ADD_LIBRARY(tensor_filter_tflitecore SHARED
- tensor_filter_tensorflow_lite_core.cc
- )
+ LINK_DIRECTORIES(${TENSORFLOW_LITE_LIBRARY_DIRS})
+
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wno-sign-compare")
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -Wno-sign-compare")
+ ADD_LIBRARY(tensor_filter_tflitecore SHARED tensor_filter_tensorflow_lite_core.cc)
TARGET_LINK_LIBRARIES(tensor_filter_tflitecore ${pkgs_LIBRARIES} tensorflow-lite)
TARGET_INCLUDE_DIRECTORIES(tensor_filter_tflitecore PUBLIC ${pkgs_INCLUDE_DIRS} ${TENSORFLOW_LITE_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(tensor_filter_tflitecore PUBLIC ${pkgs_CFLAGS_OTHER})
- ADD_LIBRARY(tensor_filter_tflitecoreStatic STATIC
- tensor_filter_tensorflow_lite_core.cc
- )
-
+ ADD_LIBRARY(tensor_filter_tflitecoreStatic STATIC tensor_filter_tensorflow_lite_core.cc)
TARGET_LINK_LIBRARIES(tensor_filter_tflitecoreStatic ${pkgs_LIBRARIES} tensorflow-lite)
TARGET_INCLUDE_DIRECTORIES(tensor_filter_tflitecoreStatic PUBLIC ${pkgs_INCLUDE_DIRS} ${TENSORFLOW_LITE_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(tensor_filter_tflitecoreStatic PUBLIC ${pkgs_CFLAGS_OTHER})
+ENDIF(NOT DISABLE_TENSORFLOW_LITE)
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wno-sign-compare")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -Wno-sign-compare")
-ENDIF(NOT DISABLE_TENSORFLOW_LITE) # AVAILABLE
-
-IF(NOT DISABLE_TENSORFLOW) # AVAILABLE
- ADD_LIBRARY(tensor_filter_tfcore SHARED
- tensor_filter_tensorflow_core.cc
- )
+IF(NOT DISABLE_TENSORFLOW)
+ list(APPEND FILTER_SOURCE tensor_filter_tensorflow.c)
+ list(APPEND FILTER_TARGET tensor_filter_tfcore)
+ list(APPEND FILTER_TARGET tensor_filter_tfcoreStatic)
+ PKG_CHECK_MODULES(TENSORFLOW REQUIRED tensorflow)
+ LINK_DIRECTORIES(${TENSORFLOW_LIBRARY_DIRS})
+ ADD_LIBRARY(tensor_filter_tfcore SHARED tensor_filter_tensorflow_core.cc)
TARGET_LINK_LIBRARIES(tensor_filter_tfcore ${pkgs_LIBRARIES} ${TENSORFLOW_LIBRARIES})
TARGET_INCLUDE_DIRECTORIES(tensor_filter_tfcore PUBLIC ${pkgs_INCLUDE_DIRS} ${TENSORFLOW_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(tensor_filter_tfcore PUBLIC ${pkgs_CFLAGS_OTHER})
- ADD_LIBRARY(tensor_filter_tfcoreStatic STATIC
- tensor_filter_tensorflow_core.cc
- )
-
+ ADD_LIBRARY(tensor_filter_tfcoreStatic STATIC tensor_filter_tensorflow_core.cc)
TARGET_LINK_LIBRARIES(tensor_filter_tfcoreStatic ${pkgs_LIBRARIES} ${TENSORFLOW_LIBRARIES})
TARGET_INCLUDE_DIRECTORIES(tensor_filter_tfcoreStatic PUBLIC ${pkgs_INCLUDE_DIRS} ${TENSORFLOW_INCLUDE_DIRS})
TARGET_COMPILE_OPTIONS(tensor_filter_tfcoreStatic PUBLIC ${pkgs_CFLAGS_OTHER})
+ENDIF(NOT DISABLE_TENSORFLOW)
-ENDIF(NOT DISABLE_TENSORFLOW) # AVAILABLE
+MESSAGE(filterOBJ ${FILTER_SOURCE})
+ADD_LIBRARY(tensor_filterOBJ OBJECT ${FILTER_SOURCE})
INSTALL(TARGETS ${FILTER_TARGET}
- RUNTIME DESTINATION ${EXEC_PREFIX}
- LIBRARY DESTINATION ${GST_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- )
+ RUNTIME DESTINATION ${EXEC_PREFIX}
+ LIBRARY DESTINATION ${GST_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+)
* initialize the plug-in itself
* register the element factories and other features
*/
-static gboolean
-gst_tensor_filter_plugin_init (GstPlugin * plugin)
+NNSTREAMER_PLUGIN_INIT (tensor_filter)
{
/**
* debug category for filtering log messages
GST_TYPE_TENSOR_FILTER);
}
+#ifndef SINGLE_BINARY
/**
* @brief Definition for identifying tensor_filter plugin.
*
* compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
*/
#ifndef PACKAGE
-#define PACKAGE "tensor_filter"
+#define PACKAGE "nnstreamer"
#endif
/**
GST_VERSION_MINOR,
tensor_filter,
"GStreamer plugin to use general neural network frameworks as filters",
- gst_tensor_filter_plugin_init, VERSION, "LGPL", "GStreamer",
- "http://gstreamer.net/");
+ gst_tensor_filter_plugin_init, VERSION, "LGPL", "nnstreamer",
+ "https://github.com/nnsuite/nnstreamer/");
+#endif
-ADD_LIBRARY(tensor_merge SHARED gsttensormerge.c )
-ADD_LIBRARY(tensor_mergeStatic STATIC gsttensormerge.c)
-
-TARGET_LINK_LIBRARIES(tensor_merge ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_merge PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_merge PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(tensor_mergeStatic ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_mergeStatic PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_mergeStatic PUBLIC ${pkgs_CFLAGS_OTHER})
-
-INSTALL(TARGETS tensor_merge tensor_mergeStatic
- RUNTIME DESTINATION ${EXEC_PREFIX}
- LIBRARY DESTINATION ${GST_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- )
+ADD_LIBRARY(tensor_mergeOBJ OBJECT gsttensormerge.c )
/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "tensor_merge"
-#endif
-
-/**
* @brief entry point to initialize the plug-in
* initialize the plug-in itself
* register the element factories and other features
*/
-gboolean
-gst_tensor_merge_plugin_init (GstPlugin * tensormerge)
+NNSTREAMER_PLUGIN_INIT (tensor_merge)
{
/** debug category for fltering log messages
* exchange the string 'Template tensor_merge' with your description
*/
GST_DEBUG_CATEGORY_INIT (gst_tensor_merge_debug, "tensor_merge", 0,
"Tensor Merger");
- return gst_element_register (tensormerge, "tensor_merge",
+ return gst_element_register (plugin, "tensor_merge",
GST_RANK_NONE, GST_TYPE_TENSOR_MERGE);
}
+#ifndef SINGLE_BINARY
+/**
+ * PACKAGE: this is usually set by autotools depending on some _INIT macro
+ * in configure.ac and then written into and defined in config.h, but we can
+ * just set it ourselves here in case someone doesn't use autotools to
+ * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
+ */
+#ifndef PACKAGE
+#define PACKAGE "nnstreamer"
+#endif
+
/**
* @brief gstreamer looks for this structure to register tensormerge
*/
GST_VERSION_MINOR,
tensor_merge,
"tensor merge plugin",
- gst_tensor_merge_plugin_init, VERSION, "LGPL", "GStreamer",
- "http://gstreamer.net/");
+ gst_tensor_merge_plugin_init, VERSION, "LGPL", "nnstreamer",
+ "https://github.com/nnsuite/nnstreamer/");
+#endif
-ADD_LIBRARY(tensor_mux SHARED gsttensormux.c )
-ADD_LIBRARY(tensor_muxStatic STATIC gsttensormux.c)
-
-TARGET_LINK_LIBRARIES(tensor_mux ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_mux PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_mux PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(tensor_muxStatic ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_muxStatic PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_muxStatic PUBLIC ${pkgs_CFLAGS_OTHER})
-
-INSTALL(TARGETS tensor_mux tensor_muxStatic
- RUNTIME DESTINATION ${EXEC_PREFIX}
- LIBRARY DESTINATION ${GST_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- )
+ADD_LIBRARY(tensor_muxOBJ OBJECT gsttensormux.c )
/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "tensor_mux"
-#endif
-
-/**
* @brief entry point to initialize the plug-in
* initialize the plug-in itself
* register the element factories and other features
*/
-gboolean
-gst_tensor_mux_plugin_init (GstPlugin * tensormux)
+NNSTREAMER_PLUGIN_INIT (tensor_mux)
{
/** debug category for fltering log messages
* exchange the string 'Template tensor_mux' with your description
*/
GST_DEBUG_CATEGORY_INIT (gst_tensor_mux_debug, "tensor_mux", 0,
"Tensor Muxer");
- return gst_element_register (tensormux, "tensor_mux",
+ return gst_element_register (plugin, "tensor_mux",
GST_RANK_NONE, GST_TYPE_TENSOR_MUX);
}
+#ifndef SINGLE_BINARY
+/**
+ * PACKAGE: this is usually set by autotools depending on some _INIT macro
+ * in configure.ac and then written into and defined in config.h, but we can
+ * just set it ourselves here in case someone doesn't use autotools to
+ * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
+ */
+#ifndef PACKAGE
+#define PACKAGE "nnstreamer"
+#endif
+
/**
* @brief gstreamer looks for this structure to register tensormux
*/
GST_VERSION_MINOR,
tensor_mux,
"tensor mux plugin",
- gst_tensor_mux_plugin_init, VERSION, "LGPL", "GStreamer",
- "http://gstreamer.net/");
+ gst_tensor_mux_plugin_init, VERSION, "LGPL", "nnstreamer",
+ "https://github.com/nnsuite/nnstreamer/");
+#endif
-ADD_LIBRARY(tensor_load SHARED tensor_load.c)
-ADD_LIBRARY(tensor_loadStatic STATIC tensor_load.c)
-
-TARGET_LINK_LIBRARIES(tensor_load ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_load PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_load PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(tensor_loadStatic ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_loadStatic PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_loadStatic PUBLIC ${pkgs_CFLAGS_OTHER})
-
-INSTALL(TARGETS tensor_load tensor_loadStatic
- RUNTIME DESTINATION ${EXEC_PREFIX}
- LIBRARY DESTINATION ${GST_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- )
-
-## @todo Add tensor_save
+ADD_LIBRARY(tensor_saveloadOBJ OBJECT tensor_load.c)
#include <string.h>
#include <gst/gst.h>
#include <glib.h>
+#include <tensor_common.h>
#include "tensor_load.h"
;
/**
- * @brief entry point to initialize the plug-in
- * initialize the plug-in itself
- * register the element factories and other features
- */
-static gboolean
-tensor_load_init (GstPlugin * tensor_load)
-{
- /**
- * debug category for fltering log messages
- *
- * exchange the string 'Template tensor_load' with your description
- */
- GST_DEBUG_CATEGORY_INIT (gst_tensor_load_debug, "tensor_load",
- 0, "Template tensor_load");
-
- return gst_element_register (tensor_load, "tensor_load",
- GST_RANK_NONE, GST_TYPE_TENSOR_LOAD);
-}
-
-/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "tensor_load"
-#endif
-
-/**
- * gstreamer looks for this structure to register tensor_loads
- *
- * exchange the string 'Template tensor_load' with your tensor_load description
- */
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- tensor_load,
- "tensor_load",
- tensor_load_init, VERSION, "LGPL", "GStreamer", "http://gstreamer.net/");
-
-/**
* @brief non-ip transform. required vmethod for BaseTransform class.
*/
static GstFlowReturn
/** @todo NYI */
return FALSE;
}
+
+/**
+ * @brief entry point to initialize the plug-in
+ * initialize the plug-in itself
+ * register the element factories and other features
+ */
+NNSTREAMER_PLUGIN_INIT (tensor_load)
+{
+ /**
+ * debug category for fltering log messages
+ *
+ * exchange the string 'Template tensor_load' with your description
+ */
+ GST_DEBUG_CATEGORY_INIT (gst_tensor_load_debug, "tensor_load",
+ 0, "Template tensor_load");
+
+ return gst_element_register (plugin, "tensor_load",
+ GST_RANK_NONE, GST_TYPE_TENSOR_LOAD);
+}
+
+#ifndef SINGLE_BINARY
+/**
+ * PACKAGE: this is usually set by autotools depending on some _INIT macro
+ * in configure.ac and then written into and defined in config.h, but we can
+ * just set it ourselves here in case someone doesn't use autotools to
+ * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
+ */
+#ifndef PACKAGE
+#define PACKAGE "nnstreamer"
+#endif
+
+/**
+ * gstreamer looks for this structure to register tensor_loads
+ *
+ * exchange the string 'Template tensor_load' with your tensor_load description
+ */
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ tensor_load,
+ "Load other/tensor_save and as other/tensor or other/tensors",
+ gst_tensor_load_plugin_init, VERSION, "LGPL", "nnstreamer",
+ "https://github.com/nnsuite/nnstreamer/");
+#endif
-ADD_LIBRARY(tensor_sink SHARED tensor_sink.c)
-ADD_LIBRARY(tensor_sinkStatic STATIC tensor_sink.c)
-
-TARGET_LINK_LIBRARIES(tensor_sink ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_sink PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_sink PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(tensor_sinkStatic ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_sinkStatic PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_sinkStatic PUBLIC ${pkgs_CFLAGS_OTHER})
-
-INSTALL(TARGETS tensor_sink tensor_sinkStatic
- RUNTIME DESTINATION ${EXEC_PREFIX}
- LIBRARY DESTINATION ${GST_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- )
+ADD_LIBRARY(tensor_sinkOBJ OBJECT tensor_sink.c)
*
* See GstPluginInitFunc() for more details.
*/
-static gboolean
-gst_tensor_sink_plugin_init (GstPlugin * plugin)
+NNSTREAMER_PLUGIN_INIT (tensor_sink)
{
GST_DEBUG_CATEGORY_INIT (gst_tensor_sink_debug, "tensor_sink",
0, "tensor_sink element");
GST_RANK_NONE, GST_TYPE_TENSOR_SINK);
}
+#ifndef SINGLE_BINARY
/**
* @brief Definition for identifying tensor_sink plugin.
*
* compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
*/
#ifndef PACKAGE
-#define PACKAGE "tensor_sink"
+#define PACKAGE "nnstreamer"
#endif
/**
"Sink element to handle tensor stream",
gst_tensor_sink_plugin_init, VERSION, "LGPL", "nnstreamer",
"https://github.com/nnsuite/nnstreamer");
+#endif
-ADD_LIBRARY(tensor_split SHARED gsttensorsplit.c )
-ADD_LIBRARY(tensor_splitStatic STATIC gsttensorsplit.c)
-
-TARGET_LINK_LIBRARIES(tensor_split ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_split PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_split PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(tensor_splitStatic ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_splitStatic PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_splitStatic PUBLIC ${pkgs_CFLAGS_OTHER})
-
-INSTALL(TARGETS tensor_split tensor_splitStatic
- RUNTIME DESTINATION ${EXEC_PREFIX}
- LIBRARY DESTINATION ${GST_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- )
+ADD_LIBRARY(tensor_splitOBJ OBJECT gsttensorsplit.c )
}
/**
- * PACKAGE: this is usually set by autotools depending on some _INIT macro
- * in configure.ac and then written into and defined in config.h, but we can
- * just set it ourselves here in case someone doesn't use autotools to
- * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
- */
-#ifndef PACKAGE
-#define PACKAGE "tensor_split"
-#endif
-
-/**
* @brief entry point to initialize the plug-in
* initialize the plug-in itself
* register the element factories and other features
*/
-gboolean
-gst_tensor_split_plugin_init (GstPlugin * tensorsplit)
+NNSTREAMER_PLUGIN_INIT (tensor_split)
{
/** debug category for fltering log messages
* exchange the string 'Template tensor_split' with your description
*/
GST_DEBUG_CATEGORY_INIT (gst_tensor_split_debug, "tensor_split", 0,
"Tensor Spliter");
- return gst_element_register (tensorsplit, "tensor_split",
+ return gst_element_register (plugin, "tensor_split",
GST_RANK_NONE, GST_TYPE_TENSOR_SPLIT);
}
+#ifndef SINGLE_BINARY
+/**
+ * PACKAGE: this is usually set by autotools depending on some _INIT macro
+ * in configure.ac and then written into and defined in config.h, but we can
+ * just set it ourselves here in case someone doesn't use autotools to
+ * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
+ */
+#ifndef PACKAGE
+#define PACKAGE "nnstreamer"
+#endif
+
/**
* @brief gstreamer looks for this structure to register tensorsplit
*/
GST_VERSION_MINOR,
tensor_split,
"tensor split plugin",
- gst_tensor_split_plugin_init, VERSION, "LGPL", "GStreamer",
- "http://gstreamer.net/");
+ gst_tensor_split_plugin_init, VERSION, "LGPL", "nnstreamer",
+ "https://github.com/nnsuite/nnstreamer/");
+#endif
-ADD_LIBRARY(tensor_transform SHARED tensor_transform.c)
-ADD_LIBRARY(tensor_transformStatic STATIC tensor_transform.c)
-
-TARGET_LINK_LIBRARIES(tensor_transform ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_transform PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_transform PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(tensor_transformStatic ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_transformStatic PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_transformStatic PUBLIC ${pkgs_CFLAGS_OTHER})
-
-INSTALL(TARGETS tensor_transform tensor_transformStatic
- RUNTIME DESTINATION ${EXEC_PREFIX}
- LIBRARY DESTINATION ${GST_INSTALL_DIR}
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- )
+ADD_LIBRARY(tensor_transformOBJ OBJECT tensor_transform.c)
* initialize the plug-in itself
* register the element factories and other features
*/
-static gboolean
-gst_tensor_transform_plugin_init (GstPlugin * plugin)
+NNSTREAMER_PLUGIN_INIT (tensor_transform)
{
/**
* debug category for fltering log messages
GST_RANK_NONE, GST_TYPE_TENSOR_TRANSFORM);
}
+#ifndef SINGLE_BINARY
/**
* PACKAGE: this is usually set by autotools depending on some _INIT macro
* in configure.ac and then written into and defined in config.h, but we can
* compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
*/
#ifndef PACKAGE
-#define PACKAGE "tensor_transform"
+#define PACKAGE "nnstreamer"
#endif
/**
"GStreamer plugin to transform tensor dimension or type",
gst_tensor_transform_plugin_init, VERSION, "LGPL", "nnstreamer",
"https://github.com/nnsuite/nnstreamer");
+#endif