From 0d7a1903a7b14e22ac0475bdceb2da0feb78cb86 Mon Sep 17 00:00:00 2001 From: Jaeyun Date: Mon, 11 Mar 2019 13:15:30 +0900 Subject: [PATCH] [Decoder] media caps string set media caps string from decoder sub-plugins. Signed-off-by: Jaeyun Jung --- ext/nnstreamer/tensor_decoder/tensordec-directvideo.c | 6 +++++- ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c | 5 ++++- gst/nnstreamer/tensor_decoder/tensordec.c | 5 ++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ext/nnstreamer/tensor_decoder/tensordec-directvideo.c b/ext/nnstreamer/tensor_decoder/tensordec-directvideo.c index 899c1a3..36af9d3 100644 --- a/ext/nnstreamer/tensor_decoder/tensordec-directvideo.c +++ b/ext/nnstreamer/tensor_decoder/tensordec-directvideo.c @@ -31,6 +31,10 @@ #include #include +#define DECODER_DV_VIDEO_CAPS_STR \ + GST_VIDEO_CAPS_MAKE ("{ RGB, BGRx, GRAY8 }") \ + ", views = (int) 1, interlace-mode = (string) progressive" + /** @brief tensordec-plugin's TensorDecDef callback */ static int dv_init (void **pdata) @@ -68,7 +72,7 @@ dv_getOutCaps (void **pdata, const GstTensorsConfig * config) GST_INFO ("Num Tensors = %d", config->info.num_tensors); g_return_val_if_fail (config->info.num_tensors >= 1, NULL); - caps = gst_caps_from_string (GST_TENSOR_VIDEO_CAPS_STR); + caps = gst_caps_from_string (DECODER_DV_VIDEO_CAPS_STR); /* Direct video uses the first tensor only even if it's multi-tensor */ switch (config->info.info[0].dimension[0]) { diff --git a/ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c b/ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c index 05727fb..022471e 100644 --- a/ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c +++ b/ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c @@ -38,6 +38,9 @@ #include #include +#define DECODER_IL_TEXT_CAPS_STR \ + "text/x-raw, format = (string) utf8" + /** @brief Internal data structure for image labeling */ typedef struct { @@ -185,7 +188,7 @@ il_getOutCaps (void **pdata, const GstTensorsConfig * config) return NULL; } - return gst_caps_from_string (GST_TENSOR_TEXT_CAPS_STR); + return gst_caps_from_string (DECODER_IL_TEXT_CAPS_STR); } /** @brief tensordec-plugin's TensorDecDef callback */ diff --git a/gst/nnstreamer/tensor_decoder/tensordec.c b/gst/nnstreamer/tensor_decoder/tensordec.c index 2f88144..5ed72ba 100644 --- a/gst/nnstreamer/tensor_decoder/tensordec.c +++ b/gst/nnstreamer/tensor_decoder/tensordec.c @@ -47,7 +47,6 @@ #ifdef HAVE_CONFIG_H #include #endif -#include #include #include #include @@ -225,8 +224,8 @@ gst_tensordec_media_caps_from_structure (GstTensorDec * self, } if (result == NULL) { - /** raw caps for supported media types */ - result = gst_caps_from_string (GST_TENSOR_MEDIA_CAPS_STR); + /* we cannot specify the media type */ + result = gst_caps_new_any (); } return result; -- 2.7.4