MS_MSG_DB_UPDATE_BATCH_END, /**< End of media DB update batch */
MS_MSG_DIRECTORY_SCANNING, /**< Non recursive Directory Scan and Media DB Update*/
MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE,/**< Recursive Directory Scan and Media DB Update*/
- MS_MSG_BURSTSHOT_INSERT,
MS_MSG_BULK_INSERT, /**< Request bulk insert */
MS_MSG_STORAGE_ALL,
MS_MSG_STORAGE_PARTIAL,
int media_files_register(const char *list_path, insert_complete_cb user_callback, void *user_data, uid_t uid);
-int media_burstshot_register(const char *list_path, insert_complete_cb user_callback, void *user_data, uid_t uid);
-
/**
* @}
*/
return ret;
}
-
-int media_burstshot_register(const char *list_path, insert_complete_cb user_callback, void *user_data, uid_t uid)
-{
- int ret = MS_MEDIA_ERR_NONE;
-
- ret = __media_db_request_update_async(MS_MSG_BURSTSHOT_INSERT, NULL, list_path, user_callback, user_data, uid);
-
- MSAPI_DBG("client receive: %d", ret);
-
- return ret;
-}
-
typedef int (*SEND_DIR_UPDATE_NOTI)(void *, const char *, const char *, const char *, int, int, char **);
typedef int (*CHECK_ITEM_EXIST)(void*, const char *, const char *, bool *, char **);
typedef int (*INSERT_ITEM)(void *, const char *, const char *, int, uid_t, char **);
-typedef int (*INSERT_BURST_ITEM)(void *, const char *, const char *, int, uid_t, char **);
typedef int (*SET_ALL_STORAGE_ITEMS_VALIDITY)(void *, const char *, int, int, uid_t, char **);
typedef int (*SET_FOLDER_ITEM_VALIDITY)(void *, const char *, const char *, int, int, uid_t, char**);
typedef int (*SET_ITEM_VALIDITY)(void *, const char *, const char *, int, int, uid_t, char **);
typedef int (*DELETE_INVALID_FOLDER_BY_PATH)(void *, const char *, const char *, uid_t, char **);
typedef int (*CHECK_FOLDER_EXIST)(void*, const char*, const char*, char **);
typedef int (*GET_FOLDER_ID)(void *, const char *, const char *, char *, char **);
-typedef int (*GET_EXTRACT_LIST)(void*, const char*, int, int, const char*, int, uid_t, void*, char**);
-typedef int (*UPDATE_ONE_EXTRACT_ITEM)(void*, const char*, int, void*, int, char**);
+typedef int (*GET_EXTRACT_LIST)(void*, const char*, int, int, const char*, uid_t, void*, char**);
+typedef int (*UPDATE_ONE_EXTRACT_ITEM)(void*, const char*, int, void*, char**);
typedef int (*QUERY_DO_UPDATE_LIST)(void*, char**);
typedef int (*GET_MEDIA_TYPE)(void *, const char *, int *, char **);
int ms_cleanup_db(void **handle, uid_t uid);
int ms_validate_item(void **handle, const char *storage_id, const char *path, uid_t uid);
int ms_insert_item_batch(void **handle, const char *storage_id, const char *path, uid_t uid);
-int ms_insert_burst_item(void **handle, const char *storage_id, const char *path, uid_t uid);
int ms_validaty_change_all_items(void **handle, const char *storage_id, ms_user_storage_type_e storage_type, bool validity, uid_t uid);
bool ms_delete_invalid_items(void **handle, const char *storage_id, ms_user_storage_type_e storage_type, uid_t uid);
int ms_set_folder_item_validity(void **handle, const char *storage_id, const char *path, int validity, int recursive, uid_t uid);
void ms_update_start(void **handle);
void ms_update_end(void **handle, uid_t uid);
-int ms_get_extract_list(void** handle, const char* storage_id, int storage_type, int scan_type, const char* path, int burst, uid_t uid, void* array);
-int ms_update_one_extract_item(void** handle, const char* storage_id, int storage_type, void* data, int burst);
+int ms_get_extract_list(void** handle, const char* storage_id, int storage_type, int scan_type, const char* path, uid_t uid, void* array);
+int ms_update_one_extract_item(void** handle, const char* storage_id, int storage_type, void* data);
int ms_query_do_update_list(void** handle);
void ms_bacth_commit_enable(void* handle, bool ins_status, bool valid_status, bool noti_enable, int pid);
eSET_VALIDITY,
eDELETE_INVALID_ITEMS,
eSET_FOLDER_ITEM_VALIDITY,
- eINSERT_BURST,
eDELETE_FOLDER,
eSEND_DIR_UPDATE_NOTI,
eDELETE_ITEM,
"set_item_validity",
"delete_all_invalid_items_in_storage",
"set_folder_item_validity",
- "insert_burst_item",
"delete_all_invalid_items_in_folder",
"send_dir_update_noti",
"delete_item",
return res;
}
-int ms_get_extract_list(void** handle, const char* storage_id, int storage_type, int scan_type, const char* path, int burst, uid_t uid, void* array)
+int ms_get_extract_list(void** handle, const char* storage_id, int storage_type, int scan_type, const char* path, uid_t uid, void* array)
{
int lib_index;
int res = MS_MEDIA_ERR_NONE;
char *err_msg = NULL;
for (lib_index = 0; lib_index < lib_num; lib_index++) {
- ret = ((GET_EXTRACT_LIST)func_array[lib_index][eGET_EXTRACT_LIST])(handle[lib_index], storage_id, storage_type, scan_type, path, burst, uid, array, &err_msg); /*dlopen*/
+ ret = ((GET_EXTRACT_LIST)func_array[lib_index][eGET_EXTRACT_LIST])(handle[lib_index], storage_id, storage_type, scan_type, path, uid, array, &err_msg); /*dlopen*/
if (ret != 0) {
MS_DBG_ERR("error : %s [%s] %s", g_array_index(so_array, char*, lib_index), err_msg, path);
MS_SAFE_FREE(err_msg);
return res;
}
-int ms_update_one_extract_item(void** handle, const char* storage_id, int storage_type, void* data, int burst)
+int ms_update_one_extract_item(void** handle, const char* storage_id, int storage_type, void* data)
{
int lib_index;
int res = MS_MEDIA_ERR_NONE;
char *err_msg = NULL;
for (lib_index = 0; lib_index < lib_num; lib_index++) {
- ret = ((UPDATE_ONE_EXTRACT_ITEM)func_array[lib_index][eUPDATE_ONE_EXTRACT_ITEM])(handle[lib_index], storage_id, storage_type, data, burst, &err_msg); /*dlopen*/
+ ret = ((UPDATE_ONE_EXTRACT_ITEM)func_array[lib_index][eUPDATE_ONE_EXTRACT_ITEM])(handle[lib_index], storage_id, storage_type, data, &err_msg); /*dlopen*/
if (ret != 0) {
MS_DBG_ERR("error : %s [%s]", g_array_index(so_array, char*, lib_index), err_msg);
MS_SAFE_FREE(err_msg);
return res;
}
-int ms_insert_burst_item(void **handle, const char *storage_id, const char *path , uid_t uid)
-{
- int lib_index;
- int res = MS_MEDIA_ERR_NONE;
- int ret = MS_MEDIA_ERR_NONE;
- char *err_msg = NULL;
- ms_user_storage_type_e storage_type;
-
- ret = ms_user_get_storage_type(uid, path, &storage_type);
- MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "Fail to get storage type");
-
- for (lib_index = 0; lib_index < lib_num; lib_index++) {
- ret = ((INSERT_BURST_ITEM)func_array[lib_index][eINSERT_BURST])(handle[lib_index], storage_id, path, storage_type, uid, &err_msg); /*dlopen*/
- if (ret != 0) {
- MS_DBG_ERR("error : %s [%s] %s", g_array_index(so_array, char*, lib_index), err_msg, path);
- MS_SAFE_FREE(err_msg);
- res = MS_MEDIA_ERR_DB_INSERT_FAIL;
- }
- }
-
- return res;
-}
-
bool ms_delete_invalid_items(void **handle, const char *storage_id, ms_user_storage_type_e storage_type, uid_t uid)
{
int lib_index;
char *path;
} ms_item_info_s;
-static int __msc_folder_bulk_extract(void **handle, const char* storage_id, int storage_type, const char *path, int scan_type, int burst, int pid, uid_t uid, unsigned int *io_err_count, bool is_end);
+static int __msc_folder_bulk_extract(void **handle, const char* storage_id, int storage_type, const char *path, int scan_type, int pid, uid_t uid, unsigned int *io_err_count, bool is_end);
int msc_init_extract_thread()
{
return MS_MEDIA_ERR_NONE;
}
-int __msc_folder_bulk_extract(void **handle, const char* storage_id, int storage_type, const char *path, int scan_type, int burst, int pid, uid_t uid, unsigned int *io_err_count, bool is_end)
+int __msc_folder_bulk_extract(void **handle, const char* storage_id, int storage_type, const char *path, int scan_type, int pid, uid_t uid, unsigned int *io_err_count, bool is_end)
{
MS_DBG_WARN("begin of __msc_folder_bulk_extract");
int ret = MS_MEDIA_ERR_NONE;
int extract_count = 0;
int sleep_count = 0;
- ret = ms_get_extract_list(handle, storage_id, storage_type, scan_type, path, burst, uid, (void*)&data_array);
+ ret = ms_get_extract_list(handle, storage_id, storage_type, scan_type, path, uid, (void*)&data_array);
if (ret != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("ms_get_extract_list failed!!!");
return MS_MEDIA_ERR_NONE;
db_data = g_array_index(data_array, ms_item_info_s*, 0);
g_array_remove_index(data_array, 0);
- tmp_ret = ms_update_one_extract_item(handle, storage_id, storage_type, db_data, burst);
+ tmp_ret = ms_update_one_extract_item(handle, storage_id, storage_type, db_data);
if (tmp_ret == MS_MEDIA_ERR_NONE)
extract_count++;
else if (tmp_ret == MS_MEDIA_ERR_FILE_IO)
goto NEXT;
}
- ret = __msc_folder_bulk_extract(handle, extract_data->storage_id, storage_type, update_path, scan_type, end_flag, extract_data->pid, uid, &io_err_count, end_flag);
+ ret = __msc_folder_bulk_extract(handle, extract_data->storage_id, storage_type, update_path, scan_type, extract_data->pid, uid, &io_err_count, end_flag);
NEXT:
g_directory_extract_processing = false;
}
/*extract meta*/
- ret = __msc_folder_bulk_extract(handle, extract_data->storage_id, storage_type, update_path, scan_type, end_flag, extract_data->pid, uid, &io_err_count, end_flag);
+ ret = __msc_folder_bulk_extract(handle, extract_data->storage_id, storage_type, update_path, scan_type, extract_data->pid, uid, &io_err_count, end_flag);
MS_DBG_WARN("extract PAUSE");
__msc_pause_extract();
MS_DBG_WARN("extract RESUME");
static int __msc_check_stop_status(int scan_type, const char *start_path, int pid);
static int __msc_db_update(void **handle, const char *storage_id, const ms_comm_msg_s * scan_data);
static int __msc_make_file_list(char *file_path, GArray **path_array, uid_t uid);
-static int __msc_batch_insert(ms_msg_type_e current_msg, int pid, GArray *path_array, uid_t uid);
+static int __msc_batch_insert(int pid, GArray *path_array, uid_t uid);
static int __msc_pop_register_request(GArray *register_array, ms_comm_msg_s **register_data);
static int __msc_clear_file_list(GArray *path_array);
static void __msc_insert_register_request(GArray *register_array, ms_comm_msg_s *insert_data);
if (insert_data->pid == POWEROFF)
g_array_prepend_val(register_array, insert_data);
- else if (insert_data->msg_type == MS_MSG_BURSTSHOT_INSERT)
- g_array_prepend_val(register_array, insert_data);
else
g_array_append_val(register_array, insert_data);
return res;
}
-static int __msc_batch_insert(ms_msg_type_e current_msg, int pid, GArray *path_array, uid_t uid)
+static int __msc_batch_insert(int pid, GArray *path_array, uid_t uid)
{
int err;
unsigned int i;
void **handle = NULL;
char *insert_path = NULL;
- int (*insert_function)(void **, const char*, const char*, uid_t) = NULL;
char storage_id[MS_UUID_SIZE] = {0,};
bool power_off_status = FALSE;
- insert_function = (current_msg == MS_MSG_BULK_INSERT) ? ms_insert_item_batch : ms_insert_burst_item;
-
/* connect to media db, if conneting is failed, db updating is stopped */
err = ms_connect_db(&handle, uid);
if (err != MS_MEDIA_ERR_NONE)
}
/* insert to db */
- err = insert_function(handle, storage_id, insert_path, uid);
+ err = ms_insert_item_batch(handle, storage_id, insert_path, uid);
msc_get_power_status(&power_off_status);
if (power_off_status) {
char *file_path = NULL;
int ret;
int pid = 0;
- ms_msg_type_e current_msg = MS_MSG_MAX;
uid_t uid = MEDIA_DEFAULT_UID;
ms_comm_msg_s *msg_data = NULL;
}
/* check current request */
- current_msg = register_data->msg_type;
pid = register_data->pid;
uid = register_data->uid;
- if ((current_msg != MS_MSG_BULK_INSERT) &&
- (current_msg != MS_MSG_BURSTSHOT_INSERT)) {
+ if (register_data->msg_type != MS_MSG_BULK_INSERT) {
MS_DBG_ERR("wrong message type");
goto FREE_RESOURCE;
}
goto FREE_RESOURCE;
}
- ret = __msc_batch_insert(current_msg, pid, path_array, uid);
+ ret = __msc_batch_insert(pid, path_array, uid);
FREE_RESOURCE:
/*Active flush */
switch (req_num) {
case MS_MSG_BULK_INSERT:
- case MS_MSG_BURSTSHOT_INSERT:
{
MS_DBG_INFO("BULK INSERT");
/* request bulk insert*/
if (insert_data->pid == POWEROFF)
g_array_prepend_val(register_array, insert_data);
- else if (insert_data->msg_type == MS_MSG_BURSTSHOT_INSERT)
- g_array_prepend_val(register_array, insert_data);
else
g_array_append_val(register_array, insert_data);
}
return ret;
}
-static int __msc_batch_insert(ms_msg_type_e current_msg, int pid, GArray *path_array, uid_t uid)
+static int __msc_batch_insert(int pid, GArray *path_array, uid_t uid)
{
int err;
unsigned int i;
void **handle = NULL;
char *insert_path = NULL;
- int (*insert_function)(void **, const char*, const char*, uid_t) = NULL;
char storage_id[MS_UUID_SIZE] = {0,};
- insert_function = (current_msg == MS_MSG_BULK_INSERT) ? ms_insert_item_batch : ms_insert_burst_item;
-
/* connect to media db, if conneting is failed, db updating is stopped */
err = ms_connect_db(&handle, uid);
if (err != MS_MEDIA_ERR_NONE)
}
/* insert to db */
- err = insert_function(handle, storage_id, insert_path, uid);
+ err = ms_insert_item_batch(handle, storage_id, insert_path, uid);
if (power_off) {
MS_DBG_ERR("power off");
char *file_path = NULL;
int ret = MS_MEDIA_ERR_NONE;
int pid = 0;
- ms_msg_type_e current_msg = MS_MSG_MAX;
ms_comm_msg_s *msg_data = NULL;
/*create array for processing overlay data*/
}
/* check current request */
- current_msg = register_data->msg_type;
pid = register_data->pid;
- if ((current_msg != MS_MSG_BULK_INSERT) &&
- (current_msg != MS_MSG_BURSTSHOT_INSERT)) {
+ if (register_data->msg_type != MS_MSG_BULK_INSERT) {
MS_DBG_ERR("wrong message type");
goto FREE_RESOURCE;
}
goto FREE_RESOURCE;
}
- ret = __msc_batch_insert(current_msg, pid, path_array, register_data->uid);
+ ret = __msc_batch_insert(pid, path_array, register_data->uid);
FREE_RESOURCE:
/*Active flush */
switch (req_num) {
case MS_MSG_BULK_INSERT:
- case MS_MSG_BURSTSHOT_INSERT:
{
MS_DBG_INFO("BULK INSERT");
/* request bulk insert*/
if (req_num == MS_MSG_DIRECTORY_SCANNING
|| req_num == MS_MSG_BULK_INSERT
|| req_num == MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE
- || req_num == MS_MSG_BURSTSHOT_INSERT
|| req_num == MS_MSG_DIRECTORY_SCANNING_CANCEL) {
if ((ret = ms_send_scan_request(&recv_msg, client_sock)) != MS_MEDIA_ERR_NONE) {
res = ret;
res_msg.msg_type = MS_MSG_SCANNER_RESULT;
break;
case MS_MSG_BULK_INSERT:
- case MS_MSG_BURSTSHOT_INSERT:
res_msg.msg_type = MS_MSG_SCANNER_BULK_RESULT;
break;
case MS_MSG_MEDIA_DB_MALFORMED: