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
#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,
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);
+++ /dev/null
-/*
- * 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_*/
-
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;
+++ /dev/null
-/*
- * 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;
-}
-
#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)
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 {