[Android] enable custom filter in singleshot
authorJaeyun <jy1210.jung@samsung.com>
Tue, 19 May 2020 09:27:57 +0000 (18:27 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 21 May 2020 02:25:38 +0000 (11:25 +0900)
register filter subplugins (custom-filter support) when building single-shot library

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
api/android/api/src/main/jni/Android-nnstreamer.mk
api/android/api/src/main/jni/nnstreamer-native-api.c
jni/nnstreamer.mk

index f4dea57..f51479c 100644 (file)
@@ -22,7 +22,6 @@ NNSTREAMER_SRC_FILES += \
     $(NNSTREAMER_CAPI_SRCS) \
     $(NNSTREAMER_PLUGINS_SRCS) \
     $(NNSTREAMER_SOURCE_AMC_SRCS) \
-    $(NNSTREAMER_FILTER_CPP_SRCS) \
     $(NNSTREAMER_DECODER_BB_SRCS) \
     $(NNSTREAMER_DECODER_DV_SRCS) \
     $(NNSTREAMER_DECODER_IL_SRCS) \
index 3e38089..53db076 100644 (file)
@@ -27,9 +27,6 @@
 #if !defined (NNS_SINGLE_ONLY)
 GST_PLUGIN_STATIC_DECLARE (nnstreamer);
 GST_PLUGIN_STATIC_DECLARE (amcsrc);
-extern void init_filter_cpp (void);
-extern void init_filter_custom (void);
-extern void init_filter_custom_easy (void);
 extern void init_dv (void);
 extern void init_bb (void);
 extern void init_il (void);
@@ -37,6 +34,10 @@ extern void init_pose (void);
 extern void init_is (void);
 #endif
 
+extern void init_filter_cpp (void);
+extern void init_filter_custom (void);
+extern void init_filter_custom_easy (void);
+
 #if defined (ENABLE_TENSORFLOW_LITE)
 extern void init_filter_tflite (void);
 #endif
@@ -664,11 +665,6 @@ nnstreamer_native_initialize (JNIEnv * env, jobject context)
     /* Android MediaCodec */
     GST_PLUGIN_STATIC_REGISTER (amcsrc);
 
-    /* tensor-filter sub-plugins */
-    init_filter_cpp ();
-    init_filter_custom ();
-    init_filter_custom_easy ();
-
     /* tensor-decoder sub-plugins */
     init_dv ();
     init_bb ();
@@ -677,6 +673,11 @@ nnstreamer_native_initialize (JNIEnv * env, jobject context)
     init_is ();
 #endif
 
+    /* tensor-filter sub-plugins */
+    init_filter_cpp ();
+    init_filter_custom ();
+    init_filter_custom_easy ();
+
 #if defined (ENABLE_TENSORFLOW_LITE)
     init_filter_tflite ();
 #endif
@@ -728,6 +729,7 @@ Java_org_nnsuite_nnstreamer_NNStreamer_nativeCheckAvailability (JNIEnv * env,
     jclass clazz, jint fw_type)
 {
   ml_nnfw_type_e nnfw;
+
   if (!nns_get_nnfw_type (fw_type, &nnfw)) {
     return JNI_FALSE;
   }
index 9f26112..7aeb680 100644 (file)
@@ -19,7 +19,7 @@ NNSTREAMER_INCLUDES := \
     $(NNSTREAMER_GST_HOME) \
     $(NNSTREAMER_GST_HOME)/include
 
-# nnstreamer common sources. (including tensor-filter common)
+# nnstreamer common sources. (including tensor-filter common, custom filter)
 NNSTREAMER_COMMON_SRCS := \
     $(NNSTREAMER_GST_HOME)/nnstreamer_conf.c \
     $(NNSTREAMER_GST_HOME)/nnstreamer_subplugin.c \
@@ -27,7 +27,8 @@ NNSTREAMER_COMMON_SRCS := \
     $(NNSTREAMER_GST_HOME)/tensor_filter/tensor_filter_common.c \
     $(NNSTREAMER_GST_HOME)/tensor_filter/tensor_filter_custom.c \
     $(NNSTREAMER_GST_HOME)/tensor_filter/tensor_filter_custom_easy.c \
-    $(NNSTREAMER_GST_HOME)/tensor_filter/tensor_filter_support_cc.cc
+    $(NNSTREAMER_GST_HOME)/tensor_filter/tensor_filter_support_cc.cc \
+    $(NNSTREAMER_EXT_HOME)/tensor_filter/tensor_filter_cpp.cc
 
 # nnstreamer plugins. Not used for SINGLE-only build.
 NNSTREAMER_PLUGINS_SRCS := \
@@ -72,10 +73,6 @@ NNSTREAMER_SOURCE_AMC_SRCS := \
     $(NNSTREAMER_EXT_HOME)/android_source/gstamcsrc.c \
     $(NNSTREAMER_EXT_HOME)/android_source/gstamcsrc_looper.cc
 
-# filter cpp
-NNSTREAMER_FILTER_CPP_SRCS := \
-    $(NNSTREAMER_EXT_HOME)/tensor_filter/tensor_filter_cpp.cc
-
 # filter tensorflow
 NNSTREAMER_FILTER_TF_SRCS := \
     $(NNSTREAMER_EXT_HOME)/tensor_filter/tensor_filter_tensorflow.cc