Repackage capi-media-vision to each submodules 90/140090/4 accepted/tizen/4.0/unified/20170816.013541 accepted/tizen/4.0/unified/20170816.014731 accepted/tizen/unified/20170802.150904 submit/tizen/20170731.071040 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170814.115522 submit/tizen_4.0_unified/20170814.115522
authorTae-Young Chung <ty83.chung@samsung.com>
Sun, 23 Jul 2017 23:52:52 +0000 (08:52 +0900)
committerTae-Young Chung <ty83.chung@samsung.com>
Fri, 28 Jul 2017 06:11:13 +0000 (15:11 +0900)
capi-media-vision is repackaged into
capi-media-vision-{common, barcode, face, image, surveillance}
For compatibility, keep capi-media-vision package.

Change-Id: I05c45c396e2ab99029546a715a61de74599e3657
Signed-off-by: Tae-Young Chung <ty83.chung@samsung.com>
27 files changed:
CMakeLists.txt
capi-media-vision-barcode.pc.in [new file with mode: 0644]
capi-media-vision-face.pc.in [new file with mode: 0644]
capi-media-vision-image.pc.in [new file with mode: 0644]
capi-media-vision-surveillance.pc.in [new file with mode: 0644]
mv_barcode/barcode_detector/CMakeLists.txt
mv_barcode/barcode_detector/src/mv_barcode_detect.c [new file with mode: 0644]
mv_barcode/barcode_detector/src/mv_private.c [new file with mode: 0644]
mv_barcode/barcode_generator/CMakeLists.txt
mv_barcode/barcode_generator/src/mv_barcode_generate.c [new file with mode: 0644]
mv_barcode/barcode_generator/src/mv_private.c [new file with mode: 0644]
mv_common/CMakeLists.txt
mv_common/src/mv_common.c [new file with mode: 0644]
mv_common/src/mv_private.c [new file with mode: 0644]
mv_face/face/CMakeLists.txt
mv_face/face/src/mv_face.c [new file with mode: 0644]
mv_face/face/src/mv_private.c [new file with mode: 0644]
mv_image/image/CMakeLists.txt
mv_image/image/src/mv_image.c [new file with mode: 0644]
mv_image/image/src/mv_private.c [new file with mode: 0644]
mv_surveillance/surveillance/src/mv_private.c [new file with mode: 0644]
mv_surveillance/surveillance/src/mv_surveillance.c [new file with mode: 0644]
packaging/capi-media-vision.spec
test/testsuites/barcode/CMakeLists.txt
test/testsuites/face/CMakeLists.txt
test/testsuites/image/CMakeLists.txt
test/testsuites/surveillance/CMakeLists.txt

index cd6895c..ff32b82 100644 (file)
@@ -179,6 +179,42 @@ CONFIGURE_FILE(
 )
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 
+SET(PC_NAME ${fw_name}-barcode)
+SET(PC_LDFLAGS "-l${MV_BARCODE_DETECTOR_LIB_NAME} -l${MV_BARCODE_GENERATOR_LIB_NAME}")
+CONFIGURE_FILE(
+    ${fw_name}-barcode.pc.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-barcode.pc
+    @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-barcode.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+SET(PC_NAME ${fw_name}-face)
+SET(PC_LDFLAGS -l${MV_FACE_LIB_NAME})
+CONFIGURE_FILE(
+    ${fw_name}-face.pc.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-face.pc
+    @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-face.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+SET(PC_NAME ${fw_name}-image)
+SET(PC_LDFLAGS -l${MV_IMAGE_LIB_NAME})
+CONFIGURE_FILE(
+    ${fw_name}-image.pc.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-image.pc
+    @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-image.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+SET(PC_NAME ${fw_name}-surveillance)
+SET(PC_LDFLAGS -l${MV_SURVEILLANCE_LIB_NAME})
+CONFIGURE_FILE(
+    ${fw_name}-surveillance.pc.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-surveillance.pc
+    @ONLY
+)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}-surveillance.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
 ADD_SUBDIRECTORY(test)
 
 IF(UNIX)
diff --git a/capi-media-vision-barcode.pc.in b/capi-media-vision-barcode.pc.in
new file mode 100644 (file)
index 0000000..cde0c80
--- /dev/null
@@ -0,0 +1,14 @@
+
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=@LIB_INSTALL_DIR@
+includedir=/usr/include/media
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
diff --git a/capi-media-vision-face.pc.in b/capi-media-vision-face.pc.in
new file mode 100644 (file)
index 0000000..cde0c80
--- /dev/null
@@ -0,0 +1,14 @@
+
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=@LIB_INSTALL_DIR@
+includedir=/usr/include/media
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
diff --git a/capi-media-vision-image.pc.in b/capi-media-vision-image.pc.in
new file mode 100644 (file)
index 0000000..cde0c80
--- /dev/null
@@ -0,0 +1,14 @@
+
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=@LIB_INSTALL_DIR@
+includedir=/usr/include/media
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
diff --git a/capi-media-vision-surveillance.pc.in b/capi-media-vision-surveillance.pc.in
new file mode 100644 (file)
index 0000000..cde0c80
--- /dev/null
@@ -0,0 +1,14 @@
+
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=@LIB_INSTALL_DIR@
+includedir=/usr/include/media
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
index 4a85be3..d66a9e2 100644 (file)
@@ -16,7 +16,8 @@ include_directories("${PROJECT_SOURCE_DIR}/include")
 include_directories("${PROJECT_SOURCE_DIR}/src")
 
 file(GLOB MV_BARCODE_DET_INC_LIST "${PROJECT_SOURCE_DIR}/include/*.h")
-file(GLOB MV_BARCODE_DET_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp")
+file(GLOB MV_BARCODE_DET_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp"
+                                  "${PROJECT_SOURCE_DIR}/src/*.c")
 
 if(FORCED_STATIC_BUILD)
     add_library(${PROJECT_NAME} STATIC ${MV_BARCODE_DET_INC_LIST} ${MV_BARCODE_DET_SRC_LIST})
diff --git a/mv_barcode/barcode_detector/src/mv_barcode_detect.c b/mv_barcode/barcode_detector/src/mv_barcode_detect.c
new file mode 100644 (file)
index 0000000..9232a43
--- /dev/null
@@ -0,0 +1,91 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <system_info.h>
+
+#include "mv_private.h"
+#include "mv_barcode_detect.h"
+
+#ifdef MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT
+
+/* Include headers of licensed barcode detect module here. */
+#include "mv_barcode_detect_lic.h"
+
+#else
+
+/* Include headers of open barcode detect module here. */
+#include "mv_barcode_detect_open.h"
+
+#endif /* MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT */
+
+/**
+ * @file  mv_barcode_detect.c
+ * @brief This file contains the porting layer for Media Vision barcode module.
+ */
+
+int mv_barcode_detect(
+               mv_source_h source,
+               mv_engine_config_h engine_cfg,
+               mv_rectangle_s roi,
+               mv_barcode_detected_cb detect_cb,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_barcode_detect_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_NULL_ARG_CHECK(detect_cb);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+       unsigned int src_w = 0;
+       unsigned int src_h = 0;
+
+       ret = mv_source_get_width(source, &src_w);
+       if (ret != MEDIA_VISION_ERROR_NONE) {
+               LOGE("mv_source_get_width fail");
+               return ret;
+       }
+
+       ret = mv_source_get_height(source, &src_h);
+       if (ret != MEDIA_VISION_ERROR_NONE) {
+               LOGE("mv_source_get_height fail");
+               return ret;
+       }
+
+       if (roi.point.x < 0 || roi.point.y < 0 ||
+               (roi.point.x + roi.width) > src_w ||
+               (roi.point.y + roi.height) > src_h) {
+               LOGE("roi is out of area on source");
+               return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+       }
+
+#ifdef MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT
+
+       /* Use licensed barcode detect functionality here. */
+       ret = mv_barcode_detect_lic(
+                                       source, engine_cfg, roi, detect_cb, user_data);
+
+#else
+
+       /* Use open barcode detect functionality here. */
+       ret = mv_barcode_detect_open(
+                                       source, engine_cfg, roi, detect_cb, user_data);
+
+#endif /* MEDIA_VISION_BARCODE_DETECTOR_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
diff --git a/mv_barcode/barcode_detector/src/mv_private.c b/mv_barcode/barcode_detector/src/mv_private.c
new file mode 100644 (file)
index 0000000..796f8f9
--- /dev/null
@@ -0,0 +1,165 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <system_info.h>
+
+#include "mv_private.h"
+
+bool __mv_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+       bool isBarcodeGenerationSupported = false;
+       bool isFaceRecognitionSupported = false;
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal1 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal1 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       const int nRetVal2 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal2 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       const int nRetVal3 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal3 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       const int nRetVal4 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal4 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+               isFaceRecognitionSupported  || isImageRecognitionSupported) ?
+                       LOGI("system_info_get_platform_bool returned"
+                                       "Supported one feature among barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") :
+                       LOGE("system_info_get_platform_bool returned"
+                                       "Unsupported all features of barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") ;
+
+       return (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+                       isFaceRecognitionSupported  || isImageRecognitionSupported);
+}
+
+bool __mv_barcode_detect_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       isBarcodeDetectionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode detection feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode detection feature capability\n");
+
+       return isBarcodeDetectionSupported;
+}
+
+bool __mv_barcode_generate_check_system_info_feature_supported()
+{
+       bool isBarcodeGenerationSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       isBarcodeGenerationSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode generation feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode generation feature capability\n");
+
+       return isBarcodeGenerationSupported;
+}
+
+bool __mv_face_check_system_info_feature_supported()
+{
+       bool isFaceRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       isFaceRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported face recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported face recognition feature capability\n");
+
+       return isFaceRecognitionSupported;
+}
+
+bool __mv_image_check_system_info_feature_supported()
+{
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       isImageRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported image recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported image recognition feature capability\n");
+
+       return isImageRecognitionSupported;
+}
index f3b16b9..b9716ee 100644 (file)
@@ -16,7 +16,8 @@ include_directories("${PROJECT_SOURCE_DIR}/include")
 include_directories("${PROJECT_SOURCE_DIR}/src")
 
 file(GLOB MV_BARCODE_GEN_INC_LIST "${PROJECT_SOURCE_DIR}/include/*.h")
-file(GLOB MV_BARCODE_GEN_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp")
+file(GLOB MV_BARCODE_GEN_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp"
+                                  "${PROJECT_SOURCE_DIR}/src/*.c")
 
 find_package(OpenCV REQUIRED)
 include_directories(${OpenCV_INCLUDE_DIRS})
diff --git a/mv_barcode/barcode_generator/src/mv_barcode_generate.c b/mv_barcode/barcode_generator/src/mv_barcode_generate.c
new file mode 100644 (file)
index 0000000..5f0c38d
--- /dev/null
@@ -0,0 +1,173 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <system_info.h>
+
+#include "mv_private.h"
+#include "mv_barcode_generate.h"
+
+
+
+#ifdef MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT
+
+/* Include headers of licensed barcode generate module here. */
+#include "mv_barcode_generate_lic.h"
+
+#else
+
+/* Include headers of open barcode generate module here. */
+#include "mv_barcode_generate_open.h"
+
+#endif /* MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT */
+
+/**
+ * @file  mv_barcode_generate.c
+ * @brief This file contains the porting layer for Media Vision barcode module.
+ */
+
+
+int mv_barcode_generate_source(
+               mv_engine_config_h engine_cfg,
+               const char *message,
+               mv_barcode_type_e type,
+               mv_barcode_qr_mode_e qr_enc_mode,
+               mv_barcode_qr_ecc_e qr_ecc,
+               int qr_version,
+               mv_source_h image)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_barcode_generate_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(message);
+       MEDIA_VISION_INSTANCE_CHECK(image);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       if (type < MV_BARCODE_QR ||
+               type >= MV_BARCODE_UNDEFINED) {
+               LOGE("Not supported barcode type [%d]", type);
+               return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+       }
+
+       if (type == MV_BARCODE_QR) {
+               if (qr_enc_mode < MV_BARCODE_QR_MODE_NUMERIC ||
+                       qr_enc_mode >= MV_BARCODE_QR_MODE_UNAVAILABLE) {
+                       LOGE("Not supported QR encoding mode[%d]", qr_enc_mode);
+                       return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+               }
+
+               if (qr_ecc < MV_BARCODE_QR_ECC_LOW ||
+                       qr_ecc >= MV_BARCODE_QR_ECC_UNAVAILABLE) {
+                       LOGE("Not supported QR ECC level [%d]", qr_ecc);
+                       return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+               }
+
+               if (qr_version < 1 || qr_version > 40) {
+                       LOGE("Not supported QR version [%d]", qr_version);
+                       return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+               }
+       }
+
+#ifdef MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT
+
+       /* Use licensed barcode generate functionality here. */
+       int ret = mv_barcode_generate_source_lic(
+                                       engine_cfg, message, type, qr_enc_mode, qr_ecc, qr_version,
+                                       image);
+
+#else
+
+       /* Use open barcode generate functionality here. */
+       int ret = mv_barcode_generate_source_open(
+                                       engine_cfg, message, type, qr_enc_mode, qr_ecc, qr_version,
+                                       image);
+
+#endif /* MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_barcode_generate_image(
+               mv_engine_config_h engine_cfg,
+               const char *message,
+               int image_width,
+               int image_height,
+               mv_barcode_type_e type,
+               mv_barcode_qr_mode_e qr_enc_mode,
+               mv_barcode_qr_ecc_e qr_ecc,
+               int qr_version,
+               const char *image_path,
+               mv_barcode_image_format_e image_format)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_barcode_generate_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(message);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       if (image_path == NULL) {
+               LOGE("image_path is NULL");
+               return MEDIA_VISION_ERROR_INVALID_PATH;
+       }
+
+       if (type < MV_BARCODE_QR ||
+               type >= MV_BARCODE_UNDEFINED) {
+               LOGE("Not supported barcode type [%d]", type);
+               return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+       }
+
+       if (type == MV_BARCODE_QR) {
+               if (qr_enc_mode < MV_BARCODE_QR_MODE_NUMERIC ||
+                       qr_enc_mode >= MV_BARCODE_QR_MODE_UNAVAILABLE) {
+                       LOGE("Not supported QR encoding mode[%d]", qr_enc_mode);
+                       return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+               }
+
+               if (qr_ecc < MV_BARCODE_QR_ECC_LOW ||
+                       qr_ecc >= MV_BARCODE_QR_ECC_UNAVAILABLE) {
+                       LOGE("Not supported QR ECC level [%d]", qr_ecc);
+                       return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+               }
+
+               if (qr_version < 1 || qr_version > 40) {
+                       LOGE("Not supported QR version [%d]", qr_version);
+                       return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+               }
+       }
+
+       if (image_format < MV_BARCODE_IMAGE_FORMAT_BMP ||
+               image_format >= MV_BARCODE_IMAGE_FORMAT_NUM) {
+               LOGE("Not supported image format [%d]", image_format);
+               return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+       }
+
+#ifdef MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT
+
+       /* Use licensed barcode generate functionality here. */
+       int ret = mv_barcode_generate_image_lic(
+                                       engine_cfg, message, image_width, image_height, type,
+                                       qr_enc_mode, qr_ecc, qr_version, image_path, image_format);
+
+#else
+
+       /* Use open barcode generate functionality here. */
+       int ret = mv_barcode_generate_image_open(
+                                       engine_cfg, message, image_width, image_height, type,
+                                       qr_enc_mode, qr_ecc, qr_version, image_path, image_format);
+
+#endif /* MEDIA_VISION_BARCODE_GENERATOR_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
diff --git a/mv_barcode/barcode_generator/src/mv_private.c b/mv_barcode/barcode_generator/src/mv_private.c
new file mode 100644 (file)
index 0000000..796f8f9
--- /dev/null
@@ -0,0 +1,165 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <system_info.h>
+
+#include "mv_private.h"
+
+bool __mv_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+       bool isBarcodeGenerationSupported = false;
+       bool isFaceRecognitionSupported = false;
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal1 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal1 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       const int nRetVal2 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal2 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       const int nRetVal3 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal3 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       const int nRetVal4 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal4 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+               isFaceRecognitionSupported  || isImageRecognitionSupported) ?
+                       LOGI("system_info_get_platform_bool returned"
+                                       "Supported one feature among barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") :
+                       LOGE("system_info_get_platform_bool returned"
+                                       "Unsupported all features of barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") ;
+
+       return (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+                       isFaceRecognitionSupported  || isImageRecognitionSupported);
+}
+
+bool __mv_barcode_detect_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       isBarcodeDetectionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode detection feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode detection feature capability\n");
+
+       return isBarcodeDetectionSupported;
+}
+
+bool __mv_barcode_generate_check_system_info_feature_supported()
+{
+       bool isBarcodeGenerationSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       isBarcodeGenerationSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode generation feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode generation feature capability\n");
+
+       return isBarcodeGenerationSupported;
+}
+
+bool __mv_face_check_system_info_feature_supported()
+{
+       bool isFaceRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       isFaceRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported face recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported face recognition feature capability\n");
+
+       return isFaceRecognitionSupported;
+}
+
+bool __mv_image_check_system_info_feature_supported()
+{
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       isImageRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported image recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported image recognition feature capability\n");
+
+       return isImageRecognitionSupported;
+}
index f1df162..54ad501 100644 (file)
@@ -14,7 +14,8 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 include_directories("${PROJECT_SOURCE_DIR}/include")
 
 file(GLOB MV_COMMON_INCLUDE_LIST "${PROJECT_SOURCE_DIR}/include/*.h")
-file(GLOB MV_COMMON_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp")
+file(GLOB MV_COMMON_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp"
+                             "${PROJECT_SOURCE_DIR}/src/*.c")
 
 find_package(OpenCV REQUIRED core imgproc)
 
diff --git a/mv_common/src/mv_common.c b/mv_common/src/mv_common.c
new file mode 100644 (file)
index 0000000..8ba3b83
--- /dev/null
@@ -0,0 +1,338 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "mv_private.h"
+#include "mv_common.h"
+#include "mv_common_c.h"
+
+int mv_create_source(
+               mv_source_h *source)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(source);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_create_source_c(source);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_destroy_source(
+               mv_source_h source)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_destroy_source_c(source);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_source_fill_by_media_packet(
+               mv_source_h source,
+               media_packet_h media_packet)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_INSTANCE_CHECK(media_packet);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_source_fill_by_media_packet_c(source, media_packet);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_source_fill_by_buffer(
+               mv_source_h source,
+               unsigned char *data_buffer,
+               unsigned int buffer_size,
+               unsigned int image_width,
+               unsigned int image_height,
+               mv_colorspace_e image_colorspace)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_NULL_ARG_CHECK(data_buffer);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_source_fill_by_buffer_c(
+               source, data_buffer, buffer_size, image_width, image_height,
+               image_colorspace);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_source_clear(
+               mv_source_h source)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_source_clear_c(source);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_source_get_buffer(
+               mv_source_h source,
+               unsigned char **data_buffer,
+               unsigned int *buffer_size)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_NULL_ARG_CHECK(data_buffer);
+       MEDIA_VISION_NULL_ARG_CHECK(buffer_size);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_source_get_buffer_c(source, data_buffer, buffer_size);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_source_get_height(
+               mv_source_h source,
+               unsigned int *image_height)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_NULL_ARG_CHECK(image_height);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_source_get_height_c(source, image_height);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_source_get_width(
+               mv_source_h source,
+               unsigned int *image_width)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_NULL_ARG_CHECK(image_width);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_source_get_width_c(source, image_width);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_source_get_colorspace(
+               mv_source_h source,
+               mv_colorspace_e *image_colorspace)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_NULL_ARG_CHECK(image_colorspace);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_source_get_colorspace_c(source, image_colorspace);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_create_engine_config(
+               mv_engine_config_h *engine_cfg)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(engine_cfg);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_create_engine_config_c(engine_cfg);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_destroy_engine_config(
+               mv_engine_config_h engine_cfg)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_destroy_engine_config_c(engine_cfg);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_engine_config_set_double_attribute(
+               mv_engine_config_h engine_cfg,
+               const char *name,
+               double value)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
+       MEDIA_VISION_NULL_ARG_CHECK(name);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_engine_config_set_double_attribute_c(
+                                       engine_cfg, name, value);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_engine_config_set_int_attribute(
+               mv_engine_config_h engine_cfg,
+               const char *name,
+               int value)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
+       MEDIA_VISION_NULL_ARG_CHECK(name);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_engine_config_set_int_attribute_c(
+                                       engine_cfg, name, value);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_engine_config_set_bool_attribute(
+               mv_engine_config_h engine_cfg,
+               const char *name,
+               bool value)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
+       MEDIA_VISION_NULL_ARG_CHECK(name);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_engine_config_set_bool_attribute_c(
+                                       engine_cfg, name, value);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_engine_config_set_string_attribute(
+               mv_engine_config_h engine_cfg,
+               const char *name,
+               const char *value)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
+       MEDIA_VISION_NULL_ARG_CHECK(name);
+       MEDIA_VISION_NULL_ARG_CHECK(value);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_engine_config_set_string_attribute_c(
+                                       engine_cfg, name, value);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_engine_config_get_double_attribute(
+               mv_engine_config_h engine_cfg,
+               const char *name,
+               double *value)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
+       MEDIA_VISION_NULL_ARG_CHECK(name);
+       MEDIA_VISION_NULL_ARG_CHECK(value);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_engine_config_get_double_attribute_c(
+                                       engine_cfg, name, value);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_engine_config_get_int_attribute(
+               mv_engine_config_h engine_cfg,
+               const char *name,
+               int *value)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
+       MEDIA_VISION_NULL_ARG_CHECK(name);
+       MEDIA_VISION_NULL_ARG_CHECK(value);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_engine_config_get_int_attribute_c(
+               engine_cfg, name, value);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_engine_config_get_bool_attribute(
+               mv_engine_config_h engine_cfg,
+               const char *name,
+               bool *value)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
+       MEDIA_VISION_NULL_ARG_CHECK(name);
+       MEDIA_VISION_NULL_ARG_CHECK(value);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_engine_config_get_bool_attribute_c(
+                                       engine_cfg, name, value);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_engine_config_get_string_attribute(
+               mv_engine_config_h engine_cfg,
+               const char *name,
+               char **value)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
+       MEDIA_VISION_NULL_ARG_CHECK(name);
+       MEDIA_VISION_NULL_ARG_CHECK(value);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_engine_config_get_string_attribute_c(
+                                       engine_cfg, name, value);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_engine_config_foreach_supported_attribute(
+               mv_supported_attribute_cb callback,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(callback);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+       int ret = mv_engine_config_foreach_supported_attribute_c(
+                                       callback, user_data);
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
diff --git a/mv_common/src/mv_private.c b/mv_common/src/mv_private.c
new file mode 100644 (file)
index 0000000..796f8f9
--- /dev/null
@@ -0,0 +1,165 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <system_info.h>
+
+#include "mv_private.h"
+
+bool __mv_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+       bool isBarcodeGenerationSupported = false;
+       bool isFaceRecognitionSupported = false;
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal1 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal1 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       const int nRetVal2 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal2 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       const int nRetVal3 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal3 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       const int nRetVal4 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal4 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+               isFaceRecognitionSupported  || isImageRecognitionSupported) ?
+                       LOGI("system_info_get_platform_bool returned"
+                                       "Supported one feature among barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") :
+                       LOGE("system_info_get_platform_bool returned"
+                                       "Unsupported all features of barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") ;
+
+       return (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+                       isFaceRecognitionSupported  || isImageRecognitionSupported);
+}
+
+bool __mv_barcode_detect_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       isBarcodeDetectionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode detection feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode detection feature capability\n");
+
+       return isBarcodeDetectionSupported;
+}
+
+bool __mv_barcode_generate_check_system_info_feature_supported()
+{
+       bool isBarcodeGenerationSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       isBarcodeGenerationSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode generation feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode generation feature capability\n");
+
+       return isBarcodeGenerationSupported;
+}
+
+bool __mv_face_check_system_info_feature_supported()
+{
+       bool isFaceRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       isFaceRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported face recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported face recognition feature capability\n");
+
+       return isFaceRecognitionSupported;
+}
+
+bool __mv_image_check_system_info_feature_supported()
+{
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       isImageRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported image recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported image recognition feature capability\n");
+
+       return isImageRecognitionSupported;
+}
index 6cc1199..caff530 100644 (file)
@@ -15,7 +15,7 @@ include_directories("${PROJECT_SOURCE_DIR}/include")
 include_directories("${PROJECT_SOURCE_DIR}/src")
 
 file(GLOB MV_FACE_INCLUDE_LIST "${PROJECT_SOURCE_DIR}/include/*.h")
-file(GLOB MV_FACE_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp")
+file(GLOB MV_FACE_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp" "${PROJECT_SOURCE_DIR}/src/*.c")
 
 find_package(OpenCV REQUIRED core objdetect contrib)
 if(NOT OpenCV_FOUND)
diff --git a/mv_face/face/src/mv_face.c b/mv_face/face/src/mv_face.c
new file mode 100644 (file)
index 0000000..ffde256
--- /dev/null
@@ -0,0 +1,744 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "mv_private.h"
+#include "mv_face.h"
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+/* Include headers of licensed face module here. */
+#include "mv_face_lic.h"
+
+#else
+
+/* Include headers of open face module here. */
+#include "mv_face_open.h"
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+/**
+ * @file  mv_face.c
+ * @brief This file contains the porting layer for Media Vision face module.
+ */
+
+static const int check_source_roi_quadrangle(mv_quadrangle_s *roi, mv_source_h source)
+{
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+       if (roi) {
+               int src_w = 0;
+               int src_h = 0;
+
+               ret = mv_source_get_width(source, &src_w);
+               if (ret != MEDIA_VISION_ERROR_NONE) {
+                       LOGE("mv_source_get_width fail");
+                       return ret;
+               }
+
+               ret = mv_source_get_height(source, &src_h);
+               if (ret != MEDIA_VISION_ERROR_NONE) {
+                       LOGE("mv_source_get_height fail");
+                       return ret;
+               }
+
+               int idx = 0;
+               while (idx < 4) {
+                       if (roi->points[idx].x < 0 || roi->points[idx].y < 0 ||
+                               roi->points[idx].x > src_w || roi->points[idx].y > src_h) {
+                               LOGE("roi is out of area on source");
+                               return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+                       }
+                       ++idx;
+               }
+       }
+
+       return ret;
+}
+
+static const int check_source_roi(mv_rectangle_s *roi, mv_source_h source)
+{
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+       if (roi) {
+               int src_w = 0;
+               int src_h = 0;
+
+               ret = mv_source_get_width(source, &src_w);
+               if (ret != MEDIA_VISION_ERROR_NONE) {
+                       LOGE("mv_source_get_width fail");
+                       return ret;
+               }
+
+               ret = mv_source_get_height(source, &src_h);
+               if (ret != MEDIA_VISION_ERROR_NONE) {
+                       LOGE("mv_source_get_height fail");
+                       return ret;
+               }
+
+               if (roi->width <= 0 || roi->height <= 0) {
+                       LOGE("roi has negative width or height");
+                       return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+               }
+
+               if (roi->point.x < 0 || roi->point.y < 0 ||
+                       (roi->point.x + roi->width) > src_w ||
+                       (roi->point.y + roi->height) > src_h) {
+                       LOGE("roi is out of area on source");
+                       return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+               }
+       }
+
+       return ret;
+}
+
+int mv_face_detect(
+               mv_source_h source,
+               mv_engine_config_h engine_cfg,
+               mv_face_detected_cb detected_cb,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_detect_lic(source, engine_cfg, detected_cb, user_data);
+
+#else
+
+       ret = mv_face_detect_open(source, engine_cfg, detected_cb, user_data);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_recognize(
+               mv_source_h source,
+               mv_face_recognition_model_h recognition_model,
+               mv_engine_config_h engine_cfg,
+               mv_rectangle_s *face_location,
+               mv_face_recognized_cb recognized_cb,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_INSTANCE_CHECK(recognition_model);
+       MEDIA_VISION_NULL_ARG_CHECK(recognized_cb);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = check_source_roi(face_location, source);
+       if (MEDIA_VISION_ERROR_NONE != ret) {
+               LOGE("Errors occured when check source and ROI");
+               return ret;
+       }
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_recognize_lic(
+                                       source,
+                                       recognition_model,
+                                       engine_cfg,
+                                       face_location,
+                                       recognized_cb,
+                                       user_data);
+
+#else
+
+       ret = mv_face_recognize_open(
+                                       source,
+                                       recognition_model,
+                                       engine_cfg,
+                                       face_location,
+                                       recognized_cb,
+                                       user_data);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_track(
+               mv_source_h source,
+               mv_face_tracking_model_h tracking_model,
+               mv_engine_config_h engine_cfg,
+               mv_face_tracked_cb tracked_cb,
+               bool do_learn,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_INSTANCE_CHECK(tracking_model);
+       MEDIA_VISION_NULL_ARG_CHECK(tracked_cb);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_track_lic(
+                       source,
+                       tracking_model,
+                       engine_cfg,
+                       tracked_cb,
+                       do_learn,
+                       user_data);
+
+#else
+
+       ret = mv_face_track_open(
+                       source,
+                       tracking_model,
+                       engine_cfg,
+                       tracked_cb,
+                       do_learn,
+                       user_data);
+
+       #endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_eye_condition_recognize(
+               mv_source_h source,
+               mv_engine_config_h engine_cfg,
+               mv_rectangle_s face_location,
+               mv_face_eye_condition_recognized_cb eye_condition_recognized_cb,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_NULL_ARG_CHECK(eye_condition_recognized_cb);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_eye_condition_recognize_lic(
+                               source,
+                               engine_cfg,
+                               face_location,
+                               eye_condition_recognized_cb,
+                               user_data);
+
+#else
+
+       ret = mv_face_eye_condition_recognize_open(
+                               source,
+                               engine_cfg,
+                               face_location,
+                               eye_condition_recognized_cb,
+                               user_data);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+MEDIA_VISION_FUNCTION_LEAVE();
+return ret;
+}
+
+int mv_face_facial_expression_recognize(
+               mv_source_h source,
+               mv_engine_config_h engine_cfg,
+               mv_rectangle_s face_location,
+               mv_face_facial_expression_recognized_cb expression_recognized_cb,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_NULL_ARG_CHECK(expression_recognized_cb);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = check_source_roi(&face_location, source);
+       if (MEDIA_VISION_ERROR_NONE != ret) {
+               LOGE("Errors occurred when check source and ROI");
+               return ret;
+       }
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_facial_expression_recognize_lic(
+                                       source,
+                                       engine_cfg,
+                                       face_location,
+                                       expression_recognized_cb,
+                                       user_data);
+
+#else
+
+       ret = mv_face_facial_expression_recognize_open(
+                                       source,
+                                       engine_cfg,
+                                       face_location,
+                                       expression_recognized_cb,
+                                       user_data);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_recognition_model_create(
+               mv_face_recognition_model_h *recognition_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(recognition_model);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_recognition_model_create_lic(recognition_model);
+
+#else
+
+       ret = mv_face_recognition_model_create_open(recognition_model);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_recognition_model_destroy(
+               mv_face_recognition_model_h recognition_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(recognition_model);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_recognition_model_destroy_lic(recognition_model);
+
+#else
+
+       ret = mv_face_recognition_model_destroy_open(recognition_model);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+MEDIA_VISION_FUNCTION_LEAVE();
+return ret;
+}
+
+int mv_face_recognition_model_clone(
+               mv_face_recognition_model_h src,
+               mv_face_recognition_model_h *dst)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(src);
+       MEDIA_VISION_NULL_ARG_CHECK(dst);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_recognition_model_clone_lic(src, dst);
+
+#else
+
+       ret = mv_face_recognition_model_clone_open(src, dst);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_recognition_model_save(
+               const char *file_name,
+               mv_face_recognition_model_h recognition_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(recognition_model);
+
+       if (file_name == NULL) {
+               LOGE("File name is NULL. The file name has to be specified");
+               return MEDIA_VISION_ERROR_INVALID_PATH;
+       }
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_recognition_model_save_lic(
+                                       file_name,
+                                       recognition_model);
+
+#else
+
+       ret = mv_face_recognition_model_save_open(
+                                       file_name,
+                                       recognition_model);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_recognition_model_load(
+               const char *file_name,
+               mv_face_recognition_model_h *recognition_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(recognition_model);
+
+       if (file_name == NULL) {
+               LOGE("File name is NULL. The file name has to be specified");
+               return MEDIA_VISION_ERROR_INVALID_PATH;
+       }
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_recognition_model_load_lic(
+                                       file_name,
+                                       recognition_model);
+
+#else
+
+       ret = mv_face_recognition_model_load_open(
+                                       file_name,
+                                       recognition_model);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_recognition_model_add(
+               const mv_source_h source,
+               mv_face_recognition_model_h recognition_model,
+               const mv_rectangle_s *example_location,
+               int face_label)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_INSTANCE_CHECK(recognition_model);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = check_source_roi(example_location, source);
+       if (MEDIA_VISION_ERROR_NONE != ret) {
+               LOGE("Errors occured when check source and ROI");
+               return ret;
+       }
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_recognition_model_add_lic(
+                                       source,
+                                       recognition_model,
+                                       example_location,
+                                       face_label);
+#else
+
+       ret = mv_face_recognition_model_add_open(
+                                       source,
+                                       recognition_model,
+                                       example_location,
+                                       face_label);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_recognition_model_reset(
+               mv_face_recognition_model_h recognition_model,
+               int *face_label)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(recognition_model);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_recognition_model_reset_lic(
+                                       recognition_model,
+                                       face_label);
+
+#else
+
+       ret = mv_face_recognition_model_reset_open(
+                                       recognition_model,
+                                       face_label);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_recognition_model_learn(
+               mv_engine_config_h engine_cfg,
+               mv_face_recognition_model_h recognition_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(recognition_model);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_recognition_model_learn_lic(engine_cfg, recognition_model);
+
+#else
+
+       ret = mv_face_recognition_model_learn_open(engine_cfg, recognition_model);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_recognition_model_query_labels(
+               mv_face_recognition_model_h recognition_model,
+               int **labels,
+               unsigned int *number_of_labels)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(recognition_model);
+       MEDIA_VISION_NULL_ARG_CHECK(labels);
+       MEDIA_VISION_NULL_ARG_CHECK(number_of_labels);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_recognition_model_query_labels_lic(recognition_model, labels, number_of_labels);
+
+#else
+
+       ret = mv_face_recognition_model_query_labels_open(recognition_model, labels, number_of_labels);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_tracking_model_create(
+               mv_face_tracking_model_h *tracking_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(tracking_model);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_tracking_model_create_lic(tracking_model);
+
+#else
+
+       ret = mv_face_tracking_model_create_open(tracking_model);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_tracking_model_destroy(
+               mv_face_tracking_model_h tracking_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(tracking_model);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_tracking_model_destroy_lic(tracking_model);
+
+#else
+
+       ret = mv_face_tracking_model_destroy_open(tracking_model);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_tracking_model_prepare(
+               mv_face_tracking_model_h tracking_model,
+               mv_engine_config_h engine_cfg,
+               mv_source_h source,
+               mv_quadrangle_s *location)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(tracking_model);
+       MEDIA_VISION_INSTANCE_CHECK(source);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = check_source_roi_quadrangle(location, source);
+       if (MEDIA_VISION_ERROR_NONE != ret) {
+               LOGE("Errors occured when check source and tracking start location");
+               return ret;
+       }
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_tracking_model_prepare_lic(
+                               tracking_model, engine_cfg, source, location);
+
+#else
+
+       ret = mv_face_tracking_model_prepare_open(
+                               tracking_model, engine_cfg, source, location);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_tracking_model_clone(
+               mv_face_tracking_model_h src,
+               mv_face_tracking_model_h *dst)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(src);
+       MEDIA_VISION_NULL_ARG_CHECK(dst);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_tracking_model_clone_lic(src, dst);
+
+#else
+
+       ret = mv_face_tracking_model_clone_open(src, dst);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_tracking_model_save(
+               const char *file_name,
+               mv_face_tracking_model_h tracking_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(tracking_model);
+
+       if (file_name == NULL) {
+               LOGE("File name is NULL. The file name has to be specified");
+               return MEDIA_VISION_ERROR_INVALID_PATH;
+       }
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_tracking_model_save_lic(
+                                       file_name,
+                                       tracking_model);
+
+#else
+
+       ret = mv_face_tracking_model_save_open(
+                                       file_name,
+                                       tracking_model);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_face_tracking_model_load(
+               const char *file_name,
+               mv_face_tracking_model_h *tracking_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(tracking_model);
+
+       if (file_name == NULL) {
+               LOGE("File name is NULL. The file name has to be specifiled");
+               return MEDIA_VISION_ERROR_INVALID_PATH;
+       }
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       int ret = MEDIA_VISION_ERROR_NONE;
+
+#ifdef MEDIA_VISION_FACE_LICENSE_PORT
+
+       ret = mv_face_tracking_model_load_lic(
+                                       file_name,
+                                       tracking_model);
+
+#else
+
+       ret = mv_face_tracking_model_load_open(
+                                       file_name,
+                                       tracking_model);
+
+#endif /* MEDIA_VISION_FACE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
diff --git a/mv_face/face/src/mv_private.c b/mv_face/face/src/mv_private.c
new file mode 100644 (file)
index 0000000..796f8f9
--- /dev/null
@@ -0,0 +1,165 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <system_info.h>
+
+#include "mv_private.h"
+
+bool __mv_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+       bool isBarcodeGenerationSupported = false;
+       bool isFaceRecognitionSupported = false;
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal1 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal1 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       const int nRetVal2 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal2 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       const int nRetVal3 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal3 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       const int nRetVal4 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal4 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+               isFaceRecognitionSupported  || isImageRecognitionSupported) ?
+                       LOGI("system_info_get_platform_bool returned"
+                                       "Supported one feature among barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") :
+                       LOGE("system_info_get_platform_bool returned"
+                                       "Unsupported all features of barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") ;
+
+       return (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+                       isFaceRecognitionSupported  || isImageRecognitionSupported);
+}
+
+bool __mv_barcode_detect_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       isBarcodeDetectionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode detection feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode detection feature capability\n");
+
+       return isBarcodeDetectionSupported;
+}
+
+bool __mv_barcode_generate_check_system_info_feature_supported()
+{
+       bool isBarcodeGenerationSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       isBarcodeGenerationSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode generation feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode generation feature capability\n");
+
+       return isBarcodeGenerationSupported;
+}
+
+bool __mv_face_check_system_info_feature_supported()
+{
+       bool isFaceRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       isFaceRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported face recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported face recognition feature capability\n");
+
+       return isFaceRecognitionSupported;
+}
+
+bool __mv_image_check_system_info_feature_supported()
+{
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       isImageRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported image recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported image recognition feature capability\n");
+
+       return isImageRecognitionSupported;
+}
index faa5072..801c418 100644 (file)
@@ -11,14 +11,13 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_INSTALL_DIR})
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 
-include_directories("${INC_DIR}")
 include_directories("${PROJECT_SOURCE_DIR}/include")
 include_directories("${PROJECT_SOURCE_DIR}/src")
 
 file(GLOB_RECURSE MV_IMAGE_INC_LIST "${PROJECT_SOURCE_DIR}/include/*.h")
-file(GLOB_RECURSE MV_IMAGE_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp")
+file(GLOB_RECURSE MV_IMAGE_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp" "${PROJECT_SOURCE_DIR}/src/*.c")
 
-find_package(OpenCV REQUIRED core highgui imgproc objdetect features2d calib3d)
+find_package(OpenCV REQUIRED core imgproc objdetect features2d contrib)
 if(NOT OpenCV_FOUND)
     message(SEND_ERROR "Failed to find OpenCV")
     return()
diff --git a/mv_image/image/src/mv_image.c b/mv_image/image/src/mv_image.c
new file mode 100644 (file)
index 0000000..3b9a1c5
--- /dev/null
@@ -0,0 +1,525 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "mv_private.h"
+#include "mv_image.h"
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+/* Include headers of licensed image module here. */
+#include "mv_image_lic.h"
+
+#else
+
+/* Include headers of open image module here. */
+#include "mv_image_open.h"
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+/**
+ * @file  mv_image.c
+ * @brief This file contains the porting layer for Media Vision image module.
+ */
+
+int mv_image_recognize(
+               mv_source_h source,
+               const mv_image_object_h *image_objects,
+               int number_of_objects,
+               mv_engine_config_h engine_cfg,
+               mv_image_recognized_cb recognized_cb,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_NULL_ARG_CHECK(image_objects);
+
+       int object_num = 0;
+       for (; object_num < number_of_objects; ++object_num)
+               MEDIA_VISION_INSTANCE_CHECK(image_objects[object_num]);
+
+       MEDIA_VISION_NULL_ARG_CHECK(recognized_cb);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_recognize_lic(source, image_objects,
+                       number_of_objects, engine_cfg, recognized_cb, user_data);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_recognize_open(source, image_objects,
+                       number_of_objects, engine_cfg, recognized_cb, user_data);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_track(
+               mv_source_h source,
+               mv_image_tracking_model_h image_tracking_model,
+               mv_engine_config_h engine_cfg,
+               mv_image_tracked_cb tracked_cb,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_INSTANCE_CHECK(image_tracking_model);
+       MEDIA_VISION_NULL_ARG_CHECK(tracked_cb);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_track_lic(source, image_tracking_model, engine_cfg, tracked_cb, user_data);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_track_open(source, image_tracking_model, engine_cfg, tracked_cb, user_data);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_object_create(
+               mv_image_object_h *image_object)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(image_object);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_object_create_lic(image_object);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_object_create_open(image_object);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_object_destroy(
+               mv_image_object_h image_object)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(image_object);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_object_destroy_lic(image_object);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_object_destroy_open(image_object);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_object_fill(
+               mv_image_object_h image_object,
+               mv_engine_config_h engine_cfg,
+               mv_source_h source,
+               mv_rectangle_s *location)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(image_object);
+       MEDIA_VISION_INSTANCE_CHECK(source);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_object_fill_lic(image_object, engine_cfg, source, location);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_object_fill_open(image_object, engine_cfg, source, location);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_object_get_recognition_rate(
+               mv_image_object_h image_object,
+               double *recognition_rate)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(image_object);
+       MEDIA_VISION_NULL_ARG_CHECK(recognition_rate);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_object_get_recognition_rate_lic(image_object, recognition_rate);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_object_get_recognition_rate_open(image_object, recognition_rate);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_object_set_label(
+               mv_image_object_h image_object,
+               int label)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(image_object);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_object_set_label_lic(image_object, label);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_object_set_label_open(image_object, label);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_object_get_label(
+               mv_image_object_h image_object,
+               int *label)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(image_object);
+       MEDIA_VISION_NULL_ARG_CHECK(label);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_object_get_label_lic(image_object, label);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_object_get_label_open(image_object, label);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_object_clone(
+               mv_image_object_h src,
+               mv_image_object_h *dst)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(src);
+       MEDIA_VISION_NULL_ARG_CHECK(dst);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_object_clone_lic(src, dst);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_object_clone_open(src, dst);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_object_save(
+               const char *file_name, mv_image_object_h image_object)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(image_object);
+
+       if (file_name == NULL) {
+               LOGE("File name is NULL. The file name has to be specified");
+               return MEDIA_VISION_ERROR_INVALID_PATH;
+       }
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_object_save_lic(file_name, image_object);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_object_save_open(file_name, image_object);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_object_load(
+               const char *file_name, mv_image_object_h *image_object)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(image_object);
+
+       if (file_name == NULL) {
+               LOGE("file name is NULL. The file name has to be specified");
+               return MEDIA_VISION_ERROR_INVALID_PATH;
+       }
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_object_load_lic(file_name, image_object);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_object_load_open(file_name, image_object);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_tracking_model_create(
+               mv_image_tracking_model_h *image_tracking_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(image_tracking_model);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_tracking_model_create_lic(image_tracking_model);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_tracking_model_create_open(image_tracking_model);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_tracking_model_set_target(
+               mv_image_object_h image_object,
+               mv_image_tracking_model_h image_tracking_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(image_tracking_model);
+       MEDIA_VISION_INSTANCE_CHECK(image_object);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_tracking_model_set_target_lic(image_object, image_tracking_model);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_tracking_model_set_target_open(image_object, image_tracking_model);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_tracking_model_destroy(
+               mv_image_tracking_model_h image_tracking_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(image_tracking_model);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_tracking_model_destroy_lic(image_tracking_model);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_tracking_model_destroy_open(image_tracking_model);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_tracking_model_refresh(
+               mv_image_tracking_model_h image_tracking_model,
+               mv_engine_config_h engine_cfg)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(image_tracking_model);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_tracking_model_refresh_lic(
+                                       image_tracking_model,
+                                       engine_cfg);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_tracking_model_refresh_open(
+                                       image_tracking_model,
+                                       engine_cfg);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_tracking_model_clone(
+               mv_image_tracking_model_h src,
+               mv_image_tracking_model_h *dst)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(src);
+       MEDIA_VISION_NULL_ARG_CHECK(dst);
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_tracking_model_clone_lic(src, dst);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_tracking_model_clone_open(src, dst);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_tracking_model_save(
+               const char *file_name, mv_image_tracking_model_h image_tracking_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(image_tracking_model);
+
+       if (file_name == NULL) {
+               LOGE("File name is NULL. The file name has to be specified");
+               return MEDIA_VISION_ERROR_INVALID_PATH;
+       }
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_tracking_model_save_lic(file_name, image_tracking_model);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_tracking_model_save_open(file_name, image_tracking_model);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_image_tracking_model_load(
+               const char *file_name, mv_image_tracking_model_h *image_tracking_model)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(image_tracking_model);
+
+       if (file_name == NULL) {
+               LOGE("File name is NULL. The file name has to be specified");
+               return MEDIA_VISION_ERROR_INVALID_PATH;
+       }
+
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_IMAGE_LICENSE_PORT
+
+       /* Use licensed image functionality here. */
+       int ret = mv_image_tracking_model_load_lic(file_name, image_tracking_model);
+
+#else
+
+       /* Use open image functionality here. */
+       int ret = mv_image_tracking_model_load_open(file_name, image_tracking_model);
+
+#endif /* MEDIA_VISION_IMAGE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
diff --git a/mv_image/image/src/mv_private.c b/mv_image/image/src/mv_private.c
new file mode 100644 (file)
index 0000000..796f8f9
--- /dev/null
@@ -0,0 +1,165 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <system_info.h>
+
+#include "mv_private.h"
+
+bool __mv_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+       bool isBarcodeGenerationSupported = false;
+       bool isFaceRecognitionSupported = false;
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal1 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal1 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       const int nRetVal2 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal2 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       const int nRetVal3 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal3 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       const int nRetVal4 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal4 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+               isFaceRecognitionSupported  || isImageRecognitionSupported) ?
+                       LOGI("system_info_get_platform_bool returned"
+                                       "Supported one feature among barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") :
+                       LOGE("system_info_get_platform_bool returned"
+                                       "Unsupported all features of barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") ;
+
+       return (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+                       isFaceRecognitionSupported  || isImageRecognitionSupported);
+}
+
+bool __mv_barcode_detect_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       isBarcodeDetectionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode detection feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode detection feature capability\n");
+
+       return isBarcodeDetectionSupported;
+}
+
+bool __mv_barcode_generate_check_system_info_feature_supported()
+{
+       bool isBarcodeGenerationSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       isBarcodeGenerationSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode generation feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode generation feature capability\n");
+
+       return isBarcodeGenerationSupported;
+}
+
+bool __mv_face_check_system_info_feature_supported()
+{
+       bool isFaceRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       isFaceRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported face recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported face recognition feature capability\n");
+
+       return isFaceRecognitionSupported;
+}
+
+bool __mv_image_check_system_info_feature_supported()
+{
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       isImageRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported image recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported image recognition feature capability\n");
+
+       return isImageRecognitionSupported;
+}
diff --git a/mv_surveillance/surveillance/src/mv_private.c b/mv_surveillance/surveillance/src/mv_private.c
new file mode 100644 (file)
index 0000000..796f8f9
--- /dev/null
@@ -0,0 +1,165 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include <system_info.h>
+
+#include "mv_private.h"
+
+bool __mv_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+       bool isBarcodeGenerationSupported = false;
+       bool isFaceRecognitionSupported = false;
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal1 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal1 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       const int nRetVal2 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal2 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       const int nRetVal3 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal3 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       const int nRetVal4 = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal4 != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+               isFaceRecognitionSupported  || isImageRecognitionSupported) ?
+                       LOGI("system_info_get_platform_bool returned"
+                                       "Supported one feature among barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") :
+                       LOGE("system_info_get_platform_bool returned"
+                                       "Unsupported all features of barcode detection, "
+                                       "barcode generation, face recognition, "
+                                       "and image recognition capability\n") ;
+
+       return (isBarcodeDetectionSupported || isBarcodeGenerationSupported ||
+                       isFaceRecognitionSupported  || isImageRecognitionSupported);
+}
+
+bool __mv_barcode_detect_check_system_info_feature_supported()
+{
+       bool isBarcodeDetectionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_detection",
+                                       &isBarcodeDetectionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_detection");
+               return false;
+       }
+
+       isBarcodeDetectionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode detection feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode detection feature capability\n");
+
+       return isBarcodeDetectionSupported;
+}
+
+bool __mv_barcode_generate_check_system_info_feature_supported()
+{
+       bool isBarcodeGenerationSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.barcode_generation",
+                                       &isBarcodeGenerationSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.barcode_generation");
+               return false;
+       }
+
+       isBarcodeGenerationSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported barcode generation feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported barcode generation feature capability\n");
+
+       return isBarcodeGenerationSupported;
+}
+
+bool __mv_face_check_system_info_feature_supported()
+{
+       bool isFaceRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.face_recognition",
+                                       &isFaceRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.face_recognition");
+               return false;
+       }
+
+       isFaceRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported face recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported face recognition feature capability\n");
+
+       return isFaceRecognitionSupported;
+}
+
+bool __mv_image_check_system_info_feature_supported()
+{
+       bool isImageRecognitionSupported = false;
+
+       const int nRetVal = system_info_get_platform_bool(
+                                       "http://tizen.org/feature/vision.image_recognition",
+                                       &isImageRecognitionSupported);
+
+       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
+               LOGE("SYSTEM_INFO_ERROR: vision.image_recognition");
+               return false;
+       }
+
+       isImageRecognitionSupported ?
+                       LOGI("system_info_get_platform_bool returned "
+                                       "Supported image recognition feature capability\n") :
+                       LOGE("system_info_get_platform_bool returned "
+                                       "Unsupported image recognition feature capability\n");
+
+       return isImageRecognitionSupported;
+}
diff --git a/mv_surveillance/surveillance/src/mv_surveillance.c b/mv_surveillance/surveillance/src/mv_surveillance.c
new file mode 100644 (file)
index 0000000..48ebc82
--- /dev/null
@@ -0,0 +1,373 @@
+/**
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * 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.
+ */
+
+#include "mv_surveillance.h"
+
+#include "mv_surveillance_private.h"
+#include "mv_private.h"
+
+#ifdef MEDIA_VISION_SURVEILLANCE_LICENSE_PORT
+
+/* Include headers of licensed surveillance module here. */
+#include "mv_surveillance_lic.h"
+
+#else
+
+/* Include headers of open surveillance module here. */
+#include "mv_surveillance_open.h"
+
+#endif /* MEDIA_VISION_SURVEILLANCE_LICENSE_PORT */
+
+/**
+ * @file  mv_surveillance.c
+ * @brief This file contains the porting layer for Media Vision surveillance module.
+ */
+
+static size_t __mv_surveillance_id_counter = 0;
+
+int mv_surveillance_event_trigger_create(
+               const char *event_type,
+               mv_surveillance_event_trigger_h * trigger)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(event_type);
+       MEDIA_VISION_NULL_ARG_CHECK(trigger);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       mv_surveillance_event_trigger_s *handle =
+                       (mv_surveillance_event_trigger_s *) malloc(
+                                       sizeof(mv_surveillance_event_trigger_s));
+       if (NULL == handle) {
+               LOGE("[%s] malloc fail", __func__);
+               return MEDIA_VISION_ERROR_OUT_OF_MEMORY;
+       }
+
+       memset(handle, 0, sizeof(mv_surveillance_event_trigger_s));
+
+       /* default values: */
+       handle->trigger_id = ++__mv_surveillance_id_counter;
+       handle->event_type = strndup(event_type, 255);
+       handle->number_of_roi_points = 0;
+       handle->roi = NULL;
+
+       *trigger = (mv_surveillance_event_trigger_h) handle;
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return MEDIA_VISION_ERROR_NONE;
+}
+
+int mv_surveillance_event_trigger_destroy(
+               mv_surveillance_event_trigger_h trigger)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(trigger);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       mv_surveillance_event_trigger_s *handle =
+                       (mv_surveillance_event_trigger_s *) trigger;
+       free(handle->event_type);
+       free(handle->roi);
+       free((mv_surveillance_event_trigger_s *) trigger);
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return MEDIA_VISION_ERROR_NONE;
+}
+
+int mv_surveillance_get_event_trigger_type(
+               mv_surveillance_event_trigger_h trigger,
+               char **event_type)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(trigger);
+       MEDIA_VISION_NULL_ARG_CHECK(event_type);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       mv_surveillance_event_trigger_s *handle =
+                       (mv_surveillance_event_trigger_s *)trigger;
+       *event_type = strndup(handle->event_type, 255);
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return MEDIA_VISION_ERROR_NONE;
+}
+
+int mv_surveillance_set_event_trigger_roi(
+               mv_surveillance_event_trigger_h trigger,
+               int number_of_points,
+               mv_point_s *roi)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(trigger);
+       MEDIA_VISION_NULL_ARG_CHECK(roi);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       if (number_of_points <= 0) {
+               LOGE("number of points shoulde be larger than zero");
+               return MEDIA_VISION_ERROR_INVALID_PARAMETER;
+       }
+
+       mv_surveillance_event_trigger_s *handle =
+                       (mv_surveillance_event_trigger_s *)trigger;
+
+       if (handle->roi) {
+               free(handle->roi);
+               handle->roi = NULL;
+       }
+
+       handle->number_of_roi_points = number_of_points;
+       handle->roi = (mv_point_s*) malloc(sizeof(mv_point_s) * number_of_points);
+
+       if (NULL == handle->roi) {
+               LOGE("[%s] malloc fail", __func__);
+               return MEDIA_VISION_ERROR_OUT_OF_MEMORY;
+       }
+
+       int i = 0;
+       for (; i < number_of_points; ++i) {
+               handle->roi[i].x = roi[i].x;
+               handle->roi[i].y = roi[i].y;
+       }
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return MEDIA_VISION_ERROR_NONE;
+}
+
+int mv_surveillance_get_event_trigger_roi(
+               mv_surveillance_event_trigger_h trigger,
+               int *number_of_points,
+               mv_point_s ** roi)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(trigger);
+       MEDIA_VISION_NULL_ARG_CHECK(number_of_points);
+       MEDIA_VISION_NULL_ARG_CHECK(roi);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+       mv_surveillance_event_trigger_s *handle =
+                       (mv_surveillance_event_trigger_s *) trigger;
+
+       *number_of_points = handle->number_of_roi_points;
+       if (0 == *number_of_points) {
+               MEDIA_VISION_FUNCTION_LEAVE();
+               return MEDIA_VISION_ERROR_NONE;
+       }
+
+       *roi = (mv_point_s *) malloc(
+                                       sizeof(mv_point_s) * handle->number_of_roi_points);
+
+       int i = 0;
+       for (; i < handle->number_of_roi_points; ++i) {
+               (*roi)[i].x = handle->roi[i].x;
+               (*roi)[i].y = handle->roi[i].y;
+       }
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return MEDIA_VISION_ERROR_NONE;
+}
+
+int mv_surveillance_subscribe_event_trigger(
+               mv_surveillance_event_trigger_h event_trigger,
+               int video_stream_id,
+               mv_engine_config_h engine_cfg,
+               mv_surveillance_event_occurred_cb callback,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(event_trigger);
+       MEDIA_VISION_NULL_ARG_CHECK(callback);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_SURVEILLANCE_LICENSE_PORT
+
+       /* Use licensed surveillance functionality here. */
+       const int ret = mv_surveillance_subscribe_event_trigger_lic(
+                                       event_trigger,
+                                       video_stream_id,
+                                       engine_cfg,
+                                       callback,
+                                       user_data);
+
+#else
+
+       /* Use open surveillance functionality here. */
+       const int ret = mv_surveillance_subscribe_event_trigger_open(
+                                       event_trigger,
+                                       video_stream_id,
+                                       engine_cfg,
+                                       callback,
+                                       user_data);
+
+#endif /* MEDIA_VISION_SURVEILLANCE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_surveillance_unsubscribe_event_trigger(
+               mv_surveillance_event_trigger_h event_trigger,
+               int video_stream_id)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(event_trigger);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_SURVEILLANCE_LICENSE_PORT
+
+       /* Use licensed surveillance functionality here. */
+       const int ret = mv_surveillance_unsubscribe_event_trigger_lic(
+                                       event_trigger,
+                                       video_stream_id);
+
+#else
+
+       /* Use open surveillance functionality here. */
+       const int ret = mv_surveillance_unsubscribe_event_trigger_open(
+                                       event_trigger,
+                                       video_stream_id);
+
+#endif /* MEDIA_VISION_SURVEILLANCE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_surveillance_push_source(
+               mv_source_h source,
+               int video_stream_id)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(source);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_SURVEILLANCE_LICENSE_PORT
+
+       /* Use licensed surveillance functionality here. */
+       const int ret = mv_surveillance_push_source_lic(source, video_stream_id);
+
+#else
+
+       /* Use open surveillance functionality here. */
+       const int ret = mv_surveillance_push_source_open(source, video_stream_id);
+
+#endif /* MEDIA_VISION_SURVEILLANCE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_surveillance_foreach_supported_event_type(
+               mv_surveillance_event_type_cb callback,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(callback);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_SURVEILLANCE_LICENSE_PORT
+
+       /* Use licensed surveillance functionality here. */
+       const int ret = mv_surveillance_foreach_event_type_lic(
+                                       callback,
+                                       user_data);
+
+#else
+
+       /* Use open surveillance functionality here. */
+       const int ret = mv_surveillance_foreach_event_type_open(
+                                       callback,
+                                       user_data);
+
+#endif /* MEDIA_VISION_SURVEILLANCE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
+
+int mv_surveillance_foreach_event_result_name(
+               const char *event_type,
+               mv_surveillance_event_result_name_cb callback,
+               void *user_data)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_NULL_ARG_CHECK(event_type);
+       MEDIA_VISION_NULL_ARG_CHECK(callback);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_SURVEILLANCE_LICENSE_PORT
+
+       /* Use licensed surveillance functionality here. */
+       const int ret = mv_surveillance_foreach_event_result_value_name_lic(
+                                       event_type,
+                                       callback,
+                                       user_data);
+
+#else
+
+       /* Use open surveillance functionality here. */
+       const int ret = mv_surveillance_foreach_event_result_value_name_open(
+                                       event_type,
+                                       callback,
+                                       user_data);
+
+#endif /* MEDIA_VISION_SURVEILLANCE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+
+       return ret;
+}
+
+int mv_surveillance_get_result_value(
+               mv_surveillance_result_h result,
+               const char *value_name,
+               void *value)
+{
+       MEDIA_VISION_SUPPORT_CHECK(__mv_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(__mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_INSTANCE_CHECK(result);
+       MEDIA_VISION_NULL_ARG_CHECK(value_name);
+       MEDIA_VISION_NULL_ARG_CHECK(value);
+       MEDIA_VISION_FUNCTION_ENTER();
+
+#ifdef MEDIA_VISION_SURVEILLANCE_LICENSE_PORT
+
+       /* Use licensed surveillance functionality here. */
+       const int ret = mv_surveillance_get_result_value_lic(
+                                       result,
+                                       value_name,
+                                       value);
+
+#else
+
+       /* Use open surveillance functionality here. */
+       const int ret = mv_surveillance_get_result_value_open(
+                                       result,
+                                       value_name,
+                                       value);
+
+#endif /* MEDIA_VISION_SURVEILLANCE_LICENSE_PORT */
+
+       MEDIA_VISION_FUNCTION_LEAVE();
+       return ret;
+}
index d87c2bf..f3abded 100644 (file)
@@ -1,6 +1,6 @@
 Name:        capi-media-vision
 Summary:     Media Vision library for Tizen Native API
-Version:     0.3.26
+Version:     0.3.27
 Release:     0
 Group:       Multimedia/Framework
 License:     Apache-2.0 and BSD-3-Clause
@@ -38,6 +38,100 @@ Requires:   %{name} = %{version}-%{release}
 %description devel
 Media Vision library for Tizen Native API (DEV). Includes barcode detecting, barcode generating, face and image modules.
 
+%package common
+Summary:    Multimedia Vision common Library
+Group:      Multimedia/Framework
+
+%description common
+Media Vision common library for Tizen Native API.
+
+%package common-devel
+Summary:    Multimedia Vision common Library
+Group:      Multimedia/Framework
+Requires:   capi-media-vision-common
+
+%description common-devel
+Media Vision common library for Tizen Native API (DEV).
+
+%package barcode
+Summary:    Multimedia Vision Barcode Library
+Group:      Multimedia/Framework
+Requires:   capi-media-vision-common
+
+%description barcode
+Media Vision barcode library for Tizen Native API.
+
+%package barcode-devel
+Summary:    Multimedia Vision Barcode Library
+Group:      Multimedia/Framework
+Requires:   capi-media-vision-barcode
+Requires:   capi-media-vision-common-devel
+
+%description barcode-devel
+Media Vision barcode library for Tizen Native API (DEV).
+
+%package face
+Summary:    Multimedia Vision Library
+Group:      Multimedia/Framework
+Requires:   capi-media-vision-common
+
+%description face
+Media Vision face library for Tizen Native API.
+
+%package face-devel
+Summary:    Multimedia Vision Face Library (DEV)
+Group:      Multimedia/Framework
+Requires:   capi-media-vision-face
+Requires:   capi-media-vision-common-devel
+
+%description face-devel
+Media Vision face library for Tizen Native API (DEV).
+
+%package image
+Summary:    Multimedia Vision Image Library
+Group:      Multimedia/Framework
+Requires:   capi-media-vision-common
+
+%description image
+Media Vision Image library for Tizen Native API.
+
+%package image-devel
+Summary:    Multimedia Vision Image Library
+Group:      Multimedia/Framework
+Requires:   capi-media-vision-image
+Requires:   capi-media-vision-common-devel
+
+%description image-devel
+Media Vision Image library for Tizen Native API (DEV).
+
+%package surveillance
+Summary:    Multimedia Vision Surveillance Library
+Group:      Multimedia/Framework
+Requires:   capi-media-vision-face
+
+%description surveillance
+Media Vision Surveillance library for Tizen Native API.
+
+%package surveillance-devel
+Summary:    Multimedia Vision Surveillance Library
+Group:      Multimedia/Framework
+Requires:   capi-media-vision-surveillance
+Requires:   capi-media-vision-common-devel
+
+%description surveillance-devel
+Media Vision Surveillance library for Tizen Native API (DEV).
+
+%package testsuite
+Summary:    Multimedia Vision Test Suite
+Group:      Multimedia/Framework
+Requires:   capi-media-vision-barcode
+Requires:   capi-media-vision-face
+Requires:   capi-media-vision-image
+Requires:   capi-media-vision-surveillance
+
+%description testsuite
+Media Vision Test Suite.
+
 %prep
 %setup -q
 
@@ -59,6 +153,7 @@ MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
 
 make %{?jobs:-j%jobs}
 
+
 %install
 rm -rf %{buildroot}
 mkdir -p %{buildroot}%{_datadir}/%{name}
@@ -81,3 +176,48 @@ cp media-vision-config.json %{buildroot}%{_datadir}/%{name}/
 %{_libdir}/pkgconfig/*.pc
 %{_libdir}/lib%{name}.so
 %TZ_SYS_BIN/*
+
+%files common
+%manifest capi-media-vision.manifest
+%license LICENSE.APLv2
+%{_datadir}/%{name}/media-vision-config.json
+%{_libdir}/libmv_common*.so
+
+%files common-devel
+%{_includedir}/media/mv_common.h
+
+%files barcode
+%{_libdir}/libmv_barcode*.so
+
+%files barcode-devel
+%{_includedir}/media/mv_barcode*.h
+%{_libdir}/pkgconfig/*barcode.pc
+
+%files face
+%{_libdir}/libmv_face*.so
+
+%files face-devel
+%{_includedir}/media/mv_face*.h
+%{_libdir}/pkgconfig/*face.pc
+
+%files image
+%{_libdir}/libmv_image.so
+
+%files image-devel
+%{_includedir}/media/mv_image*.h
+%{_libdir}/pkgconfig/*image.pc
+
+%files surveillance
+%{_libdir}/libmv_surveillance*.so
+
+%files surveillance-devel
+%{_includedir}/media/mv_surveillance*.h
+%{_libdir}/pkgconfig/*surveillance.pc
+
+%files testsuite
+%{_libdir}/libmv_*helper.so
+%{_libdir}/libmv_testsuite*.so
+%TZ_SYS_BIN/mv_barcode*
+%TZ_SYS_BIN/mv_face*
+%TZ_SYS_BIN/mv_image*
+%TZ_SYS_BIN/mv_surveillance*
index b46aea2..5845c57 100644 (file)
@@ -22,6 +22,14 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
 
 add_executable(${PROJECT_NAME} ${MV_TEST_SUITE_SRC_LIST} ${MV_TEST_SUITE_INC_LIST} ${MV_CAPI_MEDIA_VISION_INC_LIST})
 
-target_link_libraries(${PROJECT_NAME} capi-media-vision dlog avcodec avformat avutil swscale mv_image_helper)
+target_link_libraries(${PROJECT_NAME} ${MV_BARCODE_DETECTOR_LIB_NAME}
+                                      ${MV_BARCODE_GENERATOR_LIB_NAME}
+                                      capi-system-info
+                                      dlog
+                                      avcodec
+                                      avformat
+                                      avutil
+                                      swscale
+                                      mv_image_helper)
 
 install(TARGETS ${PROJECT_NAME} DESTINATION ${testbin_dir})
index 91398aa..d5aea7c 100644 (file)
@@ -25,7 +25,8 @@ add_executable(${PROJECT_NAME}
                ${MV_FACE_TEST_SUITE_SRC_LIST}
                ${MV_CAPI_MEDIA_VISION_INC_LIST})
 
-target_link_libraries(${PROJECT_NAME} capi-media-vision
+target_link_libraries(${PROJECT_NAME} ${MV_FACE_LIB_NAME}
+                                      capi-system-info
                                       dlog
                                       mv_image_helper
                                       mv_video_helper
index 9e5f5b0..ff43730 100644 (file)
@@ -32,7 +32,8 @@ endif()
 
 add_executable(${PROJECT_NAME} ${MV_TEST_SUITE_SRC_LIST} ${MV_TEST_SUITE_INC_LIST} ${MV_CAPI_MEDIA_VISION_INC_LIST})
 
-target_link_libraries(${PROJECT_NAME} capi-media-vision
+target_link_libraries(${PROJECT_NAME} ${MV_IMAGE_LIB_NAME}
+                                      capi-system-info
                                       glib-2.0
                                       mv_image_helper
                                       mv_video_helper
index 49840f3..74db9ed 100644 (file)
@@ -24,7 +24,8 @@ add_executable(${PROJECT_NAME} ${MV_SURVEILLANCE_TS_SRC_LIST}
                                ${MV_SURVEILLANCE_TS_INC_LIST}
                                ${MV_CAPI_MEDIA_VISION_INC_LIST})
 
-target_link_libraries(${PROJECT_NAME} capi-media-vision
+target_link_libraries(${PROJECT_NAME} ${MV_SURVEILLANCE_LIB_NAME}
+                                      capi-system-info
                                       mv_testsuite_common
                                       mv_image_helper)