[Android] common headers for gstreamer
authorJaeyun <jy1210.jung@samsung.com>
Thu, 12 Dec 2019 08:51:47 +0000 (17:51 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 13 Dec 2019 04:39:29 +0000 (13:39 +0900)
define common header path for gstreamer.

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

index c6981d8..30e0fa2 100644 (file)
@@ -32,15 +32,10 @@ LOCAL_C_INCLUDES := \
     $(NNSTREAMER_CAPI_INCLUDES)
 
 # common headers (gstreamer, glib)
-LOCAL_C_INCLUDES += \
-    $(GSTREAMER_ROOT)/include/gstreamer-1.0 \
-    $(GSTREAMER_ROOT)/include/glib-2.0 \
-    $(GSTREAMER_ROOT)/lib/glib-2.0/include \
-    $(GSTREAMER_ROOT)/include
+LOCAL_C_INCLUDES += $(GST_HEADERS_COMMON)
 
 # common headers (tensorflow-lite)
-LOCAL_C_INCLUDES += \
-    $(TF_LITE_INCLUDES)
+LOCAL_C_INCLUDES += $(TF_LITE_INCLUDES)
 
 LOCAL_CFLAGS += -O2 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CXXFLAGS += -std=c++11 -O2 -DVERSION=\"$(NNSTREAMER_VERSION)\"
index cc8354c..8938eaa 100644 (file)
@@ -20,8 +20,6 @@ ifndef NNSTREAMER_ROOT
 NNSTREAMER_ROOT := $(LOCAL_PATH)/..
 endif
 
-include $(LOCAL_PATH)/nnstreamer.mk
-
 CUSTOM_LINKER64    := -fPIE -pie -Wl,-dynamic-linker,/data/nnstreamer/libandroid/linker64
 
 # Do not specify "TARGET_ARCH_ABI" in this file. If you want to append additional architecture,
@@ -41,6 +39,9 @@ else
 $(error Target arch ABI not supported: $(TARGET_ARCH_ABI))
 endif
 
+# Common definition for NNStreamer
+include $(LOCAL_PATH)/nnstreamer.mk
+
 # Define shared libraries that are required by a gstreamer plug-in.
 define shared_lib_common
     include $(CLEAR_VARS)
@@ -108,10 +109,7 @@ LOCAL_LDFLAGS   := $(CUSTOM_LINKER64)
 LOCAL_C_INCLUDES       := $(NNSTREAMER_INCLUDES)
 LOCAL_SHARED_LIBRARIES := $(BUILDING_BLOCK_LIST)
 
-LOCAL_C_INCLUDES += $(GSTREAMER_ROOT)/include/gstreamer-1.0 \
-     $(GSTREAMER_ROOT)/include/glib-2.0 \
-     $(GSTREAMER_ROOT)/lib/glib-2.0/include \
-     $(GSTREAMER_ROOT)/include
+LOCAL_C_INCLUDES += $(GST_HEADERS_COMMON)
 
 GSTREAMER_ANDROID_INCLUDE := $(GSTREAMER_ROOT)/include
 
index 538ee8f..c610668 100644 (file)
@@ -31,8 +31,6 @@ ifndef NNSTREAMER_ROOT
 NNSTREAMER_ROOT := $(LOCAL_PATH)/..
 endif
 
-include $(LOCAL_PATH)/nnstreamer.mk
-
 # Do not specify "TARGET_ARCH_ABI" in this file. If you want to append additional architecture,
 # Please append an architecture name behind "APP_ABI" in Application.mk file.
 
@@ -50,6 +48,9 @@ else
 $(error Target arch ABI not supported: $(TARGET_ARCH_ABI))
 endif
 
+# Common definition for NNStreamer
+include $(LOCAL_PATH)/nnstreamer.mk
+
 # Define shared libraries that are required by a gstreamer plug-in.
 define shared_lib_common
     include $(CLEAR_VARS)
@@ -124,10 +125,7 @@ ifeq ($(NO_AUDIO), false)
 BUILDING_BLOCK_LIST += gstaudio-1.0 gstbadaudio-1.0 gstaudioconvert gstaudiomixer gstaudiorate gstaudioresample gstaudiotestsrc
 endif
 
-LOCAL_C_INCLUDES += $(GSTREAMER_ROOT)/include/gstreamer-1.0 \
-     $(GSTREAMER_ROOT)/include/glib-2.0 \
-     $(GSTREAMER_ROOT)/lib/glib-2.0/include \
-     $(GSTREAMER_ROOT)/include
+LOCAL_C_INCLUDES += $(GST_HEADERS_COMMON)
 
 LOCAL_SHARED_LIBRARIES := $(BUILDING_BLOCK_LIST)
 
index b12a25e..dc0ecae 100644 (file)
@@ -1,8 +1,6 @@
 LOCAL_PATH := $(call my-dir)
 include $(CLEAR_VARS)
 
-include $(LOCAL_PATH)/nnstreamer.mk
-
 ifndef NNSTREAMER_ROOT
 NNSTREAMER_ROOT := $(LOCAL_PATH)/..
 endif
@@ -25,6 +23,9 @@ else
 $(error Target arch ABI not supported: $(TARGET_ARCH_ABI))
 endif
 
+# Common definition for NNStreamer
+include $(LOCAL_PATH)/nnstreamer.mk
+
 # Define shared libraries that are required by a gstreamer plug-in.
 define shared_lib_common
     include $(CLEAR_VARS)
@@ -86,10 +87,7 @@ LOCAL_MODULE        := nnstreamer
 LOCAL_SRC_FILES     := $(NNSTREAMER_COMMON_SRCS) $(NNSTREAMER_PLUGINS_SRCS)
 LOCAL_C_INCLUDES    := $(NNSTREAMER_INCLUDES)
 
-LOCAL_C_INCLUDES += $(GSTREAMER_ROOT)/include/gstreamer-1.0 \
-     $(GSTREAMER_ROOT)/include/glib-2.0 \
-     $(GSTREAMER_ROOT)/lib/glib-2.0/include \
-     $(GSTREAMER_ROOT)/include
+LOCAL_C_INCLUDES += $(GST_HEADERS_COMMON)
 
 LOCAL_SHARED_LIBRARIES := $(GST_BUILDING_BLOCK_LIST)
 
@@ -175,10 +173,7 @@ LOCAL_CFLAGS        += -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CXXFLAGS      += -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CFLAGS        += -pthread -fopenmp
 
-LOCAL_C_INCLUDES += $(GSTREAMER_ROOT)/include/gstreamer-1.0 \
-     $(GSTREAMER_ROOT)/include/glib-2.0 \
-     $(GSTREAMER_ROOT)/lib/glib-2.0/include \
-     $(GSTREAMER_ROOT)/include
+LOCAL_C_INCLUDES += $(GST_HEADERS_COMMON)
 
 include $(BUILD_SHARED_LIBRARY)
 
@@ -194,10 +189,7 @@ LOCAL_CFLAGS        += -O0 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CXXFLAGS      += -std=c++11 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CFLAGS        += -pthread -fopenmp
 
-LOCAL_C_INCLUDES += $(GSTREAMER_ROOT)/include/gstreamer-1.0 \
-     $(GSTREAMER_ROOT)/include/glib-2.0 \
-     $(GSTREAMER_ROOT)/lib/glib-2.0/include \
-     $(GSTREAMER_ROOT)/include
+LOCAL_C_INCLUDES += $(GST_HEADERS_COMMON)
 
 include $(BUILD_SHARED_LIBRARY)
 
@@ -213,10 +205,7 @@ LOCAL_CFLAGS        += -O0 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CXXFLAGS      += -std=c++11 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CFLAGS        += -pthread -fopenmp
 
-LOCAL_C_INCLUDES += $(GSTREAMER_ROOT)/include/gstreamer-1.0 \
-     $(GSTREAMER_ROOT)/include/glib-2.0 \
-     $(GSTREAMER_ROOT)/lib/glib-2.0/include \
-     $(GSTREAMER_ROOT)/include
+LOCAL_C_INCLUDES += $(GST_HEADERS_COMMON)
 
 include $(BUILD_SHARED_LIBRARY)
 
@@ -232,10 +221,7 @@ LOCAL_CFLAGS        += -O0 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CXXFLAGS      += -std=c++11 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CFLAGS        += -pthread -fopenmp
 
-LOCAL_C_INCLUDES += $(GSTREAMER_ROOT)/include/gstreamer-1.0 \
-     $(GSTREAMER_ROOT)/include/glib-2.0 \
-     $(GSTREAMER_ROOT)/lib/glib-2.0/include \
-     $(GSTREAMER_ROOT)/include
+LOCAL_C_INCLUDES += $(GST_HEADERS_COMMON)
 
 include $(BUILD_SHARED_LIBRARY)
 
@@ -251,10 +237,7 @@ LOCAL_CFLAGS        += -O0 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CXXFLAGS      += -std=c++11 -DVERSION=\"$(NNSTREAMER_VERSION)\"
 LOCAL_CFLAGS        += -pthread -fopenmp
 
-LOCAL_C_INCLUDES += $(GSTREAMER_ROOT)/include/gstreamer-1.0 \
-     $(GSTREAMER_ROOT)/include/glib-2.0 \
-     $(GSTREAMER_ROOT)/lib/glib-2.0/include \
-     $(GSTREAMER_ROOT)/include
+LOCAL_C_INCLUDES += $(GST_HEADERS_COMMON)
 
 include $(BUILD_SHARED_LIBRARY)
 
index 28f1c42..9f64306 100644 (file)
@@ -1,8 +1,11 @@
 # This mk file defines common features to build NNStreamer library for Android.
 
 ifndef NNSTREAMER_ROOT
-$(warning NNSTREAMER_ROOT is not defined! Using $(LOCAL_PATH)/.. )
-NNSTREAMER_ROOT := $(LOCAL_PATH)/..
+$(error NNSTREAMER_ROOT is not defined!)
+endif
+
+ifndef GSTREAMER_ROOT_ANDROID
+$(error GSTREAMER_ROOT_ANDROID is not defined!)
 endif
 
 NNSTREAMER_VERSION  := 1.0.0
@@ -99,6 +102,12 @@ NO_AUDIO := false
 
 ENABLE_NNAPI :=false
 
+GST_HEADERS_COMMON := \
+    $(GSTREAMER_ROOT)/include/gstreamer-1.0 \
+    $(GSTREAMER_ROOT)/include/glib-2.0 \
+    $(GSTREAMER_ROOT)/lib/glib-2.0/include \
+    $(GSTREAMER_ROOT)/include
+
 GST_LIBS_COMMON := gstreamer-1.0 gstbase-1.0 gstvideo-1.0 glib-2.0 \
                    gobject-2.0 intl z bz2 orc-0.4 gmodule-2.0 gsttag-1.0 iconv \
                    gstapp-1.0 png16 gio-2.0 pangocairo-1.0 \