Remove unused color extracting related code 80/160380/2
authorhj kim <backto.kim@samsung.com>
Thu, 16 Nov 2017 02:01:05 +0000 (11:01 +0900)
committerhj kim <backto.kim@samsung.com>
Thu, 16 Nov 2017 02:01:27 +0000 (11:01 +0900)
Change-Id: Id1f2a162758e676ce18831adea85fba5d2eaf5b6

CMakeLists.txt
include/dcm_svc_db.h
include/dcm_svc_extract_color.h [deleted file]
src/dcm_svc_db.c
src/dcm_svc_extract_color.c [deleted file]
src/dcm_svc_internal.c

index bf0dbe9e9a8c2f486e022a1136ae607979784e2e..0ca234abf7370614468a22d3adaa98741f1f6c2d 100755 (executable)
@@ -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
index 36ba225c73b482b92853a44b664c97afcf6c2690..0c6141ca67f9ce30c2d25ac0df5f125e3411716c 100755 (executable)
 #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 (executable)
index f33b674..0000000
+++ /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 <dcm_svc_internal.h>
-
-int dcm_color_extract_process(dcm_svc_item_s *scan_item, dcm_image_info_s *image_info);
-
-#endif /*_DCM_SVC_COLOR_H_*/
-
index 5d6bb4d2dc0d774f11c8281f14797f066e297f8f..18957e958ed79504fb28075fc5ac2f876e291cee 100755 (executable)
@@ -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 (executable)
index bdad34f..0000000
+++ /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 <stdlib.h>
-#include <string.h>
-#include <image_util.h>
-#include <dcm_svc_db.h>
-#include <dcm_svc_debug.h>
-#include <dcm_svc_extract_color.h>
-
-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;
-}
-
index 29acf65a446847ddc91f68470645dd227332246a..d28afe93e7fa2d7d81f53236afe42d2d86a18d1a 100755 (executable)
@@ -24,7 +24,6 @@
 #include <dcm_svc_db.h>
 
 #include <dcm_svc_debug.h>
-#include <dcm_svc_extract_color.h>
 #include <dcm_svc_detect_face.h>
 
 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 {