From: Haejeong, Kim Date: Wed, 7 Oct 2015 09:34:15 +0000 (+0900) Subject: Remove unused code X-Git-Tag: submit/tizen/20151015.024229~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1639e50820cbb7da7cd3194b71d97c0264ac33f7;p=platform%2Fcore%2Fmultimedia%2Fdcm-service.git Remove unused code Change-Id: Id292607c1f4f7bb66fb3a30e7d0a7e6e1c4fdd0b --- diff --git a/include/DcmDebugUtils.h b/include/DcmDebugUtils.h index 5d337f3..3cfe0a1 100755 --- a/include/DcmDebugUtils.h +++ b/include/DcmDebugUtils.h @@ -24,21 +24,17 @@ #undef LOG_TAG #endif -#define _USE_DLOG_ #define LOG_TAG "DCM_SVC" -/* anci c color type */ -#define FONT_COLOR_RESET "\033[0m" -#define FONT_COLOR_RED "\033[31m" -#define FONT_COLOR_GREEN "\033[32m" -#define FONT_COLOR_YELLOW "\033[33m" -#define FONT_COLOR_BLUE "\033[34m" -#define FONT_COLOR_PURPLE "\033[35m" -#define FONT_COLOR_CYAN "\033[36m" -#define FONT_COLOR_GRAY "\033[37m" - -/*#undef _USE_DLOG_ */ -#ifdef _USE_DLOG_ +#define FONT_COLOR_RESET "\033[0m" +#define FONT_COLOR_RED "\033[31m" +#define FONT_COLOR_GREEN "\033[32m" +#define FONT_COLOR_YELLOW "\033[33m" +#define FONT_COLOR_BLUE "\033[34m" +#define FONT_COLOR_PURPLE "\033[35m" +#define FONT_COLOR_CYAN "\033[36m" +#define FONT_COLOR_GRAY "\033[37m" + #define dcm_debug(fmt, arg...) do { \ LOGD(FONT_COLOR_CYAN""fmt""FONT_COLOR_RESET, ##arg); \ } while (0) @@ -90,23 +86,11 @@ return (val); \ } \ } while (0) -#else -#define dcm_debug(fmt, arg...) -#define dcm_info(fmt, arg...) -#define dcm_warn(fmt, arg...) -#define dcm_error(fmt, arg...) - -#define dcm_sec_debug(fmt, arg...) -#define dcm_sec_info(fmt, arg...) -#define dcm_sec_warn(fmt, arg...) -#define dcm_sec_error(fmt, arg...) - -#endif -#define DCM_CHECK_VAL(expr, val) dcm_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!") -#define DCM_CHECK_NULL(expr) dcm_retvm_if(!(expr), NULL, "Invalid parameter, return NULL!") +#define DCM_CHECK_VAL(expr, val) dcm_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!") +#define DCM_CHECK_NULL(expr) dcm_retvm_if(!(expr), NULL, "Invalid parameter, return NULL!") #define DCM_CHECK_FALSE(expr) dcm_retvm_if(!(expr), FALSE, "Invalid parameter, return FALSE!") -#define DCM_CHECK(expr) dcm_retm_if (!(expr), "Invalid parameter, return!") +#define DCM_CHECK(expr) dcm_retm_if (!(expr), "Invalid parameter, return!") #define DCM_SAFE_FREE(ptr) { if(ptr) {free(ptr); ptr = NULL;} } diff --git a/include/DcmTypes.h b/include/DcmTypes.h index d371c11..04a6dc7 100755 --- a/include/DcmTypes.h +++ b/include/DcmTypes.h @@ -22,9 +22,9 @@ #include /* - * Definitions defined here can be used by all threads - * If a definition can only be used in a specific thread, then this definition should be defined in that thread, not here. - */ + * Definitions defined here can be used by all threads + * If a definition can only be used in a specific thread, then this definition should be defined in that thread, not here. + */ #define DCM_MAX_PATH_SIZE 4096 #define DCM_IPC_MSG_MAX_SIZE 4096 diff --git a/libdcm-face/dcm-face-debug.h b/libdcm-face/dcm-face-debug.h index 5c0886c..637076c 100755 --- a/libdcm-face/dcm-face-debug.h +++ b/libdcm-face/dcm-face-debug.h @@ -22,21 +22,17 @@ #undef LOG_TAG #endif -#define _USE_DLOG_ #define LOG_TAG "DCM_FACE" -/* anci c color type */ -#define FONT_COLOR_RESET "\033[0m" -#define FONT_COLOR_RED "\033[31m" -#define FONT_COLOR_GREEN "\033[32m" -#define FONT_COLOR_YELLOW "\033[33m" -#define FONT_COLOR_BLUE "\033[34m" -#define FONT_COLOR_PURPLE "\033[35m" -#define FONT_COLOR_CYAN "\033[36m " -#define FONT_COLOR_GRAY "\033[37m" - -/*#undef _USE_DLOG_ */ -#ifdef _USE_DLOG_ +#define FONT_COLOR_RESET "\033[0m" +#define FONT_COLOR_RED "\033[31m" +#define FONT_COLOR_GREEN "\033[32m" +#define FONT_COLOR_YELLOW "\033[33m" +#define FONT_COLOR_BLUE "\033[34m" +#define FONT_COLOR_PURPLE "\033[35m" +#define FONT_COLOR_CYAN "\033[36m" +#define FONT_COLOR_GRAY "\033[37m" + #define dcm_debug(fmt, arg...) do { \ LOGD(FONT_COLOR_CYAN""fmt""FONT_COLOR_RESET, ##arg); \ } while (0) @@ -88,17 +84,6 @@ return (val); \ } \ } while (0) -#else -#define dcm_debug(fmt, arg...) -#define dcm_info(fmt, arg...) -#define dcm_warn(fmt, arg...) -#define dcm_error(fmt, arg...) - -#define dcm_sec_debug(fmt, arg...) -#define dcm_sec_info(fmt, arg...) -#define dcm_sec_warn(fmt, arg...) -#define dcm_sec_error(fmt, arg...) -#endif #endif /*__FACE_DEBUG_H__ */ diff --git a/libdcm-face/dcm-face_mediavision.c b/libdcm-face/dcm-face_mediavision.c index dcab375..60a16d2 100755 --- a/libdcm-face/dcm-face_mediavision.c +++ b/libdcm-face/dcm-face_mediavision.c @@ -109,7 +109,7 @@ void __face_detected_cb(mv_source_h source, mv_engine_config_h cfg, mv_rectangle _data->face_rect[i].y = faces_locations[i].point.y; _data->face_rect[i].w = faces_locations[i].width; _data->face_rect[i].h = faces_locations[i].height; - _data->face_rect[i].orientation = 0; /* set to default orientation */ + _data->face_rect[i].orientation = 0; /* set to default orientation */ } _data->count = number_of_faces; diff --git a/libdcm-face/dcm-face_priv.h b/libdcm-face/dcm-face_priv.h index a1abf71..4dd6a23 100755 --- a/libdcm-face/dcm-face_priv.h +++ b/libdcm-face/dcm-face_priv.h @@ -32,7 +32,7 @@ #define FACE_IMAGE_MAGIC (0x1a2b3c4d) #define FACE_INVALID_MAGIC (0xDEADBEAF) -#define DCM_SAFE_FREE(src) { if(src) {free(src); src = NULL;}} +#define DCM_SAFE_FREE(src) { if(src) {free(src); src = NULL;}} typedef struct face_image_s { unsigned char *data; diff --git a/libdcm-face/include/dcm-face.h b/libdcm-face/include/dcm-face.h index 1637a72..9797dc3 100755 --- a/libdcm-face/include/dcm-face.h +++ b/libdcm-face/include/dcm-face.h @@ -79,7 +79,7 @@ int dcm_face_get_prefered_colorspace(dcm_face_h handle, face_image_colorspace_e * @retval #FACE_ERROR_INVALID_PARAMTER Invalid parameter * @retval #FACE_ERROR_OUT_OF_MEMORY Out of memory * @see dcm_face_create() - */ + */ int dcm_face_set_image_info(dcm_face_h handle, face_image_colorspace_e colorspace, unsigned char *buffer, unsigned int width, unsigned int height, unsigned int size); /** diff --git a/libdcm-util/dcm_image_codec.cpp b/libdcm-util/dcm_image_codec.cpp index 8309dd6..3ae677f 100755 --- a/libdcm-util/dcm_image_codec.cpp +++ b/libdcm-util/dcm_image_codec.cpp @@ -26,46 +26,6 @@ #include #include -#if 0 -static void _dcm_codec_calc_image_size(int ori_width, int ori_height, int tar_width, int tar_height, int *buf_width, int *buf_height) -{ - - *buf_width = 0; - *buf_height = 0; - - if (tar_width <= 0 && tar_height <= 0) { - dcm_warn("Invalid input decode size! Set decode size to original size"); - *buf_width = 0; - *buf_height = 0; - return; - } - - if (ori_width <= tar_width && ori_height <= tar_height) { - dcm_debug("Original image size is already smaller. Set docode size to original size"); - /* Make sure that decode buffer size can be divided by 8 (required by YUV420 decoding) */ - *buf_width = ori_width - (ori_width) % 8; - *buf_height = ori_height - (ori_height) % 8; - return; - } - - if (ori_width > ori_height) { - /* Scale image size based on input width */ - *buf_width = tar_width; - *buf_height = (int) (ori_height * (((double) tar_width) / ((double) ori_width))); - } else { - /* Scale image size based on input height */ - *buf_height = tar_height; - *buf_width = (int) (ori_width * (((double) tar_height) / ((double) ori_height))); - } - - /* Make sure that decode buffer size can be divided by 8 (required by YUV420 decoding) */ - *buf_width = *buf_width - (*buf_width) % 8; - *buf_height = *buf_height - (*buf_height) % 8; - - return; -} -#endif - int __dcm_decode_image_with_evas(const char *origin_path, int dest_width, int dest_height, dcm_image_info *image_info) @@ -370,7 +330,7 @@ static int __dcm_decode_image_with_size_orient(const char *file_path, unsigned i } EXPORT_API -int dcm_decode_image_with_size_orient(const char *file_path, unsigned int target_width, unsigned int target_height, +int dcm_decode_image_with_size_orient(const char *file_path, unsigned int target_width, unsigned int target_height, dcm_image_codec_type_e decode_type, unsigned char **image_buffer, unsigned int *buff_width, unsigned int *buff_height, int *orientation, unsigned int *size) { int ret = DCM_SUCCESS; @@ -385,7 +345,7 @@ int dcm_decode_image_with_size_orient(const char *file_path, unsigned int target EXPORT_API int dcm_decode_image_with_evas(const char *file_path, unsigned int target_width, unsigned int target_height, - dcm_image_codec_type_e decode_type, unsigned char **image_buffer, unsigned int *buff_width, unsigned int *buff_height, int *orientation, unsigned int *size) + dcm_image_codec_type_e decode_type, unsigned char **image_buffer, unsigned int *buff_width, unsigned int *buff_height, int *orientation, unsigned int *size) { int ret = DCM_SUCCESS; dcm_image_info image_info = {0, }; diff --git a/libdcm-util/include/dcm_image_codec.h b/libdcm-util/include/dcm_image_codec.h index 37a80c3..a8eb061 100755 --- a/libdcm-util/include/dcm_image_codec.h +++ b/libdcm-util/include/dcm_image_codec.h @@ -39,11 +39,11 @@ typedef struct { /* Decoding image with input width and height, if possible (width/height ratio is kept the same as original), and rotate the buffer according to orientation */ -int dcm_decode_image_with_size_orient(const char *file_path, unsigned int target_width, unsigned int target_height, - dcm_image_codec_type_e decode_type, unsigned char **image_buffer, unsigned int *buff_width, unsigned int *buff_height, int *orientation, unsigned int *size); +int dcm_decode_image_with_size_orient(const char *file_path, unsigned int target_width, unsigned int target_height, + dcm_image_codec_type_e decode_type, unsigned char **image_buffer, unsigned int *buff_width, unsigned int *buff_height, int *orientation, unsigned int *size); int dcm_decode_image_with_evas(const char *file_path, unsigned int target_width, unsigned int target_height, - dcm_image_codec_type_e decode_type, unsigned char **image_buffer, unsigned int *buff_width, unsigned int *buff_height, int *orientation, unsigned int *size); + dcm_image_codec_type_e decode_type, unsigned char **image_buffer, unsigned int *buff_width, unsigned int *buff_height, int *orientation, unsigned int *size); #ifdef __cplusplus } diff --git a/libdcm-util/include/dcm_image_debug_utils.h b/libdcm-util/include/dcm_image_debug_utils.h index f833d7a..78f4e48 100755 --- a/libdcm-util/include/dcm_image_debug_utils.h +++ b/libdcm-util/include/dcm_image_debug_utils.h @@ -25,7 +25,6 @@ #undef LOG_TAG #endif -#define _USE_DLOG_ #define LOG_TAG "DCM_IMAGE_CODEC" typedef enum { @@ -39,18 +38,15 @@ typedef enum { DCM_ERROR_UNSUPPORTED_IMAGE_TYPE, } DcmErrorType; -/* anci c color type */ -#define FONT_COLOR_RESET "\033[0m" -#define FONT_COLOR_RED "\033[31m" -#define FONT_COLOR_GREEN "\033[32m" -#define FONT_COLOR_YELLOW "\033[33m" -#define FONT_COLOR_BLUE "\033[34m" -#define FONT_COLOR_PURPLE "\033[35m" -#define FONT_COLOR_CYAN "\033[36m" -#define FONT_COLOR_GRAY "\033[37m" - -/*#undef _USE_DLOG_ */ -#ifdef _USE_DLOG_ +#define FONT_COLOR_RESET "\033[0m" +#define FONT_COLOR_RED "\033[31m" +#define FONT_COLOR_GREEN "\033[32m" +#define FONT_COLOR_YELLOW "\033[33m" +#define FONT_COLOR_BLUE "\033[34m" +#define FONT_COLOR_PURPLE "\033[35m" +#define FONT_COLOR_CYAN "\033[36m" +#define FONT_COLOR_GRAY "\033[37m" + #define dcm_debug(fmt, arg...) do { \ LOGD(FONT_COLOR_CYAN""fmt""FONT_COLOR_RESET, ##arg); \ } while (0) @@ -64,7 +60,7 @@ typedef enum { } while (0) #define dcm_error(fmt, arg...) do { \ - LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET , ##arg); \ + LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg); \ } while (0) #define dcm_sec_debug(fmt, arg...) do { \ @@ -90,18 +86,7 @@ typedef enum { #define dcm_debug_fleave() do { \ LOGD(FONT_COLOR_RESET""); \ } while (0) -#else -#define dcm_debug(fmt, arg...) -#define dcm_info(fmt, arg...) -#define dcm_warn(fmt, arg...) -#define dcm_error(fmt, arg...) - -#define dcm_sec_debug(fmt, arg...) -#define dcm_sec_info(fmt, arg...) -#define dcm_sec_warn(fmt, arg...) -#define dcm_sec_error(fmt, arg...) -#endif #define dcm_retm_if(expr, fmt, arg...) do { \ if(expr) { \ dcm_error(fmt, ##arg); \ @@ -128,9 +113,8 @@ typedef enum { #define DCM_CHECK_VAL(expr, val) dcm_retvm_if(!(expr), val , "Invalid parameter, return ERROR code!") #define DCM_CHECK_NULL(expr) dcm_retvm_if(!(expr), NULL, "Invalid parameter, return NULL!") #define DCM_CHECK_FALSE(expr) dcm_retvm_if(!(expr), FALSE, "Invalid parameter, return FALSE!") -#define DCM_CHECK(expr) dcm_retm_if (!(expr), "Invalid parameter, return!") +#define DCM_CHECK(expr) dcm_retm_if (!(expr), "Invalid parameter, return!") #define DCM_SAFE_FREE(ptr) { if(ptr) {free(ptr); ptr = NULL;} } #endif /* _DCM_DEBUG_UTILS_H_ */ - diff --git a/packaging/dcm-service.spec b/packaging/dcm-service.spec index c413547..6589b81 100755 --- a/packaging/dcm-service.spec +++ b/packaging/dcm-service.spec @@ -1,5 +1,5 @@ Name: dcm-service -Summary: Multimedia DCM(Digital Contents Management) Service +Summary: Multimedia DCM(Digital Contents Management) Service Version: 0.0.1 Release: 0 Group: Multimedia/Service diff --git a/src/DcmScanSvc.cpp b/src/DcmScanSvc.cpp index f606515..60ce842 100755 --- a/src/DcmScanSvc.cpp +++ b/src/DcmScanSvc.cpp @@ -41,39 +41,39 @@ class DcmScanSvc { public: - GMainLoop *g_scan_thread_mainloop; - GMainContext *scan_thread_main_context; + GMainLoop *g_scan_thread_mainloop; + GMainContext *scan_thread_main_context; - /* scan all images */ - GList *scan_all_item_list; - unsigned int scan_all_curr_index; + /* scan all images */ + GList *scan_all_item_list; + unsigned int scan_all_curr_index; - /* scan single images */ - GList *scan_single_item_list; - unsigned int scan_single_curr_index; + /* scan single images */ + GList *scan_single_item_list; + unsigned int scan_single_curr_index; - void quitScanThread(); - int getMmcState(void); - int prepareImageList(); + void quitScanThread(); + int getMmcState(void); + int prepareImageList(); int prepareImageListByPath(const char *file_path); - int clearAllItemList(); - int clearSingleItemList(); - int initialize(); - int finalize(); - int sendCompletedMsg(const char *msg, DcmIpcPortType port); - int getScanStatus(DcmScanItem *scan_item, bool *media_scanned); - int runScanProcess(DcmScanItem *scan_item); - int ScanAllItems(); - int ScanSingleItem(const char *file_path); - int terminateScanOperations(); - int receiveMsg(DcmIpcMsg *recv_msg); + int clearAllItemList(); + int clearSingleItemList(); + int initialize(); + int finalize(); + int sendCompletedMsg(const char *msg, DcmIpcPortType port); + int getScanStatus(DcmScanItem *scan_item, bool *media_scanned); + int runScanProcess(DcmScanItem *scan_item); + int ScanAllItems(); + int ScanSingleItem(const char *file_path); + int terminateScanOperations(); + int receiveMsg(DcmIpcMsg *recv_msg); }; namespace DcmScanCallback { -void freeScanItem(void *data); -gboolean readyScanThreadIdle(gpointer data); -gboolean readMsg(GIOChannel *src, GIOCondition condition, gpointer data); + void freeScanItem(void *data); + gboolean readyScanThreadIdle(gpointer data); + gboolean readMsg(GIOChannel *src, GIOCondition condition, gpointer data); } void DcmScanSvc::quitScanThread()