Use common feature key checking function 10/302810/4
authorVibhav Aggarwal <v.aggarwal@samsung.com>
Thu, 14 Dec 2023 03:52:44 +0000 (12:52 +0900)
committerVibhav Aggarwal <v.aggarwal@samsung.com>
Wed, 20 Dec 2023 10:39:55 +0000 (19:39 +0900)
[Issue type] code refactoring

This patch replaces all the individual feature key checking
functions by a common function mv_check_feature_key().

Change-Id: I7c63131af0d6b481c1ecfd8d859362328fa3657d
Signed-off-by: Vibhav Aggarwal <v.aggarwal@samsung.com>
25 files changed:
mv_3d/3d/src/mv_3d.cpp
mv_barcode/barcode_detector/src/mv_barcode_detect.c
mv_barcode/barcode_generator/src/mv_barcode_generate.c
mv_common/CMakeLists.txt
mv_common/include/mv_feature_key.h [new file with mode: 0644]
mv_common/include/mv_private.h
mv_common/src/mv_common.cpp
mv_common/src/mv_feature_key.cpp [new file with mode: 0644]
mv_common/src/mv_private.c [deleted file]
mv_face/face/src/mv_face.c
mv_image/image/src/mv_image.c
mv_machine_learning/face_recognition/src/mv_face_recognition.cpp
mv_machine_learning/image_classification/src/mv_image_classification.cpp
mv_machine_learning/image_segmentation/src/mv_selfie_segmentation.cpp
mv_machine_learning/inference/src/mv_inference.c
mv_machine_learning/landmark_detection/src/mv_facial_landmark.cpp
mv_machine_learning/landmark_detection/src/mv_pose_landmark.cpp
mv_machine_learning/object_detection/src/mv_face_detection.cpp
mv_machine_learning/object_detection/src/mv_object_detection.cpp
mv_machine_learning/object_detection_3d/src/mv_object_detection_3d.cpp
mv_roi_tracker/roi_tracker/src/mv_roi_tracker.c
mv_surveillance/surveillance/src/mv_surveillance.c
test/assessment/barcode/CMakeLists.txt
test/assessment/face/CMakeLists.txt
test/assessment/surveillance/CMakeLists.txt

index ee37176..a9ff00f 100644 (file)
 #include <cstddef>
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "mv_common.h"
 #include "mv_3d.h"
 #include "Mv3d.h"
 
 using namespace mediavision::mv3d;
 
+static const char *main_feature_keys[] = { "http://tizen.org/feature/vision.3d" };
+static const char *sub_feature_keys[] = { "http://tizen.org/feature/vision.3d.depth",
+                                                                                 "http://tizen.org/feature/vision.3d.pointcloud" };
+
+static inline bool mv_3d_all_check_system_info_feature_supported()
+{
+       return mv_check_feature_key(main_feature_keys, 1, false) && mv_check_feature_key(sub_feature_keys, 2, true);
+}
+
 int mv_3d_create(mv_3d_h *mv3d)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_3d_all_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_3d_all_check_system_info_feature_supported());
        MEDIA_VISION_NULL_ARG_CHECK(mv3d);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -44,7 +54,7 @@ int mv_3d_create(mv_3d_h *mv3d)
 
 int mv_3d_destroy(mv_3d_h mv3d)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_3d_all_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_3d_all_check_system_info_feature_supported());
        MEDIA_VISION_INSTANCE_CHECK(mv3d);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -72,7 +82,7 @@ int mv3dSetDepthParameters(mv_3d_h mv3d, mv_engine_config_h engine_config)
 
 int mv_3d_configure(mv_3d_h mv3d, mv_engine_config_h engine_config)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_3d_all_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_3d_all_check_system_info_feature_supported());
        MEDIA_VISION_INSTANCE_CHECK(mv3d);
        MEDIA_VISION_INSTANCE_CHECK(engine_config);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -182,8 +192,8 @@ int mv_3d_configure(mv_3d_h mv3d, mv_engine_config_h engine_config)
 
 int mv_3d_set_depth_cb(mv_3d_h mv3d, mv_3d_depth_cb depth_cb, void *user_data)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_3d_depth_check_system_info_feature_supported() &&
-                                                          _mv_3d_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(main_feature_keys, 1, false) &&
+                                                          mv_check_feature_key(sub_feature_keys, 1, false));
        MEDIA_VISION_INSTANCE_CHECK(mv3d);
        MEDIA_VISION_NULL_ARG_CHECK(depth_cb);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -198,8 +208,8 @@ int mv_3d_set_depth_cb(mv_3d_h mv3d, mv_3d_depth_cb depth_cb, void *user_data)
 // LCOV_EXCL_START
 int mv_3d_set_pointcloud_cb(mv_3d_h mv3d, mv_3d_pointcloud_cb pointcloud_cb, void *user_data)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_3d_pointcloud_check_system_info_feature_supported() &&
-                                                          _mv_3d_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(main_feature_keys, 1, false) &&
+                                                          mv_check_feature_key(&sub_feature_keys[1], 1, false));
        MEDIA_VISION_INSTANCE_CHECK(mv3d);
        MEDIA_VISION_NULL_ARG_CHECK(pointcloud_cb);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -218,7 +228,7 @@ int mv_3d_set_pointcloud_cb(mv_3d_h mv3d, mv_3d_pointcloud_cb pointcloud_cb, voi
 
 int mv_3d_prepare(mv_3d_h mv3d)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_3d_all_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_3d_all_check_system_info_feature_supported());
        MEDIA_VISION_INSTANCE_CHECK(mv3d);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -235,7 +245,7 @@ int mv_3d_prepare(mv_3d_h mv3d)
 
 int mv_3d_run(mv_3d_h mv3d, mv_source_h source, mv_source_h source_extra, mv_source_h color)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_3d_all_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_3d_all_check_system_info_feature_supported());
        MEDIA_VISION_INSTANCE_CHECK(mv3d);
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -254,7 +264,7 @@ int mv_3d_run(mv_3d_h mv3d, mv_source_h source, mv_source_h source_extra, mv_sou
 
 int mv_3d_run_async(mv_3d_h mv3d, mv_source_h source, mv_source_h source_extra, mv_source_h color)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_3d_all_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_3d_all_check_system_info_feature_supported());
        MEDIA_VISION_INSTANCE_CHECK(mv3d);
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -274,8 +284,8 @@ int mv_3d_run_async(mv_3d_h mv3d, mv_source_h source, mv_source_h source_extra,
 int mv_3d_pointcloud_write_file(mv_3d_h mv3d, mv_3d_pointcloud_h pointcloud, mv_3d_pointcloud_type_e type,
                                                                char *filename)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_3d_pointcloud_check_system_info_feature_supported() &&
-                                                          _mv_3d_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(main_feature_keys, 1, false) &&
+                                                          mv_check_feature_key(&sub_feature_keys[1], 1, false));
        MEDIA_VISION_INSTANCE_CHECK(mv3d);
        MEDIA_VISION_INSTANCE_CHECK(pointcloud);
        MEDIA_VISION_FUNCTION_ENTER();
index aa36a95..725ef18 100644 (file)
@@ -17,6 +17,7 @@
 #include <system_info.h>
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "mv_barcode_detect.h"
 
 /* Include headers of open barcode detect module here. */
  * @brief This file contains the porting layer for Media Vision barcode module.
  */
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.barcode_detection" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(detect_cb);
 
index caa3f03..73624a2 100644 (file)
@@ -17,6 +17,7 @@
 #include <system_info.h>
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "mv_barcode_generate.h"
 
 /* Include headers of open barcode generate module here. */
  * @brief This file contains the porting layer for Media Vision barcode module.
  */
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.barcode_generation" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(message);
        MEDIA_VISION_INSTANCE_CHECK(image);
 
@@ -70,7 +74,7 @@ int mv_barcode_generate_image(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, 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(message);
 
        MEDIA_VISION_FUNCTION_ENTER();
index 6fcbd82..fc36248 100644 (file)
@@ -1,8 +1,7 @@
 project(${MV_COMMON_LIB_NAME})
 cmake_minimum_required(VERSION 3.13)
 
-file(GLOB MV_COMMON_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp"
-                             "${PROJECT_SOURCE_DIR}/src/*.c")
+file(GLOB MV_COMMON_SRC_LIST "${PROJECT_SOURCE_DIR}/src/*.cpp")
 
 find_package(OpenCV REQUIRED imgproc)
 if(NOT OpenCV_FOUND)
diff --git a/mv_common/include/mv_feature_key.h b/mv_common/include/mv_feature_key.h
new file mode 100644 (file)
index 0000000..de00197
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2023 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.
+ */
+
+#ifndef __TIZEN_MEDIA_VISION_FEATURE_KEY_H__
+#define __TIZEN_MEDIA_VISION_FEATURE_KEY_H__
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+bool mv_check_feature_key(const char *keys[], size_t num_keys, bool at_least_one);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_VISION_FEATURE_KEY_H__ */
index f7303a2..06ac898 100644 (file)
@@ -60,23 +60,6 @@ extern "C" {
 #define MEDIA_VISION_SUPPORT_CHECK(arg) \
        MEDIA_VISION_CHECK_CONDITION((arg), MEDIA_VISION_ERROR_NOT_SUPPORTED, "MEDIA_VISION_ERROR_NOT_SUPPORTED")
 
-bool _mv_check_system_info_feature_supported(void);
-bool _mv_barcode_detect_check_system_info_feature_supported(void);
-bool _mv_barcode_generate_check_system_info_feature_supported(void);
-bool _mv_face_check_system_info_feature_supported(void);
-bool _mv_inference_face_recognition_check_system_info_feature_supported(void);
-bool _mv_training_face_recognition_check_system_info_feature_supported(void);
-bool _mv_image_check_system_info_feature_supported(void);
-bool _mv_inference_check_system_info_feature_supported(void);
-bool _mv_inference_group_check_system_info_feature_supported(void);
-bool _mv_training_group_check_system_info_feature_supported(void);
-bool _mv_inference_image_check_system_info_feature_supported(void);
-bool _mv_inference_face_check_system_info_feature_supported(void);
-bool _mv_roi_tracking_check_system_info_feature_supported(void);
-bool _mv_3d_all_check_system_info_feature_supported(void);
-bool _mv_3d_check_system_info_feature_supported(void);
-bool _mv_3d_depth_check_system_info_feature_supported(void);
-bool _mv_3d_pointcloud_check_system_info_feature_supported(void);
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
index ae9e593..e0d5665 100644 (file)
 #include <mv_common.h>
 #include <mv_common_internal.h>
 #include <mv_private.h>
+#include "mv_feature_key.h"
 
 #include "MediaSource.h"
 #include "EngineConfig.h"
 
+static const char *feature_keys[] = {
+       "http://tizen.org/feature/vision.barcode_detection", "http://tizen.org/feature/vision.barcode_generation",
+       "http://tizen.org/feature/vision.face_recognition",      "http://tizen.org/feature/vision.image_recognition",
+       "http://tizen.org/feature/vision.inference.image",       "http://tizen.org/feature/vision.inference.face"
+};
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 int mv_create_source(mv_source_h *source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_NULL_ARG_CHECK(source);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -49,7 +57,7 @@ int mv_create_source(mv_source_h *source)
 
 int mv_destroy_source(mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -64,7 +72,7 @@ int mv_destroy_source(mv_source_h source)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(media_packet);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -200,7 +208,7 @@ int mv_source_fill_by_media_packet(mv_source_h source, media_packet_h media_pack
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(buffer_size);
        MEDIA_VISION_NULL_ARG_CHECK(data_buffer);
@@ -219,7 +227,7 @@ int mv_source_fill_by_buffer(mv_source_h source, unsigned char *data_buffer, uns
 
 int mv_source_clear(mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -233,7 +241,7 @@ int mv_source_clear(mv_source_h source)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(data_buffer);
        MEDIA_VISION_NULL_ARG_CHECK(buffer_size);
@@ -251,7 +259,7 @@ int mv_source_get_buffer(mv_source_h source, unsigned char **data_buffer, unsign
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(image_height);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -266,7 +274,7 @@ int mv_source_get_height(mv_source_h source, unsigned int *image_height)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(image_width);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -281,7 +289,7 @@ int mv_source_get_width(mv_source_h source, unsigned int *image_width)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(image_colorspace);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -296,7 +304,7 @@ int mv_source_get_colorspace(mv_source_h source, mv_colorspace_e *image_colorspa
 
 int mv_create_engine_config(mv_engine_config_h *engine_cfg)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_NULL_ARG_CHECK(engine_cfg);
        MEDIA_VISION_FUNCTION_ENTER();
        LOGD("Creating media vision engine config");
@@ -314,7 +322,7 @@ int mv_create_engine_config(mv_engine_config_h *engine_cfg)
 
 int mv_destroy_engine_config(mv_engine_config_h engine_cfg)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -328,7 +336,7 @@ int mv_destroy_engine_config(mv_engine_config_h engine_cfg)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_NULL_ARG_CHECK(name);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -347,7 +355,7 @@ int mv_engine_config_set_double_attribute(mv_engine_config_h engine_cfg, const c
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_NULL_ARG_CHECK(name);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -367,7 +375,7 @@ int mv_engine_config_set_int_attribute(mv_engine_config_h engine_cfg, const char
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_NULL_ARG_CHECK(name);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -386,7 +394,7 @@ int mv_engine_config_set_bool_attribute(mv_engine_config_h engine_cfg, const cha
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_NULL_ARG_CHECK(name);
        MEDIA_VISION_NULL_ARG_CHECK(value);
@@ -408,7 +416,7 @@ int mv_engine_config_set_string_attribute(mv_engine_config_h engine_cfg, const c
 int mv_engine_config_set_array_string_attribute(mv_engine_config_h engine_cfg, const char *name, const char **values,
                                                                                                unsigned int size)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_NULL_ARG_CHECK(name);
        MEDIA_VISION_NULL_ARG_CHECK(values);
@@ -440,7 +448,7 @@ int mv_engine_config_set_array_string_attribute(mv_engine_config_h engine_cfg, c
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_NULL_ARG_CHECK(name);
        MEDIA_VISION_NULL_ARG_CHECK(value);
@@ -461,7 +469,7 @@ int mv_engine_config_get_double_attribute(mv_engine_config_h engine_cfg, const c
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_NULL_ARG_CHECK(name);
        MEDIA_VISION_NULL_ARG_CHECK(value);
@@ -482,7 +490,7 @@ int mv_engine_config_get_int_attribute(mv_engine_config_h engine_cfg, const char
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_NULL_ARG_CHECK(name);
        MEDIA_VISION_NULL_ARG_CHECK(value);
@@ -503,7 +511,7 @@ int mv_engine_config_get_bool_attribute(mv_engine_config_h engine_cfg, const cha
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_NULL_ARG_CHECK(name);
        MEDIA_VISION_NULL_ARG_CHECK(value);
@@ -550,7 +558,7 @@ int mv_engine_config_get_string_attribute(mv_engine_config_h engine_cfg, const c
 int mv_engine_config_get_array_string_attribute(mv_engine_config_h engine_cfg, const char *name, char ***values,
                                                                                                int *size)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(engine_cfg);
        MEDIA_VISION_NULL_ARG_CHECK(name);
        MEDIA_VISION_NULL_ARG_CHECK(values);
@@ -615,7 +623,7 @@ int mv_engine_config_get_array_string_attribute(mv_engine_config_h engine_cfg, c
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_NULL_ARG_CHECK(callback);
        MEDIA_VISION_NULL_ARG_CHECK(user_data);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -677,7 +685,7 @@ int mv_engine_config_foreach_supported_attribute(mv_supported_attribute_cb callb
 
 int mv_source_get_timestamp(mv_source_h source, uint64_t *timestamp)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
 
        try {
@@ -693,7 +701,7 @@ int mv_source_get_timestamp(mv_source_h source, uint64_t *timestamp)
 
 int mv_source_set_timestamp(mv_source_h source, uint64_t timestamp)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
 
        try {
@@ -710,7 +718,7 @@ int mv_source_set_timestamp(mv_source_h source, uint64_t timestamp)
 
 int mv_source_get_priv_timestamp(mv_source_h source, void **priv)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(priv);
 
@@ -727,7 +735,7 @@ int mv_source_get_priv_timestamp(mv_source_h source, void **priv)
 
 int mv_source_set_priv_timestamp(mv_source_h source, void *priv)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(priv);
 
diff --git a/mv_common/src/mv_feature_key.cpp b/mv_common/src/mv_feature_key.cpp
new file mode 100644 (file)
index 0000000..e8638bf
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2023 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_feature_key.h"
+#include <system_info.h>
+
+bool mv_check_feature_key(const char *keys[], size_t num_keys, bool at_least_one)
+{
+       bool or_result = false;
+       for (size_t i = 0; i < num_keys; i++) {
+               bool supported = false;
+
+               if (system_info_get_platform_bool(keys[i], &supported)) {
+                       return false;
+               }
+
+               or_result |= supported;
+               if (!supported && !at_least_one)
+                       return false;
+       }
+
+       return or_result;
+}
diff --git a/mv_common/src/mv_private.c b/mv_common/src/mv_private.c
deleted file mode 100644 (file)
index f43e73a..0000000
+++ /dev/null
@@ -1,404 +0,0 @@
-/**
- * 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 <glib.h>
-#include "mv_private.h"
-
-#define VISION_FEATURE_ROI_TRACKING "http://tizen.org/feature/vision.roi_tracking"
-
-static gpointer __get_system_info_feature_once(gpointer data)
-{
-       bool supported = false;
-       gchar *feature = (gchar *) data;
-
-       if (system_info_get_platform_bool(feature, &supported) != SYSTEM_INFO_ERROR_NONE)
-               LOGE("SYSTEM_INFO_ERROR: %s", feature);
-
-       return (gpointer) supported;
-}
-
-bool _mv_check_system_info_feature_supported(void)
-{
-       bool isBarcodeDetectionSupported = false;
-       bool isBarcodeGenerationSupported = false;
-       bool isFaceRecognitionSupported = false;
-       bool isImageRecognitionSupported = false;
-       bool isInferenceImageSupported = false;
-       bool isInferenceFaceSupported = 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;
-       }
-       const int nRetVal5 = system_info_get_platform_bool("http://tizen.org/feature/vision.inference.image",
-                                                                                                          &isInferenceImageSupported);
-
-       if (nRetVal5 != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.inference.image");
-               return false;
-       }
-
-       const int nRetVal6 =
-                       system_info_get_platform_bool("http://tizen.org/feature/vision.inference.face", &isInferenceFaceSupported);
-
-       if (nRetVal6 != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.inference.face");
-               return false;
-       }
-       (isBarcodeDetectionSupported || isBarcodeGenerationSupported || isFaceRecognitionSupported ||
-        isImageRecognitionSupported || isInferenceImageSupported || isInferenceFaceSupported) ?
-                       LOGI("system_info_get_platform_bool returned "
-                                "Supported one feature among barcode detection, "
-                                "barcode generation, face recognition, "
-                                "image recognition, and inference capability\n") :
-                       LOGE("system_info_get_platform_bool returned "
-                                "Unsupported all features of barcode detection, "
-                                "barcode generation, face recognition, "
-                                "image recognition, inference capability\n");
-
-       return (isBarcodeDetectionSupported || isBarcodeGenerationSupported || isFaceRecognitionSupported ||
-                       isImageRecognitionSupported || isInferenceImageSupported || isInferenceFaceSupported);
-}
-
-bool _mv_barcode_detect_check_system_info_feature_supported(void)
-{
-       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(void)
-{
-       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(void)
-{
-       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_inference_group_check_system_info_feature_supported(void)
-{
-       bool isInferenceSupported = false;
-
-       const int nRetVal =
-                       system_info_get_platform_bool("http://tizen.org/feature/vision.inference", &isInferenceSupported);
-
-       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.inference");
-               return false;
-       }
-
-       isInferenceSupported ? LOGI("system_info_get_platform_bool returned "
-                                                               "Supported inference group feature capability\n") :
-                                                  LOGE("system_info_get_platform_bool returned "
-                                                               "Unsupported inference group feature capability\n");
-
-       return (isInferenceSupported);
-}
-
-bool _mv_training_group_check_system_info_feature_supported(void)
-{
-       bool isTrainingSupported = false;
-
-       const int nRetVal = system_info_get_platform_bool("http://tizen.org/feature/vision.training", &isTrainingSupported);
-
-       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.training");
-               return false;
-       }
-
-       isTrainingSupported ? LOGI("system_info_get_platform_bool returned "
-                                                          "Supported training group feature capability\n") :
-                                                 LOGE("system_info_get_platform_bool returned "
-                                                          "Unsupported training group feature capability\n");
-
-       return (isTrainingSupported);
-}
-
-bool _mv_inference_face_recognition_check_system_info_feature_supported(void)
-{
-       bool isInferenceFaceSupported = false;
-
-       const int nRetVal = system_info_get_platform_bool("http://tizen.org/feature/vision.inference.face_recognition",
-                                                                                                         &isInferenceFaceSupported);
-
-       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.inference.face_recognition");
-               return false;
-       }
-
-       isInferenceFaceSupported ? LOGI("system_info_get_platform_bool returned "
-                                                                       "Supported inference face recognition feature capability\n") :
-                                                          LOGE("system_info_get_platform_bool returned "
-                                                                       "Unsupported inference face recognition feature capability\n");
-
-       return (_mv_inference_group_check_system_info_feature_supported() && isInferenceFaceSupported);
-}
-
-bool _mv_training_face_recognition_check_system_info_feature_supported(void)
-{
-       bool isFaceRecognitionSupported = false;
-
-       const int nRetVal = system_info_get_platform_bool("http://tizen.org/feature/vision.training.face_recognition",
-                                                                                                         &isFaceRecognitionSupported);
-
-       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.training.face_recognition");
-               return false;
-       }
-
-       isFaceRecognitionSupported ? LOGI("system_info_get_platform_bool returned "
-                                                                         "Supported training face recognition feature capability\n") :
-                                                                LOGE("system_info_get_platform_bool returned "
-                                                                         "Unsupported training face recognition feature capability\n");
-
-       return (_mv_training_group_check_system_info_feature_supported() && isFaceRecognitionSupported);
-}
-
-bool _mv_image_check_system_info_feature_supported(void)
-{
-       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;
-}
-
-bool _mv_inference_check_system_info_feature_supported(void)
-{
-       bool isInferenceImageSupported = false;
-       bool isInferenceFaceSupported = false;
-
-       const int nRetVal1 = system_info_get_platform_bool("http://tizen.org/feature/vision.inference.image",
-                                                                                                          &isInferenceImageSupported);
-
-       if (nRetVal1 != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.inference.image");
-               return false;
-       }
-
-       const int nRetVal2 =
-                       system_info_get_platform_bool("http://tizen.org/feature/vision.inference.face", &isInferenceFaceSupported);
-
-       if (nRetVal2 != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.inference.face");
-               return false;
-       }
-
-       (isInferenceImageSupported || isInferenceFaceSupported) ? LOGI("system_info_get_platform_bool returned "
-                                                                                                                                  "Supported inference feature capability\n") :
-                                                                                                                         LOGE("system_info_get_platform_bool returned "
-                                                                                                                                  "Unsupported inference feature capability\n");
-
-       return (isInferenceImageSupported || isInferenceFaceSupported);
-}
-
-bool _mv_inference_image_check_system_info_feature_supported(void)
-{
-       bool isInferenceImageSupported = false;
-
-       const int nRetVal = system_info_get_platform_bool("http://tizen.org/feature/vision.inference.image",
-                                                                                                         &isInferenceImageSupported);
-
-       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.inference.image");
-               return false;
-       }
-
-       isInferenceImageSupported ? LOGI("system_info_get_platform_bool returned "
-                                                                        "Supported inference image feature capability\n") :
-                                                               LOGE("system_info_get_platform_bool returned "
-                                                                        "Unsupported inference image feature capability\n");
-
-       return isInferenceImageSupported;
-}
-
-bool _mv_inference_face_check_system_info_feature_supported(void)
-{
-       bool isInferenceFaceSupported = false;
-
-       const int nRetVal =
-                       system_info_get_platform_bool("http://tizen.org/feature/vision.inference.face", &isInferenceFaceSupported);
-
-       if (nRetVal != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.inference.face");
-               return false;
-       }
-
-       isInferenceFaceSupported ? LOGI("system_info_get_platform_bool returned "
-                                                                       "Supported inference face feature capability\n") :
-                                                          LOGE("system_info_get_platform_bool returned "
-                                                                       "Unsupported inference face feature capability\n");
-
-       return isInferenceFaceSupported;
-}
-
-bool _mv_roi_tracking_check_system_info_feature_supported(void)
-{
-       static GOnce once = G_ONCE_INIT;
-       bool supported = (bool) g_once(&once, __get_system_info_feature_once, VISION_FEATURE_ROI_TRACKING);
-
-       LOGI("Feature[%s] : %d", VISION_FEATURE_ROI_TRACKING, supported);
-
-       return supported;
-}
-
-bool _mv_3d_all_check_system_info_feature_supported(void)
-{
-       return _mv_3d_check_system_info_feature_supported() && (_mv_3d_depth_check_system_info_feature_supported() ||
-                                                                                                                       _mv_3d_pointcloud_check_system_info_feature_supported());
-}
-
-bool _mv_3d_check_system_info_feature_supported(void)
-{
-       bool is3dSupported = false;
-
-       const int nRetVal1 = system_info_get_platform_bool("http://tizen.org/feature/vision.3d", &is3dSupported);
-
-       if (nRetVal1 != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.3d");
-               return false;
-       }
-
-       is3dSupported ? LOGI("system_info_get_platform_bool returned "
-                                                "Supported 3d feature capability\n") :
-                                       LOGE("system_info_get_platform_bool returned "
-                                                "Unsupported 3d feature capability\n");
-
-       return is3dSupported;
-}
-
-bool _mv_3d_depth_check_system_info_feature_supported(void)
-{
-       bool is3dDepthSupported = false;
-
-       const int nRetVal1 = system_info_get_platform_bool("http://tizen.org/feature/vision.3d.depth", &is3dDepthSupported);
-
-       if (nRetVal1 != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.3d.depth");
-               return false;
-       }
-
-       is3dDepthSupported ? LOGI("system_info_get_platform_bool returned "
-                                                         "Supported 3d depth feature capability\n") :
-                                                LOGE("system_info_get_platform_bool returned "
-                                                         "Unsupported 3d depth feature capability\n");
-
-       return is3dDepthSupported;
-}
-
-bool _mv_3d_pointcloud_check_system_info_feature_supported(void)
-{
-       bool is3dPointCloudSupported = false;
-
-       const int nRetVal1 =
-                       system_info_get_platform_bool("http://tizen.org/feature/vision.3d.pointcloud", &is3dPointCloudSupported);
-
-       if (nRetVal1 != SYSTEM_INFO_ERROR_NONE) {
-               LOGE("SYSTEM_INFO_ERROR: vision.3d.pointcloud");
-               return false;
-       }
-
-       is3dPointCloudSupported ? LOGI("system_info_get_platform_bool returned "
-                                                                  "Supported 3d pointcloud feature capability\n") :
-                                                         LOGE("system_info_get_platform_bool returned "
-                                                                  "Unsupported 3d pointcloud feature capability\n");
-
-       return is3dPointCloudSupported;
-}
\ No newline at end of file
index 782180d..d4e669d 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "mv_face.h"
 #include "mv_face_open.h"
 
@@ -23,6 +24,9 @@
  * @brief This file contains the porting layer for Media Vision face module.
  */
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.face_recognition" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 static int check_source_roi_quadrangle(mv_quadrangle_s *roi, mv_source_h source)
 {
        int ret;
@@ -83,7 +87,7 @@ static int check_source_roi(const mv_rectangle_s *roi, mv_source_h source)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
 
@@ -100,7 +104,7 @@ int mv_face_detect(mv_source_h source, mv_engine_config_h engine_cfg, mv_face_de
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(recognition_model);
        MEDIA_VISION_NULL_ARG_CHECK(recognized_cb);
@@ -122,7 +126,7 @@ int mv_face_recognize(mv_source_h source, mv_face_recognition_model_h recognitio
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(tracking_model);
        MEDIA_VISION_NULL_ARG_CHECK(tracked_cb);
@@ -140,7 +144,7 @@ int mv_face_track(mv_source_h source, mv_face_tracking_model_h tracking_model, m
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(eye_condition_recognized_cb);
 
@@ -159,7 +163,7 @@ int mv_face_facial_expression_recognize(mv_source_h source, mv_engine_config_h e
                                                                                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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(expression_recognized_cb);
 
@@ -180,7 +184,7 @@ int mv_face_facial_expression_recognize(mv_source_h source, mv_engine_config_h e
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(recognition_model);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -195,7 +199,7 @@ int mv_face_recognition_model_create(mv_face_recognition_model_h *recognition_mo
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(recognition_model);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -210,7 +214,7 @@ int mv_face_recognition_model_destroy(mv_face_recognition_model_h recognition_mo
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(src);
        MEDIA_VISION_NULL_ARG_CHECK(dst);
 
@@ -226,7 +230,7 @@ int mv_face_recognition_model_clone(mv_face_recognition_model_h src, mv_face_rec
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(recognition_model);
 
        if (file_name == NULL) {
@@ -246,7 +250,7 @@ int mv_face_recognition_model_save(const char *file_name, mv_face_recognition_mo
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(recognition_model);
 
        if (file_name == NULL) {
@@ -267,7 +271,7 @@ int mv_face_recognition_model_load(const char *file_name, mv_face_recognition_mo
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(recognition_model);
 
@@ -287,7 +291,7 @@ int mv_face_recognition_model_add(const mv_source_h source, mv_face_recognition_
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(recognition_model);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -302,7 +306,7 @@ int mv_face_recognition_model_reset(mv_face_recognition_model_h recognition_mode
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(recognition_model);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -318,7 +322,7 @@ int mv_face_recognition_model_learn(mv_engine_config_h engine_cfg, mv_face_recog
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(recognition_model);
        MEDIA_VISION_NULL_ARG_CHECK(labels);
        MEDIA_VISION_NULL_ARG_CHECK(number_of_labels);
@@ -335,7 +339,7 @@ int mv_face_recognition_model_query_labels(mv_face_recognition_model_h recogniti
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(tracking_model);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -350,7 +354,7 @@ int mv_face_tracking_model_create(mv_face_tracking_model_h *tracking_model)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(tracking_model);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -366,7 +370,7 @@ int mv_face_tracking_model_destroy(mv_face_tracking_model_h tracking_model)
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(tracking_model);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -386,7 +390,7 @@ int mv_face_tracking_model_prepare(mv_face_tracking_model_h tracking_model, mv_e
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(src);
        MEDIA_VISION_NULL_ARG_CHECK(dst);
 
@@ -402,7 +406,7 @@ int mv_face_tracking_model_clone(mv_face_tracking_model_h src, mv_face_tracking_
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(tracking_model);
 
        if (file_name == NULL) {
@@ -422,7 +426,7 @@ int mv_face_tracking_model_save(const char *file_name, mv_face_tracking_model_h
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(tracking_model);
 
        if (file_name == NULL) {
index 0a8bd83..d39eb61 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "mv_image.h"
 #include "mv_image_open.h"
 
  * @brief This file contains the porting layer for Media Vision image module.
  */
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.image_recognition" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_NULL_ARG_CHECK(image_objects);
 
@@ -47,7 +51,7 @@ int mv_image_recognize(mv_source_h source, const mv_image_object_h *image_object
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(image_tracking_model);
        MEDIA_VISION_NULL_ARG_CHECK(tracked_cb);
@@ -62,7 +66,7 @@ int mv_image_track(mv_source_h source, mv_image_tracking_model_h image_tracking_
 
 int mv_image_object_create(mv_image_object_h *image_object)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(image_object);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -74,7 +78,7 @@ int mv_image_object_create(mv_image_object_h *image_object)
 
 int mv_image_object_destroy(mv_image_object_h image_object)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(image_object);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -87,7 +91,7 @@ int mv_image_object_destroy(mv_image_object_h image_object)
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(image_object);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -101,7 +105,7 @@ int mv_image_object_fill(mv_image_object_h image_object, mv_engine_config_h engi
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(image_object);
        MEDIA_VISION_NULL_ARG_CHECK(recognition_rate);
 
@@ -115,7 +119,7 @@ int mv_image_object_get_recognition_rate(mv_image_object_h image_object, double
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(image_object);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -128,7 +132,7 @@ int mv_image_object_set_label(mv_image_object_h image_object, int label)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(image_object);
        MEDIA_VISION_NULL_ARG_CHECK(label);
 
@@ -142,7 +146,7 @@ int mv_image_object_get_label(mv_image_object_h image_object, int *label)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(src);
        MEDIA_VISION_NULL_ARG_CHECK(dst);
 
@@ -155,7 +159,7 @@ int mv_image_object_clone(mv_image_object_h src, mv_image_object_h *dst)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(image_object);
 
        if (file_name == NULL) {
@@ -173,7 +177,7 @@ int mv_image_object_save(const char *file_name, mv_image_object_h image_object)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(image_object);
 
        if (file_name == NULL) {
@@ -191,7 +195,7 @@ int mv_image_object_load(const char *file_name, mv_image_object_h *image_object)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(image_tracking_model);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -204,7 +208,7 @@ int mv_image_tracking_model_create(mv_image_tracking_model_h *image_tracking_mod
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(image_tracking_model);
        MEDIA_VISION_INSTANCE_CHECK(image_object);
 
@@ -218,7 +222,7 @@ int mv_image_tracking_model_set_target(mv_image_object_h image_object, mv_image_
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(image_tracking_model);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -231,7 +235,7 @@ int mv_image_tracking_model_destroy(mv_image_tracking_model_h image_tracking_mod
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(image_tracking_model);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -244,7 +248,7 @@ int mv_image_tracking_model_refresh(mv_image_tracking_model_h image_tracking_mod
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(src);
        MEDIA_VISION_NULL_ARG_CHECK(dst);
 
@@ -258,7 +262,7 @@ int mv_image_tracking_model_clone(mv_image_tracking_model_h src, mv_image_tracki
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(image_tracking_model);
 
        if (file_name == NULL) {
@@ -276,7 +280,7 @@ int mv_image_tracking_model_save(const char *file_name, mv_image_tracking_model_
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(image_tracking_model);
 
        if (file_name == NULL) {
index 2aac4e4..b98a9fb 100644 (file)
@@ -20,6 +20,7 @@
 #include <mutex>
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "context.h"
 #include "machine_learning_exception.h"
 #include "face_recognition_adapter.h"
@@ -37,10 +38,15 @@ using FacenetTask = ITask<FacenetInput, FacenetOutput>;
 
 static mutex g_face_recognition_mutex;
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference",
+                                                                         "http://tizen.org/feature/vision.inference.face_recognition",
+                                                                         "http://tizen.org/feature/vision.training",
+                                                                         "http://tizen.org/feature/vision.training.face_recognition" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 int mv_face_recognition_create(mv_face_recognition_h *out_handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
-       MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_NULL_ARG_CHECK(out_handle);
 
@@ -101,8 +107,7 @@ int mv_face_recognition_destroy(mv_face_recognition_h handle)
 {
        lock_guard<mutex> lock(g_face_recognition_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
-       MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
@@ -136,8 +141,7 @@ int mv_face_recognition_prepare(mv_face_recognition_h handle)
 {
        lock_guard<mutex> lock(g_face_recognition_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
-       MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
@@ -166,8 +170,7 @@ int mv_face_recognition_register(mv_face_recognition_h handle, mv_source_h sourc
 {
        lock_guard<mutex> lock(g_face_recognition_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
-       MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
@@ -206,8 +209,7 @@ int mv_face_recognition_unregister(mv_face_recognition_h handle, const char *lab
 {
        lock_guard<mutex> lock(g_face_recognition_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
-       MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(label);
@@ -237,8 +239,7 @@ int mv_face_recognition_inference(mv_face_recognition_h handle, mv_source_h sour
 {
        lock_guard<mutex> lock(g_face_recognition_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
-       MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
@@ -274,8 +275,7 @@ int mv_face_recognition_get_label(mv_face_recognition_h handle, const char **out
 {
        lock_guard<mutex> lock(g_face_recognition_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
-       MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(out_label);
@@ -302,8 +302,7 @@ int mv_face_recognition_get_confidence(mv_face_recognition_h handle, const float
 {
        lock_guard<mutex> lock(g_face_recognition_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
-       MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(confidences);
@@ -331,8 +330,7 @@ int mv_face_recognition_get_label_with_index(mv_face_recognition_h handle, const
 {
        lock_guard<mutex> lock(g_face_recognition_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_recognition_check_system_info_feature_supported());
-       MEDIA_VISION_SUPPORT_CHECK(_mv_training_face_recognition_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(label);
index baa4ada..8b0bb86 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "itask.h"
 #include "mv_image_classification_internal.h"
 #include "image_classification_adapter.h"
@@ -38,9 +39,12 @@ using namespace MediaVision::Common;
 using namespace mediavision::machine_learning::exception;
 using ImageClassificationTask = ImageClassificationAdapter<InputBaseType, OutputBaseType>;
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference.image" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 int mv_image_classification_create(mv_image_classification_h *out_handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(out_handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -62,7 +66,7 @@ int mv_image_classification_create(mv_image_classification_h *out_handle)
 
 int mv_image_classification_destroy(mv_image_classification_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -76,7 +80,7 @@ int mv_image_classification_destroy(mv_image_classification_h handle)
 
 int mv_image_classification_configure(mv_image_classification_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -95,7 +99,7 @@ int mv_image_classification_configure(mv_image_classification_h handle)
 
 int mv_image_classification_prepare(mv_image_classification_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -114,7 +118,7 @@ int mv_image_classification_prepare(mv_image_classification_h handle)
 
 int mv_image_classification_inference(mv_image_classification_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -136,7 +140,7 @@ int mv_image_classification_inference(mv_image_classification_h handle, mv_sourc
 
 int mv_image_classification_inference_async(mv_image_classification_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -158,7 +162,7 @@ int mv_image_classification_inference_async(mv_image_classification_h handle, mv
 
 int mv_image_classification_get_label(mv_image_classification_h handle, const char **out_label)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(out_label);
 
@@ -182,7 +186,7 @@ int mv_image_classification_get_label(mv_image_classification_h handle, const ch
 int mv_image_classification_set_model(mv_image_classification_h handle, const char *model_file, const char *meta_file,
                                                                          const char *label_file)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(model_file);
        MEDIA_VISION_NULL_ARG_CHECK(meta_file);
@@ -205,7 +209,7 @@ int mv_image_classification_set_model(mv_image_classification_h handle, const ch
 int mv_image_classification_set_engine(mv_image_classification_h handle, const char *backend_type,
                                                                           const char *device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(backend_type);
        MEDIA_VISION_NULL_ARG_CHECK(device_type);
@@ -226,7 +230,7 @@ int mv_image_classification_set_engine(mv_image_classification_h handle, const c
 
 int mv_image_classification_get_engine_count(mv_image_classification_h handle, unsigned int *engine_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_count);
 
@@ -247,7 +251,7 @@ int mv_image_classification_get_engine_count(mv_image_classification_h handle, u
 int mv_image_classification_get_engine_type(mv_image_classification_h handle, const unsigned int engine_index,
                                                                                        char **engine_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
 
@@ -268,7 +272,7 @@ int mv_image_classification_get_engine_type(mv_image_classification_h handle, co
 int mv_image_classification_get_device_count(mv_image_classification_h handle, const char *engine_type,
                                                                                         unsigned int *device_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(device_count);
 
@@ -289,7 +293,7 @@ int mv_image_classification_get_device_count(mv_image_classification_h handle, c
 int mv_image_classification_get_device_type(mv_image_classification_h handle, const char *engine_type,
                                                                                        const unsigned int device_index, char **device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
        MEDIA_VISION_NULL_ARG_CHECK(device_type);
index 904af41..cae6d81 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "itask.h"
 #include "mv_selfie_segmentation_type.h"
 #include "mv_selfie_segmentation_internal.h"
@@ -38,9 +39,13 @@ using namespace MediaVision::Common;
 using namespace mediavision::machine_learning::exception;
 using ImageSegmentationTask = ITask<ImageSegmentationInput, ImageSegmentationResult>;
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference.image",
+                                                                         "http://tizen.org/feature/vision.inference.face" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 int mv_selfie_segmentation_create(mv_selfie_segmentation_h *handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_NULL_ARG_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -66,7 +71,7 @@ int mv_selfie_segmentation_create(mv_selfie_segmentation_h *handle)
 
 int mv_selfie_segmentation_destroy(mv_selfie_segmentation_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -86,7 +91,7 @@ int mv_selfie_segmentation_destroy(mv_selfie_segmentation_h handle)
 int mv_selfie_segmentation_set_model(mv_selfie_segmentation_h handle, const char *model_name, const char *model_file,
                                                                         const char *meta_file, const char *label_file)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
@@ -110,7 +115,7 @@ int mv_selfie_segmentation_set_model(mv_selfie_segmentation_h handle, const char
 int mv_selfie_segmentation_set_engine(mv_selfie_segmentation_h handle, const char *backend_type,
                                                                          const char *device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(backend_type);
@@ -135,7 +140,7 @@ int mv_selfie_segmentation_set_engine(mv_selfie_segmentation_h handle, const cha
 
 int mv_selfie_segmentation_get_engine_count(mv_selfie_segmentation_h handle, unsigned int *engine_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_count);
@@ -161,7 +166,7 @@ int mv_selfie_segmentation_get_engine_count(mv_selfie_segmentation_h handle, uns
 int mv_selfie_segmentation_get_engine_type(mv_selfie_segmentation_h handle, const unsigned int engine_index,
                                                                                   char **engine_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -187,7 +192,7 @@ int mv_selfie_segmentation_get_engine_type(mv_selfie_segmentation_h handle, cons
 int mv_selfie_segmentation_get_device_count(mv_selfie_segmentation_h handle, const char *engine_type,
                                                                                        unsigned int *device_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(device_count);
@@ -213,7 +218,7 @@ int mv_selfie_segmentation_get_device_count(mv_selfie_segmentation_h handle, con
 int mv_selfie_segmentation_get_device_type(mv_selfie_segmentation_h handle, const char *engine_type,
                                                                                   const unsigned int device_index, char **device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -239,7 +244,7 @@ int mv_selfie_segmentation_get_device_type(mv_selfie_segmentation_h handle, cons
 
 int mv_selfie_segmentation_configure(mv_selfie_segmentation_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -261,7 +266,7 @@ int mv_selfie_segmentation_configure(mv_selfie_segmentation_h handle)
 
 int mv_selfie_segmentation_prepare(mv_selfie_segmentation_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -283,7 +288,7 @@ int mv_selfie_segmentation_prepare(mv_selfie_segmentation_h handle)
 
 int mv_selfie_segmentation_inference(mv_selfie_segmentation_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -309,7 +314,7 @@ int mv_selfie_segmentation_inference(mv_selfie_segmentation_h handle, mv_source_
 
 int mv_selfie_segmentation_inference_async(mv_selfie_segmentation_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -335,7 +340,7 @@ int mv_selfie_segmentation_inference_async(mv_selfie_segmentation_h handle, mv_s
 int mv_selfie_segmentation_get_result(mv_selfie_segmentation_h handle, unsigned int *width, unsigned int *height,
                                                                          unsigned int *pixel_size, const unsigned char **data)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(width);
        MEDIA_VISION_INSTANCE_CHECK(height);
index f722cd9..1ad34af 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "mv_inference.h"
 #include "mv_inference_open.h"
 
  * @brief This file contains Media Vision inference module.
  */
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference.image",
+                                                                         "http://tizen.org/feature/vision.inference.face" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 int mv_inference_create(mv_inference_h *infer)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_NULL_ARG_CHECK(infer);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -40,7 +45,7 @@ int mv_inference_create(mv_inference_h *infer)
 
 int mv_inference_destroy(mv_inference_h infer)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(infer);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -55,7 +60,7 @@ int mv_inference_destroy(mv_inference_h infer)
 
 int mv_inference_configure(mv_inference_h infer, mv_engine_config_h engine_config)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(infer);
        MEDIA_VISION_INSTANCE_CHECK(engine_config);
 
@@ -75,7 +80,7 @@ int mv_inference_configure(mv_inference_h infer, mv_engine_config_h engine_confi
 
 int mv_inference_prepare(mv_inference_h infer)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(infer);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -91,7 +96,7 @@ int mv_inference_prepare(mv_inference_h infer)
 int mv_inference_foreach_supported_engine(mv_inference_h infer, mv_inference_supported_engine_cb callback,
                                                                                  void *user_data)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(infer);
        MEDIA_VISION_NULL_ARG_CHECK(callback);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -108,7 +113,7 @@ int mv_inference_foreach_supported_engine(mv_inference_h infer, mv_inference_sup
 int mv_inference_image_classify(mv_source_h source, mv_inference_h infer, mv_rectangle_s *roi,
                                                                mv_inference_image_classified_cb classified_cb, void *user_data)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(infer);
        MEDIA_VISION_NULL_ARG_CHECK(classified_cb);
@@ -127,7 +132,7 @@ int mv_inference_image_classify(mv_source_h source, mv_inference_h infer, mv_rec
 int mv_inference_object_detect(mv_source_h source, mv_inference_h infer, mv_inference_object_detected_cb detected_cb,
                                                           void *user_data)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(infer);
        MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
@@ -146,7 +151,7 @@ int mv_inference_object_detect(mv_source_h source, mv_inference_h infer, mv_infe
 int mv_inference_face_detect(mv_source_h source, mv_inference_h infer, mv_inference_face_detected_cb detected_cb,
                                                         void *user_data)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(infer);
        MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
@@ -165,7 +170,7 @@ int mv_inference_face_detect(mv_source_h source, mv_inference_h infer, mv_infere
 int mv_inference_facial_landmark_detect(mv_source_h source, mv_inference_h infer, mv_rectangle_s *roi,
                                                                                mv_inference_facial_landmark_detected_cb detected_cb, void *user_data)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(infer);
        MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
@@ -184,7 +189,7 @@ int mv_inference_facial_landmark_detect(mv_source_h source, mv_inference_h infer
 int mv_inference_pose_landmark_detect(mv_source_h source, mv_inference_h infer, mv_rectangle_s *roi,
                                                                          mv_inference_pose_landmark_detected_cb detected_cb, void *user_data)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(infer);
        MEDIA_VISION_NULL_ARG_CHECK(detected_cb);
@@ -202,7 +207,7 @@ int mv_inference_pose_landmark_detect(mv_source_h source, mv_inference_h infer,
 
 int mv_inference_pose_get_number_of_poses(mv_inference_pose_result_h result, int *number_of_poses)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(result);
 
        MEDIA_VISION_NULL_ARG_CHECK(number_of_poses);
@@ -220,7 +225,7 @@ int mv_inference_pose_get_number_of_poses(mv_inference_pose_result_h result, int
 
 int mv_inference_pose_get_number_of_landmarks(mv_inference_pose_result_h result, int *number_of_landmarks)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(result);
 
        MEDIA_VISION_NULL_ARG_CHECK(number_of_landmarks);
@@ -239,7 +244,7 @@ int mv_inference_pose_get_number_of_landmarks(mv_inference_pose_result_h result,
 int mv_inference_pose_get_landmark(mv_inference_pose_result_h result, int pose_index, int part_index,
                                                                   mv_point_s *location, float *score)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(result);
 
        MEDIA_VISION_NULL_ARG_CHECK(location);
@@ -261,7 +266,7 @@ int mv_inference_pose_get_landmark(mv_inference_pose_result_h result, int pose_i
 
 int mv_inference_pose_get_label(mv_inference_pose_result_h result, int pose_index, int *label)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(result);
 
        MEDIA_VISION_NULL_ARG_CHECK(label);
@@ -282,7 +287,7 @@ int mv_inference_pose_get_label(mv_inference_pose_result_h result, int pose_inde
 
 int mv_pose_create(mv_pose_h *pose)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_NULL_ARG_CHECK(pose);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -298,7 +303,7 @@ int mv_pose_create(mv_pose_h *pose)
 
 int mv_pose_destroy(mv_pose_h pose)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(pose);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -314,7 +319,7 @@ int mv_pose_destroy(mv_pose_h pose)
 
 int mv_pose_set_from_file(mv_pose_h pose, const char *motion_capture_file_path, const char *motion_mapping_file_path)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(pose);
        MEDIA_VISION_NULL_ARG_CHECK(motion_capture_file_path);
        MEDIA_VISION_NULL_ARG_CHECK(motion_mapping_file_path);
@@ -332,7 +337,7 @@ int mv_pose_set_from_file(mv_pose_h pose, const char *motion_capture_file_path,
 
 int mv_pose_compare(mv_pose_h pose, mv_inference_pose_result_h action, int parts, float *score)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(pose);
        MEDIA_VISION_INSTANCE_CHECK(action);
        MEDIA_VISION_NULL_ARG_CHECK(score);
index cd46b2e..b7398f8 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "itask.h"
 #include "mv_facial_landmark_internal.h"
 #include "facial_landmark_adapter.h"
@@ -38,9 +39,13 @@ using namespace MediaVision::Common;
 using namespace mediavision::machine_learning::exception;
 using LandmarkDetectionTask = FacialLandmarkAdapter<InputBaseType, OutputBaseType>;
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference.image",
+                                                                         "http://tizen.org/feature/vision.inference.face" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 int mv_facial_landmark_create(mv_facial_landmark_h *handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_NULL_ARG_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -59,7 +64,7 @@ int mv_facial_landmark_create(mv_facial_landmark_h *handle)
 
 int mv_facial_landmark_destroy(mv_facial_landmark_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -74,7 +79,7 @@ int mv_facial_landmark_destroy(mv_facial_landmark_h handle)
 int mv_facial_landmark_set_model(mv_facial_landmark_h handle, const char *model_name, const char *model_file,
                                                                 const char *meta_file, const char *label_file)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(model_name);
@@ -98,7 +103,7 @@ int mv_facial_landmark_set_model(mv_facial_landmark_h handle, const char *model_
 
 int mv_facial_landmark_set_engine(mv_facial_landmark_h handle, const char *backend_type, const char *device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(backend_type);
@@ -120,7 +125,7 @@ int mv_facial_landmark_set_engine(mv_facial_landmark_h handle, const char *backe
 
 int mv_facial_landmark_get_engine_count(mv_facial_landmark_h handle, unsigned int *engine_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_count);
@@ -141,7 +146,7 @@ int mv_facial_landmark_get_engine_count(mv_facial_landmark_h handle, unsigned in
 
 int mv_facial_landmark_get_engine_type(mv_facial_landmark_h handle, const unsigned int engine_index, char **engine_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -163,7 +168,7 @@ int mv_facial_landmark_get_engine_type(mv_facial_landmark_h handle, const unsign
 int mv_facial_landmark_get_device_count(mv_facial_landmark_h handle, const char *engine_type,
                                                                                unsigned int *device_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(device_count);
@@ -185,7 +190,7 @@ int mv_facial_landmark_get_device_count(mv_facial_landmark_h handle, const char
 int mv_facial_landmark_get_device_type(mv_facial_landmark_h handle, const char *engine_type,
                                                                           const unsigned int device_index, char **device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -207,7 +212,7 @@ int mv_facial_landmark_get_device_type(mv_facial_landmark_h handle, const char *
 
 int mv_facial_landmark_configure(mv_facial_landmark_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -226,7 +231,7 @@ int mv_facial_landmark_configure(mv_facial_landmark_h handle)
 
 int mv_facial_landmark_prepare(mv_facial_landmark_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -245,7 +250,7 @@ int mv_facial_landmark_prepare(mv_facial_landmark_h handle)
 
 int mv_facial_landmark_inference(mv_facial_landmark_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -267,7 +272,7 @@ int mv_facial_landmark_inference(mv_facial_landmark_h handle, mv_source_h source
 
 int mv_facial_landmark_inference_async(mv_facial_landmark_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -290,7 +295,7 @@ int mv_facial_landmark_inference_async(mv_facial_landmark_h handle, mv_source_h
 int mv_facial_landmark_get_positions(mv_facial_landmark_h handle, unsigned int *number_of_landmarks,
                                                                         unsigned int **pos_x, unsigned int **pos_y)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(number_of_landmarks);
        MEDIA_VISION_INSTANCE_CHECK(pos_x);
index 5de2d98..f9be39f 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "itask.h"
 #include "mv_pose_landmark_internal.h"
 #include "pose_landmark_adapter.h"
@@ -38,9 +39,13 @@ using namespace MediaVision::Common;
 using namespace mediavision::machine_learning::exception;
 using LandmarkDetectionTask = PoseLandmarkAdapter<InputBaseType, OutputBaseType>;
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference.image",
+                                                                         "http://tizen.org/feature/vision.inference.face" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 int mv_pose_landmark_create(mv_pose_landmark_h *handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_NULL_ARG_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -59,7 +64,7 @@ int mv_pose_landmark_create(mv_pose_landmark_h *handle)
 
 int mv_pose_landmark_destroy(mv_pose_landmark_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -74,7 +79,7 @@ int mv_pose_landmark_destroy(mv_pose_landmark_h handle)
 int mv_pose_landmark_set_model(mv_pose_landmark_h handle, const char *model_name, const char *model_file,
                                                           const char *meta_file, const char *label_file)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(model_name);
@@ -98,7 +103,7 @@ int mv_pose_landmark_set_model(mv_pose_landmark_h handle, const char *model_name
 
 int mv_pose_landmark_set_engine(mv_pose_landmark_h handle, const char *backend_type, const char *device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(backend_type);
@@ -120,7 +125,7 @@ int mv_pose_landmark_set_engine(mv_pose_landmark_h handle, const char *backend_t
 
 int mv_pose_landmark_get_engine_count(mv_pose_landmark_h handle, unsigned int *engine_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_count);
@@ -141,7 +146,7 @@ int mv_pose_landmark_get_engine_count(mv_pose_landmark_h handle, unsigned int *e
 
 int mv_pose_landmark_get_engine_type(mv_pose_landmark_h handle, const unsigned int engine_index, char **engine_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -162,7 +167,7 @@ int mv_pose_landmark_get_engine_type(mv_pose_landmark_h handle, const unsigned i
 
 int mv_pose_landmark_get_device_count(mv_pose_landmark_h handle, const char *engine_type, unsigned int *device_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(device_count);
@@ -184,7 +189,7 @@ int mv_pose_landmark_get_device_count(mv_pose_landmark_h handle, const char *eng
 int mv_pose_landmark_get_device_type(mv_pose_landmark_h handle, const char *engine_type,
                                                                         const unsigned int device_index, char **device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -206,7 +211,7 @@ int mv_pose_landmark_get_device_type(mv_pose_landmark_h handle, const char *engi
 
 int mv_pose_landmark_configure(mv_pose_landmark_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -225,7 +230,7 @@ int mv_pose_landmark_configure(mv_pose_landmark_h handle)
 
 int mv_pose_landmark_prepare(mv_pose_landmark_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -244,7 +249,7 @@ int mv_pose_landmark_prepare(mv_pose_landmark_h handle)
 
 int mv_pose_landmark_inference(mv_pose_landmark_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -266,7 +271,7 @@ int mv_pose_landmark_inference(mv_pose_landmark_h handle, mv_source_h source)
 
 int mv_pose_landmark_inference_async(mv_pose_landmark_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -289,7 +294,7 @@ int mv_pose_landmark_inference_async(mv_pose_landmark_h handle, mv_source_h sour
 int mv_pose_landmark_get_pos(mv_pose_landmark_h handle, unsigned int *number_of_landmarks, unsigned int **pos_x,
                                                         unsigned int **pos_y)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(number_of_landmarks);
        MEDIA_VISION_INSTANCE_CHECK(pos_x);
index cac09ba..41a254c 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "itask.h"
 #include "mv_face_detection_internal.h"
 #include "face_detection_adapter.h"
@@ -40,9 +41,13 @@ using namespace MediaVision::Common;
 using namespace mediavision::machine_learning::exception;
 using FaceDetectionTask = FaceDetectionAdapter<InputBaseType, OutputBaseType>;
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference.image",
+                                                                         "http://tizen.org/feature/vision.inference.face" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 int mv_face_detection_create(mv_face_detection_h *handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_NULL_ARG_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -60,7 +65,7 @@ int mv_face_detection_create(mv_face_detection_h *handle)
 
 int mv_face_detection_destroy(mv_face_detection_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -75,7 +80,7 @@ int mv_face_detection_destroy(mv_face_detection_h handle)
 int mv_face_detection_set_model(mv_face_detection_h handle, const char *model_name, const char *model_file,
                                                                const char *meta_file, const char *label_file)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(model_name);
@@ -99,7 +104,7 @@ int mv_face_detection_set_model(mv_face_detection_h handle, const char *model_na
 
 int mv_face_detection_set_engine(mv_face_detection_h handle, const char *backend_type, const char *device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(backend_type);
@@ -121,7 +126,7 @@ int mv_face_detection_set_engine(mv_face_detection_h handle, const char *backend
 
 int mv_face_detection_get_engine_count(mv_face_detection_h handle, unsigned int *engine_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_count);
@@ -142,7 +147,7 @@ int mv_face_detection_get_engine_count(mv_face_detection_h handle, unsigned int
 
 int mv_face_detection_get_engine_type(mv_face_detection_h handle, const unsigned int engine_index, char **engine_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -163,7 +168,7 @@ int mv_face_detection_get_engine_type(mv_face_detection_h handle, const unsigned
 
 int mv_face_detection_get_device_count(mv_face_detection_h handle, const char *engine_type, unsigned int *device_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(device_count);
@@ -185,7 +190,7 @@ int mv_face_detection_get_device_count(mv_face_detection_h handle, const char *e
 int mv_face_detection_get_device_type(mv_face_detection_h handle, const char *engine_type,
                                                                          const unsigned int device_index, char **device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -207,7 +212,7 @@ int mv_face_detection_get_device_type(mv_face_detection_h handle, const char *en
 
 int mv_face_detection_configure(mv_face_detection_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -226,7 +231,7 @@ int mv_face_detection_configure(mv_face_detection_h handle)
 
 int mv_face_detection_prepare(mv_face_detection_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -245,7 +250,7 @@ int mv_face_detection_prepare(mv_face_detection_h handle)
 
 int mv_face_detection_inference(mv_face_detection_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
@@ -267,7 +272,7 @@ int mv_face_detection_inference(mv_face_detection_h handle, mv_source_h source)
 
 int mv_face_detection_inference_async(mv_face_detection_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -291,7 +296,7 @@ int mv_face_detection_get_result(mv_face_detection_h handle, unsigned int *numbe
                                                                 unsigned long *frame_number, const float **confidences, const int **left,
                                                                 const int **top, const int **right, const int **bottom)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(number_of_objects);
        MEDIA_VISION_INSTANCE_CHECK(frame_number);
@@ -324,7 +329,7 @@ int mv_face_detection_get_result(mv_face_detection_h handle, unsigned int *numbe
 
 int mv_face_detection_get_label(mv_face_detection_h handle, const unsigned int index, const char **out_label)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(out_label);
 
index a86eff6..e336583 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "itask.h"
 #include "mv_object_detection_internal.h"
 #include "object_detection_adapter.h"
@@ -40,9 +41,13 @@ using namespace MediaVision::Common;
 using namespace mediavision::machine_learning::exception;
 using ObjectDetectionTask = ObjectDetectionAdapter<InputBaseType, OutputBaseType>;
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference.image",
+                                                                         "http://tizen.org/feature/vision.inference.face" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 int mv_object_detection_create(mv_object_detection_h *handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_NULL_ARG_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -60,7 +65,7 @@ int mv_object_detection_create(mv_object_detection_h *handle)
 
 int mv_object_detection_destroy(mv_object_detection_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -75,7 +80,7 @@ int mv_object_detection_destroy(mv_object_detection_h handle)
 int mv_object_detection_set_model(mv_object_detection_h handle, const char *model_name, const char *model_file,
                                                                  const char *meta_file, const char *label_file)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
@@ -95,7 +100,7 @@ int mv_object_detection_set_model(mv_object_detection_h handle, const char *mode
 
 int mv_object_detection_set_engine(mv_object_detection_h handle, const char *backend_type, const char *device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(backend_type);
@@ -117,7 +122,7 @@ int mv_object_detection_set_engine(mv_object_detection_h handle, const char *bac
 
 int mv_object_detection_get_engine_count(mv_object_detection_h handle, unsigned int *engine_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_count);
@@ -139,7 +144,7 @@ int mv_object_detection_get_engine_count(mv_object_detection_h handle, unsigned
 int mv_object_detection_get_engine_type(mv_object_detection_h handle, const unsigned int engine_index,
                                                                                char **engine_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -161,7 +166,7 @@ int mv_object_detection_get_engine_type(mv_object_detection_h handle, const unsi
 int mv_object_detection_get_device_count(mv_object_detection_h handle, const char *engine_type,
                                                                                 unsigned int *device_count)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(device_count);
@@ -183,7 +188,7 @@ int mv_object_detection_get_device_count(mv_object_detection_h handle, const cha
 int mv_object_detection_get_device_type(mv_object_detection_h handle, const char *engine_type,
                                                                                const unsigned int device_index, char **device_type)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -205,7 +210,7 @@ int mv_object_detection_get_device_type(mv_object_detection_h handle, const char
 
 int mv_object_detection_configure(mv_object_detection_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -224,7 +229,7 @@ int mv_object_detection_configure(mv_object_detection_h handle)
 
 int mv_object_detection_prepare(mv_object_detection_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        MEDIA_VISION_FUNCTION_ENTER();
@@ -243,7 +248,7 @@ int mv_object_detection_prepare(mv_object_detection_h handle)
 
 int mv_object_detection_inference(mv_object_detection_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -265,7 +270,7 @@ int mv_object_detection_inference(mv_object_detection_h handle, mv_source_h sour
 
 int mv_object_detection_inference_async(mv_object_detection_h handle, mv_source_h source)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
 
@@ -289,7 +294,7 @@ int mv_object_detection_get_result(mv_object_detection_h handle, unsigned int *n
                                                                   unsigned long *frame_number, const float **confidences, const int **left,
                                                                   const int **top, const int **right, const int **bottom)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(number_of_objects);
        MEDIA_VISION_INSTANCE_CHECK(frame_number);
@@ -322,7 +327,7 @@ int mv_object_detection_get_result(mv_object_detection_h handle, unsigned int *n
 
 int mv_object_detection_get_label(mv_object_detection_h handle, const unsigned int index, const char **label)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(label);
 
index df59dfa..cd02449 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "itask.h"
 #include "mv_object_detection_3d_internal.h"
 #include "object_detection_3d_adapter.h"
@@ -37,10 +38,13 @@ using namespace mediavision::machine_learning::exception;
 using ObjectDetection3dTask = ITask<ObjectDetection3dInput, ObjectDetection3dResult>;
 
 static mutex g_object_detection_3d_mutex;
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.inference.image",
+                                                                         "http://tizen.org/feature/vision.inference.face" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
 
 int mv_object_detection_3d_create(mv_object_detection_3d_h *handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_NULL_ARG_CHECK(handle);
 
@@ -69,7 +73,7 @@ int mv_object_detection_3d_destroy(mv_object_detection_3d_h handle)
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
@@ -92,7 +96,7 @@ int mv_object_detection_3d_set_model(mv_object_detection_3d_h handle, const char
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(model_name);
@@ -122,7 +126,7 @@ int mv_object_detection_3d_set_engine(mv_object_detection_3d_h handle, const cha
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(backend_type);
@@ -149,7 +153,7 @@ int mv_object_detection_3d_get_engine_count(mv_object_detection_3d_h handle, uns
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_count);
@@ -177,7 +181,7 @@ int mv_object_detection_3d_get_engine_type(mv_object_detection_3d_h handle, cons
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(engine_type);
@@ -205,7 +209,7 @@ int mv_object_detection_3d_get_device_count(mv_object_detection_3d_h handle, con
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(device_count);
@@ -233,7 +237,7 @@ int mv_object_detection_3d_get_device_type(mv_object_detection_3d_h handle, cons
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
@@ -262,7 +266,7 @@ int mv_object_detection_3d_configure(mv_object_detection_3d_h handle)
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
@@ -287,7 +291,7 @@ int mv_object_detection_3d_prepare(mv_object_detection_3d_h handle)
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
@@ -312,7 +316,7 @@ int mv_object_detection_3d_inference(mv_object_detection_3d_h handle, mv_source_
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_image_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
@@ -341,7 +345,7 @@ int mv_object_detection_3d_get_probability(mv_object_detection_3d_h handle, unsi
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(out_probability);
@@ -369,7 +373,7 @@ int mv_object_detection_3d_get_num_of_points(mv_object_detection_3d_h handle, un
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(out_num_of_points);
@@ -397,7 +401,7 @@ int mv_object_detection_3d_get_points(mv_object_detection_3d_h handle, unsigned
 {
        lock_guard<mutex> lock(g_object_detection_3d_mutex);
 
-       MEDIA_VISION_SUPPORT_CHECK(_mv_inference_face_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, true));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_NULL_ARG_CHECK(out_x);
index 5de7333..4e53cf8 100644 (file)
  */
 
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "mv_roi_tracker.h"
 #include "mv_roi_tracker_open.h"
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.roi_tracking" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 int mv_roi_tracker_create(mv_roi_tracker_h *handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_roi_tracking_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_NULL_ARG_CHECK(handle);
 
@@ -35,7 +39,7 @@ int mv_roi_tracker_create(mv_roi_tracker_h *handle)
 
 int mv_roi_tracker_destroy(mv_roi_tracker_h handle)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_roi_tracking_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
@@ -50,7 +54,7 @@ int mv_roi_tracker_destroy(mv_roi_tracker_h handle)
 
 int mv_roi_tracker_configure(mv_roi_tracker_h handle, mv_engine_config_h engine_config)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_roi_tracking_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(engine_config);
 
@@ -70,7 +74,7 @@ int mv_roi_tracker_configure(mv_roi_tracker_h handle, mv_engine_config_h engine_
 
 int mv_roi_tracker_prepare(mv_roi_tracker_h handle, int x, int y, int width, int height)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_roi_tracking_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(handle);
 
        if (x < 0 || y < 0 || width <= 0 || height <= 0) {
@@ -91,7 +95,7 @@ int mv_roi_tracker_prepare(mv_roi_tracker_h handle, int x, int y, int width, int
 int mv_roi_tracker_perform(mv_roi_tracker_h handle, mv_source_h source, mv_roi_tracker_tracked_cb tracked_cb,
                                                   void *user_data)
 {
-       MEDIA_VISION_SUPPORT_CHECK(_mv_roi_tracking_check_system_info_feature_supported());
+       MEDIA_VISION_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
 
        MEDIA_VISION_INSTANCE_CHECK(handle);
        MEDIA_VISION_INSTANCE_CHECK(source);
index 1facc76..edb7f9d 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "mv_surveillance_private.h"
 #include "mv_private.h"
+#include "mv_feature_key.h"
 #include "mv_surveillance_open.h"
 
 /**
 
 static size_t __mv_surveillance_id_counter = 0;
 
+static const char *feature_keys[] = { "http://tizen.org/feature/vision.face_recognition",
+                                                                         "http://tizen.org/feature/vision.image_recognition" };
+static const size_t num_keys = sizeof(feature_keys) / sizeof(char *);
+
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(event_type);
        MEDIA_VISION_NULL_ARG_CHECK(trigger);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -59,8 +63,7 @@ int mv_surveillance_event_trigger_create(const char *event_type, mv_surveillance
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(trigger);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -75,8 +78,7 @@ int mv_surveillance_event_trigger_destroy(mv_surveillance_event_trigger_h trigge
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(trigger);
        MEDIA_VISION_NULL_ARG_CHECK(event_type);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -91,8 +93,7 @@ int mv_surveillance_get_event_trigger_type(mv_surveillance_event_trigger_h trigg
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(trigger);
        MEDIA_VISION_NULL_ARG_CHECK(roi);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -128,8 +129,7 @@ int mv_surveillance_set_event_trigger_roi(mv_surveillance_event_trigger_h trigge
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(trigger);
        MEDIA_VISION_NULL_ARG_CHECK(number_of_points);
        MEDIA_VISION_NULL_ARG_CHECK(roi);
@@ -163,8 +163,7 @@ int mv_surveillance_subscribe_event_trigger(mv_surveillance_event_trigger_h even
                                                                                        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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(event_trigger);
        MEDIA_VISION_NULL_ARG_CHECK(callback);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -178,8 +177,7 @@ int mv_surveillance_subscribe_event_trigger(mv_surveillance_event_trigger_h even
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(event_trigger);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -191,8 +189,7 @@ int mv_surveillance_unsubscribe_event_trigger(mv_surveillance_event_trigger_h ev
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(source);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -204,8 +201,7 @@ int mv_surveillance_push_source(mv_source_h source, int video_stream_id)
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(callback);
        MEDIA_VISION_FUNCTION_ENTER();
 
@@ -218,8 +214,7 @@ int mv_surveillance_foreach_supported_event_type(mv_surveillance_event_type_cb c
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_NULL_ARG_CHECK(event_type);
        MEDIA_VISION_NULL_ARG_CHECK(callback);
        MEDIA_VISION_FUNCTION_ENTER();
@@ -233,8 +228,7 @@ int mv_surveillance_foreach_event_result_name(const char *event_type, mv_surveil
 
 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_SUPPORT_CHECK(mv_check_feature_key(feature_keys, num_keys, false));
        MEDIA_VISION_INSTANCE_CHECK(result);
        MEDIA_VISION_NULL_ARG_CHECK(value_name);
        MEDIA_VISION_NULL_ARG_CHECK(value);
index 1d9fd7f..8599845 100644 (file)
@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.13)
 add_executable(${PROJECT_NAME} assessment_barcode.cpp)
 target_link_libraries(${PROJECT_NAME} ${MV_BARCODE_DETECTOR_LIB_NAME}
                                       ${MV_BARCODE_GENERATOR_LIB_NAME}
+                                      ${MV_COMMON_LIB_NAME}
                                       dlog
                                       )
 
index 6f7aa7a..19709f4 100644 (file)
@@ -11,7 +11,7 @@ add_executable(${PROJECT_NAME} assessment_face.cpp)
 target_link_libraries(${PROJECT_NAME}
                     ${MV_FACE_LIB_NAME}
                     ${OpenCV_LIBRARIES}
-                    mv_common
+                    ${MV_COMMON_LIB_NAME}
                     dlog)
 
 install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
index c85f028..a9d9cff 100644 (file)
@@ -10,7 +10,7 @@ endif()
 add_executable(${PROJECT_NAME} assessment_surveillance.cpp)
 target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBRARIES}
                                     ${MV_SURVEILLANCE_LIB_NAME}
-                                    mv_common
+                                    ${MV_COMMON_LIB_NAME}
                                     dlog)
 
 install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})