Camera2: Add DNG validation to DngCreatorTest
- Rename JNI library since it's more than just for NDK now
- Link against static version of dng_sdk with validate active
- Duplicate much of SDK dng_validate executable for validation
- Statically include dng_sdk dependencies as well
Bug: 23727371
Change-Id: Ifec2bae0f4b4d7acf3b17ee39c252e1046a9b7b9
diff --git a/tests/camera/libctscamera2jni/Android.mk b/tests/camera/libctscamera2jni/Android.mk
new file mode 100644
index 0000000..eac42f5
--- /dev/null
+++ b/tests/camera/libctscamera2jni/Android.mk
@@ -0,0 +1,53 @@
+# Copyright (C) 2015 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libctscamera2_jni
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := \
+ native-camera-jni.cpp \
+ dng-validate-jni.cpp
+
+LOCAL_C_INCLUDES := \
+ $(JNI_H_INCLUDE) \
+ system/core/include \
+ frameworks/av/include/camera/ndk \
+ frameworks/av/include/ndk \
+
+# Flags needed by DNG SDK
+LOCAL_CFLAGS := -DUNIX_ENV=1 -DqDNGBigEndian=0 -DqDNGThreadSafe=1 -DqDNGUseLibJPEG=1 -DqDNGUseXMP=0 -DqDNGValidate=1 -DqDNGValidateTarget=1 -DqAndroid=1 -fexceptions -Wsign-compare -Wno-reorder -Wframe-larger-than=20000
+
+# Flags to avoid warnings from DNG SDK
+LOCAL_CFLAGS += -Wno-unused-parameter
+
+LOCAL_STATIC_LIBRARIES := libdng_sdk_validate libjpeg_static libz
+LOCAL_SHARED_LIBRARIES := libandroid \
+ libnativehelper_compat_libc++ \
+ liblog \
+ libcamera2ndk \
+ libmediandk
+
+# NDK build, shared C++ runtime
+#LOCAL_SDK_VERSION := current
+#LOCAL_NDK_STL_VARIANT := c++_shared
+
+# Temporary workaround until camera2 NDK is active. See b/27102995.
+LOCAL_CXX_STL := libc++_static
+
+include $(BUILD_SHARED_LIBRARY)