Name: libmedia-thumbnail
Summary: Media thumbnail service library for multimedia applications
-Version: 0.1.85
+Version: 0.1.86
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
#ifdef _SUPPORT_DCM
#define dcm_retvm_if(expr, val, fmt, arg...) do { \
- if(expr) { \
+ if (expr) { \
thumb_err(fmt, ##arg); \
thumb_err("(%s) -> %s() return", #expr, __FUNCTION__); \
return (val); \
} \
} while (0)
-#define DCM_CHECK_VAL(expr, val) dcm_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!")
+#define DCM_CHECK_VAL(expr, val) dcm_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!")
#define DCM_SVC_NAME "dcm-svc"
#define DCM_SVC_EXEC_NAME "/usr/bin/dcm-svc"
static int g_dcm_timer_id = 0;
static int g_dcm_server_pid = 0;
-static char DCM_IPC_PATH[3][100] =
- {"/var/run/media-server/media_ipc_thumbdcm_dcmrecv",
- "/var/run/media-server/media_ipc_thumbdcm_thumbrecv",
- "/var/run/media-server/dcm_ipc_thumbserver_comm_recv"};
+static char DCM_IPC_PATH[3][100] = {
+ "/var/run/media-server/media_ipc_thumbdcm_dcmrecv",
+ "/var/run/media-server/media_ipc_thumbdcm_thumbrecv",
+ "/var/run/media-server/dcm_ipc_thumbserver_comm_recv"};
static gboolean g_folk_dcm_server = FALSE;
static gboolean g_dcm_server_extracting = FALSE;
g_source_destroy(g_main_context_find_source_by_id(g_main_context_get_thread_default(), id));
GSource *timer_src = g_timeout_source_new_seconds(MS_TIMEOUT_SEC_20);
- g_source_set_callback (timer_src, __thumb_server_dcm_agent_timer, NULL, NULL);
- g_dcm_timer_id = g_source_attach (timer_src, g_main_context_get_thread_default());
+ g_source_set_callback(timer_src, __thumb_server_dcm_agent_timer, NULL, NULL);
+ g_dcm_timer_id = g_source_attach(timer_src, g_main_context_get_thread_default());
}
if (result == NULL)
break;
- if (pinfo.d_type != 4 || pinfo.d_name[0] == '.'
- || pinfo.d_name[0] > 57)
+ if (pinfo.d_type != 4 || pinfo.d_name[0] == '.' || pinfo.d_name[0] > 57)
continue;
FILE *fp;
if (!(recv_msg.msg_type >= 0 && recv_msg.msg_type < THUMB_SERVER_DCM_MSG_MAX)) {
thumb_err("IPC message is wrong!");
- return MEDIA_THUMB_ERROR_NETWORK;
+ return MEDIA_THUMB_ERROR_NETWORK;
}
if (recv_msg.msg_type == THUMB_SERVER_DCM_MSG_SERVER_READY) {
}
if (g_folk_dcm_server == FALSE && g_dcm_server_extracting == FALSE) {
- if(__thumb_server_dcm_check_process() == FALSE) { // dcm-svc is running?
+ if (__thumb_server_dcm_check_process() == FALSE) { // dcm-svc is running?
thumb_warn("Dcm-svc server is not running.. so start it");
memcpy(&last_msg, recv_msg, sizeof(thumb_server_dcm_ipc_msg_s));
if (!__thumb_server_dcm_agent_execute_server()) {
if (!(recv_msg->msg_type >= 0 && recv_msg->msg_type < THUMB_SERVER_DCM_MSG_MAX)) {
thumb_err("IPC message is wrong!");
- return MS_MEDIA_ERR_SOCKET_RECEIVE;
+ return MS_MEDIA_ERR_SOCKET_RECEIVE;
}
return MS_MEDIA_ERR_NONE;
if ((sockfd = accept(serv_sock, (struct sockaddr*)&client_addr, &client_addr_len)) < 0) {
thumb_err("accept failed : %s", strerror(errno));
- *client_sock = -1;
+ *client_sock = -1;
return MS_MEDIA_ERR_SOCKET_ACCEPT;
}
- *client_sock = sockfd;
+ *client_sock = sockfd;
return MS_MEDIA_ERR_NONE;
}
strcpy(serv_addr.sun_path, DCM_IPC_PATH[port]);
/* Bind socket to local address */
- for (i = 0; i < 20; i ++) {
+ for (i = 0; i < 20; i++) {
if (bind(sock, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) == 0) {
bind_success = true;
break;
}
- thumb_dbg("#%d bind",i);
+ thumb_dbg("#%d bind", i);
usleep(250000);
}
GMainContext *context = NULL;
int err = 0;
- thumb_err( "_thumb_server_dcm_thread!S");
+ thumb_err("_thumb_server_dcm_thread!S");
/* Create TCP Socket to receive message from thumb server main thread */
b_dcm_svc_launched = false;
thumb_dbg("********************************************");
- thumb_dbg("*** Thumb Server DCM thread is running ***");
+ thumb_dbg("*** Thumb Server DCM thread is running ***");
thumb_dbg("********************************************");
/* Start to run main event loop for dcm thread */
thumb_dbg("*** Thumb Server DCM thread will be closed ***");
/* Destroy IO channel */
- g_io_channel_shutdown(channel, FALSE, NULL);
+ g_io_channel_shutdown(channel, FALSE, NULL);
g_io_channel_unref(channel);
/* Close the TCP socket */
return MS_MEDIA_ERR_SOCKET_SEND;
}
- thumb_err( "_thumb_server_dcm_send_msg to %d ", port);
+ thumb_err("_thumb_server_dcm_send_msg to %d", port);
int socket_fd = -1;
struct sockaddr_un serv_addr;
return MS_MEDIA_ERR_INTERNAL;
}
- while(1) {
+ while (1) {
err = sqlite3_step(sqlite_stmt);
if (err != SQLITE_ROW) {
thumb_dbg("end of row [%s]", sqlite3_errmsg(sqlite_db_handle));
strncpy(recv_msg.org_path, path, sizeof(recv_msg.org_path));
recv_msg.org_path[sizeof(recv_msg.org_path) - 1] = '\0';
- err = _thumb_daemon_process_job(&recv_msg, &res_msg,uid );
+ err = _thumb_daemon_process_job(&recv_msg, &res_msg, uid);
if (err == MS_MEDIA_ERR_FILE_NOT_EXIST) {
thumb_err("Thumbnail processing is failed : %d", err);
} else {
}
if (ms_cynara_receive_untrusted_message_thumb(client_sock, &recv_msg, &credentials) != MS_MEDIA_ERR_NONE) {
- thumb_err("ms_cynara_receive_untrusted_message_thumb failed");
+ thumb_err("ms_cynara_receive_untrusted_message_thumb failed");
close(client_sock);
return FALSE;
}
_thumb_server_send_deny_message(client_sock);
close(client_sock);
return TRUE;
- }
+ }
- if(recv_msg.msg_type != THUMB_REQUEST_KILL_SERVER) {
+ if (recv_msg.msg_type != THUMB_REQUEST_KILL_SERVER) {
if (ms_cynara_check(&credentials, MEDIA_STORAGE_PRIVILEGE) != MS_MEDIA_ERR_NONE) {
thumb_err("Cynara denied access to process request");
_thumb_server_send_deny_message(client_sock);
thumb_dbg("All thumbnails are being extracted now");
__thumb_daemon_all_extract(recv_msg.uid);
g_idle_add(_thumb_daemon_process_queue_jobs, NULL);
-
+
#ifdef _SUPPORT_DCM
/* Send msg to dcm thread to scan all images */
_thumb_server_dcm_send_msg(THUMB_SERVER_DCM_MSG_SCAN_ALL, recv_msg.uid, NULL, THUMB_SERVER_DCM_PORT_DCM_RECV);
#endif /* _SUPPORT_DCM */
- } else if(recv_msg.msg_type == THUMB_REQUEST_RAW_DATA) {
+ } else if (recv_msg.msg_type == THUMB_REQUEST_RAW_DATA) {
__thumb_daemon_process_job_raw(&recv_msg, &res_msg);
- } else if(recv_msg.msg_type == THUMB_REQUEST_KILL_SERVER) {
+ } else if (recv_msg.msg_type == THUMB_REQUEST_KILL_SERVER) {
thumb_warn("received KILL msg from thumbnail agent.");
} else {
- _thumb_daemon_process_job(&recv_msg, &res_msg,recv_msg.uid);
+ _thumb_daemon_process_job(&recv_msg, &res_msg, recv_msg.uid);
#ifdef _SUPPORT_DCM
/* Send msg to dcm thread to scan a single image */
#endif /* _SUPPORT_DCM */
}
- if(res_msg.msg_type == 0)
+ if (res_msg.msg_type == 0)
res_msg.msg_type = recv_msg.msg_type;
res_msg.request_id = recv_msg.request_id;
strncpy(res_msg.org_path, recv_msg.org_path, recv_msg.origin_path_size);
res_msg.origin_path_size = recv_msg.origin_path_size;
- if(res_msg.msg_type != THUMB_RESPONSE_RAW_DATA) {
+ if (res_msg.msg_type != THUMB_RESPONSE_RAW_DATA) {
res_msg.dest_path_size = strlen(res_msg.dst_path)+1;
res_msg.thumb_size = 0;
} else {
unsigned char *buf = NULL;
_media_thumb_set_buffer(&res_msg, &buf, &buf_size);
- while(buf_size > 0) {
- if(buf_size < THUMB_BLOCK_SIZE) {
+ while (buf_size > 0) {
+ if (buf_size < THUMB_BLOCK_SIZE) {
block_size = buf_size;
}
if (send(client_sock, buf+sending_block, block_size, 0) != block_size) {
}
sending_block += block_size;
buf_size -= block_size;
- if(block_size < THUMB_BLOCK_SIZE) {
+ if (block_size < THUMB_BLOCK_SIZE) {
block_size = THUMB_BLOCK_SIZE;
}
}
- if(buf_size == 0) {
+ if (buf_size == 0) {
thumb_dbg_slog("Sent data(%d) from %s", res_msg.thumb_size, res_msg.org_path);
}
SAFE_FREE(buf);
- if(recv_msg.msg_type == THUMB_REQUEST_KILL_SERVER) {
+ if (recv_msg.msg_type == THUMB_REQUEST_KILL_SERVER) {
thumb_warn("Shutting down...");
#ifdef _SUPPORT_DCM
/* Quit dcm thread main loop */
ms_ipc_delete_client_socket(&sock_info);
- return TRUE;
+ return TRUE;
}
static gboolean _thumb_server_send_deny_message(int sockfd)
{
char *result_psswd = NULL;
struct group *grpinfo = NULL;
- if(uid == getuid())
- {
+ if (uid == getuid()) {
result_psswd = strdup(THUMB_DEFAULT_PATH);
grpinfo = getgrnam("users");
- if(grpinfo == NULL) {
+ if (grpinfo == NULL) {
thumb_err("getgrnam(users) returns NULL !");
- if(result_psswd)
+ if (result_psswd)
free(result_psswd);
return NULL;
}
- }
- else
- {
+ } else {
struct passwd *userinfo = getpwuid(uid);
- if(userinfo == NULL) {
+ if (userinfo == NULL) {
thumb_err("getpwuid(%d) returns NULL !", uid);
return NULL;
}
grpinfo = getgrnam("users");
- if(grpinfo == NULL) {
+ if (grpinfo == NULL) {
thumb_err("getgrnam(users) returns NULL !");
return NULL;
}
file_type = _media_thumb_get_file_type(origin_path);
thumb_width = *width;
thumb_height = *height;
- if(thumb_width == 0) {
+ if (thumb_width == 0) {
thumb_width = THUMB_DEFAULT_WIDTH;
thumb_height = THUMB_DEFAULT_HEIGHT;
}
if (origin_width) *origin_width = thumb_info.origin_width;
if (origin_height) *origin_height = thumb_info.origin_height;
if (alpha) *alpha = thumb_info.alpha;
- if (is_saved) *is_saved= thumb_info.is_saved;
+ if (is_saved) *is_saved = thumb_info.is_saved;
thumb_dbg("Thumb data is generated successfully (Size:%d, W:%d, H:%d) 0x%x",
*size, *width, *height, *data);
return MS_MEDIA_ERR_NONE;
} else {
if (strlen(thumb_path) == 0) {
- err = _media_thumb_get_hash_name(origin_path, thumb_path, max_length,uid);
+ err = _media_thumb_get_hash_name(origin_path, thumb_path, max_length, uid);
if (err != MS_MEDIA_ERR_NONE) {
char *default_path = _media_thumb_get_default_path(uid);
- if(default_path) {
+ if (default_path) {
thumb_err("_media_thumb_get_hash_name failed - %d", err);
strncpy(thumb_path, default_path, max_length);
free(default_path);
strncpy(thumb_path, req_msg->dst_path, max_length);
} else if (msg_type == THUMB_REQUEST_ALL_MEDIA) {
- err = _media_thumb_get_hash_name(origin_path, thumb_path, max_length,uid);
+ err = _media_thumb_get_hash_name(origin_path, thumb_path, max_length, uid);
if (err != MS_MEDIA_ERR_NONE) {
char *default_path = _media_thumb_get_default_path(uid);
- if(default_path) {
+ if (default_path) {
thumb_err("_media_thumb_get_hash_name failed - %d", err);
strncpy(thumb_path, default_path, max_length);
free(default_path);
thumb_err("_thumbnail_get_data failed - %d", err);
SAFE_FREE(data);
- if(default_path) {
+ if (default_path) {
strncpy(thumb_path, default_path, max_length);
free(default_path);
default_path = NULL;
SAFE_FREE(data);
if (msg_type == THUMB_REQUEST_DB_INSERT || msg_type == THUMB_REQUEST_ALL_MEDIA) {
- if(default_path) {
+ if (default_path) {
strncpy(thumb_path, default_path, max_length);
free(default_path);
default_path = NULL;
thumb_err("sigaction failed [%s]", strerror(errno));
}
- signal(SIGPIPE,SIG_IGN);
+ signal(SIGPIPE, SIG_IGN);
}
#endif
g_source_attach(source, context);
GSource *source_evas_init = NULL;
- source_evas_init = g_idle_source_new ();
- g_source_set_callback (source_evas_init, _thumb_daemon_start_jobs, NULL, NULL);
- g_source_attach (source_evas_init, context);
+ source_evas_init = g_idle_source_new();
+ g_source_set_callback(source_evas_init, _thumb_daemon_start_jobs, NULL, NULL);
+ g_source_attach(source_evas_init, context);
#ifdef _SUPPORT_DCM
- thumb_dbg( "[GD] _thumb_server_dcm_thread created");
+ thumb_dbg("[GD] _thumb_server_dcm_thread created");
/* Create dcm thread */
GThread *dcm_thread = NULL;
dcm_thread = g_thread_new("dcm_thread", (GThreadFunc)_thumb_server_dcm_thread, NULL);
-#define MAX_CODES 4096
+#define MAX_CODES 4096
-int __FastImgGetNextFrameAGIF_NoBuffer (AGifFrameInfo *pFrameData, BOOL bCenterAlign);
-int __FastImgGetNextFrameAGIF_UseBuffer (AGifFrameInfo *pFrameData, BOOL bCenterAlign);
+int __FastImgGetNextFrameAGIF_NoBuffer(AGifFrameInfo *pFrameData, BOOL bCenterAlign);
+int __FastImgGetNextFrameAGIF_UseBuffer(AGifFrameInfo *pFrameData, BOOL bCenterAlign);
int image_left_pos_N = 0; /* left position of image in Logical screeen */
int image_top_pos_N = 0;
pFrameData->nRepeatCount = 0;
- thumb_dbg("10st data : 0x%x , global color table num : %d", pEncodedData[10], header_temp);
+ thumb_dbg("10st data : 0x%x , global color table num : %d", pEncodedData[10], header_temp);
thumb_dbg("13: 0x%x ,14: 0x%x, 15: 0x%x, nRepeatCount : %d, nLoopCount : %d", pEncodedData[13+header_temp], pEncodedData[14+header_temp], pEncodedData[15+header_temp], pFrameData->nRepeatCount, pFrameData->nLoopCount);
backcolor_index = pEncodedData[11];
if (pEncodedData[14+header_temp] == 0xF9) {
transparent = pEncodedData[16+header_temp] & 0x01;
- transIndex = pEncodedData[19+header_temp];
+ transIndex = pEncodedData[19+header_temp];
backcolor_parsing = (unsigned short)((pEncodedData[inputPos+backcolor_index*3] >> 3)<<11) | ((pEncodedData[inputPos+backcolor_index*3+1] >> 2)<<5) | (pEncodedData[inputPos+backcolor_index*3+2] >> 3);
} else if (pEncodedData[14+19+header_temp] == 0xF9) {
if (pEncodedData[14+header_temp] == 0xF9 || pEncodedData[14+19+header_temp] == 0xF9) {
if (transparent == 1 && backcolor_index == transIndex) {
- image_backcolor = ui_backcolor;
+ image_backcolor = ui_backcolor;
} else if (transparent == 1 && backcolor_index != transIndex) {
image_backcolor = backcolor_parsing;
} else {
- image_backcolor = backcolor_parsing;
+ image_backcolor = backcolor_parsing;
}
} else {
- image_backcolor = backcolor_parsing;
+ image_backcolor = backcolor_parsing;
}
#if MODE == 0
#if MODE == 2
if (((pFrameData->logi_wdt <= width) && (pFrameData->logi_hgt <= height))) {
- if (0 == (pFrameData->pPrevImg = IfegMemAlloc(sizeof(unsigned char)*width*height*2))) {
+ if (0 == (pFrameData->pPrevImg = IfegMemAlloc(sizeof(unsigned char)*width*height*2))) {
if (pFrameData) {
IfegMemFree(pFrameData);
pFrameData = 0;
}
pFrameData->useBuffer = 0;
} else {
- if (0 == (pFrameData->pPrevImg = IfegMemAlloc(sizeof(unsigned int)*pFrameData->logi_wdt*pFrameData->logi_hgt))) {
+ if (0 == (pFrameData->pPrevImg = IfegMemAlloc(sizeof(unsigned int)*pFrameData->logi_wdt*pFrameData->logi_hgt))) {
if (pFrameData) {
IfegMemFree(pFrameData);
pFrameData = 0;
inputPos = pFrameData->offset;
done_prefix = IfegMemAlloc(sizeof(unsigned char)*(MAX_CODES+1));
- if (done_prefix == 0)
- {
+ if (done_prefix == 0) {
thumb_err("Failed to allocate memory for check buffer.");
return -1;
}
out_x = 0, out_y = -dechgt;
/* Color Resolution */
- if ((buffer[8] & 0x80) == 0) { /* Logical color table */
+ if ((buffer[8] & 0x80) == 0) { /* Logical color table */
/* use global table */
} else { /* Logical color table */
IfegMemset(dacbox, 0, 1024);
}
/* Now that we've pushed the decoded string (in reverse order)
* onto the stack, lets pop it off and put it into our decode
- * buffer... And when the decode buffer is full, write another
+ * buffer... And when the decode buffer is full, write another
* line...
*/
while (sp > dstack) {
if (!flag) {
out_x = 0, out_y += dechgt;
}
- } else { /* interlaced image */
+ } else { /* interlaced image */
if (inter_step == 1) {
startloc += 8;
} else if (inter_step == 2) {
a_x += orgwdt, c_x += orgwdt;
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32 + (b_x/orgwdt)) += 0x1000000;
*(pImage32_2 + (d_x/orgwdt)) += 0x1000000;
c_x += orgwdt;
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32_2 + (d_x/orgwdt)) += 0x1000000;
d_x += orgwdt;
*(pImage32_2 + (c_x/orgwdt)) += pDacbox[val1];
a_x += orgwdt, c_x += orgwdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/orgwdt)) += pDacbox[val1];
*(pImage32_2 + (d_x/orgwdt)) += pDacbox[val1];
b_x += orgwdt, d_x += orgwdt;
*(pImage32 + (a_x/orgwdt)) += pDacbox[val1];
a_x += orgwdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/orgwdt)) += pDacbox[val1];
b_x += orgwdt;
}
IfegMemset(done_prefix, 0, sizeof(unsigned char)*(MAX_CODES+1));
while (code >= newcodes) {
*sp++ = suffix[code];
- if ((code == prefix[code]) || (done_prefix[code] == 1))
- {
+ if ((code == prefix[code]) || (done_prefix[code] == 1)) {
thumb_err("Circular entry in table.");
if (decoderline != 0) {
IfegMemFree(decoderline);
/* Color Resolution */
IfegMemset(global_dacbox, 0, 1024);
numcolors = (buffer[10] & 0x7) + 1;
- if ((buffer[10] & 0x80) == 0) { /* Global color table */
+ if ((buffer[10] & 0x80) == 0) { /* Global color table */
global_dacbox[0] = 0x000000;
global_dacbox[1] = 0x3f3f3f;
numcolors = 2;
out_x = 0, out_y = -dechgt;
/* Color Resolution */
- if ((buffer[8] & 0x80) == 0) { /* Logical color table */
+ if ((buffer[8] & 0x80) == 0) { /* Logical color table */
;/* use global table */
} else { /* Logical color table */
IfegMemset(dacbox, 0, 1024);
if (logi_hgt < (image_top_pos + orghgt)) {
for (i = 0; i < logi_hgt - image_top_pos; i++) {
for (j = 0; j < orgwdt; j++) {
- pImage32[j] = 0x1000000; /* set ui color */
+ pImage32[j] = 0x1000000; /* set ui color */
}
pImage32 += logi_wdt;
}
} else {
for (i = 0; i < orghgt; i++) {
for (j = 0; j < orgwdt; j++) {
- pImage32[j] = 0x1000000; /* set ui color */
+ pImage32[j] = 0x1000000; /* set ui color */
}
pImage32 += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
}
/* Now that we've pushed the decoded string (in reverse order)
* onto the stack, lets pop it off and put it into our decode
- * buffer... And when the decode buffer is full, write another
+ * buffer... And when the decode buffer is full, write another
* line...
*/
while (sp > dstack) {
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
a_x += logi_wdt, c_x += logi_wdt;
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i+image_left_pos];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i+image_left_pos];
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
a_x += logi_wdt;
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i+image_left_pos];
b_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
c_x += logi_wdt;
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i+image_left_pos];
d_x += logi_wdt;
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32_2 + (c_x/logi_wdt)) += pDacbox[val1];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += pDacbox[val1];
*(pImage32_2 + (d_x/logi_wdt)) += pDacbox[val1];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
*(pImage32 + (a_x/logi_wdt)) += pDacbox[val1];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += pDacbox[val1];
b_x += logi_wdt;
}
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += pDacbox[val1];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += pDacbox[val1];
d_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
a_x += logi_wdt, c_x += logi_wdt;
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i+image_left_pos];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i+image_left_pos];
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
a_x += logi_wdt;
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i+image_left_pos];
b_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
c_x += logi_wdt;
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i+image_left_pos];
d_x += logi_wdt;
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
a_x += logi_wdt, c_x += logi_wdt;
backGround[i+image_left_pos] = backcolor888;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += pDacbox[val1];
*(pImage32_2 + (d_x/logi_wdt)) += pDacbox[val1];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
a_x += logi_wdt;
backGround[i+image_left_pos] = backcolor888;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += pDacbox[val1];
b_x += logi_wdt;
backGround[i+image_left_pos] = backcolor888;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
c_x += logi_wdt;
backGround[i+image_left_pos] = backcolor888;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += pDacbox[val1];
d_x += logi_wdt;
backGround[i+image_left_pos] = backcolor888;
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
}
/* Now that we've pushed the decoded string (in reverse order)
* onto the stack, lets pop it off and put it into our decode
- * buffer... And when the decode buffer is full, write another
+ * buffer... And when the decode buffer is full, write another
* line...
*/
while (sp > dstack) {
len = orgwdt;
}
- if (interLaced == 0) { /* interlaced image */
+ if (interLaced == 0) { /* interlaced image */
if (!flag) {
out_x = 0, out_y += dechgt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
backGround[i+image_left_pos] = pDacbox[val1];
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i+image_left_pos];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i+image_left_pos];
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
backGround[i+image_left_pos] = pDacbox[val1];
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i+image_left_pos];
b_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
backGround[i+image_left_pos] = pDacbox[val1];
}
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
if (val1 == transIndex) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i+image_left_pos];
d_x += logi_wdt;
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
a_x += logi_wdt, c_x += logi_wdt;
backGround[i+image_left_pos] = pDacbox[val1];
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += pDacbox[val1];
*(pImage32_2 + (d_x/logi_wdt)) += pDacbox[val1];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
a_x += logi_wdt;
backGround[i+image_left_pos] = pDacbox[val1];
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += pDacbox[val1];
b_x += logi_wdt;
backGround[i+image_left_pos] = pDacbox[val1];
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
c_x += logi_wdt;
backGround[i+image_left_pos] = pDacbox[val1];
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += pDacbox[val1];
d_x += logi_wdt;
backGround[i+image_left_pos] = pDacbox[val1];
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
a_x += logi_wdt, c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
b_x += logi_wdt, d_x += logi_wdt;
*(pImage32 + (a_x/logi_wdt)) += backGround[i];
a_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32 + (b_x/logi_wdt)) += backGround[i];
b_x += logi_wdt;
}
*(pImage32_2 + (c_x/logi_wdt)) += backGround[i];
c_x += logi_wdt;
}
- if (0 <= d2 && d2 < decwdt) {
+ if (0 <= d2 && d2 < decwdt) {
*(pImage32_2 + (d_x/logi_wdt)) += backGround[i];
d_x += logi_wdt;
}
}
- /* 565 Conversion */
+ /* 565 Conversion */
pImage32 = (unsigned int *)(pDecBuf);
for (i = 0, k = margin_hgt1_2; i < dechgt; i++) {
if ((*pImage32>>24) == 0) {
*(pImage16++) = ((*pImage32 & 0xf80000) >> 8) | ((*pImage32 & 0xfc00) >> 5) | ((*pImage32 & 0xf8) >> 3);
} else if ((*pImage32 >> 24) == 1) {
- *(pImage16++) = (((*pImage32 & 0xf80000) >> 6) / 3) | (((*pImage32 & 0xfc00) >> 3)/3) | (((*pImage32 & 0xf8) >> 1)/3);
+ *(pImage16++) = (((*pImage32 & 0xf80000) >> 6) / 3) | (((*pImage32 & 0xfc00) >> 3)/3) | (((*pImage32 & 0xf8) >> 1)/3);
} else if ((*pImage32 >> 24) == 2) {
*(pImage16++) = ((*pImage32 & 0xf80000) >> 7) | ((*pImage32 & 0xfc00) >> 4) | ((*pImage32 & 0xf8) >> 2);
} else {
#define TIFF_IMAGE_WIDTH 0x100
#define TIFF_IMAGE_HEIGHT 0x101
-#define JPG_HEADER_TYPE_LENGTH 2
-#define JPG_BLOCK_SIZE_LENGTH 2
-#define JPG_IMAGE_SIZE_LENGTH 8
+#define JPG_HEADER_TYPE_LENGTH 2
+#define JPG_BLOCK_SIZE_LENGTH 2
+#define JPG_IMAGE_SIZE_LENGTH 8
#define FILE_READ_SIZE 4096
typedef struct _stream {
}
if (pIfegstreamctrl->buffpos == 0) {
- if (DrmReadFile
- (pIfegstreamctrl->fd, pIfegstreamctrl->buffer,
- FILE_READ_SIZE, &fileread) == FALSE) {
+ if (DrmReadFile(pIfegstreamctrl->fd, pIfegstreamctrl->buffer, FILE_READ_SIZE, &fileread) == FALSE) {
return 0;
}
if (fileread == 0) {
pIfegstreamctrl->buffpos = 0;
} else {
- if (size >= 2048
- || pIfegstreamctrl->buffend -
- pIfegstreamctrl->buffpos > FILE_READ_SIZE) {
+ if (size >= 2048 || pIfegstreamctrl->buffend - pIfegstreamctrl->buffpos > FILE_READ_SIZE) {
return 0;
}
AcMemcpy(pIfegstreamctrl->buffer,
- &pIfegstreamctrl->buffer[pIfegstreamctrl->
- buffpos],
+ &pIfegstreamctrl->buffer[pIfegstreamctrl->buffpos],
pIfegstreamctrl->buffend -
pIfegstreamctrl->buffpos);
- if (DrmReadFile
- (pIfegstreamctrl->fd,
- &pIfegstreamctrl->buffer[pIfegstreamctrl->buffend -
- pIfegstreamctrl->buffpos],
- pIfegstreamctrl->buffpos, &fileread) == FALSE) {
+ if (DrmReadFile(pIfegstreamctrl->fd, &pIfegstreamctrl->buffer[pIfegstreamctrl->buffend - pIfegstreamctrl->buffpos], pIfegstreamctrl->buffpos, &fileread) == FALSE) {
return 0;
}
if (fileread == 0) {
return 0;
}
- pIfegstreamctrl->buffend =
- pIfegstreamctrl->buffend -
- pIfegstreamctrl->buffpos + fileread;
+ pIfegstreamctrl->buffend = pIfegstreamctrl->buffend - pIfegstreamctrl->buffpos + fileread;
pIfegstreamctrl->buffpos = 0;
pIfegstreamctrl->filepos += fileread;
}
unsigned int *pHeight = NULL;
int ret = MS_MEDIA_ERR_NONE;
- if (type == NULL || width == NULL ||height == NULL ) {
+ if (type == NULL || width == NULL || height == NULL) {
return MS_MEDIA_ERR_INVALID_PARAMETER;
} else {
pWidth = width;
thumb_dbg("IMG_CODEC_JPEG");
*type = IMG_CODEC_JPEG;
}
- /*********************** PNG *************************/
+ /*********************** PNG *************************/
else if (AcMemcmp(EncodedDataBuffer, gIfegPNGHeader, PNG_HEADER_LENGTH) == 0) {
unsigned char tmp;
thumb_dbg("IMG_CODEC_PNG");
*type = IMG_CODEC_PNG;
}
- /*********************** BMP *************************/
+ /*********************** BMP *************************/
else if (AcMemcmp(EncodedDataBuffer, gIfegBMPHeader, BMP_HEADER_LENGTH) == 0) {
/* Parse BMP File and get image width and image height */
if (DrmReadFile(hFile, &EncodedDataBuffer[8], 18, &fileread) == FALSE) {
if (pHeight) {
// add the reference function abs(). may have negative height values in bmp header.
*pHeight = abs(EncodedDataBuffer[22] | (EncodedDataBuffer[23] << 8) |
- (EncodedDataBuffer[24] << 16) | (EncodedDataBuffer[25] << 24));
+ (EncodedDataBuffer[24] << 16) | (EncodedDataBuffer[25] << 24));
}
thumb_dbg("IMG_CODEC_BMP");
*type = IMG_CODEC_BMP;
}
- /*********************** GIF *************************/
+ /*********************** GIF *************************/
else if (AcMemcmp(EncodedDataBuffer, gIfegGIFHeader, GIF_HEADER_LENGTH) == 0) {
unsigned int tablelength = 0;
unsigned int imagecount = 0;
img_block_w = EncodedDataBuffer[ifegstreamctrl.buffpos + 4] |(EncodedDataBuffer[ifegstreamctrl.buffpos + 5] << 8);
img_block_h = EncodedDataBuffer[ifegstreamctrl.buffpos + 6] |(EncodedDataBuffer[ifegstreamctrl.buffpos + 7] << 8);
- thumb_dbg ("Image block width : %d, Height : %d, left:%d, top:%d", img_block_w, img_block_h);
+ thumb_dbg("Image block width : %d, Height : %d, left : %d, top : %d", img_block_w, img_block_h);
*pWidth = img_block_w;
*pHeight = img_block_h;
return ret;
}
- length =EncodedDataBuffer[ifegstreamctrl.buffpos++];
+ length = EncodedDataBuffer[ifegstreamctrl.buffpos++];
if ((length + ifegstreamctrl.buffpos) > ifegstreamctrl.buffend) {
length =
length +
ifegstreamctrl.buffpos = 0;
ifegstreamctrl.buffend = 0;
} else {
- ifegstreamctrl.buffpos +=length;
+ ifegstreamctrl.buffpos += length;
}
/* File End Check */
thumb_dbg("IMG_CODEC_GIF");
*type = IMG_CODEC_GIF;
}
- /*********************** WBMP *************************/
+ /*********************** WBMP *************************/
else if ((AcMemcmp(EncodedDataBuffer, gIfegWBMPHeader, WBMP_HEADER_LENGTH) == 0)
&& (strcasecmp(fileExt, "wbmp") == 0)) {
/* Parse BMP File and get image width and image height */
unsigned char *raw_data = NULL;
if (szFileName == NULL) {
- thumb_err
- ("ImgGetFirstFrameAGIFAtSize: Input File Name is NULL");
+ thumb_err("ImgGetFirstFrameAGIFAtSize: Input File Name is NULL");
return NULL;
}
if (width == 0 || height == 0) {
- thumb_err
- ("ImgGetFirstFrameAGIFAtSize: Input width or height is zero");
+ thumb_err("ImgGetFirstFrameAGIFAtSize: Input width or height is zero");
return NULL;
}
- pFrameInfo =
- ImgCreateAGIFFrame(szFileName, width,
- height, 0, FALSE);
+ pFrameInfo = ImgCreateAGIFFrame(szFileName, width, height, 0, FALSE);
if (pFrameInfo && pFrameInfo->pOutBits) {
ImgGetNextAGIFFrame(pFrameInfo, TRUE);
- if (ImgConvertRGB565ToRGB888
- (pFrameInfo->pOutBits, &pDecodedRGB888Buf,
- pFrameInfo->width, pFrameInfo->height)) {
+ if (ImgConvertRGB565ToRGB888(pFrameInfo->pOutBits, &pDecodedRGB888Buf, pFrameInfo->width, pFrameInfo->height)) {
if (pDecodedRGB888Buf) {
free(pFrameInfo->pOutBits);
pFrameInfo->pOutBits = pDecodedRGB888Buf;
- unsigned char *src =
- ((unsigned char *)(pFrameInfo->pOutBits));
+ unsigned char *src = ((unsigned char *)(pFrameInfo->pOutBits));
unsigned int i = 0;
unsigned char *dest = raw_data;
while (i--) {
if (dest != NULL) {
- *dest =
- *((unsigned char *)(src));
+ *dest = *((unsigned char *)(src));
dest++;
src++;
}
return (unsigned int *)raw_data;
}
-int ImgConvertRGB565ToRGB888(void *pBuf_rgb565, void **pBuf_rgb888, int width,
- int height)
+int ImgConvertRGB565ToRGB888(void *pBuf_rgb565, void **pBuf_rgb888, int width, int height)
{
unsigned short *rgb565buf = 0;
unsigned char *rgb888Buf = 0;
return TRUE;
}
-/**
- * This function is wrapper function for "ImgFastCreateAGIFFrameData".
- *
- * @param szFileName[in] Specifies the read image data.
- * @param width[in] Specifies a width of the image to be created.
- * @param height[in] Specifies a height of the image to be created.
- * @param bgColor[in] Specifies background color of output buffer.
- * @param bLoop[in] Specifies looping condition whether infinte or once play.
- * @return This fucntion returns AGifFrameInfo Structure's pointer.
- * @see ImgFastCreateAGIFFrameData.
- */
-
-AGifFrameInfo *ImgCreateAGIFFrame(const char *szFileName, unsigned int width,
- unsigned int height, unsigned int bgColor,
- BOOL bLoop)
+AGifFrameInfo *ImgCreateAGIFFrame(const char *szFileName, unsigned int width, unsigned int height, unsigned int bgColor, BOOL bLoop)
{
HFile hFile;
FmFileAttribute fileAttrib;
DrmCloseFile(hFile);
return NULL;
}
- memset(pEncodedData,0,mem_alloc_size);
+ memset(pEncodedData, 0, mem_alloc_size);
/* coverity[ -tainted_data_argument : pEncodedData ] */
if (DrmReadFile(hFile, pEncodedData, mem_alloc_size, &size) == FALSE) {
thumb_err("DrmReadFile was failed");
DrmCloseFile(hFile);
- return FastImgCreateAGIFFrameData(width, height, pEncodedData,
- cFileSize, bgColor, bLoop);
+ return FastImgCreateAGIFFrameData(width, height, pEncodedData, cFileSize, bgColor, bLoop);
}
-/**
- * This function is wrapper function for "ImgFastDestroyAGIFFrameData".
- *
- * @param pFrameData[in]
- * @return void
- * @see ImgFastDestroyAGIFFrameData.
- * @see ImgFastDestroyAGIFFrameData.
- *
- * @note ImgFastDestroyAGIFFrameData function set free all memory in AGifFrameInfo structure
- * even pEncodedData
- *
- * @author rubric(sinjae4b.lee@samsung.com)
- */
-
void ImgDestroyAGIFFrame(AGifFrameInfo *pFrameData)
{
SysAssert(pFrameData);
FastImgDestroyAGIFFrameData(pFrameData);
}
-/**
- * This function is wrapper function for "ImgFastGetNextFrameAGIF".
- *
- * @param pFrameData[in]
- * @param bCenterAlign Specifies true if you want center align in output buffer, else left top align
- * @return This fucntion returns True or False as decoding result.
- * @see ImgFastGetNextFrameAGIF.
- *
- * @note This function returns one frame data it decoded.
- * next time, returns next decoded frame data... and so on.
- *
- * @author rubric(sinjae4b.lee@samsung.com)
- */
-
-ImgFastCodecInfo ImgGetNextAGIFFrame(AGifFrameInfo *gFrameData,
- BOOL bCenterAlign)
+ImgFastCodecInfo ImgGetNextAGIFFrame(AGifFrameInfo *gFrameData, BOOL bCenterAlign)
{
int iResult;
#define thumb_dbg(fmt, arg...) do{ \
LOGD(FONT_COLOR_RESET fmt "\n", ##arg); \
- } while(0)
+ } while (0)
#define thumb_warn(fmt, arg...) do{ \
LOGW(FONT_COLOR_GREEN fmt "\n", ##arg); \
- } while(0)
+ } while (0)
#define thumb_err(fmt, arg...) do{ \
LOGE(FONT_COLOR_RED fmt "\n", ##arg); \
- } while(0)
+ } while (0)
#define thumb_dbg_slog(fmt, arg...) do{ \
SECURE_LOGD(FONT_COLOR_RESET fmt "\n", ##arg); \
- } while(0)
+ } while (0)
#define thumb_warn_slog(fmt, arg...) do{ \
SECURE_LOGW(FONT_COLOR_GREEN fmt "\n", ##arg); \
- } while(0)
+ } while (0)
#define ERR_BUF_LENGHT 256
#ifndef _MEDIA_THUMB_UTIL_H_
#define _MEDIA_THUMB_UTIL_H_
-#define SAFE_FREE(src) { if(src) {free(src); src = NULL;}}
+#define SAFE_FREE(src) { if (src) {free(src); src = NULL;}}
#define THUMB_MALLOC(src, size) { if (size <= 0) {src = NULL;} \
- else { src = malloc(size); if(src) memset(src, 0x0, size);} }
+ else { src = malloc(size); if (src) memset(src, 0x0, size);} }
typedef enum {
MEDIA_THUMB_BGRA, /* BGRA, especially provided for evas users */
break;
}
}
- if(!flag) {
+ if (!flag) {
return __media_thumb_check_req_queue_for_cancel(path);
}
}
break;
}
}
- if(!flag) {
+ if (!flag) {
return __media_thumb_check_raw_data_req_queue_for_cancel(request_id);
}
}
if (req == NULL) {
return false;
} else {
- if(req->isCanceled)
+ if (req->isCanceled)
return false;
else
return true;
if (req == NULL) {
return false;
} else {
- if(req->isCanceled)
+ if (req->isCanceled)
return false;
else
return true;
//thumb_dbg("origin_path_size : %d, dest_path_size : %d, thumb_size : %d", msg->origin_path_size, msg->dest_path_size, msg->thumb_size);
SAFE_FREE(buf);
- if(msg->origin_path_size < 0 ||msg->dest_path_size < 0 || msg->thumb_size < 0) {
+ if (msg->origin_path_size < 0 || msg->dest_path_size < 0 || msg->thumb_size < 0) {
thumb_err("recv data is wrong");
SAFE_FREE(block_buf);
return MS_MEDIA_ERR_SOCKET_RECEIVE;
remain_size = msg->origin_path_size + msg->dest_path_size + msg->thumb_size;
THUMB_MALLOC(buf, remain_size);
- if(buf == NULL) {
+ if (buf == NULL) {
SAFE_FREE(block_buf);
return MS_MEDIA_ERR_OUT_OF_MEMORY;
}
- while(remain_size > 0) {
- if(remain_size < THUMB_SOCK_BLOCK_SIZE) {
+ while (remain_size > 0) {
+ if (remain_size < THUMB_SOCK_BLOCK_SIZE) {
block_size = remain_size;
}
if ((recv_msg_len = recv(sock, block_buf, block_size, 0)) < 0) {
strncpy(msg->dst_path, (char *)buf + msg->origin_path_size, msg->dest_path_size);
SAFE_FREE(msg->thumb_data);
- if(msg->thumb_size > 0) {
+ if (msg->thumb_size > 0) {
THUMB_MALLOC(msg->thumb_data, msg->thumb_size);
- if(msg->thumb_data != NULL) {
+ if (msg->thumb_data != NULL) {
memcpy(msg->thumb_data, buf + msg->origin_path_size + msg->dest_path_size, msg->thumb_size);
} else {
SAFE_FREE(buf);
memcpy(msg, buf, header_size);
- if (msg->origin_path_size <= 0 || msg->origin_path_size > MAX_PATH_SIZE) {
+ if (msg->origin_path_size <= 0 || msg->origin_path_size > MAX_PATH_SIZE) {
SAFE_FREE(buf);
- thumb_err("msg->origin_path_size is invalid %d", msg->origin_path_size );
+ thumb_err("msg->origin_path_size is invalid %d", msg->origin_path_size);
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
strncpy(msg->org_path, (char*)buf + header_size, msg->origin_path_size);
- if (msg->dest_path_size <= 0 || msg->dest_path_size > MAX_PATH_SIZE) {
+ if (msg->dest_path_size <= 0 || msg->dest_path_size > MAX_PATH_SIZE) {
SAFE_FREE(buf);
- thumb_err("msg->origin_path_size is invalid %d", msg->dest_path_size );
+ thumb_err("msg->origin_path_size is invalid %d", msg->dest_path_size);
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
memcpy(*buf, req_msg, header_size);
memcpy((*buf)+header_size, req_msg->org_path, org_path_len);
memcpy((*buf)+header_size + org_path_len, req_msg->dst_path, dst_path_len);
- if(thumb_data_len > 0)
+ if (thumb_data_len > 0)
memcpy((*buf)+header_size + org_path_len + dst_path_len, req_msg->thumb_data, thumb_data_len);
*buf_size = size;
err = MS_MEDIA_ERR_INTERNAL;
}
- if(__media_thumb_check_cancel()) {
+ if (__media_thumb_check_cancel()) {
if (data) {
thumbUserData* cb = (thumbUserData*)data;
if (cb->func != NULL)
SAFE_FREE(recv_msg.thumb_data);
/* Check manage queue */
- if(g_manage_queue) {
+ if (g_manage_queue) {
len = g_queue_get_length(g_manage_queue);
- if(len > 0) {
+ if (len > 0) {
_media_thumb_send_request();
} else {
g_queue_free(g_manage_queue);
err = MS_MEDIA_ERR_INTERNAL;
}
- if(__media_thumb_check_cancel_for_raw()) {
+ if (__media_thumb_check_cancel_for_raw()) {
if (data) {
thumbRawUserData* cb = (thumbRawUserData*)data;
if (cb->func != NULL)
SAFE_FREE(recv_msg.thumb_data);
/* Check manage queue */
- if(g_manage_raw_queue) {
+ if (g_manage_raw_queue) {
len = g_queue_get_length(g_manage_raw_queue);
- if(len > 0) {
+ if (len > 0) {
_media_thumb_raw_data_send_request();
} else {
g_queue_free(g_manage_raw_queue);
return FALSE;
}
-int _media_thumb_send_request() {
+int _media_thumb_send_request()
+{
int err = MS_MEDIA_ERR_NONE;
int sock = -1;
struct sockaddr_un serv_addr;
sock_info.port = MS_THUMB_CREATOR_PORT;
err = ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock_info);
- if(err != MS_MEDIA_ERR_NONE)
- {
+ if (err != MS_MEDIA_ERR_NONE) {
thumb_err("ms_ipc_create_client_socket failed");
return err;
}
return err;
}
-int _media_thumb_raw_data_send_request() {
+int _media_thumb_raw_data_send_request()
+{
int err = MS_MEDIA_ERR_NONE;
int sock = -1;
struct sockaddr_un serv_addr;
sock_info.port = MS_THUMB_CREATOR_PORT;
err = ms_ipc_create_client_socket(MS_PROTOCOL_TCP, MS_TIMEOUT_SEC_10, &sock_info);
- if(err != MS_MEDIA_ERR_NONE)
- {
+ if (err != MS_MEDIA_ERR_NONE) {
thumb_err("ms_ipc_create_client_socket failed");
return err;
}
{
int err = MS_MEDIA_ERR_NONE;
- if(g_manage_queue == NULL) {
- if(msg_type == THUMB_REQUEST_CANCEL_MEDIA)
+ if (g_manage_queue == NULL) {
+ if (msg_type == THUMB_REQUEST_CANCEL_MEDIA)
return MS_MEDIA_ERR_INTERNAL;
g_manage_queue = g_queue_new();
err = _media_thumb_send_request();
} else {
- if(msg_type != THUMB_REQUEST_CANCEL_MEDIA) {
+ if (msg_type != THUMB_REQUEST_CANCEL_MEDIA) {
/* Enqueue */
if ((msg_type == THUMB_REQUEST_DB_INSERT) && (__media_thumb_check_req_queue(origin_path) < 0)) {
thumb_err("duplicated request");
{
int err = MS_MEDIA_ERR_NONE;
- if(g_manage_raw_queue == NULL) {
- if(msg_type == THUMB_REQUEST_CANCEL_RAW_DATA)
+ if (g_manage_raw_queue == NULL) {
+ if (msg_type == THUMB_REQUEST_CANCEL_RAW_DATA)
return MS_MEDIA_ERR_INTERNAL;
g_manage_raw_queue = g_queue_new();
thumb_req->request_id = request_id;
thumb_req->path = strdup(origin_path);
thumb_req->width = width;
- thumb_req->height= height;
+ thumb_req->height = height;
thumb_req->userData = userData;
thumb_req->isCanceled = false;
thumb_req->uid = uid;
err = _media_thumb_raw_data_send_request();
} else {
- if(msg_type != THUMB_REQUEST_CANCEL_RAW_DATA) {
+ if (msg_type != THUMB_REQUEST_CANCEL_RAW_DATA) {
/* Enqueue */
thumbRawReq *thumb_req = NULL;
THUMB_MALLOC(thumb_req, sizeof(thumbRawReq));
thumb_req->request_id = request_id;
thumb_req->path = strdup(origin_path);
thumb_req->width = width;
- thumb_req->height= height;
+ thumb_req->height = height;
thumb_req->userData = userData;
thumb_req->isCanceled = false;
thumb_req->uid = uid;
return err;
}
-int _media_thumb_request_cancel_all(bool isRaw) {
+int _media_thumb_request_cancel_all(bool isRaw)
+{
int i;
int req_len = -1;
int len = 0;
- if(isRaw) {
+ if (isRaw) {
thumbRawReq *tmp_raw_req = NULL;
- if(g_manage_raw_queue == NULL) {
+ if (g_manage_raw_queue == NULL) {
thumb_err("manage_queue is NULL");
- if(g_request_raw_queue != NULL) {
+ if (g_request_raw_queue != NULL) {
/* Check request queue */
len = g_queue_get_length(g_request_raw_queue);
- if(len > 0) {
+ if (len > 0) {
tmp_raw_req = g_queue_peek_head(g_request_raw_queue);
if (tmp_raw_req != NULL)
tmp_raw_req->isCanceled = true;
return MS_MEDIA_ERR_INTERNAL;
}
req_len = g_queue_get_length(g_manage_raw_queue);
- for(i=0;i<req_len;i++) {
+ for (i = 0; i < req_len; i++) {
tmp_raw_req = g_queue_pop_tail(g_manage_raw_queue);
- if(tmp_raw_req) {
+ if (tmp_raw_req) {
SAFE_FREE(tmp_raw_req->path);
SAFE_FREE(tmp_raw_req->userData);
SAFE_FREE(tmp_raw_req);
tmp_raw_req = NULL;
}
}
- g_queue_free (g_manage_raw_queue);
+ g_queue_free(g_manage_raw_queue);
g_manage_raw_queue = NULL;
- if(g_request_raw_queue != NULL) {
+ if (g_request_raw_queue != NULL) {
/* Check request queue */
len = g_queue_get_length(g_request_raw_queue);
- if(len > 0) {
+ if (len > 0) {
tmp_raw_req = g_queue_peek_head(g_request_raw_queue);
if (tmp_raw_req != NULL)
tmp_raw_req->isCanceled = true;
}
} else {
thumbReq *tmp_req = NULL;
- if(g_manage_queue == NULL) {
+ if (g_manage_queue == NULL) {
thumb_err("manage_queue is NULL");
- if(g_request_queue != NULL) {
+ if (g_request_queue != NULL) {
/* Check request queue */
len = g_queue_get_length(g_request_queue);
- if(len > 0) {
+ if (len > 0) {
tmp_req = g_queue_peek_head(g_request_queue);
if (tmp_req != NULL)
tmp_req->isCanceled = true;
return MS_MEDIA_ERR_INTERNAL;
}
req_len = g_queue_get_length(g_manage_queue);
- for(i=0;i<req_len;i++) {
+ for (i = 0; i < req_len; i++) {
tmp_req = g_queue_pop_tail(g_manage_queue);
- if(tmp_req) {
+ if (tmp_req) {
SAFE_FREE(tmp_req->path);
SAFE_FREE(tmp_req->userData);
SAFE_FREE(tmp_req);
tmp_req = NULL;
}
}
- g_queue_free (g_manage_queue);
+ g_queue_free(g_manage_queue);
g_manage_queue = NULL;
- if(g_request_queue != NULL) {
+ if (g_request_queue != NULL) {
/* Check request queue */
len = g_queue_get_length(g_request_queue);
- if(len > 0) {
+ if (len > 0) {
tmp_req = g_queue_peek_head(g_request_queue);
if (tmp_req != NULL)
tmp_req->isCanceled = true;
return MS_MEDIA_ERR_NONE;
}
-int _media_thumb_get_exif_info(ExifData *ed, char *buf, int max_size, int *value,
- int ifdtype, long tagtype)
+int _media_thumb_get_exif_info(ExifData *ed, char *buf, int max_size, int *value, int ifdtype, long tagtype)
{
ExifEntry *entry;
ExifIfd ifd;
if (entry) {
/* Get the contents of the tag in human-readable form */
char width[10] = {0,};
- exif_entry_get_value(entry,width,10);
+ exif_entry_get_value(entry, width, 10);
*thumb_width = atoi(width);
} else {
entry = exif_content_get_entry(ed->ifd[ifd], tag);
if (entry) {
/* Get the contents of the tag in human-readable form */
- char height[10] = {0,};
- exif_entry_get_value(entry,height,10);
+ char height[10] = {0, };
+ exif_entry_get_value(entry, height, 10);
*thumb_height = atoi(height);
} else {
if (entry) {
char width[10] = {0,};
- exif_entry_get_value(entry,width,10);
+ exif_entry_get_value(entry, width, 10);
*origin_width = atoi(width);
} else {
entry = exif_content_get_entry(ed->ifd[ifd], tag);
if (entry) {
- char height[10] = {0,};
- exif_entry_get_value(entry,height,10);
+ char height[10] = {0, };
+ exif_entry_get_value(entry, height, 10);
*origin_height = atoi(height);
} else {
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
- err = _media_thumb_get_data_from_exif(ed,
+ err = _media_thumb_get_data_from_exif(ed,
&thumb,
&size,
&thumb_width,
SAFE_FREE(decoded.data);
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
- }else {
+ } else {
/*in this case, just write raw data in file */
thumb_dbg_slog("Thumb is :%s", thumb_path);
thumb_info->width = thumb_width;
thumb_info->height = thumb_height;
thumb_info->data = malloc(buf_size);
- if(thumb_info->data != NULL) {
+ if (thumb_info->data != NULL) {
memcpy(thumb_info->data, dst, buf_size);
} else {
thumb_err("malloc fails");
int _media_thumb_get_wh_with_evas(const char *origin_path, int *width, int *height)
{
/* using evas to get w/h */
- Ecore_Evas *ee = ecore_evas_buffer_new(0, 0);
+ Ecore_Evas *ee = ecore_evas_buffer_new(0, 0);
if (!ee) {
thumb_err("ecore_evas_buffer_new fails");
return MS_MEDIA_ERR_INTERNAL;
thumb_info->height = thumb_height;
thumb_info->data = malloc(buf_size);
if (thumb_info->data == NULL) {
- thumb_err("Failed to allocate memory" );
+ thumb_err("Failed to allocate memory");
ecore_evas_free(resize_img_ee);
ecore_evas_free(target_ee);
mm_util_img_format _media_thumb_get_format(media_thumb_format src_format)
{
- switch(src_format) {
+ switch (src_format) {
case MEDIA_THUMB_BGRA:
return MM_UTIL_IMG_FMT_BGRA8888;
case MEDIA_THUMB_RGB888:
err = ImgGetImageInfoForThumb(origin_path, &image_type, &origin_w, &origin_h);
- if (err != MS_MEDIA_ERR_NONE){
+ if (err != MS_MEDIA_ERR_NONE) {
thumb_warn("Getting image info is failed err: %d", err);
}
if (image_type == IMG_CODEC_AGIF) {
err = _media_thumb_agif(origin_path, origin_w, origin_h, thumb_width, thumb_height, format, thumb_info);
} else if (image_type == IMG_CODEC_JPEG) {
- if(is_req_raw == TRUE) {
+ if (is_req_raw == TRUE) {
err = _media_thumb_jpeg_for_raw(origin_path, thumb_path, thumb_width, thumb_height, format, thumb_info);
} else {
err = _media_thumb_jpeg(origin_path, thumb_path, thumb_width, thumb_height, format, thumb_info);
is_drm = drm_type;
- /* Get Content Tag attribute for orientatin */
+ /* Get Content Tag attribute for orientatin */
MMHandleType tag = (MMHandleType) NULL;
char *p = NULL;
int cdis_value = 0;
} else {
if (strncmp(p, "90", size) == 0) {
rot_type = MM_UTIL_ROTATE_90;
- } else if(strncmp(p, "180", size) == 0) {
+ } else if (strncmp(p, "180", size) == 0) {
rot_type = MM_UTIL_ROTATE_180;
- } else if(strncmp(p, "270", size) == 0) {
+ } else if (strncmp(p, "270", size) == 0) {
rot_type = MM_UTIL_ROTATE_270;
} else {
rot_type = MM_UTIL_ROTATE_0;
thumb_info->height = height;
thumb_info->data = malloc(size);
if (thumb_info->data == NULL) {
- thumb_err("memory allcation failed" );
+ thumb_err("memory allcation failed");
mm_file_destroy_content_attrs(content);
return MS_MEDIA_ERR_OUT_OF_MEMORY;
}
{
char *result_psswd = NULL;
struct group *grpinfo = NULL;
- if(uid == getuid())
- {
+ if (uid == getuid()) {
result_psswd = strdup(THUMB_MMC_PATH);
grpinfo = getgrnam("users");
- if(grpinfo == NULL) {
+ if (grpinfo == NULL) {
thumb_err("getgrnam(users) returns NULL !");
- if(result_psswd)
+ if (result_psswd)
free(result_psswd);
return NULL;
}
- }
- else
- {
+ } else {
struct passwd *userinfo = getpwuid(uid);
- if(userinfo == NULL) {
+ if (userinfo == NULL) {
thumb_err("getpwuid(%d) returns NULL !", uid);
return NULL;
}
grpinfo = getgrnam("users");
- if(grpinfo == NULL) {
+ if (grpinfo == NULL) {
thumb_err("getgrnam(users) returns NULL !");
return NULL;
}
{
char *result_psswd = NULL;
struct group *grpinfo = NULL;
- if(uid == getuid())
- {
+ if (uid == getuid()) {
result_psswd = strdup(THUMB_PHONE_PATH);
grpinfo = getgrnam("users");
- if(grpinfo == NULL) {
+ if (grpinfo == NULL) {
thumb_err("getgrnam(users) returns NULL !");
- if(result_psswd)
+ if (result_psswd)
free(result_psswd);
return NULL;
}
- }
- else
- {
+ } else {
struct passwd *userinfo = getpwuid(uid);
- if(userinfo == NULL) {
+ if (userinfo == NULL) {
thumb_err("getpwuid(%d) returns NULL !", uid);
return NULL;
}
grpinfo = getgrnam("users");
- if(grpinfo == NULL) {
+ if (grpinfo == NULL) {
thumb_err("getgrnam(users) returns NULL !");
return NULL;
}
int ret_len = 0;
media_thumb_store_type store_type = -1;
- if (file_full_path == NULL || thumb_hash_path == NULL
- || max_thumb_path <= 0) {
- thumb_err
- ("file_full_path==NULL || thumb_hash_path == NULL || max_thumb_path <= 0");
+ if (file_full_path == NULL || thumb_hash_path == NULL || max_thumb_path <= 0) {
+ thumb_err("file_full_path==NULL || thumb_hash_path == NULL || max_thumb_path <= 0");
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
}*/
hash_name = _media_thumb_generate_hash_name(file_full_path);
- if(hash_name == NULL)
- {
+ if (hash_name == NULL) {
thumb_err("_media_thumb_generate_hash_name fail");
return MS_MEDIA_ERR_INTERNAL;
}
int alpha,
char *thumb_path)
{
- Ecore_Evas *ee = ecore_evas_buffer_new(w, h);
+ Ecore_Evas *ee = ecore_evas_buffer_new(w, h);
if (ee == NULL) {
thumb_err("ecore_evas_buffer_new failed");
return MS_MEDIA_ERR_INTERNAL;
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
- if (!g_file_test
- (origin_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
+ if (!g_file_test(origin_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
thumb_err("Original path(%s) doesn't exist.", origin_path);
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
- if (!g_file_test
- (origin_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
+ if (!g_file_test(origin_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
thumb_err("Original path(%s) doesn't exist.", origin_path);
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
- if (!g_file_test
- (origin_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
+ if (!g_file_test(origin_path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
thumb_err("Original path(%s) doesn't exist.", origin_path);
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
thumb_dbg_slog("Path : %s", origin_path);
thumbRawUserData *userData = (thumbRawUserData*)malloc(sizeof(thumbRawUserData));
- if(userData == NULL) {
+ if (userData == NULL) {
thumb_err("userData malloc failed : %d", err);
return MS_MEDIA_ERR_OUT_OF_MEMORY;
}
return MS_MEDIA_ERR_INVALID_PARAMETER;
}
- err = _media_thumb_request_async(THUMB_REQUEST_CANCEL_MEDIA, origin_path, NULL, 0);
+ err = _media_thumb_request_async(THUMB_REQUEST_CANCEL_MEDIA, origin_path, NULL, 0);
if (err != MS_MEDIA_ERR_NONE) {
thumb_err("_media_thumb_request failed : %d", err);
return err;
{
int err = MS_MEDIA_ERR_NONE;
- if(is_raw_data) {
+ if (is_raw_data) {
err = _media_thumb_request_cancel_all(true);
} else {
err = _media_thumb_request_cancel_all(false);
{
int err = MS_MEDIA_ERR_NONE;
- err = media_db_connect(&db_handle,uid, FALSE);
+ err = media_db_connect(&db_handle, uid, FALSE);
if (err != MS_MEDIA_ERR_NONE) {
thumb_err("media_db_connect failed: %d", err);
db_handle = NULL;
}
#else
if (media_type == THUMB_IMAGE_TYPE && width > 0 && height > 0) {
- err = _media_thumb_update_thumb_path_wh_to_db(db_handle, origin_path, thumb_path, width, height,uid);
+ err = _media_thumb_update_thumb_path_wh_to_db(db_handle, origin_path, thumb_path, width, height, uid);
if (err < 0) {
thumb_err("_media_thumb_update_wh_to_db (%s) failed: %d", origin_path, err);
return err;
int origin_h = 0;
int alpha = FALSE;
bool is_saved = FALSE;
- char *thumb_path = "thumbnail_path.jpg";
+ char *thumb_path = "thumbnail_path.jpg";
media_thumb_format thumb_format = MEDIA_THUMB_BGRA;
//media_thumb_format thumb_format = MEDIA_THUMB_RGB888;