TS1=utc_audio_svc_add_item_to_playlist_func\r
TS2=utc_audio_svc_add_playlist_func\r
TS3=utc_audio_svc_check_duplicate_insertion_in_playlist_func\r
-#TS4=utc_audio_svc_close_func\r
TS5=utc_audio_svc_get_playlist_func\r
TS7=utc_audio_svc_count_group_item_func\r
TS8=utc_audio_svc_count_list_item_func\r
TS31=utc_audio_svc_list_item_get_val_func\r
TS32=utc_audio_svc_list_item_new_func\r
TS34=utc_audio_svc_move_item_func\r
-#TS35=utc_audio_svc_open_func\r
TS36=utc_audio_svc_playlist_free_func\r
TS37=utc_audio_svc_playlist_get_item_func\r
TS38=utc_audio_svc_playlist_get_val_func\r
+++ /dev/null
-/*\r
- * libmedia-service\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-\r
-\r
-/**\r
-* @file utc_audio_svc_close_func.c\r
-* @brief This is a suit of unit test cases to test audio_svc_close API function\r
-* @author \r
-* @version Initial Creation Version 0.1\r
-* @date 2010-09-13\r
-*/\r
-\r
-#include "utc_audio_svc_close_func.h"\r
-\r
-void startup()\r
-{\r
- UTC_AUDIO_SVC_OPEN();\r
-}\r
-\r
-\r
-/**\r
-* @brief This tests int audio_svc_close() API with valid parameter\r
-* Create a player handle with valid parameter & Test the handle by playing\r
-* @par ID utc_audio_svc_close_func_01\r
-* @param [in] &player = handle of player to be populated\r
-* @return This function returns zero on success, or negative value with error code\r
-*/\r
-void utc_audio_svc_close_func_01()\r
-{\r
- int ret = AUDIO_SVC_ERROR_NONE;\r
-\r
- ret = audio_svc_close();\r
- dts_check_eq("audio_svc_close", ret, AUDIO_SVC_ERROR_NONE, "fail to close music db.");\r
-\r
-}\r
-\r
-#if 0\r
-/**\r
-* @brief This tests int audio_svc_close() API with invalid parameter\r
-* Create a player handle with a NULL out param\r
-* @par ID utc_audio_svc_close_func_02\r
-* @param [in] &player = NULL\r
-* @return error code on success \r
-*/\r
-void utc_audio_svc_close_func_02()\r
-{ \r
- int ret = AUDIO_SVC_ERROR_NONE;\r
- UTC_AUDIO_SVC_OPEN();\r
- ret = audio_svc_close();\r
- if (!ret)\r
- {\r
- UTC_MM_LOG("abnormal condition test for null, error code->%x", ret);\r
- tet_result(TET_PASS);\r
- }\r
- else\r
- {\r
- UTC_MM_LOG("Closing music db should be failed because of the NULL out parameter.");\r
- tet_result(TET_FAIL);\r
- }\r
-\r
- return ;\r
-}\r
-#endif\r
+++ /dev/null
-/*\r
- * libmedia-service\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-\r
-\r
-/**\r
-* @file utc_audio_svc_close_func.h\r
-* @author \r
-* @brief This is the implementaion file for the test case of audio_svc_close API function\r
-* @version Initial Creation Version 0.1\r
-* @date 2010-09-13\r
-*/\r
-\r
-#ifndef __UTS_AUDIO_SVC_CLOSE_FUNC_H_\r
-#define __UTS_AUDIO_SVC_CLOSE_FUNC_H_\r
-\r
-\r
-#include "utc_audio_svc_common.h"\r
-\r
-\r
-void startup();\r
-\r
-/* Initialize TCM data structures */\r
-void (*tet_startup)() = startup;\r
-void (*tet_cleanup)() = NULL;\r
-\r
-void utc_audio_svc_close_func_01();\r
-//void utc_audio_svc_close_func_02();\r
-\r
-struct tet_testlist tet_testlist[] = {\r
- {utc_audio_svc_close_func_01, 1},\r
-// {utc_audio_svc_close_func_02, 2}, \r
- {NULL, 0}\r
-};\r
-\r
-\r
-#endif //__UTS_AUDIO_SVC_CLOSE_FUNC_H_ \r
+++ /dev/null
-/*\r
- * libmedia-service\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-\r
-\r
-/**\r
-* @file utc_audio_svc_create_table_func.c\r
-* @brief This is a suit of unit test cases to test audio_svc_create_table API function\r
-* @author \r
-* @version Initial Creation Version 0.1\r
-* @date 2010-09-13\r
-*/\r
-\r
-#include "utc_audio_svc_create_table_func.h"\r
-\r
-void startup()\r
-{\r
- UTC_AUDIO_SVC_OPEN();\r
-}\r
-\r
-\r
-void cleanup()\r
-{\r
- UTC_AUDIO_SVC_CLOSE();\r
-}\r
-\r
-/**\r
-* @brief This tests int audio_svc_create_table() API with valid parameter\r
-* Create a player handle with valid parameter & Test the handle by playing\r
-* @par ID utc_audio_svc_create_table_func_01\r
-* @param [in] &player = handle of player to be populated\r
-* @return This function returns zero on success, or negative value with error code\r
-*/\r
-void utc_audio_svc_create_table_func_01()\r
-{\r
- int ret = AUDIO_SVC_ERROR_NONE;\r
- \r
- ret = audio_svc_create_table(db_handle);\r
- dts_check_eq("audio_svc_create_table", ret, AUDIO_SVC_ERROR_NONE, "unable to create music phone table.");\r
-\r
-}\r
-\r
-#if 0\r
-/**\r
-* @brief This tests int audio_svc_create_table() API with invalid parameter\r
-* Create a player handle with a NULL out param\r
-* @par ID utc_audio_svc_create_table_func_02\r
-* @param [in] &player = NULL\r
-* @return error code on success \r
-*/\r
-void utc_audio_svc_create_table_func_02()\r
-{ \r
- int ret = AUDIO_SVC_ERROR_NONE;\r
- \r
- ret = audio_svc_create_table();\r
- \r
- if (ret != AUDIO_SVC_ERROR_NONE)\r
- {\r
- dts_pass("audio_svc_create_table","abnormal condition test for invalid storage type parameter.");\r
- }\r
- else\r
- {\r
- dts_fail("audio_svc_create_table","create music table should be failed because of the invalid storage type.");\r
- }\r
-\r
-}\r
-#endif\r
+++ /dev/null
-/*\r
- * libmedia-service\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-\r
-\r
-/**\r
-* @file utc_audio_svc_open_func.c\r
-* @brief This is a suit of unit test cases to test audio_svc_open API function\r
-* @author \r
-* @version Initial Creation Version 0.1\r
-* @date 2010-09-13\r
-*/\r
-#include "utc_audio_svc_open_func.h"\r
-\r
-\r
-void cleanup()\r
-{\r
- UTC_AUDIO_SVC_CLOSE();\r
-}\r
-\r
-/**\r
-* @brief This tests int audio_svc_open() API with valid parameter\r
-* Create a player handle with valid parameter & Test the handle by playing\r
-* @par ID utc_audio_svc_open_func_01\r
-* @param [in] &player = handle of player to be populated\r
-* @return This function returns zero on success, or negative value with error code\r
-*/\r
-void utc_audio_svc_open_func_01()\r
-{\r
- int ret = AUDIO_SVC_ERROR_NONE;\r
-\r
- ret = audio_svc_open();\r
- dts_check_eq("audio_svc_open", ret, AUDIO_SVC_ERROR_NONE, "failed to open music db.");\r
-\r
-}\r
-\r
-#if 0 //there is no abnormal case\r
-/**\r
-* @brief This tests int audio_svc_open() API with invalid parameter\r
-* Create a player handle with a NULL out param\r
-* @par ID utc_audio_svc_open_func_02\r
-* @param [in] &player = NULL\r
-* @return error code on success \r
-*/\r
-void utc_audio_svc_open_func_02()\r
-{ \r
- int ret = AUDIO_SVC_ERROR_NONE;\r
-\r
- ret = audio_svc_open();\r
- \r
- if (ret != AUDIO_SVC_ERROR_NONE)\r
- {\r
- UTC_MM_LOG("abnormal condition test for null, error code->%d", ret);\r
- tet_result(TET_PASS);\r
- }\r
- else\r
- {\r
- UTC_MM_LOG("Open music db should be failed because of the NULL out parameter.");\r
- tet_result(TET_FAIL);\r
- }\r
-\r
- return ;\r
-}\r
-#endif\r
+++ /dev/null
-/*\r
- * libmedia-service\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-\r
-/**\r
-* @file utc_audio_svc_open_func.h\r
-* @author \r
-* @brief This is the implementaion file for the test case of audio_svc_open API function\r
-* @version Initial Creation Version 0.1\r
-* @date 2010-09-13\r
-*/\r
-\r
-#ifndef __UTS_AUDIO_SVC_OPEN_FUNC_H_\r
-#define __UTS_AUDIO_SVC_OPEN_FUNC_H_\r
-\r
-\r
-#include "utc_audio_svc_common.h"\r
-\r
-\r
-void cleanup();\r
-\r
-/* Initialize TCM data structures */\r
-void (*tet_startup)() = NULL;\r
-void (*tet_cleanup)() = cleanup;\r
-\r
-void utc_audio_svc_open_func_01();\r
-//void utc_audio_svc_open_func_02();\r
-\r
-struct tet_testlist tet_testlist[] = {\r
- {utc_audio_svc_open_func_01, 1},\r
-// {utc_audio_svc_open_func_02, 2}, \r
- {NULL, 0}\r
-};\r
-\r
-\r
-#endif //__UTS_AUDIO_SVC_OPEN_FUNC_H_ \r
manage the service database.
*/
-#if 0
-/**
- * mediainfo_open:
- * Open media information service library. This is the function that an user who wants to use media information service calls first.
- * This function connects to the media database.
- *
- * @return This function returns zero(MEDIA_INFO_ERROR_NONE) on success, or negative value with error code.
- * Please refer 'media-info-error.h' to know the exact meaning of the error.
- * @see mediainfo_close
- * @pre None.
- * @post call mediainfo_close() to close the media database
- * @remark The database name is "/opt/dbspace/.media.db".
- * @par example
- * @code
-
-#include <media-info.h>
-void open_media_db()
-{
- int ret = MEDIA_INFO_ERROR_NONE;
- // open media database
- ret = mediainfo_open();
- // open failed
- if (ret < 0)
- {
- printf( "Cannot open media db. error code->%d", ret);
- return;
- }
-
- return;
-}
-
- * @endcode
- */
-int mediainfo_open(void);
-
-/**
- * mediainfo_close:
- * Open media information service library. This is the function that an user who wants to finalize media information service calls before closing the application.
- * This function disconnects to the media database.
- *
- * @return This function returns zero(MEDIA_INFO_ERROR_NONE) on success, or negative value with error code.
- * Please refer 'media-info-error.h' to know the exact meaning of the error.
- * @see mediainfo_open
- * @pre None.
- * @post call mediainfo_open() to open the media database
- * @remark The database name is "/opt/dbspace/.media.db".
- * @par example
- * @code
-
-#include <media-info.h>
-
-void close_media_db()
-{
- int ret = MEDIA_INFO_ERROR_NONE;
- // close media database
- ret = mediainfo_close();
- // close failed
- if (ret < 0)
- {
- printf( "Cannot close media db. error code->%d", ret);
- return;
- }
-
- return;
-}
-
- * @endcode
- */
-int mediainfo_close(void);
-#endif
/**
* media_svc_connect:
* Connect to the media database. This is the function that an user who wants to get a handle to access the media database.
char *zErrMsg = NULL;
audio_svc_debug("SQL = [%s]", sql_str);
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_error("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
err = sqlite3_exec(handle, sql_str, NULL, NULL, &zErrMsg);
if (SQLITE_OK != err) {
int err = -1;
audio_svc_debug("[SQL query] : %s", sql_str);
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_error("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
err = sqlite3_prepare_v2(handle, sql_str, -1, stmt, NULL);
sqlite3_free((char *)sql_str);
char *err_msg = NULL;
audio_svc_debug("========_audio_svc_sql_begin_trans");
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_error("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
if (SQLITE_OK != sqlite3_exec(handle, "BEGIN IMMEDIATE;", NULL, NULL, &err_msg)) {
audio_svc_error("Error:failed to begin transaction: error=%s", err_msg);
sqlite3_free(err_msg);
char *err_msg = NULL;
audio_svc_debug("========_audio_svc_sql_end_trans");
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_error("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
if (SQLITE_OK != sqlite3_exec(handle, "COMMIT;", NULL, NULL, &err_msg)) {
audio_svc_error("Error:failed to end transaction: error=%s", err_msg);
sqlite3_free(err_msg);
char *err_msg = NULL;
audio_svc_debug("========_audio_svc_sql_rollback_trans");
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_error("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
if (SQLITE_OK != sqlite3_exec(handle, "ROLLBACK;", NULL, NULL, &err_msg)) {
audio_svc_error("Error:failed to rollback transaction: error=%s", err_msg);
sqlite3_free(err_msg);
int err = -1;
int idx = 0;
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
char *sql =
sqlite3_mprintf
("select thumbnail_path from %s where valid=0 and storage_type=%d and thumbnail_path is not null",
int err = -1;
int idx = 0;
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
char *sql =
sqlite3_mprintf
("select thumbnail_path from %s where storage_type=%d and thumbnail_path is not null",
int year = -1;
char *audio_id = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
if (item == NULL) {
audio_svc_error("Invalid handle");
return AUDIO_SVC_ERROR_INVALID_PARAMETER;
int text_bind = 1;
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
if (filter_string) {
if (strlen(filter_string) > 0) {
snprintf(filter_query, sizeof(filter_query), "%%%s%%",
int idx = 0;
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
if (filter_string) {
if (strlen(filter_string) > 0) {
snprintf(filter_query, sizeof(filter_query), "%%%s%%",
int text_bind = 1;
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
if (filter_string) {
if (strlen(filter_string) > 0) {
snprintf(filter_query, sizeof(filter_query), "%%%s%%",
int idx = 0;
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
#define filter_condition(filter_mode, filter_mode2, query) \
if ((filter_mode)) g_strlcat((query), " and title like ?", sizeof((query))); \
if ((filter_mode2)) g_strlcat((query), " and title like ?", sizeof((query)));
return AUDIO_SVC_ERROR_DB_INTERNAL;
}
-#if 0
- for (idx = 0; idx < invalid_count; idx++) {
- if (strlen(thumbpath_record[idx].thumbnail_path) > 0) {
- ret =
- _audio_svc_check_and_remove_thumbnail
- (thumbpath_record[idx].thumbnail_path);
- if (ret != AUDIO_SVC_ERROR_NONE) {
- audio_svc_error
- ("error _audio_svc_check_and_remove_thumbnail");
- SAFE_FREE(thumbpath_record);
- return ret;
- }
- }
- }
-
- SAFE_FREE(thumbpath_record);
-#endif
for (idx = 0; idx < invalid_count; idx++) {
if (strlen(thumbpath_record[idx].thumbnail_path) > 0) {
if (_audio_svc_remove_file(thumbpath_record[idx].thumbnail_path) == FALSE) {
const char *folder_id, const char *path_name, const char *folder_name, int modified_date)
{
int err = -1;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
char *sql = sqlite3_mprintf("insert into %s (folder_uuid, path, folder_name, storage_type, modified_date) values ('%q', '%q', '%q', '%d', '%d'); ",
AUDIO_SVC_DB_TABLE_AUDIO_FOLDER, folder_id, path_name, folder_name, storage_type, modified_date);
err = _audio_svc_sql_query(handle, sql);
char order_str[AUDIO_SVC_QUERY_SIZE] = { 0 };
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
snprintf(query, sizeof(query), "SELECT * FROM audio_media WHERE %s", where_query);
audio_svc_debug("");
bool filter_mode2 = FALSE;
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
const char *filter_1 = " where name like ?";
const char *filter_2 = " and name like ?";
if (filter_string) {
int ret = AUDIO_SVC_ERROR_NONE;
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
if (filter_string) {
if (strlen(filter_string) > 0) {
filter_mode = TRUE;
int text_bind = 1;
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
if (filter_string) {
if (strlen(filter_string) > 0) {
snprintf(filter_query, sizeof(filter_query), "%%%s%%",
int idx = 0;
sqlite3_stmt *sql_stmt = NULL;
-#if 0
- sqlite3 *handle = _media_info_get_proper_handle();
- if (handle == NULL) {
- audio_svc_debug("handle is NULL");
- return AUDIO_SVC_ERROR_DB_INTERNAL;
- }
-#endif
+
filter_mode = STRING_VALID(filter_string);
filter_mode2 = STRING_VALID(filter_string2);
bool thumb_extracted_from_drm = FALSE;
char *err_attr_name = NULL;
char *title = NULL;
-#if 0
- bool extract_thumbnail = FALSE;
- int album_id = -1;
- char *thumbnail_path = NULL;
-#endif
int artwork_mime_size = -1;
_strncpy_safe(item->pathname, path, sizeof(item->pathname));
/* extract thumbnail image */
/* remove thumbnail extract routine while db creating.*/
-#if 0
- album_id = _audio_svc_get_album_id(item->audio.album);
- if (album_id < 0) {
- audio_svc_debug("album does not exist. So start to make album art");
- extract_thumbnail = TRUE;
- } else {
- audio_svc_debug("album already exists. don't need to make album art");
- thumbnail_path = _audio_svc_get_thumbnail_path_by_album_id(album_id);
- _strncpy_safe(item->thumbname, thumbnail_path, sizeof(item->thumbname));
- SAFE_FREE(thumbnail_path);
- }
-#endif
if ((!thumb_extracted_from_drm)/* && (extract_thumbnail == TRUE)*/) {
mmf_error = mm_file_get_attrs(tag, &err_attr_name, MM_FILE_TAG_ARTWORK, &image, &size, NULL);
if (mmf_error != 0) {
static __thread int g_audio_svc_insert_item_data_cnt = 1;
static __thread int g_audio_svc_insert_item_cur_data_cnt = 0;
-#if 0
-/**
- * audio_svc_open:\n
- * Open audio service library. This is the function that an user who wants to use music-service calls first.
- * This function connects with the music database and initialize efreet mime libary.
- *
- * @return This function returns zero(AUDIO_SVC_ERROR_NONE) on success, or negative value with error code.\n
- * Please refer 'audio-svc-types.h' to know the exact meaning of the error.
- * @see audio_svc_close
- * @pre None.
- * @post call audio_svc_close() to close music database
- * @remark The database name is "/opt/dbspace/.music.db".
- * @par example
- * @code
-
-#include <audio-svc.h>
-
-void open_music_db()
-{
- int ret = AUDIO_SVC_ERROR_NONE;
- // open music database
- ret = audio_svc_open();
- // open failed
- if (ret < 0)
- {
- printf( "Cannot open music db. error code->%d", ret);
- return;
- }
-
- return;
-}
-
- * @endcode
- */
-int audio_svc_open(void);
-
-
-/**
- * audio_svc_close:\n
- * Close audio service library. This is the function need to call before close the application.
- * This function disconnects with the music database and shutdown the efreet mime libary.
- *
- * @return This function returns zero(AUDIO_SVC_ERROR_NONE) on success, or negative value with error code.\n
- * Please refer 'audio-svc-types.h' to know the exact meaning of the error.
- * @see audio_svc_open
- * @pre music database already is opened.
- * @post None
- * @remark memory free before you call this function to close database.
- * @par example
- * @code
-
-#include <audio-svc.h>
-
-void close_music_db()
-{
- int ret = AUDIO_SVC_ERROR_NONE;
- // close music database
- ret = audio_svc_close();
- // close failed
- if (ret < 0)
- {
- printf( "unable to close music db. error code->%d", ret);
- return;
- }
-
- return;
-}
-
- * @endcode
- */
-int audio_svc_close(void);
-
-int audio_svc_open(void)
-{
- int err = -1;
- int tid = -1;
-
- audio_svc_debug("");
-
- err = _media_info_init_handle_tbl();
- if (err < 0) {
- audio_svc_debug("Error:_media_info_init_handle_tbl\n");
- return AUDIO_SVC_ERROR_DB_CONNECT;
- }
-
- tid = _media_info_get_thread_id();
- audio_svc_debug("Current thread id : %d", tid);
-
- HandleTable *handle_table = NULL;
- handle_table = _media_info_search_handle(tid);
-
- if (handle_table == NULL) {
- audio_svc_debug("A handle in thread [%d] does not exist. So now trying to make connection");
- int *key_tid = NULL;
-
- err = _media_info_insert_handle(&key_tid, tid, &handle_table);
- if (err < 0) {
- audio_svc_error("Fail to insert handle");
- if (key_tid) g_free(key_tid);
- if (handle_table) g_free(handle_table);
- return AUDIO_SVC_ERROR_DB_CONNECT;
- }
-
- sqlite3 *handle = NULL;
-
- if (db_util_open(MEDIA_INFO_DATABASE_NAME, &handle, DB_UTIL_REGISTER_HOOK_METHOD) != SQLITE_OK) {
- audio_svc_error("Unable to open database");
- if (handle) audio_svc_error("[sqlite] %s\n", sqlite3_errmsg(handle));
- if (key_tid) g_free(key_tid);
- if (handle_table) g_free(handle_table);
- return AUDIO_SVC_ERROR_DB_CONNECT;
- }
-
- handle_table->handle = handle;
-
- /* Register Busy handler */
- err = sqlite3_busy_handler(handle, _audio_svc_sql_busy_handler, NULL);
- if (SQLITE_OK != err) {
- audio_svc_error("Fail to register busy handler\n");
- if (handle) audio_svc_error("[sqlite] %s\n", sqlite3_errmsg(handle));
-
- db_util_close(handle);
- handle = NULL;
-
- return AUDIO_SVC_ERROR_DB_CONNECT;
- }
-
- } else {
- audio_svc_debug("A handle in thread [%d] exists. ");
- _media_info_atomic_add_counting(handle_table);
- }
-
- audio_svc_debug("audio_svc_open succeed");
- return AUDIO_SVC_ERROR_NONE;
-}
-
-int audio_svc_close(void)
-{
- int ret = AUDIO_SVC_ERROR_NONE;
- int err = -1;
- int tid = -1;
- audio_svc_debug("");
-
- tid = _media_info_get_thread_id();
- audio_svc_debug("Current thread id : %d", tid);
-
- HandleTable *handle_table = NULL;
- handle_table = _media_info_search_handle(tid);
-
- if (handle_table == NULL) {
- audio_svc_error("handle_table is NULL");
- return AUDIO_SVC_ERROR_DB_DISCONNECT;
- } else {
- audio_svc_debug("ref count in thread[%d] is %d", tid, handle_table->ref_cnt);
-
- if (handle_table->ref_cnt > 1) {
- _media_info_atomic_sub_counting(handle_table);
- } else {
- if (db_util_close(handle_table->handle) != SQLITE_OK) {
- audio_svc_error("error closing database: %s\n", sqlite3_errmsg(handle_table->handle));
- ret = AUDIO_SVC_ERROR_DB_DISCONNECT;
- }
-
- err = _media_info_remove_handle(tid);
- if (err < 0) {
- audio_svc_error
- ("Error:_media_info_remove_handle\n");
- return AUDIO_SVC_ERROR_DB_DISCONNECT;
- }
-
- _media_info_finalize_handle_tbl();
- }
- }
-
- audio_svc_debug("audio_svc_close succeed");
- return ret;
-}
-#endif
int audio_svc_create_table(MediaSvcHandle *handle)
{
int ret = AUDIO_SVC_ERROR_NONE;
ret = _audio_svc_delete_folder(db_handle, storage_type, NULL);
audio_svc_retv_if(ret != AUDIO_SVC_ERROR_NONE, ret);
-#if 0
- ret = _audio_svc_check_and_update_albums_table(NULL);
- audio_svc_retv_if(ret != AUDIO_SVC_ERROR_NONE, ret);
-#endif
-
return AUDIO_SVC_ERROR_NONE;
}
ret = _audio_svc_check_and_update_folder_table(db_handle, path);
audio_svc_retv_if(ret != AUDIO_SVC_ERROR_NONE, ret);
-#if 0
- ret = _audio_svc_check_and_update_albums_table(item.audio.album);
- audio_svc_retv_if(ret != AUDIO_SVC_ERROR_NONE, ret);
-#endif
-#if 0
- if (strlen(item.thumbname) > 0) {
- ret = _audio_svc_check_and_remove_thumbnail(item.thumbname);
- audio_svc_retv_if(ret != AUDIO_SVC_ERROR_NONE, ret);
- }
-#endif
if (strlen(item.thumbname) > 0) {
if (_audio_svc_remove_file(item.thumbname) == FALSE) {
audio_svc_error("fail to remove thumbnail file.");
ret = _audio_svc_update_folder_table(db_handle);
audio_svc_retv_if(ret != AUDIO_SVC_ERROR_NONE, ret);
-#if 0
- ret = _audio_svc_check_and_update_albums_table(NULL);
- audio_svc_retv_if(ret != AUDIO_SVC_ERROR_NONE, ret);
-#endif
-
return AUDIO_SVC_ERROR_NONE;
}
return AUDIO_SVC_ERROR_INVALID_PARAMETER;
}
-#if 0 //original code
- return _audio_svc_update_valid_in_music_record(path, valid);
-
-#else //stack up querys and commit it at once when query counts are same as g_audio_svc_item_valid_data_cnt
-
audio_svc_debug("g_audio_svc_item_valid_data_cnt =[%d], g_audio_svc_item_valid_cur_data_cnt =[%d]",
g_audio_svc_item_valid_data_cnt , g_audio_svc_item_valid_cur_data_cnt );
}
return AUDIO_SVC_ERROR_NONE;
-#endif
}
int audio_svc_get_path_by_audio_id(MediaSvcHandle *handle, const char *audio_id, char *path,
*
*/
-#if 0
-#include <unistd.h>
-#include <asm/unistd.h>
-#include <pthread.h>
-#include <string.h>
-
-#include "media-svc-util.h"
-#include "media-svc-error.h"
-#include "media-svc-debug.h"
-#include "media-svc.h"
-#include "audio-svc.h"
-#include "audio-svc-error.h"
-#endif
#include "uuid.h"
-#if 0
-static GHashTable *g_handle_table = NULL;
-pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-
-int _media_info_get_thread_id()
-{
- return syscall(__NR_gettid);
-}
-
-int _media_info_init_handle_tbl()
-{
- pthread_mutex_lock(&mutex);
-
- if (g_handle_table == NULL)
- g_handle_table = g_hash_table_new(g_int_hash, g_int_equal);
-
- pthread_mutex_unlock(&mutex);
-
- if (g_handle_table == NULL)
- return -1;
- else
- return 0;
-}
-
-int _media_info_finalize_handle_tbl()
-{
- pthread_mutex_lock(&mutex);
-
- if (g_handle_table != NULL) {
- int size = g_hash_table_size(g_handle_table);
- if (size == 0) {
- g_hash_table_destroy(g_handle_table);
- g_handle_table = NULL;
- } else
- mediainfo_dbg("handle table is not empty");
- }
-
- pthread_mutex_unlock(&mutex);
-
- return 0;
-}
-
-int
-_media_info_insert_handle(int **tid_key, int tid, HandleTable ** handle_table)
-{
- *tid_key = g_malloc(sizeof **tid_key);
- **tid_key = tid;
- *handle_table = g_malloc(sizeof **handle_table);
-
- pthread_mutex_lock(&mutex);
-
- g_hash_table_insert(g_handle_table, (gpointer) * tid_key,
- (gpointer) * handle_table);
-
- (*handle_table)->ref_cnt = 1;
-
- pthread_mutex_unlock(&mutex);
-
- return 0;
-}
-
-int _media_info_remove_handle(int tid)
-{
- int *key = NULL;
- HandleTable *val = NULL;
-
- pthread_mutex_lock(&mutex);
-
- if (!g_hash_table_lookup_extended
- (g_handle_table, &tid, (gpointer) & key, (gpointer) & val)) {
- pthread_mutex_unlock(&mutex);
- return -1;
- } else {
- if (g_hash_table_remove(g_handle_table, (gpointer) & tid))
- mediainfo_dbg("g_hash_table_remove done");
- else
- mediainfo_dbg("g_hash_table_remove fails");
-
- if (key)
- g_free(key);
- if (val)
- g_free(val);
-
- pthread_mutex_unlock(&mutex);
- return 0;
- }
-}
-
-HandleTable *_media_info_search_handle(int tid)
-{
- pthread_mutex_lock(&mutex);
-
- HandleTable *value =
- (HandleTable *) g_hash_table_lookup(g_handle_table,
- (gpointer) & tid);
-
- pthread_mutex_unlock(&mutex);
-
- return value;
-}
-
-sqlite3 *_media_info_get_proper_handle()
-{
- int tid = _media_info_get_thread_id();
- HandleTable *value =
- (HandleTable *) g_hash_table_lookup(g_handle_table,
- (gpointer) & tid);
-
- if (value == NULL) {
- return NULL;
- } else {
- return value->handle;
- }
-}
-void _media_info_atomic_add_counting(HandleTable *handle_table)
-{
- pthread_mutex_lock(&mutex);
- handle_table->ref_cnt++;
- pthread_mutex_unlock(&mutex);
-}
-
-
-void _media_info_atomic_sub_counting(HandleTable *handle_table)
-{
- pthread_mutex_lock(&mutex);
- handle_table->ref_cnt--;
- pthread_mutex_unlock(&mutex);
-}
-#endif
char *_media_info_generate_uuid(void)
{
uuid_t uuid_value;
extern "C" {
#endif
-#if 0
-typedef struct _handle_table {
- int ref_cnt;
- sqlite3* handle;
-} HandleTable;
-
-
-int
-_media_info_get_thread_id();
-
-/* To manage handles in each trhead, use GHashTable */
-int
-_media_info_init_handle_tbl();
-
-int
-_media_info_finalize_handle_tbl();
-
-int
-_media_info_insert_handle(int** tid_key, int tid, HandleTable** handle_table);
-
-int
-_media_info_remove_handle(int tid);
-
-HandleTable*
-_media_info_search_handle(int tid);
-
-sqlite3*
-_media_info_get_proper_handle();
-
-void
-_media_info_atomic_add_counting(HandleTable *handle_table);
-
-void
-_media_info_atomic_sub_counting(HandleTable *handle_table);
-#endif
-
char *_media_info_generate_uuid(void);
#ifdef __cplusplus
return 0;
}
-#if 0
-EXPORT_API int mb_svc_initialize()
-{
- int err = -1;
- int tid = -1;
- mb_svc_debug("mb_svc_initialize-----------enter\n");
-
- g_type_init();
-
- err = _media_info_init_handle_tbl();
- if (err < 0) {
- mb_svc_debug("Error:_media_info_init_handle_tbl\n");
- return MB_SVC_ERROR_DB_CONNECT;
- }
-
- tid = _media_info_get_thread_id();
- mb_svc_debug("Current thread id : %d", tid);
-
- HandleTable *handle_table = NULL;
- handle_table = _media_info_search_handle(tid);
-
- if (handle_table == NULL) {
- mb_svc_debug
- ("A handle in thread [%d] does not exist. So now trying to make connection");
- int *key_tid = NULL;
-
- err = _media_info_insert_handle(&key_tid, tid, &handle_table);
- if (err < 0) {
- mb_svc_debug("A handle in thread [%d] exists. ", tid);
- if (key_tid)
- g_free(key_tid);
- if (handle_table)
- g_free(handle_table);
- return 0;
- }
-
- sqlite3 *handle = NULL;
- err = mb_svc_connect_db(&handle);
- if (err < 0 || handle == NULL) {
- mb_svc_debug("Error:failed to initialize DB\n");
- if (key_tid)
- g_free(key_tid);
- if (handle_table)
- g_free(handle_table);
- return MB_SVC_ERROR_DB_CONNECT;
- }
-
- handle_table->handle = handle;
- } else {
- mb_svc_debug("A handle in thread [%d] exists. ", tid);
- _media_info_atomic_add_counting(handle_table);
- }
-
- mb_svc_debug("mb_svc_initialize-----------leave\n");
- return 0;
-}
-
-EXPORT_API int mb_svc_finalize()
-{
- int ret = 0;
- int err = -1;
- int tid = -1;
- mb_svc_debug("mb_svc_finalize-----------enter\n");
-
- tid = _media_info_get_thread_id();
- mb_svc_debug("Current thread id : %d", tid);
-
- HandleTable *handle_table = NULL;
- handle_table = _media_info_search_handle(tid);
-
- if (handle_table == NULL) {
- mb_svc_debug("handle_table is NULL");
- return MB_SVC_ERROR_DB_DISCONNECT;
- } else {
- mb_svc_debug("ref count in thread[%d] is %d", tid,
- handle_table->ref_cnt);
-
- if (handle_table->ref_cnt > 1) {
- _media_info_atomic_sub_counting(handle_table);
- } else {
-
- err = mb_svc_disconnect_db(handle_table->handle);
- if (err < 0) {
- mb_svc_debug("Error:mb_svc_disconnect_db\n");
- ret = MB_SVC_ERROR_DB_DISCONNECT;
- }
-
- err = _media_info_remove_handle(tid);
- if (err < 0) {
- mb_svc_debug
- ("Error:_media_info_remove_handle\n");
- return MB_SVC_ERROR_DB_DISCONNECT;
- }
-
- _media_info_finalize_handle_tbl();
-
- }
- }
-
- return ret;
-}
-#endif
/* clock_t */
long mb_svc_get_clock(void)
{
static __thread GList *g_sql_list = NULL;
static __thread char g_last_updated_folder_uuid[MB_SVC_UUID_LEN_MAX + 1] = {0,};
-#if 0
-static int __mb_svc_create_tbl(bool external);
-static int __mb_svc_drop_tbl(void);
-#endif
static int __mb_svc_delete_record(MediaSvcHandle *mb_svc_handle, int id, mb_svc_tbl_name_e tbl_name);
static int __mb_svc_delete_record_by_uuid(MediaSvcHandle *mb_svc_handle, const char *id, mb_svc_tbl_name_e tbl_name);
static int __mb_svc_db_get_next_id(MediaSvcHandle *mb_svc_handle, int table_id);
-#if 0
-static int __mb_svc_create_tbl(bool external)
-{
- int err = -1;
- char table_name[MB_SVC_TABLE_NAME_MAX_LEN] = { 0, };
- char *primary_key = NULL;
- int i, j;
- mb_svc_tbl_field_s *mb_svc_field = NULL;
- int field_count = 0;
- GString *query_string =
- g_string_sized_new(MB_SVC_DEFAULT_QUERY_SIZE + 1);
- mb_svc_debug("__mb_svc_create_tbl--enter\n");
-
- for (i = 0; i < MB_SVC_TABLE_CNT_MAX; ++i) {
- field_count = field_num_max[i];
- memset(table_name, 0x00, MB_SVC_TABLE_NAME_MAX_LEN);
-
- snprintf(table_name, MB_SVC_TABLE_NAME_MAX_LEN, "%s",
- mb_svc_tbl[i].table_name);
-
- mb_svc_field = mb_svc_tbl[i].mb_svc_field;
- primary_key = mb_svc_tbl[i].primary_key;
-
- err = _mb_svc_table_exist(table_name);
- if (err > 0) {
- continue;
- }
- g_string_printf(query_string, "CREATE TABLE %s(", table_name);
-
- for (j = 0; j < field_count; ++j) {
- if (j != 0) {
- g_string_append(query_string, ", ");
- }
- g_string_append_printf(query_string, "%s %s",
- mb_svc_field[j].field_name,
- mb_svc_field[j].field_type);
- }
-
- g_string_append(query_string, primary_key);
- g_string_append(query_string, " );");
-
- err = mb_svc_query_sql_gstring(query_string);
- if (err < 0) {
- mb_svc_debug("failed to create table\n");
- mb_svc_debug("query string is %s\n", query_string->str);
-
- g_string_free(query_string, TRUE);
- return MB_SVC_ERROR_DB_INTERNAL;
- }
- }
-
- g_string_free(query_string, TRUE);
-
- mb_svc_debug("__mb_svc_create_tbl--leave\n");
- return 0;
-}
-
-static int __mb_svc_drop_tbl(void)
-{
- char query_string[MB_SVC_DEFAULT_QUERY_SIZE + 1] = { 0 };
- int i, err;
- char *table_name;
- mb_svc_debug("__mb_svc_drop_tbl--enter\n");
-
- for (i = 0; i < MB_SVC_TABLE_CNT_MAX; ++i) {
- table_name = mb_svc_tbl[i].table_name;
- if (table_name == NULL) {
- mb_svc_debug("table_name is null\n");
- return MB_SVC_ERROR_INVALID_PARAMETER;
- }
- err = _mb_svc_table_exist(table_name);
- if (err > 0) {
- snprintf(query_string, sizeof(query_string),
- MB_SVC_TABLE_DROP_QUERY_STRING, table_name);
- err = mb_svc_query_sql(query_string);
- if (err < 0) {
- mb_svc_debug("drop failed\n");
- mb_svc_debug("query string is %s\n",
- query_string);
- return MB_SVC_ERROR_DB_INTERNAL;
- }
- }
- }
- mb_svc_debug("__mb_svc_drop_tbl--leave\n");
- return 0;
-}
-#endif
int mb_svc_set_folder_as_valid_sql_add(const char *folder_id, int valid)
{
return 0;
}
-#if 0
-static int mb_svc_busy_handler(void *pData, int count)
-{
- usleep(50000);
- printf("mb_svc_busy_handler called : %d\n", count);
- mb_svc_debug("mb_svc_busy_handler called : %d\n", count);
-
- return 100 - count;
-}
-
-/* connect to database-server */
-int mb_svc_connect_db(sqlite3 **handle)
-{
- mb_svc_debug("mb_svc_connect_db\n");
- int ret = 0;
-
- ret =
- db_util_open(MEDIA_INFO_DATABASE_NAME, handle,
- DB_UTIL_REGISTER_HOOK_METHOD);
- if (SQLITE_OK != ret) {
- mb_svc_debug("can not connect to db-server\n");
- if (*handle) mb_svc_debug("[sqlite] %s\n", sqlite3_errmsg(*handle));
-
- *handle = NULL;
-
- return MB_SVC_ERROR_DB_CONNECT;
- }
-
- /* Register Busy handler */
- ret = sqlite3_busy_handler(*handle, mb_svc_busy_handler, NULL);
- if (SQLITE_OK != ret) {
- mb_svc_debug("Fail to register busy handler\n");
- if (*handle) mb_svc_debug("[sqlite] %s\n", sqlite3_errmsg(*handle));
-
- db_util_close(*handle);
- *handle = NULL;
-
- return MB_SVC_ERROR_DB_CONNECT;
- }
-
- mb_svc_debug("connected to db-server\n");
-
- return 0;
-}
-
-/* disconnect from database-server */
-int mb_svc_disconnect_db(sqlite3 *handle)
-{
- /* disconnect from database-server */
- int ret = 0;
-
- ret = db_util_close(handle);
-
- if (SQLITE_OK != ret) {
- mb_svc_debug("can not disconnect database\n");
- mb_svc_debug("[sqlite] %s\n", sqlite3_errmsg(handle));
-
- return MB_SVC_ERROR_DB_DISCONNECT;
- }
- handle = NULL;
-
- mb_svc_debug("Disconnected successfully\n");
- return 0;
-}
-#endif
mb_svc_tbl_s *mb_svc_search_matched_svc_tbl(mb_svc_tbl_name_e tbl_name)
{
int i;
static __thread int g_trans_move_cnt = 1;
static __thread int g_cur_trans_move_cnt = 0;
-#if 0
-EXPORT_API int minfo_init(void)
-{
- mb_svc_debug("");
- return mb_svc_initialize();
-}
-
-EXPORT_API int minfo_finalize(void)
-{
- mb_svc_debug("");
- return mb_svc_finalize();
-}
-#endif
-
EXPORT_API int
minfo_get_item_list(MediaSvcHandle *mb_svc_handle,
const char *cluster_id,
#include <string.h>
#include <dirent.h>
-void insert_into_db(const char * dir_path);
+void insert_into_db(MediaSvcHandle * db_handle, const char * dir_path);
void msg_print(int line, char *msg);
int main()
msg_print(__LINE__, "error to delete all items on phone");
return -1;
}
- //insert_into_db("/opt/media/Sounds/Music");
+ //insert_into_db(db_handle, "/opt/media/Sounds/Music");
#endif
//iterate all tracks and get the info of tracks ==================================================
msg_print(__LINE__, "iterate all tracks");
}
-void insert_into_db(const char * dir_path)
+void insert_into_db(MediaSvcHandle * db_handle, const char * dir_path)
{
int audio_id = 300;
char thumb_path[AUDIO_SVC_PATHNAME_SIZE+1] = {0};
fprintf(stderr,"[file path] : %s\n", fpath);
- #if 0
- int ret = audio_svc_insert_item(AUDIO_SVC_STORAGE_PHONE, fpath, AUDIO_SVC_CATEGORY_MUSIC);
+ int ret = audio_svc_insert_item(db_handle, AUDIO_SVC_STORAGE_PHONE, fpath, AUDIO_SVC_CATEGORY_MUSIC);
if (ret != AUDIO_SVC_ERROR_NONE) {
fprintf(stderr,"[error to insert music] : %s\n", fpath);
}
- #endif
+
audio_id++;
}