[C-Api/Pipeline] warning message for sync option
authorJaeyun <jy1210.jung@samsung.com>
Mon, 27 Apr 2020 11:18:53 +0000 (20:18 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 28 Apr 2020 04:02:05 +0000 (13:02 +0900)
add warning message if sink element does not have sync=false option.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
api/capi/src/nnstreamer-capi-pipeline.c

index 5ab9659..869b471 100644 (file)
@@ -453,6 +453,18 @@ iterate_element (ml_pipeline * pipe_h, GstElement * pipeline)
                 /** @todo CRITICAL HANDLE THIS! */
               }
 
+              /* check 'sync' property in sink element */
+              if (element_type == ML_PIPELINE_ELEMENT_SINK ||
+                  element_type == ML_PIPELINE_ELEMENT_APP_SINK) {
+                gboolean sync = FALSE;
+
+                g_object_get (G_OBJECT (elem), "sync", &sync, NULL);
+                if (sync) {
+                  ml_logw
+                      ("It is recommended to apply 'sync=false' property to a sink element in most AI applications. Otherwise, inference results of large neural networks will be frequently dropped by the synchronization mechanism at the sink element.");
+                }
+              }
+
               if (element_type != ML_PIPELINE_ELEMENT_UNKNOWN) {
                 ml_pipeline_element *e;