From: hj kim Date: Thu, 16 Nov 2017 02:01:05 +0000 (+0900) Subject: Remove unused color extracting related code X-Git-Tag: submit/tizen/20171120.082013~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59446e2aa55329b57a01232d745481eb7de78369;p=platform%2Fcore%2Fmultimedia%2Fdcm-service.git Remove unused color extracting related code Change-Id: Id1f2a162758e676ce18831adea85fba5d2eaf5b6 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index bf0dbe9..0ca234a 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,6 @@ SET(DCMSVC-LIB "dcm-service") SET(DCMFACE-LIB "dcm-face") SET(DCMUTIL-LIB "dcm-util") SET(SRCS - src/dcm_svc_extract_color.c src/dcm_svc_db.c src/dcm_svc_detect_face.c src/dcm_svc_ipc.c diff --git a/include/dcm_svc_db.h b/include/dcm_svc_db.h index 36ba225..0c6141c 100755 --- a/include/dcm_svc_db.h +++ b/include/dcm_svc_db.h @@ -35,13 +35,6 @@ #define SELECT_SCAN_INFO_BY_MEDIA_ID "SELECT modified_time FROM "DB_TABLE_FACE_SCAN_LIST" WHERE media_uuid = '%q';" #define INSERT_FACE_ITEM_TO_DB "INSERT OR IGNORE INTO " DB_TABLE_FACE" (" FACE_ITEM") VALUES ('%q', %d, %d, %d, %d, %d);" -typedef struct { - char *media_uuid; - unsigned char rgb_r; - unsigned char rgb_g; - unsigned char rgb_b; -} dcm_color_item_s; - typedef enum { FACE_SCAN_NEEDED = 0, FACE_SCAN_NO_NEEDED = 1, @@ -54,7 +47,6 @@ int dcm_svc_db_connect(uid_t uid); int dcm_svc_db_disconnect(); int dcm_svc_db_get_scan_image_info_by_path(const char *file_path, dcm_svc_item_s **scan_item); int dcm_svc_db_insert_face_to_db(const char *media_uuid, unsigned int x, unsigned int y, unsigned int w, unsigned int h, int orientation); -int dcm_svc_db_update_color_to_db(const dcm_color_item_s color); int dcm_svc_db_insert_face_to_face_scan_list(dcm_svc_item_s *scan_item); int dcm_svc_db_delete_face_from_db(const char *media_uuid); int dcm_svc_db_check_scanned_by_media_uuid(const char *media_uuid, time_t modified_time, dcm_face_scan_status_e *scan_status); diff --git a/include/dcm_svc_extract_color.h b/include/dcm_svc_extract_color.h deleted file mode 100755 index f33b674..0000000 --- a/include/dcm_svc_extract_color.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2000 - 2011 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 _DCM_SVC_COLOR_H_ -#define _DCM_SVC_COLOR_H_ - -#include - -int dcm_color_extract_process(dcm_svc_item_s *scan_item, dcm_image_info_s *image_info); - -#endif /*_DCM_SVC_COLOR_H_*/ - diff --git a/src/dcm_svc_db.c b/src/dcm_svc_db.c index 5d6bb4d..18957e9 100755 --- a/src/dcm_svc_db.c +++ b/src/dcm_svc_db.c @@ -231,33 +231,6 @@ int dcm_svc_db_delete_face_from_db(const char *media_uuid) return ret; } -int dcm_svc_db_update_color_to_db(dcm_color_item_s color) -{ - int ret = MS_MEDIA_ERR_NONE; - - dcm_debug_fenter(); -#if 0 - char* query_string = NULL; - - dcm_retvm_if(db_handle == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "Invalid db_handle"); - dcm_retvm_if(color.media_uuid == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "Invalid media_uuid"); - - query_string = sqlite3_mprintf(UPDATE_COLOR_ITEM_TO_DB, (int)(color.rgb_r), (int)(color.rgb_g), (int)(color.rgb_b), color.media_uuid); - dcm_debug("query is %s", query_string); - - g_mutex_trylock(&gMutexLock); - ret = media_db_request_update_db(query_string, dcm_uid); - if (ret != MS_MEDIA_ERR_NONE) - dcm_error("media_db_request_update_db fail = %d, %s", ret, sqlite3_errmsg((sqlite3 *)db_handle)); - g_mutex_unlock(&gMutexLock); - - DCM_SQLITE3_FREE(query_string); -#endif - dcm_debug_fleave(); - - return ret; -} - int dcm_svc_db_check_scanned_by_media_uuid(const char *media_uuid, time_t modified_time, dcm_face_scan_status_e *scan_status) { int ret = MS_MEDIA_ERR_NONE; diff --git a/src/dcm_svc_extract_color.c b/src/dcm_svc_extract_color.c deleted file mode 100755 index bdad34f..0000000 --- a/src/dcm_svc_extract_color.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2000 - 2011 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 -#include -#include -#include -#include -#include - -int dcm_color_extract_process(dcm_svc_item_s *scan_item, dcm_image_info_s *image_info) -{ - DCM_CHECK_VAL(scan_item, MS_MEDIA_ERR_INVALID_PARAMETER); - DCM_CHECK_VAL(image_info, MS_MEDIA_ERR_INVALID_PARAMETER); - DCM_CHECK_VAL(image_info->pixel, MS_MEDIA_ERR_INVALID_PARAMETER); - - dcm_debug_fenter(); -#if 0 - int ret = IMAGE_UTIL_ERROR_NONE; - dcm_color_item_s colorItem = {0,}; - memset(&colorItem, 0, sizeof(dcm_color_item_s)); - - // Extracting color supports only RGB888 format - ret = image_util_extract_color_from_memory(image_info->pixel, image_info->buffer_width, image_info->buffer_height, &(colorItem.rgb_r), &(colorItem.rgb_g), &(colorItem.rgb_b)); - if (ret != IMAGE_UTIL_ERROR_NONE) { - dcm_error("image_util_extract_color_from_memory err= %d", ret); - return MS_MEDIA_ERR_INTERNAL; - } - - dcm_debug("image_util_extract_color_from_memory result r:%02x, g:%02x, b:%02x", colorItem.rgb_r, colorItem.rgb_g, colorItem.rgb_b); - - colorItem.media_uuid = g_strdup(scan_item->media_uuid); - ret = dcm_svc_db_update_color_to_db(colorItem); - if (ret != MS_MEDIA_ERR_NONE) { - dcm_error("Failed to update color item into db! err: %d", ret); - return MS_MEDIA_ERR_DB_INTERNAL; - } -#endif - dcm_debug_fleave(); - - return MS_MEDIA_ERR_NONE; -} - diff --git a/src/dcm_svc_internal.c b/src/dcm_svc_internal.c index 29acf65..d28afe9 100755 --- a/src/dcm_svc_internal.c +++ b/src/dcm_svc_internal.c @@ -24,7 +24,6 @@ #include #include -#include #include static int __dcm_scan_process(dcm_svc_item_s *scan_item) @@ -87,13 +86,6 @@ static int __dcm_scan_process(dcm_svc_item_s *scan_item) if (ret != MS_MEDIA_ERR_NONE) dcm_error("Failed to process face detection! err: %d", ret); -#if 0 - /* Process color extract */ - ret = dcm_color_extract_process(scan_item, &image_info); - if (ret != MS_MEDIA_ERR_NONE) - dcm_error("Failed to process color extraction! err: %d", ret); -#endif - /* Free image buffer */ DCM_SAFE_FREE(image_info.pixel); } else {