From: Wook Song Date: Tue, 12 Feb 2019 07:44:53 +0000 (+0900) Subject: [Transform/Stand] Change reaction for invalid option string X-Git-Tag: v0.1.1~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c6c05431105c127ea3ea60d8c34d46dfd278e15f;p=platform%2Fupstream%2Fnnstreamer.git [Transform/Stand] Change reaction for invalid option string This patch changes the reaction for the invalid option string to displaying error messages using g_critical and terminating the pipeline before it starts. Signed-off-by: Wook Song --- diff --git a/gst/nnstreamer/tensor_transform/tensor_transform.c b/gst/nnstreamer/tensor_transform/tensor_transform.c index d9d4fee..e3fccdb 100644 --- a/gst/nnstreamer/tensor_transform/tensor_transform.c +++ b/gst/nnstreamer/tensor_transform/tensor_transform.c @@ -192,7 +192,8 @@ gst_tensor_transform_mode_get_type (void) {GTT_TRANSPOSE, "Mode for transposing shape of tensor, " "option=D1\':D2\':D3\':D4 (fixed to 3)", "transpose"}, - {GTT_STAND, "Mode for statistical standardization of tensor", + {GTT_STAND, "Mode for statistical standardization of tensor, " + "option=default", "stand"}, {GTT_UNKNOWN, "Unknown or not-implemented-yet mode", "unknown"}, @@ -891,7 +892,13 @@ gst_tensor_transform_set_option_data (GstTensorTransform * filter) { filter->data_stand.mode = gst_tensor_transform_get_stand_mode (filter->option); - g_assert (filter->data_stand.mode != STAND_END); + if (filter->data_stand.mode == STAND_END) { + g_critical ("%s: stand: " + "\'%s\' is not valid option string: " + "it should be \'default\', currently the only supported mode.\n", + gst_object_get_name ((GstObject *) filter), filter->option); + break; + } filter->loaded = TRUE; break; }