[Single Binary] Merge decoder, demux
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 12 Oct 2018 07:02:00 +0000 (16:02 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Mon, 15 Oct 2018 04:31:40 +0000 (13:31 +0900)
1. Merge decoder,demux for the new build scheme.
2. Rephrase related code of aggregator, converter

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
CMakeLists.txt
gst/nnstreamer/nnstreamer.c
gst/tensor_aggregator/tensor_aggregator.c
gst/tensor_converter/tensor_converter.c
gst/tensor_decoder/CMakeLists.txt
gst/tensor_decoder/tensordec.c
gst/tensor_demux/CMakeLists.txt
gst/tensor_demux/gsttensordemux.c

index 85d10c5..d276dfc 100644 (file)
@@ -101,15 +101,15 @@ TARGET_LINK_LIBRARIES(unittest_sink ${pkgs_LIBRARIES} ${gtestLink})
 
 # Supported projects for the single binary
 SET(PROJECTS
-       tensor_converter
        tensor_aggregator
+       tensor_converter
+       tensor_decoder
+       tensor_demux
 )
 
 ADD_SUBDIRECTORY(gst/tensor_filter)
-ADD_SUBDIRECTORY(gst/tensor_decoder)
 ADD_SUBDIRECTORY(gst/tensor_sink)
 ADD_SUBDIRECTORY(gst/tensor_mux)
-ADD_SUBDIRECTORY(gst/tensor_demux)
 ADD_SUBDIRECTORY(gst/tensor_split)
 ADD_SUBDIRECTORY(gst/tensor_merge)
 ADD_SUBDIRECTORY(gst/tensor_transform)
index 7a6eb94..419b492 100644 (file)
@@ -30,6 +30,8 @@
 
 NNSTREAMER_PLUGIN (tensor_converter);
 NNSTREAMER_PLUGIN (tensor_aggregator);
+NNSTREAMER_PLUGIN (tensor_decoder);
+NNSTREAMER_PLUGIN (tensor_demux);
 
 #define NNSTREAMER_INIT(name, plugin) \
   do { \
@@ -45,6 +47,8 @@ gst_nnstreamer_init (GstPlugin * plugin)
 {
   NNSTREAMER_INIT (tensor_converter, plugin);
   NNSTREAMER_INIT (tensor_aggregator, plugin);
+  NNSTREAMER_INIT (tensor_decoder, plugin);
+  NNSTREAMER_INIT (tensor_demux, plugin);
 
   return TRUE;
 }
index d9ddd7a..71830cd 100644 (file)
@@ -1022,6 +1022,7 @@ NNSTREAMER_PLUGIN_INIT (tensor_aggregator)
       GST_RANK_NONE, GST_TYPE_TENSOR_AGGREGATOR);
 }
 
+#ifndef SINGLE_BINARY
 /**
  * @brief Definition for identifying tensor_aggregator plugin.
  *
@@ -1031,10 +1032,9 @@ NNSTREAMER_PLUGIN_INIT (tensor_aggregator)
  * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
  */
 #ifndef PACKAGE
-#define PACKAGE "tensor_aggregator"
+#define PACKAGE "nnstreamer"
 #endif
 
-#ifndef SINGLE_BINARY
 /**
  * @brief Macro to define the entry point of the plugin.
  */
@@ -1042,6 +1042,6 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     tensor_aggregator,
     "GStreamer plugin to aggregate tensor stream",
-    gst_tensor_aggregator_plugin_init, VERSION, "LGPL", "GStreamer",
-    "http://gstreamer.net/");
+    gst_tensor_aggregator_plugin_init, VERSION, "LGPL", "nnstreamer",
+    "http://github.com/nnsuite/nnstreamer/");
 #endif
index e9da659..2144879 100644 (file)
@@ -885,6 +885,7 @@ NNSTREAMER_PLUGIN_INIT (tensor_converter)
       GST_RANK_NONE, GST_TYPE_TENSOR_CONVERTER);
 }
 
+#ifndef SINGLE_BINARY
 /**
  * @brief Definition for identifying tensor_converter plugin.
  *
@@ -894,10 +895,9 @@ NNSTREAMER_PLUGIN_INIT (tensor_converter)
  * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
  */
 #ifndef PACKAGE
-#define PACKAGE "tensor_converter"
+#define PACKAGE "nnstreamer"
 #endif
 
-#ifndef SINGLE_BINARY
 /**
  * @brief Macro to define the entry point of the plugin.
  */
@@ -905,6 +905,6 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     tensor_converter,
     "GStreamer plugin to convert media types to tensors",
-    gst_tensor_converter_plugin_init, VERSION, "LGPL", "GStreamer",
+    gst_tensor_converter_plugin_init, VERSION, "LGPL", "nnstreamer",
     "http://github.com/nnsuite/nnstreamer/");
 #endif
index 4acb5d6..5e3b37e 100644 (file)
@@ -1,15 +1 @@
-ADD_LIBRARY(tensor_decoder SHARED tensordec.c)
-ADD_LIBRARY(tensor_decoderStatic STATIC tensordec.c)
-
-TARGET_LINK_LIBRARIES(tensor_decoder ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_decoder PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_decoder PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(tensor_decoderStatic ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_decoderStatic PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_decoderStatic PUBLIC ${pkgs_CFLAGS_OTHER})
-
-INSTALL(TARGETS tensor_decoder tensor_decoderStatic
-       RUNTIME DESTINATION ${EXEC_PREFIX}
-       LIBRARY DESTINATION ${GST_INSTALL_DIR}
-       ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
-       )
+ADD_LIBRARY(tensor_decoderOBJ OBJECT tensordec.c)
index 9a84c11..982090d 100644 (file)
@@ -1080,8 +1080,7 @@ gst_tensordec_transform_size (GstBaseTransform * trans,
  * initialize the plug-in itself
  * register the element factories and other features
  */
-static gboolean
-gst_tensordec_plugin_init (GstPlugin * plugin)
+NNSTREAMER_PLUGIN_INIT (tensor_decoder)
 {
   /**
    * debug category for fltering log messages
@@ -1093,6 +1092,7 @@ gst_tensordec_plugin_init (GstPlugin * plugin)
       GST_TYPE_TENSORDEC);
 }
 
+#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
@@ -1100,7 +1100,7 @@ gst_tensordec_plugin_init (GstPlugin * plugin)
  * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
  */
 #ifndef PACKAGE
-#define PACKAGE "tensor_decoder"
+#define PACKAGE "nnstreamer"
 #endif
 
 /**
@@ -1110,5 +1110,6 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     tensor_decoder,
     "Element to convert tensor to media stream",
-    gst_tensordec_plugin_init,
-    VERSION, "LGPL", "GStreamer", "http://gstreamer.net/");
+    gst_tensor_decoder_plugin_init,
+    VERSION, "LGPL", "nnstreamer", "http://github.com/nnsuite/nnstreamer/");
+#endif
index 4d18bf9..00929ec 100644 (file)
@@ -1,15 +1 @@
-ADD_LIBRARY(tensor_demux SHARED gsttensordemux.c )
-ADD_LIBRARY(tensor_demuxStatic STATIC gsttensordemux.c)
-
-TARGET_LINK_LIBRARIES(tensor_demux ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_demux PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_demux PUBLIC ${pkgs_CFLAGS_OTHER})
-TARGET_LINK_LIBRARIES(tensor_demuxStatic ${pkgs_LIBRARIES})
-TARGET_INCLUDE_DIRECTORIES(tensor_demuxStatic PUBLIC ${pkgs_INCLUDE_DIRS})
-TARGET_COMPILE_OPTIONS(tensor_demuxStatic PUBLIC ${pkgs_CFLAGS_OTHER})
-
-INSTALL(TARGETS tensor_demux tensor_demuxStatic
-       RUNTIME DESTINATION ${EXEC_PREFIX}
-       LIBRARY DESTINATION ${GST_INSTALL_DIR}
-       ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
-       )
+ADD_LIBRARY(tensor_demuxOBJ OBJECT gsttensordemux.c )
index 16725c5..f183d60 100644 (file)
@@ -604,32 +604,32 @@ gst_tensor_demux_get_property (GObject * object, guint prop_id,
 }
 
 /**
- * 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_demux"
-#endif
-
-/**
  * @brief entry point to initialize the plug-in
  * initialize the plug-in itself
  * register the element factories and other features
  */
-gboolean
-gst_tensor_demux_plugin_init (GstPlugin * tensordemux)
+NNSTREAMER_PLUGIN_INIT (tensor_demux)
 {
   /** debug category for fltering log messages
    * exchange the string 'Template tensor_demux' with your description
    */
   GST_DEBUG_CATEGORY_INIT (gst_tensor_demux_debug, "tensor_demux", 0,
       "Tensor Demuxer");
-  return gst_element_register (tensordemux, "tensor_demux",
+  return gst_element_register (plugin, "tensor_demux",
       GST_RANK_NONE, GST_TYPE_TENSOR_DEMUX);
 }
 
+#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 tensor_demux
  */
@@ -637,5 +637,6 @@ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     tensor_demux,
     "tensor_demux",
-    gst_tensor_demux_plugin_init, VERSION, "LGPL", "GStreamer",
-    "http://gstreamer.net/");
+    gst_tensor_demux_plugin_init, VERSION, "LGPL", "nnstreamer",
+    "http://github.com/nnsuite/nnstreamer/");
+#endif