decoder/filter: more info for gst-inspect.
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 16 Oct 2023 07:02:35 +0000 (16:02 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 18 Oct 2023 10:15:15 +0000 (19:15 +0900)
Show available frameworks / mode with gst-inspect.
This is the first step to address #3903

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
gst/nnstreamer/elements/gsttensor_decoder.c
gst/nnstreamer/registerer/nnstreamer.c
gst/nnstreamer/tensor_filter/tensor_filter_common.c

index effe87c..6435398 100644 (file)
@@ -289,6 +289,9 @@ gst_tensordec_class_init (GstTensorDecoderClass * klass)
   GObjectClass *gobject_class;
   GstElementClass *gstelement_class;
   GstBaseTransformClass *trans_class;
+  gchar **subplugins = NULL;
+  gchar *strbuf;
+  static gchar *strprint = NULL;
 
   GST_DEBUG_CATEGORY_INIT (gst_tensordec_debug, "tensor_decoder", 0,
       "Element to convert tensor to media stream");
@@ -305,9 +308,18 @@ gst_tensordec_class_init (GstTensorDecoderClass * klass)
       g_param_spec_boolean ("silent", "Silent", "Produce verbose output",
           DEFAULT_SILENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  subplugins = get_all_subplugins (NNS_SUBPLUGIN_DECODER);
+  strbuf = g_strjoinv (", ", subplugins);
+  g_free (strprint);
+  strprint = g_strdup_printf
+      ("Decoder mode. Other options (option1 to optionN) depend on the specified model. For more detail on optionX for each mode, please refer to the documentation or nnstreamer-check utility. Available modes (decoder subplugins) are: {%s}.",
+      strbuf);
+
   g_object_class_install_property (gobject_class, PROP_MODE,
-      g_param_spec_string ("mode", "Mode", "Decoder mode", "",
+      g_param_spec_string ("mode", "Mode", strprint, "",
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+  g_free (strbuf);
+  g_strfreev (subplugins);
 
   g_object_class_install_property (gobject_class, PROP_MODE_OPTION1,
       g_param_spec_string ("option1", "Mode option 1",
index 138519b..64d892b 100644 (file)
@@ -128,6 +128,6 @@ gst_nnstreamer_init (GstPlugin * plugin)
 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
     GST_VERSION_MINOR,
     nnstreamer,
-    "nnstreamer plugin library",
+    "NNStreamer plugin library allows neural networks in GStreamer pipelines. Use nnstreamer-check utility for more information of the current NNStreamer installation.",
     gst_nnstreamer_init, VERSION, "LGPL", "nnstreamer",
     "https://github.com/nnstreamer/nnstreamer");
index da14c99..8b58452 100644 (file)
@@ -881,13 +881,28 @@ gst_tensorsinfo_compare_print (const GstTensorsInfo * info1,
 void
 gst_tensor_filter_install_properties (GObjectClass * gobject_class)
 {
+  gchar **subplugins = NULL;
+  gchar *strbuf;
+  static gchar *strprint = NULL;
+
   g_object_class_install_property (gobject_class, PROP_SILENT,
       g_param_spec_boolean ("silent", "Silent", "Produce verbose output",
           FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  subplugins = get_all_subplugins (NNS_SUBPLUGIN_FILTER);
+  strbuf = g_strjoinv (", ", subplugins);
+  g_free (strprint);
+  strprint = g_strdup_printf
+      ("Neural network framework. Custom property depends on the specified framework. Use 'auto' to let tensor_filter determine the framework. For more detail, please refer to the documentation or nnstreamer-check utility. Available frameworks (filter subplugins) are: {%s}.",
+      strbuf);
+
   g_object_class_install_property (gobject_class, PROP_FRAMEWORK,
-      g_param_spec_string ("framework", "Framework",
-          "Neural network framework", "auto",
+      g_param_spec_string ("framework", "Framework", strprint, "auto",
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  g_free (strbuf);
+  g_strfreev (subplugins);
+
   g_object_class_install_property (gobject_class, PROP_MODEL,
       g_param_spec_string ("model", "Model filepath",
           "File path to the model file. Separated with ',' in case of multiple model files(like caffe2)",