#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)
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;} }
#include <unistd.h>
/*
- * 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
#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)
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__ */
_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;
#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;
* @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);
/**
#include <dcm_image_debug_utils.h>
#include <dcm_image_codec.h>
-#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)
}
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;
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, };
/* 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
}
#undef LOG_TAG
#endif
-#define _USE_DLOG_
#define LOG_TAG "DCM_IMAGE_CODEC"
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)
} 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 { \
#define dcm_debug_fleave() do { \
LOGD(FONT_COLOR_RESET"<Leave>"); \
} 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); \
#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_ */
-
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
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()