From: Jaeyun Date: Fri, 7 Dec 2018 03:50:57 +0000 (+0900) Subject: [Transform/Orc] code clean to prepare meson X-Git-Tag: v0.1.0~82 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e63ccf1cf503380ce6992536227ee2176d100f5;p=platform%2Fupstream%2Fnnstreamer.git [Transform/Orc] code clean to prepare meson 1. Orc feature is defined in config, include config header to prepare meson build. 2. Set default property value with orc feature. 3. Add log message to indicate orc acceleration. Signed-off-by: Jaeyun Jung --- diff --git a/gst/nnstreamer/tensor_common.h b/gst/nnstreamer/tensor_common.h index 9c5ab53..47ac875 100644 --- a/gst/nnstreamer/tensor_common.h +++ b/gst/nnstreamer/tensor_common.h @@ -25,6 +25,10 @@ #ifndef __GST_TENSOR_COMMON_H__ #define __GST_TENSOR_COMMON_H__ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include "tensor_typedef.h" diff --git a/gst/tensor_transform/tensor_transform.c b/gst/tensor_transform/tensor_transform.c index 6834d08..92a61a9 100644 --- a/gst/tensor_transform/tensor_transform.c +++ b/gst/tensor_transform/tensor_transform.c @@ -103,6 +103,15 @@ enum PROP_ACCELERATION }; +/** + * @brief Flag to set orc acceleration. + */ +#ifdef HAVE_ORC +#define DEFAULT_ACCELERATION TRUE +#else +#define DEFAULT_ACCELERATION FALSE +#endif + static const gchar *gst_tensor_transform_mode_string[] = { [GTT_DIMCHG] = "dimchg", [GTT_TYPECAST] = "typecast", @@ -194,7 +203,7 @@ gst_tensor_transform_class_init (GstTensorTransformClass * klass) "Option for the tensor transform mode ?", "", G_PARAM_READWRITE)); g_object_class_install_property (gobject_class, PROP_ACCELERATION, g_param_spec_boolean ("acceleration", "Acceleration", "Orc acceleration", - TRUE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + DEFAULT_ACCELERATION, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); gst_element_class_set_details_simple (gstelement_class, "TensorTransform", @@ -238,11 +247,9 @@ gst_tensor_transform_init (GstTensorTransform * filter) filter->option = NULL; filter->loaded = FALSE; filter->operators = NULL; + filter->acceleration = DEFAULT_ACCELERATION; #ifdef HAVE_ORC - filter->acceleration = TRUE; filter->orc_supported = FALSE; -#else - filter->acceleration = FALSE; #endif gst_tensor_config_init (&filter->in_config); @@ -1662,6 +1669,10 @@ gst_tensor_transform_set_caps (GstBaseTransform * trans, out_config.info.type != _NNS_UINT64) { filter->orc_supported = TRUE; } + + if (orc_supported (filter)) { + GST_INFO_OBJECT (filter, "Orc acceleration enabled."); + } #endif return TRUE; error: diff --git a/gst/tensor_transform/tensor_transform.h b/gst/tensor_transform/tensor_transform.h index 50105f1..2928921 100644 --- a/gst/tensor_transform/tensor_transform.h +++ b/gst/tensor_transform/tensor_transform.h @@ -28,6 +28,10 @@ #ifndef __GST_TENSOR_TRANSFORM_H__ #define __GST_TENSOR_TRANSFORM_H__ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include