[Filter/Custom/Easy] Add unregister function
authorSangjung Woo <sangjung.woo@samsung.com>
Thu, 11 Jun 2020 01:58:56 +0000 (10:58 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Thu, 11 Jun 2020 11:17:38 +0000 (20:17 +0900)
This patch newly adds 'NNS_custom_easy_unregister()' function to remove
registered function so that pipeline itself can be reused without
changing custom model name.

Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
gst/nnstreamer/include/tensor_filter_custom_easy.h
gst/nnstreamer/tensor_filter/tensor_filter_custom_easy.c

index 3f1de9b..01c46a9 100644 (file)
@@ -63,5 +63,12 @@ extern int NNS_custom_easy_register (const char * modelname,
     NNS_custom_invoke func, void *data,
     const GstTensorsInfo * in_info, const GstTensorsInfo * out_info);
 
+/**
+ * @brief Unregister the custom-easy tensor function.
+ * @param[in] modelname The registered name of custom-easy tensor function.
+ * @return 0 if success, non-zero if error
+ */
+extern int NNS_custom_easy_unregister (const char * modelname);
+
 G_END_DECLS
 #endif /*__NNS_TENSOR_FILTER_CUSTOM_EASY_H__*/
index 1e4b6c8..fdbf665 100644 (file)
@@ -85,6 +85,16 @@ NNS_custom_easy_register (const char *modelname,
 }
 
 /**
+ * @brief Unregister the custom-easy tensor function.
+ * @return 0 if success. -EINVAL if invalid model name.
+ */
+int
+NNS_custom_easy_unregister (const char *modelname)
+{
+  return unregister_subplugin (NNS_EASY_CUSTOM_FILTER, modelname) ? 0 : -EINVAL;
+}
+
+/**
  * @brief Callback required by tensor_filter subplugin
  */
 static int