summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMinje Ahn <minje.ahn@samsung.com>2015-06-08 12:43:27 +0900
committerMinje Ahn <minje.ahn@samsung.com>2015-06-08 15:22:41 +0900
commit9c534f334a71a5250c9411cc53c83cd72e3b7e74 (patch)
treecca701a14ae87449dab7de9e8ccbec23c6312554 /src
parentbe3906afcd5d61009fa339b320305b04b5e89c64 (diff)
downloadlibmedia-thumbnail-9c534f334a71a5250c9411cc53c83cd72e3b7e74.tar.gz
libmedia-thumbnail-9c534f334a71a5250c9411cc53c83cd72e3b7e74.tar.bz2
libmedia-thumbnail-9c534f334a71a5250c9411cc53c83cd72e3b7e74.zip
Remove unused code.
Change-Id: I9c8d472cff513d88c90b9558201d20f2fbad05c2 Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/codec/img-codec-osal.c1
-rwxr-xr-xsrc/include/ipc/media-thumb-ipc.h90
-rwxr-xr-xsrc/include/util/media-thumb-db.h15
-rwxr-xr-xsrc/ipc/media-thumb-ipc.c120
-rwxr-xr-xsrc/media-thumb-internal.c7
-rwxr-xr-xsrc/util/media-thumb-db.c133
-rwxr-xr-xsrc/util/media-thumb-debug.c1
-rwxr-xr-xsrc/util/media-thumb-util.c12
8 files changed, 40 insertions, 339 deletions
diff --git a/src/codec/img-codec-osal.c b/src/codec/img-codec-osal.c
index 47062bc..ecce649 100644
--- a/src/codec/img-codec-osal.c
+++ b/src/codec/img-codec-osal.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
-//#include <drm-service.h>
#include <drm_client.h>
void *IfegMemAlloc(unsigned int size)
diff --git a/src/include/ipc/media-thumb-ipc.h b/src/include/ipc/media-thumb-ipc.h
index b4ad38e..cc3cabf 100755
--- a/src/include/ipc/media-thumb-ipc.h
+++ b/src/include/ipc/media-thumb-ipc.h
@@ -20,21 +20,7 @@
*/
-#include "media-thumb-debug.h"
-#include "media-thumb-types.h"
-#include "media-thumb-internal.h"
-
-#ifdef _USE_MEDIA_UTIL_
-#include "media-util-ipc.h"
-#include "media-server-ipc.h"
-#endif
-
-#ifdef _USE_UDS_SOCKET_
#include <sys/un.h>
-#else
-#include <sys/socket.h>
-#endif
-
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
@@ -43,18 +29,16 @@
#include <signal.h>
#include <sys/types.h>
+#include "media-thumb-debug.h"
+#include "media-thumb-types.h"
+#include "media-thumb-internal.h"
+#include "media-util-ipc.h"
+#include "media-server-ipc.h"
+
#ifndef _MEDIA_THUMB_IPC_H_
#define _MEDIA_THUMB_IPC_H_
-#ifndef _USE_MEDIA_UTIL_
-#define THUMB_DAEMON_PORT 10000
-#endif
#define MAX_PATH_SIZE 4096
-
-#ifndef _USE_MEDIA_UTIL_
-#define TIMEOUT_SEC 10
-#endif
-
#define MAX_TRIES 3
enum {
@@ -72,52 +56,18 @@ enum {
THUMB_FAIL
};
-#ifndef _USE_MEDIA_UTIL_
-enum {
- CLIENT_SOCKET,
- SERVER_SOCKET
-};
-typedef struct _thumbMsg{
- int msg_type;
- media_thumb_type thumb_type;
- int status;
- int pid;
- uid_t uid;
- int thumb_size;
- int thumb_width;
- int thumb_height;
- int origin_width;
- int origin_height;
- int origin_path_size;
- int dest_path_size;
- char org_path[MAX_PATH_SIZE];
- char dst_path[MAX_PATH_SIZE];
-} thumbMsg;
-#endif
-
-int
-_media_thumb_create_socket(int sock_type, int *sock);
-
-int
-_media_thumb_create_udp_socket(int *sock);
-
-int
-_media_thumb_recv_msg(int sock, int header_size, thumbMsg *msg);
-
-#ifdef _USE_UDS_SOCKET_
-int
-_media_thumb_recv_udp_msg(int sock, int header_size, thumbMsg *msg, struct sockaddr_un *from_addr, unsigned int *from_size);
-#else
-int
-_media_thumb_recv_udp_msg(int sock, int header_size, thumbMsg *msg, struct sockaddr_in *from_addr, unsigned int *from_size);
-#endif
-
-int
-_media_thumb_set_buffer(thumbMsg *req_msg, unsigned char **buf, int *buf_size);
-
-int
-_media_thumb_request(int msg_type,
+int _media_thumb_create_socket(int sock_type, int *sock);
+
+int _media_thumb_create_udp_socket(int *sock);
+
+int _media_thumb_recv_msg(int sock, int header_size, thumbMsg *msg);
+
+int _media_thumb_recv_udp_msg(int sock, int header_size, thumbMsg *msg, struct sockaddr_un *from_addr, unsigned int *from_size);
+
+int _media_thumb_set_buffer(thumbMsg *req_msg, unsigned char **buf, int *buf_size);
+
+int _media_thumb_request(int msg_type,
media_thumb_type thumb_type,
const char *origin_path,
char *thumb_path,
@@ -125,14 +75,12 @@ _media_thumb_request(int msg_type,
media_thumb_info *thumb_info,
uid_t uid);
-int
-_media_thumb_request_async(int msg_type,
+int _media_thumb_request_async(int msg_type,
media_thumb_type thumb_type,
const char *origin_path,
thumbUserData *userData,
uid_t uid);
-int
-_media_thumb_process(thumbMsg *req_msg, thumbMsg *res_msg, uid_t uid);
+int _media_thumb_process(thumbMsg *req_msg, thumbMsg *res_msg, uid_t uid);
#endif /*_MEDIA_THUMB_IPC_H_*/
diff --git a/src/include/util/media-thumb-db.h b/src/include/util/media-thumb-db.h
index 3dc5495..5302fa6 100755
--- a/src/include/util/media-thumb-db.h
+++ b/src/include/util/media-thumb-db.h
@@ -49,28 +49,23 @@
sqlite3 *_media_thumb_db_get_handle();
-int
-_media_thumb_db_connect(uid_t uid);
+int _media_thumb_db_connect(uid_t uid);
-int
-_media_thumb_db_disconnect();
+int _media_thumb_db_disconnect();
-int
-_media_thumb_get_thumb_from_db(const char *origin_path,
+int _media_thumb_get_thumb_from_db(const char *origin_path,
char *thumb_path,
int max_length,
int *need_update_db);
-int
-_media_thumb_get_thumb_from_db_with_size(const char *origin_path,
+int _media_thumb_get_thumb_from_db_with_size(const char *origin_path,
char *thumb_path,
int max_length,
int *need_update_db,
int *width,
int *height);
-int
-_media_thumb_update_db(const char *origin_path,
+int _media_thumb_update_db(const char *origin_path,
char *thumb_path,
int width,
int height,
diff --git a/src/ipc/media-thumb-ipc.c b/src/ipc/media-thumb-ipc.c
index 2f56457..9284c64 100755
--- a/src/ipc/media-thumb-ipc.c
+++ b/src/ipc/media-thumb-ipc.c
@@ -40,8 +40,7 @@ typedef struct {
int source_id;
} thumbReq;
-int
-_media_thumb_create_socket(int sock_type, int *sock)
+int _media_thumb_create_socket(int sock_type, int *sock)
{
int sock_fd = 0;
@@ -51,12 +50,7 @@ _media_thumb_create_socket(int sock_type, int *sock)
}
if (sock_type == CLIENT_SOCKET) {
-
-#ifdef _USE_MEDIA_UTIL_
struct timeval tv_timeout = { MS_TIMEOUT_SEC_10, 0 };
-#else
- struct timeval tv_timeout = { TIMEOUT_SEC, 0 };
-#endif
if (setsockopt(sock_fd, SOL_SOCKET, SO_RCVTIMEO, &tv_timeout, sizeof(tv_timeout)) == -1) {
thumb_err("setsockopt failed: %s", strerror(errno));
@@ -80,8 +74,7 @@ _media_thumb_create_socket(int sock_type, int *sock)
}
-int
-_media_thumb_create_udp_socket(int *sock)
+int _media_thumb_create_udp_socket(int *sock)
{
int sock_fd = 0;
@@ -90,11 +83,7 @@ _media_thumb_create_udp_socket(int *sock)
return MS_MEDIA_ERR_SOCKET_CONN;
}
-#ifdef _USE_MEDIA_UTIL_
struct timeval tv_timeout = { MS_TIMEOUT_SEC_10, 0 };
-#else
- struct timeval tv_timeout = { TIMEOUT_SEC, 0 };
-#endif
if (setsockopt(sock_fd, SOL_SOCKET, SO_RCVTIMEO, &tv_timeout, sizeof(tv_timeout)) == -1) {
thumb_err("setsockopt failed: %s", strerror(errno));
@@ -122,12 +111,9 @@ int __media_thumb_pop_req_queue(const char *path, bool shutdown_channel)
{
int req_len = 0, i;
- if (g_request_queue == NULL) return -1;
+ if (g_request_queue == NULL) return MS_MEDIA_ERR_INVALID_PARAMETER;
req_len = g_queue_get_length(g_request_queue);
-// thumb_dbg("Queue length : %d", req_len);
-// thumb_dbg("Queue path : %s", path);
-
if (req_len <= 0) {
// thumb_dbg("There is no request in the queue");
} else {
@@ -138,7 +124,6 @@ int __media_thumb_pop_req_queue(const char *path, bool shutdown_channel)
if (req == NULL) continue;
if (strncmp(path, req->path, strlen(path)) == 0) {
- //thumb_dbg("Popped %s", path);
if (shutdown_channel) {
g_source_destroy(g_main_context_find_source_by_id(g_main_context_get_thread_default(), req->source_id));
@@ -238,20 +223,11 @@ _media_thumb_recv_msg(int sock, int header_size, thumbMsg *msg)
return MS_MEDIA_ERR_NONE;
}
-#ifdef _USE_UDS_SOCKET_
int
_media_thumb_recv_udp_msg(int sock, int header_size, thumbMsg *msg, struct sockaddr_un *from_addr, unsigned int *from_size)
-#else
-int
-_media_thumb_recv_udp_msg(int sock, int header_size, thumbMsg *msg, struct sockaddr_in *from_addr, unsigned int *from_size)
-#endif
{
int recv_msg_len = 0;
-#ifdef _USE_UDS_SOCKET_
unsigned int from_addr_size = sizeof(struct sockaddr_un);
-#else
- unsigned int from_addr_size = sizeof(struct sockaddr_in);
-#endif
unsigned char *buf = NULL;
buf = (unsigned char*)malloc(sizeof(thumbMsg));
@@ -321,61 +297,19 @@ int
_media_thumb_request(int msg_type, media_thumb_type thumb_type, const char *origin_path, char *thumb_path, int max_length, media_thumb_info *thumb_info, uid_t uid)
{
int sock;
-#ifdef _USE_UDS_SOCKET_
struct sockaddr_un serv_addr;
-#elif defined(_USE_UDS_SOCKET_TCP_)
- struct sockaddr_un serv_addr;
-#else
- const char *serv_ip = "127.0.0.1";
- struct sockaddr_in serv_addr;
-#endif
-
int recv_str_len = 0;
int err = MS_MEDIA_ERR_NONE;
int pid;
-
-#ifdef _USE_MEDIA_UTIL_
-#ifdef _USE_UDS_SOCKET_
if (ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock, MS_THUMB_CREATOR_PORT) < 0) {
-#elif defined(_USE_UDS_SOCKET_TCP_)
- if (ms_ipc_create_client_tcp_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock, MS_THUMB_CREATOR_TCP_PORT) < 0) {
-#else
- if (ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock) < 0) {
-#endif
thumb_err("ms_ipc_create_client_socket failed");
return MS_MEDIA_ERR_SOCKET_CONN;
}
-#else
- /* Creaete a TCP socket */
- if (_media_thumb_create_socket(CLIENT_SOCKET, &sock) < 0) {
- thumb_err("_media_thumb_create_socket failed");
- return MS_MEDIA_ERR_SOCKET_CONN;
- }
-#endif
memset(&serv_addr, 0, sizeof(serv_addr));
-#ifdef _USE_UDS_SOCKET_
serv_addr.sun_family = AF_UNIX;
-#elif defined(_USE_UDS_SOCKET_TCP_)
- serv_addr.sun_family = AF_UNIX;
-#else
- serv_addr.sin_family = AF_INET;
- serv_addr.sin_addr.s_addr = inet_addr(serv_ip);
-#endif
-
-#ifdef _USE_MEDIA_UTIL_
-#ifdef _USE_UDS_SOCKET_
- strcpy(serv_addr.sun_path, "/var/run/media-server/media_ipc_thumbcreator.socket");
-#elif defined(_USE_UDS_SOCKET_TCP_)
- thumb_dbg("");
strcpy(serv_addr.sun_path, "/var/run/media-server/media_ipc_thumbcreator.socket");
-#else
- serv_addr.sin_port = htons(MS_THUMB_CREATOR_PORT);
-#endif
-#else
- serv_addr.sin_port = htons(THUMB_DAEMON_PORT);
-#endif
/* Connecting to the thumbnail server */
if (connect(sock, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) {
@@ -520,8 +454,7 @@ static char* _media_thumb_get_default_path(uid_t uid)
return result_psswd;
}
-int
-_media_thumb_process(thumbMsg *req_msg, thumbMsg *res_msg, uid_t uid)
+int _media_thumb_process(thumbMsg *req_msg, thumbMsg *res_msg, uid_t uid)
{
int err = -1;
GdkPixbuf *gdkdata = NULL;
@@ -660,7 +593,6 @@ _media_thumb_process(thumbMsg *req_msg, thumbMsg *res_msg, uid_t uid)
if (err == -1) {
thumb_warn("fsync failed");
}
-
close(fd);
}
/* End of fsync */
@@ -731,66 +663,26 @@ int
_media_thumb_request_async(int msg_type, media_thumb_type thumb_type, const char *origin_path, thumbUserData *userData, uid_t uid)
{
int sock;
-#ifdef _USE_UDS_SOCKET_
- struct sockaddr_un serv_addr;
-#elif defined(_USE_UDS_SOCKET_TCP_)
struct sockaddr_un serv_addr;
-#else
- const char *serv_ip = "127.0.0.1";
- struct sockaddr_in serv_addr;
-#endif
-
int pid;
if ((msg_type == THUMB_REQUEST_DB_INSERT) && (__media_thumb_check_req_queue(origin_path) < 0)) {
return MS_MEDIA_ERR_THUMB_DUPLICATED_REQUEST;
}
-#ifdef _USE_MEDIA_UTIL_
-#ifdef _USE_UDS_SOCKET_
if (ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock, MS_THUMB_CREATOR_PORT) < 0) {
-#elif defined(_USE_UDS_SOCKET_TCP_)
- if (ms_ipc_create_client_tcp_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock, MS_THUMB_CREATOR_TCP_PORT) < 0) {
-#else
- if (ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock) < 0) {
-#endif
thumb_err("ms_ipc_create_client_socket failed");
return MS_MEDIA_ERR_SOCKET_CONN;
}
-#else
- /* Creaete a TCP socket */
- if (_media_thumb_create_socket(CLIENT_SOCKET, &sock) < 0) {
- thumb_err("_media_thumb_create_socket failed");
- return MS_MEDIA_ERR_SOCKET_CONN;
- }
-#endif
-
GIOChannel *channel = NULL;
channel = g_io_channel_unix_new(sock);
int source_id = -1;
memset(&serv_addr, 0, sizeof(serv_addr));
-#ifdef _USE_UDS_SOCKET_
- serv_addr.sun_family = AF_UNIX;
-#elif defined(_USE_UDS_SOCKET_TCP_)
serv_addr.sun_family = AF_UNIX;
-#else
- serv_addr.sin_family = AF_INET;
- serv_addr.sin_addr.s_addr = inet_addr(serv_ip);
-#endif
-#ifdef _USE_MEDIA_UTIL_
-#ifdef _USE_UDS_SOCKET_
strcpy(serv_addr.sun_path, "/var/run/media-server/media_ipc_thumbcreator.socket");
-#elif defined(_USE_UDS_SOCKET_TCP_)
- strcpy(serv_addr.sun_path, "/tmp/media_ipc_thumbcreator.dat");
-#else
- serv_addr.sin_port = htons(MS_THUMB_CREATOR_PORT);
-#endif
-#else
- serv_addr.sin_port = htons(THUMB_DAEMON_PORT);
-#endif
/* Connecting to the thumbnail server */
if (connect(sock, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) {
@@ -819,7 +711,7 @@ _media_thumb_request_async(int msg_type, media_thumb_type thumb_type, const char
req_msg.msg_type = msg_type;
req_msg.thumb_type = thumb_type;
req_msg.uid = uid;
-
+
strncpy(req_msg.org_path, origin_path, sizeof(req_msg.org_path));
req_msg.org_path[strlen(req_msg.org_path)] = '\0';
@@ -836,8 +728,6 @@ _media_thumb_request_async(int msg_type, media_thumb_type thumb_type, const char
int buf_size = 0;
_media_thumb_set_buffer(&req_msg, &buf, &buf_size);
- //thumb_dbg("buffer size : %d", buf_size);
-
if (send(sock, buf, buf_size, 0) != buf_size) {
thumb_err("sendto failed: %d\n", errno);
SAFE_FREE(buf);
diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c
index b8890f7..2ca640d 100755
--- a/src/media-thumb-internal.c
+++ b/src/media-thumb-internal.c
@@ -36,7 +36,6 @@
#include <fcntl.h>
#include <unistd.h>
-//#include <drm-service.h>
#include <drm_client.h>
#include <mm_file.h>
#include <mm_error.h>
@@ -153,8 +152,7 @@ int _media_thumb_get_exif_info(ExifData *ed, char *buf, int max_size, int *value
buf[strlen(buf)] = '\0';
if (*buf) {
- thumb_dbg("%s: %s\n",
- exif_tag_get_name_in_ifd(tag, ifd), buf);
+ thumb_dbg("%s: %s\n", exif_tag_get_name_in_ifd(tag, ifd), buf);
}
}
}
@@ -913,8 +911,7 @@ int _media_thumb_jpeg(const char *origin_path,
return err;
}
-int
-_media_thumb_image(const char *origin_path,
+int _media_thumb_image(const char *origin_path,
int thumb_width,
int thumb_height,
media_thumb_format format,
diff --git a/src/util/media-thumb-db.c b/src/util/media-thumb-db.c
index 664cc47..275a98e 100755
--- a/src/util/media-thumb-db.c
+++ b/src/util/media-thumb-db.c
@@ -28,12 +28,7 @@
#include <unistd.h>
#include <util-func.h>
-
-#ifdef _USE_MEDIA_UTIL_
static __thread MediaDBHandle *db_handle;
-#else
-static __thread sqlite3 *db_handle;
-#endif
static int _media_thumb_busy_handler(void *pData, int count)
{
@@ -48,8 +43,7 @@ sqlite3 *_media_thumb_db_get_handle()
return db_handle;
}
-int
-_media_thumb_sqlite_connect(sqlite3 **handle)
+int _media_thumb_sqlite_connect(sqlite3 **handle)
{
int err = MS_MEDIA_ERR_NONE;
@@ -81,8 +75,7 @@ _media_thumb_sqlite_connect(sqlite3 **handle)
return MS_MEDIA_ERR_NONE;
}
-int
-_media_thumb_sqlite_disconnect(sqlite3 *handle)
+int _media_thumb_sqlite_disconnect(sqlite3 *handle)
{
int err = MS_MEDIA_ERR_NONE;
if (handle != NULL) {
@@ -258,42 +251,17 @@ int _media_thumb_update_thumb_path_to_db(sqlite3 *handle,
thumbpath_string = sqlite3_mprintf("%s", thumb_path);
query_string = sqlite3_mprintf(UPDATE_THUMB_BY_PATH, thumbpath_string, path_string);
-#ifndef _USE_MEDIA_UTIL_
- char *err_msg = NULL;
- err = sqlite3_exec(handle, query_string, NULL, NULL, &err_msg);
-
- thumb_dbg("Query : %s", query_string);
-
- sqlite3_free(query_string);
- sqlite3_free(thumbpath_string);
- sqlite3_free(path_string);
-
- if (SQLITE_OK != err) {
- if (err_msg) {
- thumb_err("Failed to query[ %s ]", err_msg);
- sqlite3_free(err_msg);
- err_msg = NULL;
- }
-
- return MS_MEDIA_ERR_DB_UPDATE_FAIL;
- }
-
- if (err_msg)
- sqlite3_free(err_msg);
-#else
err = media_db_request_update_db(query_string, uid);
if (err < 0) {
thumb_err("media_db_request_update_db failed : %d", err);
return err;
}
-#endif
thumb_dbg("Query success");
return MS_MEDIA_ERR_NONE;
}
-int
-_media_thumb_update_wh_to_db(sqlite3 *handle,
+int _media_thumb_update_wh_to_db(sqlite3 *handle,
const char *origin_path,
int width,
int height,
@@ -311,34 +279,11 @@ _media_thumb_update_wh_to_db(sqlite3 *handle,
path_string = sqlite3_mprintf("%s", origin_path);
query_string = sqlite3_mprintf(UPDATE_WH_BY_PATH, width, height, path_string);
-#ifndef _USE_MEDIA_UTIL_
- char *err_msg = NULL;
- err = sqlite3_exec(handle, query_string, NULL, NULL, &err_msg);
-
- thumb_dbg("Query : %s", query_string);
-
- sqlite3_free(query_string);
- sqlite3_free(path_string);
-
- if (SQLITE_OK != err) {
- if (err_msg) {
- thumb_err("Failed to query[ %s ]", err_msg);
- sqlite3_free(err_msg);
- err_msg = NULL;
- }
-
- return MS_MEDIA_ERR_DB_UPDATE_FAIL;
- }
-
- if (err_msg)
- sqlite3_free(err_msg);
-#else
err = media_db_request_update_db(query_string, uid);
if (err != MS_MEDIA_ERR_NONE) {
thumb_err("media_db_request_update_db failed : %d", err);
return err;
}
-#endif
thumb_dbg("Query success");
return err;
@@ -377,61 +322,27 @@ int _media_thumb_update_thumb_path_wh_to_db(sqlite3 *handle,
int _media_thumb_db_connect(uid_t uid)
{
int err = MS_MEDIA_ERR_NONE;
-/*
- err = media_svc_connect(&mb_svc_handle);
- if (err != MS_MEDIA_ERR_NONE) {
- thumb_err("media_svc_connect failed: %d", err);
- mb_svc_handle = NULL;
- return err;
- }
-*/
-#ifndef _USE_MEDIA_UTIL_
- err = _media_thumb_sqlite_connect(&db_handle);
- if (err != MS_MEDIA_ERR_NONE) {
- thumb_err("_media_thumb_sqlite_connect failed: %d", err);
- db_handle = NULL;
- return err;
- }
-#else
+
err = media_db_connect(&db_handle,uid);
if (err != MS_MEDIA_ERR_NONE) {
thumb_err("media_db_connect failed: %d", err);
db_handle = NULL;
return MS_MEDIA_ERR_DB_CONNECT_FAIL;
}
-#endif
return MS_MEDIA_ERR_NONE;
}
-int
-_media_thumb_db_disconnect()
+int _media_thumb_db_disconnect()
{
int err = MS_MEDIA_ERR_NONE;
-/*
- err = media_svc_disconnect(mb_svc_handle);
- if (err != MS_MEDIA_ERR_NONE) {
- thumb_err("media_svc_disconnect failed: %d", err);
- }
-
- mb_svc_handle = NULL;
-*/
-#ifndef _USE_MEDIA_UTIL_
- err = _media_thumb_sqlite_disconnect(db_handle);
- if (err != MS_MEDIA_ERR_NONE) {
- thumb_err("_media_thumb_sqlite_disconnect failed: %d", err);
- db_handle = NULL;
- return err;
- }
-#else
err = media_db_disconnect(db_handle);
if (err != MS_MEDIA_ERR_NONE) {
thumb_err("media_db_disconnect failed: %d", err);
db_handle = NULL;
return MS_MEDIA_ERR_DB_CONNECT_FAIL;
}
-#endif
db_handle = NULL;
return err;
@@ -525,40 +436,8 @@ int _media_thumb_update_db(const char *origin_path,
uid_t uid)
{
int err = MS_MEDIA_ERR_NONE;
-
-#if 0
- Mitem *item = NULL;
-
- err = minfo_get_item(mb_svc_handle, origin_path, &item);
- if (err != MS_MEDIA_ERR_NONE) {
- thumb_err("minfo_get_item (%s) failed: %d", origin_path, err);
- return err;
- }
-
- err = minfo_update_media_thumb(mb_svc_handle, item->uuid, thumb_path);
- if (err != MS_MEDIA_ERR_NONE) {
- thumb_err("minfo_update_media_thumb (ID:%s, %s) failed: %d",
- item->uuid, thumb_path, err);
- minfo_destroy_mtype_item(item);
- return err;
- }
-
- if (item->type == MINFO_ITEM_IMAGE) {
- err = minfo_update_image_meta_info_int(mb_svc_handle, item->uuid,
- MINFO_IMAGE_META_WIDTH, width,
- MINFO_IMAGE_META_HEIGHT, height, -1);
-
- if (err != MS_MEDIA_ERR_NONE) {
- thumb_err("minfo_update_image_meta_info_int failed: %d", err);
- minfo_destroy_mtype_item(item);
- return err;
- }
- }
-
- err = minfo_destroy_mtype_item(item);
-#endif
-
int media_type = THUMB_NONE_TYPE;
+
err = _media_thumb_get_type_from_db(db_handle, origin_path, &media_type);
if (err < 0) {
thumb_err("_media_thumb_get_type_from_db (%s) failed: %d", origin_path, err);
diff --git a/src/util/media-thumb-debug.c b/src/util/media-thumb-debug.c
index b684aa4..ab75286 100755
--- a/src/util/media-thumb-debug.c
+++ b/src/util/media-thumb-debug.c
@@ -109,4 +109,3 @@ thumb_print_debug_time_ex(long start, long end, const char *func_name,
totaltime);
#endif
}
-
diff --git a/src/util/media-thumb-util.c b/src/util/media-thumb-util.c
index 2f0fef0..ed9c0c7 100755
--- a/src/util/media-thumb-util.c
+++ b/src/util/media-thumb-util.c
@@ -169,14 +169,9 @@ _media_thumb_get_file_type(const char *file_full_path)
int _media_thumb_get_store_type_by_path(const char *full_path)
{
if (full_path != NULL) {
- if (strncmp
- (full_path, THUMB_PATH_PHONE,
- strlen(THUMB_PATH_PHONE)) == 0) {
+ if (strncmp(full_path, THUMB_PATH_PHONE, strlen(THUMB_PATH_PHONE)) == 0) {
return THUMB_PHONE;
- } else
- if (strncmp
- (full_path, THUMB_PATH_MMC,
- strlen(THUMB_PATH_MMC)) == 0) {
+ } else if (strncmp(full_path, THUMB_PATH_MMC, strlen(THUMB_PATH_MMC)) == 0) {
return THUMB_MMC;
}
}
@@ -292,8 +287,7 @@ static char* _media_thumb_phone_get_path(uid_t uid)
return result_psswd;
}
-int
-_media_thumb_get_hash_name(const char *file_full_path,
+int _media_thumb_get_hash_name(const char *file_full_path,
char *thumb_hash_path, size_t max_thumb_path, uid_t uid)
{
char *hash_name;