[Filter] Support pipeline stop and go.
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 30 Nov 2018 02:28:42 +0000 (11:28 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Fri, 30 Nov 2018 06:49:55 +0000 (15:49 +0900)
Pipeline Stop does not always mean pipeline close.
A pipeline may be paused and resumed (stop and start).
Thus, do not clean up internal data structure for stop.

Instead just notify the plugins of the events with
callbacks.

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

index 298e0ad..7564d07 100644 (file)
@@ -1281,25 +1281,12 @@ static gboolean
 gst_tensor_filter_stop (GstBaseTransform * trans)
 {
   GstTensorFilter *self;
-  GstTensorFilterProperties *prop;
 
   self = GST_TENSOR_FILTER_CAST (trans);
-  g_assert (self->fw != NULL);
-
-  prop = &self->prop;
+  if (self->fw == NULL)
+    return FALSE;
 
   gst_tensor_filter_close_fw (self);
-
-  if (prop->model_file) {
-    g_free ((void *) prop->model_file);
-    prop->model_file = NULL;
-  }
-
-  if (prop->custom_properties) {
-    g_free ((void *) prop->custom_properties);
-    prop->custom_properties = NULL;
-  }
-
   return TRUE;
 }
 
index 790417b..f0e0821 100644 (file)
@@ -97,9 +97,7 @@ tflite_loadModelFile (const GstTensorFilter * filter, void **private_data)
 static int
 tflite_open (const GstTensorFilter * filter, void **private_data)
 {
-  int retval = tflite_loadModelFile (filter, private_data);
-  g_assert (retval == 0);       /** This must be called only once */
-  return 0;
+  return tflite_loadModelFile (filter, private_data);
 }
 
 /**