[Decoder] media caps string
authorJaeyun <jy1210.jung@samsung.com>
Mon, 11 Mar 2019 04:15:30 +0000 (13:15 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 12 Mar 2019 06:33:09 +0000 (15:33 +0900)
set media caps string from decoder sub-plugins.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
ext/nnstreamer/tensor_decoder/tensordec-directvideo.c
ext/nnstreamer/tensor_decoder/tensordec-imagelabel.c
gst/nnstreamer/tensor_decoder/tensordec.c

index 899c1a3..36af9d3 100644 (file)
 #include <gst/video/video-format.h>
 #include <nnstreamer_plugin_api_decoder.h>
 
+#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]) {
index 05727fb..022471e 100644 (file)
@@ -38,6 +38,9 @@
 #include <nnstreamer_plugin_api_decoder.h>
 #include <nnstreamer_plugin_api.h>
 
+#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 */
index 2f88144..5ed72ba 100644 (file)
@@ -47,7 +47,6 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include <gst/gstinfo.h>
 #include <stdio.h>
 #include <glib.h>
 #include <string.h>
@@ -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;