summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2015-10-13 10:19:41 +0900
committerMinje Ahn <minje.ahn@samsung.com>2015-10-13 10:51:23 +0900
commite646e3b166173167a94b319b0a9889b22a55f2e7 (patch)
tree76ced7ed64ed9af47a2596074feebc1625614744 /src/util
parente787f69ce984b7b225c291ebe81664530a8284c9 (diff)
downloadlibmedia-thumbnail-e646e3b166173167a94b319b0a9889b22a55f2e7.tar.gz
libmedia-thumbnail-e646e3b166173167a94b319b0a9889b22a55f2e7.tar.bz2
libmedia-thumbnail-e646e3b166173167a94b319b0a9889b22a55f2e7.zip
Change-Id: I9bb372674a3fe257278b4867db0153d29b6a16da Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'src/util')
-rwxr-xr-xsrc/util/media-thumb-db.c69
1 files changed, 6 insertions, 63 deletions
diff --git a/src/util/media-thumb-db.c b/src/util/media-thumb-db.c
index 8e77b95..06f028a 100755
--- a/src/util/media-thumb-db.c
+++ b/src/util/media-thumb-db.c
@@ -26,75 +26,23 @@
#include <glib.h>
#include <string.h>
#include <unistd.h>
-#include <util-func.h>
static __thread MediaDBHandle *db_handle;
-static int _media_thumb_busy_handler(void *pData, int count)
-{
- usleep(50000);
- thumb_dbg("_media_thumb_busy_handler called : %d\n", count);
-
- return 100 - count;
-}
-
sqlite3 *_media_thumb_db_get_handle()
{
return db_handle;
}
-int _media_thumb_sqlite_connect(sqlite3 **handle)
-{
- int err = MS_MEDIA_ERR_NONE;
-
- err = db_util_open(MEDIA_DATABASE_NAME, handle,
- DB_UTIL_REGISTER_HOOK_METHOD);
-
- if (SQLITE_OK != err) {
- *handle = NULL;
- return MS_MEDIA_ERR_INVALID_PARAMETER;
- }
-
- /*Register busy handler*/
- if (*handle) {
- err = sqlite3_busy_handler(*handle, _media_thumb_busy_handler, NULL);
- if (SQLITE_OK != err) {
- if (*handle) {
- thumb_err("[sqlite] %s\n", sqlite3_errmsg(*handle));
- db_util_close(*handle);
- }
- *handle = NULL;
-
- return MS_MEDIA_ERR_INVALID_PARAMETER;
- }
- } else {
- *handle = NULL;
- return MS_MEDIA_ERR_INVALID_PARAMETER;
- }
-
- return MS_MEDIA_ERR_NONE;
-}
-
-int _media_thumb_sqlite_disconnect(sqlite3 *handle)
-{
- int err = MS_MEDIA_ERR_NONE;
- if (handle != NULL) {
- err = db_util_close(handle);
-
- if (SQLITE_OK != err) {
- handle = NULL;
- return MS_MEDIA_ERR_INVALID_PARAMETER;
- }
- }
-
- return MS_MEDIA_ERR_NONE;
-}
-
-int
-_media_thumb_get_type_from_db(sqlite3 *handle,
+int _media_thumb_get_type_from_db(sqlite3 *handle,
const char *origin_path,
int *type)
{
+ int err = MS_MEDIA_ERR_NONE;
+ char *path_string = NULL;
+ char *query_string = NULL;
+ sqlite3_stmt *stmt = NULL;
+
thumb_dbg_slog("Origin path : %s", origin_path);
if (handle == NULL) {
@@ -102,11 +50,6 @@ _media_thumb_get_type_from_db(sqlite3 *handle,
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
- int err = -1;
- char *path_string = NULL;
- char *query_string = NULL;
- sqlite3_stmt *stmt = NULL;
-
path_string = sqlite3_mprintf("%s", origin_path);
query_string = sqlite3_mprintf(SELECT_TYPE_BY_PATH, path_string);