#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();
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();
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();
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();
// 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();
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();
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();
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();
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();
#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);
#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);
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();
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)
--- /dev/null
+/*
+ * 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__ */
#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 */
#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();
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();
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();
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);
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();
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);
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();
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();
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();
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");
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();
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();
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();
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();
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);
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);
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);
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);
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);
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);
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);
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();
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 {
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 {
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);
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);
--- /dev/null
+/*
+ * 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;
+}
+++ /dev/null
-/**
- * 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
*/
#include "mv_private.h"
+#include "mv_feature_key.h"
#include "mv_face.h"
#include "mv_face_open.h"
* @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;
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);
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);
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);
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);
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);
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();
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();
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);
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) {
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) {
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);
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();
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();
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);
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();
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();
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);
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);
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) {
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) {
*/
#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);
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);
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();
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();
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);
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);
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();
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);
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);
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) {
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) {
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();
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);
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();
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();
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);
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) {
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) {
#include <mutex>
#include "mv_private.h"
+#include "mv_feature_key.h"
#include "context.h"
#include "machine_learning_exception.h"
#include "face_recognition_adapter.h"
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
*/
#include "mv_private.h"
+#include "mv_feature_key.h"
#include "itask.h"
#include "mv_image_classification_internal.h"
#include "image_classification_adapter.h"
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();
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();
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();
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();
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);
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);
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);
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);
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);
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);
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);
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);
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);
*/
#include "mv_private.h"
+#include "mv_feature_key.h"
#include "itask.h"
#include "mv_selfie_segmentation_type.h"
#include "mv_selfie_segmentation_internal.h"
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();
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();
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);
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);
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);
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);
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);
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);
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();
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();
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);
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);
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);
*/
#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();
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();
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);
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();
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();
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);
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);
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);
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);
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);
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);
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);
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);
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);
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();
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();
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);
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);
*/
#include "mv_private.h"
+#include "mv_feature_key.h"
#include "itask.h"
#include "mv_facial_landmark_internal.h"
#include "facial_landmark_adapter.h"
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();
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();
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);
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);
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);
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);
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);
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);
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();
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();
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);
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);
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);
*/
#include "mv_private.h"
+#include "mv_feature_key.h"
#include "itask.h"
#include "mv_pose_landmark_internal.h"
#include "pose_landmark_adapter.h"
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();
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();
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);
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);
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);
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);
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);
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);
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();
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();
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);
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);
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);
*/
#include "mv_private.h"
+#include "mv_feature_key.h"
#include "itask.h"
#include "mv_face_detection_internal.h"
#include "face_detection_adapter.h"
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();
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();
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);
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);
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);
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);
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);
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);
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();
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();
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);
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);
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);
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);
*/
#include "mv_private.h"
+#include "mv_feature_key.h"
#include "itask.h"
#include "mv_object_detection_internal.h"
#include "object_detection_adapter.h"
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();
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();
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);
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);
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);
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);
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);
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);
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();
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();
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);
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);
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);
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);
*/
#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"
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
{
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);
*/
#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);
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);
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);
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) {
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);
#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();
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();
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();
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();
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);
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();
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();
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();
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();
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();
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);
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
)
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})
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})