[Filter] Clear & explicit error for missing extensions.
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 7 Mar 2019 01:45:10 +0000 (10:45 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 7 Mar 2019 02:25:51 +0000 (11:25 +0900)
If an extension (e.g., nnstreamer-tensorflow) is missing,
the error message must be explicit and visible even without
GST_DEBUG envvars; most applications developers won't know it.

However, we cannot alarm them at the stage of set-properties.
Thus, delay alarming until it becomes "fatal".

Fixes #1206
Helps https://github.com/nnsuite/nnstreamer-example/issues/21

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

index 1af11d9..991a709 100644 (file)
@@ -832,6 +832,14 @@ unknown_format:
   GST_ELEMENT_ERROR (self, CORE, NOT_IMPLEMENTED, (NULL), ("unknown format"));
   return GST_FLOW_NOT_NEGOTIATED;
 unknown_framework:
+  /**
+    * This is fatal; if framework is not configured until this stage,
+    * it means that an extension is missing or not configured.
+    * We need readable messages for non-developers
+    */
+  g_error
+      ("\nA nnstreamer extension is not installed or framework property of tensor_filter is incorrect: [%s] is not found.\n\n",
+      prop->fwname);
   GST_ELEMENT_ERROR (self, CORE, NOT_IMPLEMENTED, (NULL),
       ("framework not configured"));
   return GST_FLOW_ERROR;