From f33d258efa3bce4a6eaa943efd97ba4b6a167b5d Mon Sep 17 00:00:00 2001 From: Jaeyun Date: Fri, 19 Apr 2019 14:32:33 +0900 Subject: [PATCH] [Build] remove warning remove build warning (-Wdiscarded-qualifiers) Signed-off-by: Jaeyun Jung --- ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c | 8 +++++--- ext/nnstreamer/tensor_decoder/tensordec-directvideo.c | 4 +++- ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c | 4 +++- ext/nnstreamer/tensor_filter/tensor_filter_python.c | 12 +++++++----- ext/nnstreamer/tensor_filter/tensor_filter_tensorflow.c | 6 ++++-- ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c | 6 ++++-- gst/nnstreamer/tensor_filter/tensor_filter_custom.c | 4 +++- gst/nnstreamer/tensor_source/tensor_src_iio.c | 9 +++++++++ gst/nnstreamer/tensor_source/tensor_src_iio.h | 4 ++-- 9 files changed, 40 insertions(+), 17 deletions(-) diff --git a/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c b/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c index 9b55349..1985069 100644 --- a/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c +++ b/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c @@ -1,5 +1,5 @@ /** - * GStreamer / NNStreamer tensor_decoder subplugin, "image labeling" + * GStreamer / NNStreamer tensor_decoder subplugin, "bounding boxes" * Copyright (C) 2018 Samsung Electronics Co. Ltd. * Copyright (C) 2018 MyungJoo Ham * @@ -1000,9 +1000,11 @@ bb_decode (void **pdata, const GstTensorsConfig * config, return GST_FLOW_OK; } -/** @brief Image Labeling tensordec-plugin TensorDecDef instance */ +static gchar decoder_subplugin_bounding_box[] = "bounding_boxes"; + +/** @brief Bounding box tensordec-plugin TensorDecDef instance */ static TensorDecDef boundingBox = { - .modename = "bounding_boxes", + .modename = decoder_subplugin_bounding_box, .type = OUTPUT_VIDEO, .init = bb_init, .exit = bb_exit, diff --git a/ext/nnstreamer/tensor_decoder/tensordec-directvideo.c b/ext/nnstreamer/tensor_decoder/tensordec-directvideo.c index 36af9d3..df4c9bb 100644 --- a/ext/nnstreamer/tensor_decoder/tensordec-directvideo.c +++ b/ext/nnstreamer/tensor_decoder/tensordec-directvideo.c @@ -188,9 +188,11 @@ dv_decode (void **pdata, const GstTensorsConfig * config, return GST_FLOW_OK; } +static gchar decoder_subplugin_direct_video[] = "direct_video"; + /** @brief Direct-Video tensordec-plugin TensorDecDef instance */ static TensorDecDef directVideo = { - .modename = "direct_video", + .modename = decoder_subplugin_direct_video, .type = OUTPUT_VIDEO, .init = dv_init, .exit = dv_exit, diff --git a/ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c b/ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c index 022471e..128408c 100644 --- a/ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c +++ b/ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c @@ -290,9 +290,11 @@ il_decode (void **pdata, const GstTensorsConfig * config, return GST_FLOW_OK; } +static gchar decoder_subplugin_image_labeling[] = "image_labeling"; + /** @brief Image Labeling tensordec-plugin TensorDecDef instance */ static TensorDecDef imageLabeling = { - .modename = "image_labeling", + .modename = decoder_subplugin_image_labeling, .type = OUTPUT_TEXT, .init = il_init, .exit = il_exit, diff --git a/ext/nnstreamer/tensor_filter/tensor_filter_python.c b/ext/nnstreamer/tensor_filter/tensor_filter_python.c index f52501a..d634190 100644 --- a/ext/nnstreamer/tensor_filter/tensor_filter_python.c +++ b/ext/nnstreamer/tensor_filter/tensor_filter_python.c @@ -116,7 +116,7 @@ py_getOutputDim (const GstTensorFilterProperties * prop, void **private_data, py_data *py = *private_data; g_assert (py); - + return py_core_getOutputDim (py->py_private_data, info); } @@ -170,7 +170,7 @@ py_loadScriptFile (const GstTensorFilterProperties * prop, void **private_data) g_printerr ("failed to initailize the object: python"); return -2; } - + /** check methods in python script */ cb_type type = py_core_getCbType (py->py_private_data); switch (type) { @@ -207,12 +207,14 @@ py_open (const GstTensorFilterProperties * prop, void **private_data) return py_loadScriptFile (prop, private_data); } -GstTensorFilterFramework _NNS_support_python = { #if PY_VERSION_HEX >= 0x03000000 - .name = "python3", +static gchar filter_subplugin_python[] = "python3"; #else - .name = "python2", +static gchar filter_subplugin_python[] = "python2"; #endif + +GstTensorFilterFramework _NNS_support_python = { + .name = filter_subplugin_python, .allow_in_place = FALSE, /** @todo: support this to optimize performance later. */ .allocate_in_invoke = TRUE, .invoke_NN = py_run, diff --git a/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow.c b/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow.c index edc56bd..4dbf4b3 100644 --- a/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow.c +++ b/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow.c @@ -171,8 +171,10 @@ tf_destroyNotify (void *data) tf_core_destroyNotify (data); } -GstTensorFilterFramework NNS_support_tensorflow = { - .name = "tensorflow", +static gchar filter_subplugin_tensorflow[] = "tensorflow"; + +static GstTensorFilterFramework NNS_support_tensorflow = { + .name = filter_subplugin_tensorflow, .allow_in_place = FALSE, /** @todo: support this to optimize performance later. */ .allocate_in_invoke = TRUE, .destroyNotify = tf_destroyNotify, diff --git a/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c b/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c index 234e9af..b71631d 100644 --- a/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c +++ b/ext/nnstreamer/tensor_filter/tensor_filter_tensorflow_lite.c @@ -158,8 +158,10 @@ tflite_getOutputDim (const GstTensorFilterProperties * prop, return tflite_core_getOutputDim (tf->tflite_private_data, info); } -GstTensorFilterFramework NNS_support_tensorflow_lite = { - .name = "tensorflow-lite", +static gchar filter_subplugin_tensorflow_lite[] = "tensorflow-lite"; + +static GstTensorFilterFramework NNS_support_tensorflow_lite = { + .name = filter_subplugin_tensorflow_lite, .allow_in_place = FALSE, /** @todo: support this to optimize performance later. */ .allocate_in_invoke = FALSE, .invoke_NN = tflite_invoke, diff --git a/gst/nnstreamer/tensor_filter/tensor_filter_custom.c b/gst/nnstreamer/tensor_filter/tensor_filter_custom.c index a117de6..843a881 100644 --- a/gst/nnstreamer/tensor_filter/tensor_filter_custom.c +++ b/gst/nnstreamer/tensor_filter/tensor_filter_custom.c @@ -229,8 +229,10 @@ custom_close (const GstTensorFilterProperties * prop, void **private_data) *private_data = NULL; } +static gchar filter_subplugin_custom[] = "custom"; + static GstTensorFilterFramework NNS_support_custom = { - .name = "custom", + .name = filter_subplugin_custom, .allow_in_place = FALSE, /* custom cannot support in-place (output == input). */ .allocate_in_invoke = FALSE, /* GstTensorFilter allocates output buffers */ .invoke_NN = custom_invoke, diff --git a/gst/nnstreamer/tensor_source/tensor_src_iio.c b/gst/nnstreamer/tensor_source/tensor_src_iio.c index a3d4740..1dc684e 100644 --- a/gst/nnstreamer/tensor_source/tensor_src_iio.c +++ b/gst/nnstreamer/tensor_source/tensor_src_iio.c @@ -159,6 +159,15 @@ enum PROP_POLL_TIMEOUT }; +static gchar nns_iio_base_dir_default[] = "/sys/bus/iio/devices/"; +static gchar nns_iio_dev_dir_default[] = "/dev/"; + +/** + * @brief IIO system paths + */ +gchar *IIO_BASE_DIR = nns_iio_base_dir_default; +gchar *IIO_DEV_DIR = nns_iio_dev_dir_default; + /** * @brief iio device channel enabled mode */ diff --git a/gst/nnstreamer/tensor_source/tensor_src_iio.h b/gst/nnstreamer/tensor_source/tensor_src_iio.h index aad0895..f875160 100644 --- a/gst/nnstreamer/tensor_source/tensor_src_iio.h +++ b/gst/nnstreamer/tensor_source/tensor_src_iio.h @@ -51,8 +51,8 @@ typedef struct _GstTensorSrcIIOClass GstTensorSrcIIOClass; /** * @brief IIO system paths */ -gchar *IIO_BASE_DIR = "/sys/bus/iio/devices/"; -gchar *IIO_DEV_DIR = "/dev/"; +extern gchar *IIO_BASE_DIR; +extern gchar *IIO_DEV_DIR; /** * @brief iio device channel enabled mode -- 2.7.4