From: Inki Dae Date: Tue, 25 Jul 2023 02:00:58 +0000 (+0900) Subject: common: clean up to mv_private.h file X-Git-Tag: accepted/tizen/unified/20230809.071949^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c69018d1e417729ab14c7400e442073badaa2527;p=platform%2Fcore%2Fapi%2Fmediavision.git common: clean up to mv_private.h file [Issue type] : code cleanup Clean up mv_private.h by dropping unnecessary inclusions and by moving mv_private.h from include/ to mv_common/include/. There is no reason for the header file should exist in include directory because it is used by internal framework code only. Change-Id: I4160942cd4966eb4104393e4193d5dfb30ed3691 Signed-off-by: Inki Dae --- diff --git a/include/mv_pose_landmark_internal.h b/include/mv_pose_landmark_internal.h index 8543bb6e..617869cb 100644 --- a/include/mv_pose_landmark_internal.h +++ b/include/mv_pose_landmark_internal.h @@ -18,7 +18,6 @@ #define __MEDIA_VISION_POSE_LANDMARK_INTERNAL_H__ #include -#include #include #ifdef __cplusplus diff --git a/include/mv_private.h b/include/mv_private.h deleted file mode 100644 index 94c5a7ba..00000000 --- a/include/mv_private.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __TIZEN_MEDIA_VISION_PRIVATE_H__ -#define __TIZEN_MEDIA_VISION_PRIVATE_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include -#include - -#ifdef LOG_TAG -#undef LOG_TAG -#endif - -#define LOG_TAG "TIZEN_MEDIA_VISION" - -#define MEDIA_VISION_FUNCTION_ENTER() LOGI("[%s] ", __FUNCTION__) - -#define MEDIA_VISION_FUNCTION_LEAVE() LOGI("[%s] ", __FUNCTION__) - -#define MEDIA_VISION_ASSERT(function, msg) \ - do { \ - int error_code = function; \ - if (error_code != MEDIA_VISION_ERROR_NONE) { \ - LOGE("%s(0x%08x)", msg, error_code); \ - return error_code; \ - } \ - } while (0) - -#define MEDIA_VISION_CHECK_CONDITION(condition, error, msg) \ - do { \ - if (!(condition)) { \ - LOGE("[%s] %s(0x%08x)", __FUNCTION__, msg, error); \ - return error; \ - } \ - } while (0) - -#define MEDIA_VISION_INSTANCE_CHECK(arg) \ - MEDIA_VISION_CHECK_CONDITION((arg), MEDIA_VISION_ERROR_INVALID_PARAMETER, "MEDIA_VISION_ERROR_INVALID_PARAMETER") - -#define MEDIA_VISION_NULL_ARG_CHECK(arg) \ - MEDIA_VISION_CHECK_CONDITION((arg), MEDIA_VISION_ERROR_INVALID_PARAMETER, "MEDIA_VISION_ERROR_INVALID_PARAMETER") - -#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_image_check_system_info_feature_supported(void); -bool _mv_inference_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 */ - -#endif /* __TIZEN_MEDIA_VISION_PRIVATE_H__ */ diff --git a/mv_common/include/mv_private.h b/mv_common/include/mv_private.h new file mode 100644 index 00000000..94c5a7ba --- /dev/null +++ b/mv_common/include/mv_private.h @@ -0,0 +1,80 @@ +/* + * 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. + */ + +#ifndef __TIZEN_MEDIA_VISION_PRIVATE_H__ +#define __TIZEN_MEDIA_VISION_PRIVATE_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include +#include + +#ifdef LOG_TAG +#undef LOG_TAG +#endif + +#define LOG_TAG "TIZEN_MEDIA_VISION" + +#define MEDIA_VISION_FUNCTION_ENTER() LOGI("[%s] ", __FUNCTION__) + +#define MEDIA_VISION_FUNCTION_LEAVE() LOGI("[%s] ", __FUNCTION__) + +#define MEDIA_VISION_ASSERT(function, msg) \ + do { \ + int error_code = function; \ + if (error_code != MEDIA_VISION_ERROR_NONE) { \ + LOGE("%s(0x%08x)", msg, error_code); \ + return error_code; \ + } \ + } while (0) + +#define MEDIA_VISION_CHECK_CONDITION(condition, error, msg) \ + do { \ + if (!(condition)) { \ + LOGE("[%s] %s(0x%08x)", __FUNCTION__, msg, error); \ + return error; \ + } \ + } while (0) + +#define MEDIA_VISION_INSTANCE_CHECK(arg) \ + MEDIA_VISION_CHECK_CONDITION((arg), MEDIA_VISION_ERROR_INVALID_PARAMETER, "MEDIA_VISION_ERROR_INVALID_PARAMETER") + +#define MEDIA_VISION_NULL_ARG_CHECK(arg) \ + MEDIA_VISION_CHECK_CONDITION((arg), MEDIA_VISION_ERROR_INVALID_PARAMETER, "MEDIA_VISION_ERROR_INVALID_PARAMETER") + +#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_image_check_system_info_feature_supported(void); +bool _mv_inference_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 */ + +#endif /* __TIZEN_MEDIA_VISION_PRIVATE_H__ */ diff --git a/mv_machine_learning/inference/src/mv_inference_open.cpp b/mv_machine_learning/inference/src/mv_inference_open.cpp index aa717570..612f2134 100644 --- a/mv_machine_learning/inference/src/mv_inference_open.cpp +++ b/mv_machine_learning/inference/src/mv_inference_open.cpp @@ -14,7 +14,6 @@ * limitations under the License. */ -#include "mv_private.h" #include "mv_inference_open.h" #include "Inference.h"