From c1579acf85c8cd27ded321075ad3f9e3435fc4a0 Mon Sep 17 00:00:00 2001 From: MyungJoo Ham Date: Thu, 21 Feb 2019 17:40:18 +0900 Subject: [PATCH] [Filter/Decoder] Exception handling of not found subplugin If subplugin is not found or not configured, do not proceed with GSTCAP negotiation or STREAM-START. Fixes #1092 Signed-off-by: MyungJoo Ham --- gst/nnstreamer/tensor_decoder/tensordec.c | 4 ++++ gst/nnstreamer/tensor_filter/tensor_filter.c | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/gst/nnstreamer/tensor_decoder/tensordec.c b/gst/nnstreamer/tensor_decoder/tensordec.c index 3b47597..2f88144 100644 --- a/gst/nnstreamer/tensor_decoder/tensordec.c +++ b/gst/nnstreamer/tensor_decoder/tensordec.c @@ -668,6 +668,10 @@ gst_tensordec_transform_caps (GstBaseTransform * trans, self = GST_TENSORDEC_CAST (trans); + /* Not ready */ + if (self->decoder == NULL) + return NULL; + silent_debug ("Direction = %d\n", direction); silent_debug_caps (caps, "from"); silent_debug_caps (filter, "filter"); diff --git a/gst/nnstreamer/tensor_filter/tensor_filter.c b/gst/nnstreamer/tensor_filter/tensor_filter.c index 7a3cf85..1af11d9 100644 --- a/gst/nnstreamer/tensor_filter/tensor_filter.c +++ b/gst/nnstreamer/tensor_filter/tensor_filter.c @@ -1161,6 +1161,11 @@ gst_tensor_filter_transform_caps (GstBaseTransform * trans, GstStructure *structure; self = GST_TENSOR_FILTER_CAST (trans); + + /* Not ready */ + if (self->fw == NULL) + return NULL; + gst_tensors_config_init (&config); silent_debug ("Direction = %d\n", direction); @@ -1353,6 +1358,10 @@ gst_tensor_filter_start (GstBaseTransform * trans) self = GST_TENSOR_FILTER_CAST (trans); + /* If it is not configured properly, don't allow to start! */ + if (self->fw == NULL) + return FALSE; + gst_tensor_filter_open_fw (self); if (self->prop.fw_opened == FALSE) -- 2.7.4