From a98949afeb8f1c663e6d5abfd7234cd50306d510 Mon Sep 17 00:00:00 2001 From: Jaeyun Date: Mon, 19 Apr 2021 20:04:31 +0900 Subject: [PATCH] [FlexTensors] define mimetype for flexible tensors add definition to handle flexible tensors stream. Signed-off-by: Jaeyun --- gst/nnstreamer/include/tensor_typedef.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gst/nnstreamer/include/tensor_typedef.h b/gst/nnstreamer/include/tensor_typedef.h index b9c2144..551674e 100644 --- a/gst/nnstreamer/include/tensor_typedef.h +++ b/gst/nnstreamer/include/tensor_typedef.h @@ -36,6 +36,10 @@ #define NNS_TENSOR_SIZE_LIMIT_STR "16" #define NNS_TENSOR_DIM_NULL ({0, 0, 0, 0}) +#define NNS_MIMETYPE_TENSOR "other/tensor" +#define NNS_MIMETYPE_TENSORS "other/tensors" +#define NNS_MIMETYPE_TENSORS_FLEXIBLE "other/tensors-flexible" + /** * @brief This value, 16, can be checked with gst_buffer_get_max_memory(), * which is GST_BUFFER_MEM_MAX in gstreamer/gstbuffer.c. @@ -55,7 +59,7 @@ * @brief Default static capability for other/tensor */ #define GST_TENSOR_CAP_DEFAULT \ - "other/tensor, " \ + NNS_MIMETYPE_TENSOR ", " \ "framerate = " GST_TENSOR_RATE_RANGE /** * type should be one of types in GST_TENSOR_TYPE_ALL @@ -69,7 +73,7 @@ * num should be a string format that describes the number of tensors, or the range of incoming tensors. */ #define GST_TENSORS_CAP_WITH_NUM(num) \ - "other/tensors, " \ + NNS_MIMETYPE_TENSORS ", " \ "num_tensors = " num ", " \ "framerate = " GST_TENSOR_RATE_RANGE /** @@ -87,6 +91,14 @@ GST_TENSORS_CAP_WITH_NUM(GST_TENSOR_NUM_TENSORS_RANGE) /** + * @brief Caps string for the caps template of flexible tensors. + * This mimetype handles non-static, flexible tensor stream without specifying the data type and shape of the tensor. + * The maximum number of tensors in a buffer is 16 (NNS_TENSOR_SIZE_LIMIT). + */ +#define GST_TENSORS_FLEX_CAP_DEFAULT \ + NNS_MIMETYPE_TENSORS_FLEXIBLE + +/** * @brief Default static capability for flatbuffers * Flatbuf converter will convert this capability to other/tensor(s) * @todo Move this definition to proper header file -- 2.7.4