[Build] fix build warning
authorJaeyun <jy1210.jung@samsung.com>
Wed, 24 Apr 2019 06:49:26 +0000 (15:49 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Thu, 25 Apr 2019 04:46:49 +0000 (13:46 +0900)
update sources to fix warning (missing-prototypes)

TODO : add function prototype to register tensor_* plugins

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c
ext/nnstreamer/tensor_decoder/tensordec-directvideo.c
ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c
ext/nnstreamer/tensor_filter/tensor_filter_tensorflow.c
ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c
gst/nnstreamer/tensor_decoder/tensordec.c
gst/nnstreamer/tensor_decoder/tensordec.h
gst/nnstreamer/tensor_filter/tensor_filter.c
gst/nnstreamer/tensor_filter/tensor_filter_custom.c
gst/nnstreamer/tensor_merge/gsttensormerge.c

index 1985069..35912f3 100644 (file)
@@ -58,6 +58,9 @@
 #include <nnstreamer_plugin_api_decoder.h>
 #include <nnstreamer_plugin_api.h>
 
+void init_bb (void) __attribute__ ((constructor));
+void fini_bb (void) __attribute__ ((destructor));
+
 #define BOX_SIZE                  4
 #define TFLITE_SSD_DETECTION_MAX  1917
 #define TFLITE_SSD_MAX_TENSORS    2
@@ -1015,15 +1018,15 @@ static TensorDecDef boundingBox = {
 };
 
 /** @brief Initialize this object for tensordec-plugin */
-__attribute__ ((constructor))
-     void init_bb (void)
+void
+init_bb (void)
 {
   tensordec_probe (&boundingBox);
 }
 
 /** @brief Destruct this object for tensordec-plugin */
-__attribute__ ((destructor))
-     void fini_bb (void)
+void
+fini_bb (void)
 {
   tensordec_exit (boundingBox.modename);
 }
index df4c9bb..795b97b 100644 (file)
@@ -31,6 +31,9 @@
 #include <gst/video/video-format.h>
 #include <nnstreamer_plugin_api_decoder.h>
 
+void init_dv (void) __attribute__ ((constructor));
+void fini_dv (void) __attribute__ ((destructor));
+
 #define DECODER_DV_VIDEO_CAPS_STR \
     GST_VIDEO_CAPS_MAKE ("{ RGB, BGRx, GRAY8 }") \
     ", views = (int) 1, interlace-mode = (string) progressive"
@@ -203,15 +206,15 @@ static TensorDecDef directVideo = {
 };
 
 /** @brief Initialize this object for tensordec-plugin */
-__attribute__ ((constructor))
-     void init_dv (void)
+void
+init_dv (void)
 {
   tensordec_probe (&directVideo);
 }
 
 /** @brief Destruct this object for tensordec-plugin */
-__attribute__ ((destructor))
-     void fini_dv (void)
+void
+fini_dv (void)
 {
   tensordec_exit (directVideo.modename);
 }
index 128408c..a36aecd 100644 (file)
@@ -38,6 +38,9 @@
 #include <nnstreamer_plugin_api_decoder.h>
 #include <nnstreamer_plugin_api.h>
 
+void init_il (void) __attribute__ ((constructor));
+void fini_il (void) __attribute__ ((destructor));
+
 #define DECODER_IL_TEXT_CAPS_STR \
     "text/x-raw, format = (string) utf8"
 
@@ -305,15 +308,15 @@ static TensorDecDef imageLabeling = {
 };
 
 /** @brief Initialize this object for tensordec-plugin */
-__attribute__ ((constructor))
-     void init_il (void)
+void
+init_il (void)
 {
   tensordec_probe (&imageLabeling);
 }
 
 /** @brief Destruct this object for tensordec-plugin */
-__attribute__ ((destructor))
-     void fini_il (void)
+void
+fini_il (void)
 {
   tensordec_exit (imageLabeling.modename);
 }
index 4dbf4b3..62a4206 100644 (file)
@@ -32,6 +32,9 @@
 #include <string.h>
 #include <nnstreamer_conf.h>
 
+void init_filter_tf (void) __attribute__ ((constructor));
+void fini_filter_tf (void) __attribute__ ((destructor));
+
 /**
  * @brief internal data of tensorflow
  */
@@ -186,15 +189,15 @@ static GstTensorFilterFramework NNS_support_tensorflow = {
 };
 
 /** @brief Initialize this object for tensor_filter subplugin runtime register */
-__attribute__ ((constructor))
-     void init_filter_tf (void)
+void
+init_filter_tf (void)
 {
   tensor_filter_probe (&NNS_support_tensorflow);
 }
 
 /** @brief Destruct the subplugin */
-__attribute__ ((destructor))
-     void fini_filter_tf (void)
+void
+fini_filter_tf (void)
 {
   tensor_filter_exit (NNS_support_tensorflow.name);
 }
index b71631d..fd03205 100644 (file)
@@ -31,6 +31,9 @@
 #include <glib.h>
 #include <string.h>
 
+void init_filter_tflite (void) __attribute__ ((constructor));
+void fini_filter_tflite (void) __attribute__ ((destructor));
+
 /**
  * @brief internal data of tensorflow lite
  */
@@ -172,15 +175,15 @@ static GstTensorFilterFramework NNS_support_tensorflow_lite = {
 };
 
 /** @brief Initialize this object for tensor_filter subplugin runtime register */
-__attribute__ ((constructor))
-     void init_filter_tflite (void)
+void
+init_filter_tflite (void)
 {
   tensor_filter_probe (&NNS_support_tensorflow_lite);
 }
 
 /** @brief Destruct the subplugin */
-__attribute__ ((destructor))
-     void fini_filter_tflite (void)
+void
+fini_filter_tflite (void)
 {
   tensor_filter_exit (NNS_support_tensorflow_lite.name);
 }
index d4d4d62..c59c2c1 100644 (file)
@@ -423,9 +423,11 @@ static void
 gst_tensordec_set_property (GObject * object, guint prop_id,
     const GValue * value, GParamSpec * pspec)
 {
-  GstTensorDec *self = GST_TENSORDEC (object);
+  GstTensorDec *self;
   gchar *temp_string;
 
+  self = GST_TENSOR_DECODER (object);
+
   switch (prop_id) {
     case PROP_SILENT:
       self->silent = g_value_get_boolean (value);
@@ -517,7 +519,9 @@ static void
 gst_tensordec_get_property (GObject * object, guint prop_id,
     GValue * value, GParamSpec * pspec)
 {
-  GstTensorDec *self = GST_TENSORDEC (object);
+  GstTensorDec *self;
+
+  self = GST_TENSOR_DECODER (object);
 
   switch (prop_id) {
     case PROP_SILENT:
@@ -550,10 +554,12 @@ gst_tensordec_get_property (GObject * object, guint prop_id,
 static void
 gst_tensordec_class_finalize (GObject * object)
 {
-  GstTensorDec *decoder = GST_TENSORDEC (object);
+  GstTensorDec *self;
+
+  self = GST_TENSOR_DECODER (object);
 
-  if (decoder->cleanup_plugin_data) {
-    decoder->cleanup_plugin_data (&decoder->plugin_data);
+  if (self->cleanup_plugin_data) {
+    self->cleanup_plugin_data (&self->plugin_data);
   }
 
   G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -615,7 +621,7 @@ gst_tensordec_transform (GstBaseTransform * trans,
   GstTensorDec *self;
   GstFlowReturn res;
 
-  self = GST_TENSORDEC_CAST (trans);
+  self = GST_TENSOR_DECODER_CAST (trans);
 
   if (G_UNLIKELY (!self->negotiated))
     goto unknown_tensor;
@@ -682,7 +688,7 @@ gst_tensordec_transform_caps (GstBaseTransform * trans,
   GstTensorDec *self;
   GstCaps *result;
 
-  self = GST_TENSORDEC_CAST (trans);
+  self = GST_TENSOR_DECODER_CAST (trans);
 
   /* Not ready */
   if (self->decoder == NULL)
@@ -738,7 +744,7 @@ gst_tensordec_fixate_caps (GstBaseTransform * trans,
   GstCaps *supposed;
   GstCaps *result;
 
-  self = GST_TENSORDEC_CAST (trans);
+  self = GST_TENSOR_DECODER_CAST (trans);
 
   silent_debug_caps (caps, "from caps");
   silent_debug_caps (othercaps, "from othercaps");
@@ -789,7 +795,7 @@ gst_tensordec_set_caps (GstBaseTransform * trans,
 {
   GstTensorDec *self;
 
-  self = GST_TENSORDEC_CAST (trans);
+  self = GST_TENSOR_DECODER_CAST (trans);
   self->negotiated = TRUE;
 
   silent_debug_caps (incaps, "from incaps");
@@ -829,7 +835,7 @@ gst_tensordec_transform_size (GstBaseTransform * trans,
   if (direction == GST_PAD_SRC)
     return FALSE;
   /** @todo If direction = SRC, you may need different interpretation! */
-  self = GST_TENSORDEC_CAST (trans);
+  self = GST_TENSOR_DECODER_CAST (trans);
 
   g_assert (self->configured);
 
@@ -861,5 +867,5 @@ NNSTREAMER_PLUGIN_INIT (tensor_decoder)
       0, "Element to convert tensor to media stream");
 
   return gst_element_register (plugin, "tensor_decoder", GST_RANK_NONE,
-      GST_TYPE_TENSORDEC);
+      GST_TYPE_TENSOR_DECODER);
 }
index 0c8a995..c2ae1a3 100644 (file)
 #include <nnstreamer_plugin_api_decoder.h>
 
 G_BEGIN_DECLS
-#define GST_TYPE_TENSORDEC \
+
+#define GST_TYPE_TENSOR_DECODER \
   (gst_tensordec_get_type())
-#define GST_TENSORDEC(obj) \
-  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TENSORDEC,GstTensorDec))
-#define GST_TENSORDEC_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TENSORDEC,GstTensorDecClass))
-#define GST_IS_TENSORDEC(obj) \
-  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TENSORDEC))
-#define GST_IS_TENSORDEC_CLASS(klass) \
-  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TENSORDEC))
-#define GST_TENSORDEC_CAST(obj)  ((GstTensorDec *)(obj))
+#define GST_TENSOR_DECODER(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TENSOR_DECODER,GstTensorDec))
+#define GST_TENSOR_DECODER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TENSOR_DECODER,GstTensorDecClass))
+#define GST_IS_TENSOR_DECODER(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TENSOR_DECODER))
+#define GST_IS_TENSOR_DECODER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TENSOR_DECODER))
+#define GST_TENSOR_DECODER_CAST(obj)  ((GstTensorDec *)(obj))
+
 typedef struct _GstTensorDec GstTensorDec;
 typedef struct _GstTensorDecClass GstTensorDecClass;
 
-
 #define TensorDecMaxOpNum (9)
+
 /**
  * @brief Internal data structure for tensordec instances.
  */
@@ -102,4 +104,5 @@ typedef enum
 GType gst_tensordec_get_type (void);
 
 G_END_DECLS
+
 #endif /* __GST_TENSORDEC_H__ */
index 7663654..440daa5 100644 (file)
@@ -60,6 +60,7 @@
 #include <string.h>
 
 #include "tensor_filter.h"
+#include "nnstreamer_plugin_api_filter.h"
 
 /**
  * @brief Macro for debug mode.
index 843a881..ecdc263 100644 (file)
@@ -32,6 +32,9 @@
 #include <glib.h>
 #include <dlfcn.h>
 
+void init_filter_custom (void) __attribute__ ((constructor));
+void fini_filter_custom (void) __attribute__ ((destructor));
+
 static GstTensorFilterFramework NNS_support_custom;
 
 /**
@@ -247,15 +250,15 @@ static GstTensorFilterFramework NNS_support_custom = {
 };
 
 /** @brief Initialize this object for tensor_filter subplugin runtime register */
-__attribute__ ((constructor))
-     void init_filter_custom (void)
+void
+init_filter_custom (void)
 {
   tensor_filter_probe (&NNS_support_custom);
 }
 
 /** @brief Destruct the subplugin */
-__attribute__ ((destructor))
-     void fini_filter_custom (void)
+void
+fini_filter_custom (void)
 {
   tensor_filter_exit (NNS_support_custom.name);
 }
index 30cde5e..f4f83fc 100644 (file)
@@ -373,7 +373,7 @@ gst_tensor_merge_sink_event (GstCollectPads * pads, GstCollectData * data,
  * @param config Tensor Config Data
  * @return true / false
  */
-gboolean
+static gboolean
 gst_merge_tensors_config (GstTensorMerge * tensor_merge,
     GstTensorsConfig * configs, GstTensorConfig * config)
 {