[Common] Refactor num tensors range of other/tensors
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 10 Sep 2018 02:34:57 +0000 (11:34 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Mon, 10 Sep 2018 05:24:30 +0000 (14:24 +0900)
With default Gstreamer, it is [1, 16], not [1, 65535]

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
include/tensor_common.h
include/tensor_typedef.h

index 36e5e35..f6ce087 100644 (file)
@@ -66,7 +66,6 @@ G_BEGIN_DECLS
 #define GST_TENSOR_RANK_RANGE "(int) [ 1, 4 ]"
 #define GST_TENSOR_DIM_RANGE "(int) [ 1, 65535 ]"
 #define GST_TENSOR_RATE_RANGE "(fraction) [ 0/1, 2147483647/1 ]"
-#define GST_TENSOR_TENSORS_RANGE "(int) [ 1, 65535 ]"
 #define GST_TENSOR_TYPE_ALL "{ float32, float64, int64, uint64, int32, uint32, int16, uint16, int8, uint8 }"
 
 #define GST_TENSOR_CAP_DEFAULT \
@@ -79,6 +78,16 @@ G_BEGIN_DECLS
     "type = (string) " GST_TENSOR_TYPE_ALL ", " \
     "framerate = " GST_TENSOR_RATE_RANGE
 
+
+/**
+ * @brief This value, 16, can be checked with gst_buffer_get_max_memory(),
+ * which is GST_BUFFER_MEM_MAX in gstreamer/gstbuffer.c.
+ * We redefined the value because GST_BUFFER_MEM_MAX is not exported and
+ * we need static value. To modify (increase) this value, you need to update
+ * gstreamer/gstbuffer.c as well.
+ */
+#define GST_TENSOR_NUM_TENSORS_RANGE "(int) [ 1, " NNS_TENSOR_SIZE_LIMIT_STR " ]"
+
 /**
  * @brief Default static capibility for other/tensors
  *
@@ -89,7 +98,7 @@ G_BEGIN_DECLS
 #define GST_TENSORS_CAP_DEFAULT \
     "other/tensors, " \
     "rank = " GST_TENSOR_RANK_RANGE ", " \
-    "num_tensors = " GST_TENSOR_TENSORS_RANGE ", "\
+    "num_tensors = " GST_TENSOR_NUM_TENSORS_RANGE ", "\
     "framerate = " GST_TENSOR_RATE_RANGE
     /**
      * type should be one of
index d84e22f..25b71fc 100644 (file)
@@ -31,6 +31,7 @@
 
 #define NNS_TENSOR_RANK_LIMIT  (4)
 #define NNS_TENSOR_SIZE_LIMIT  (16)
+#define NNS_TENSOR_SIZE_LIMIT_STR      "16"
 #define NNS_TENSOR_DIM_NULL ({0, 0, 0, 0})
 /**
  * @brief Possible data element types of other/tensor.