Remove TTRACE dependency and refine debug msg 32/160032/4
authorhj kim <backto.kim@samsung.com>
Tue, 14 Nov 2017 07:37:58 +0000 (16:37 +0900)
committerhj kim <backto.kim@samsung.com>
Tue, 14 Nov 2017 07:59:30 +0000 (16:59 +0900)
Change-Id: I55a3e86fdb1ef01b1016bff3c1cd845193a82d14

13 files changed:
bmp/Makefile.am
common/include/mm_util_debug.h
common/include/mm_util_private.h
configure.ac
gif/Makefile.am
imgcv/Makefile.am
imgcv/mm_util_imgcv.c
imgp/Makefile.am
imgp/mm_util_imgp.c
jpeg/Makefile.am
jpeg/mm_util_jpeg.c
packaging/libmm-utility.spec
png/Makefile.am

index 92ec53a..a618fe8 100644 (file)
@@ -15,7 +15,7 @@ libmmutil_bmp_la_CFLAGS = -I$(srcdir)/include \
                                -I/usr/include \
                                $(srcdir)/../imgp/libmmutil_imgp.la
 
-libmmutil_bmp_la_LIBADD = $(GLIB_LIBS) -lnsbmp -lbmp -ldl -lttrace\
+libmmutil_bmp_la_LIBADD = $(GLIB_LIBS) -lnsbmp -lbmp -ldl \
                                $(GMODULE_LIBS) \
                                $(MEDIA_LIBS)
 
index e5ca94b..4903e77 100755 (executable)
@@ -37,6 +37,7 @@ extern "C"
 
 #define FONT_COLOR_RESET    "\033[0m"
 #define FONT_COLOR_RED      "\033[31m"
+#define FONT_COLOR_YELLOW      "\033[33m"
 
 #define mm_util_debug(fmt, arg...) do { \
                LOGD(FONT_COLOR_RESET""fmt"", ##arg);     \
@@ -55,11 +56,11 @@ extern "C"
        } while (0)
 
 #define mm_util_fenter() do { \
-               LOGD(FONT_COLOR_RESET"<Enter>");     \
+               LOGD(FONT_COLOR_YELLOW"<ENTER>"FONT_COLOR_RESET); \
        } while (0)
 
 #define mm_util_fleave() do { \
-               LOGD(FONT_COLOR_RESET"<Leave>");     \
+               LOGD(FONT_COLOR_YELLOW"<LEAVE>"FONT_COLOR_RESET); \
        } while (0)
 
 #define mm_util_retm_if(expr, fmt, arg...) do { \
index 3fe2fd2..08e757e 100755 (executable)
 #include <stdlib.h>
 #include "mm_util_debug.h"
 #include "mm_util_type.h"
-#ifdef ENABLE_TTRACE
-#include <ttrace.h>
-#endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/* For_TTRACE performance checker */
-#ifdef ENABLE_TTRACE
-#define TTRACE_BEGIN(NAME) traceBegin(TTRACE_TAG_IMAGE, NAME)
-#define TTRACE_END() traceEnd(TTRACE_TAG_IMAGE)
-#else /* ENABLE_TTRACE */
-#define TTRACE_BEGIN(NAME)
-#define TTRACE_END()
-#endif /* ENABLE_TTRACE */
 
 /* For memory management */
 #define MMUTIL_SAFE_FREE(x)                            { if (x) { free(x); x = NULL; } }
index 5559e74..5fa4050 100755 (executable)
@@ -57,9 +57,6 @@ PKG_CHECK_MODULES(OPENCV, opencv)
 AC_SUBST(OPENCV_CFLAGS)
 AC_SUBST(OPENCV_LIBS)
 
-PKG_CHECK_MODULES(TTRACE, [ttrace], AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available]))
-AC_SUBST(TTRACE)
-
 #tz-platform-config lib
 PKG_CHECK_MODULES(TZ_PLATFORM_CONFIG, libtzplatform-config)
 AC_SUBST(TZ_PLATFORM_CONFIG_CFLAGS)
index c6d923b..897249c 100644 (file)
@@ -16,7 +16,7 @@ libmmutil_gif_la_CFLAGS = -I$(srcdir)/include \
                                -I/usr/include \
                                $(srcdir)/../imgp/libmmutil_imgp.la
 
-libmmutil_gif_la_LIBADD = $(GLIB_LIBS) -lgif -ldl -lttrace\
+libmmutil_gif_la_LIBADD = $(GLIB_LIBS) -lgif -ldl \
                                $(GIO_LIBS) \
                                $(GMODULE_LIBS) \
                                $(MEDIA_LIBS)
index 9192a91..598c9cc 100755 (executable)
@@ -22,7 +22,7 @@ libmmutil_imgcv_la_LIBADD = $(GLIB_LIBS) \
                                $(MEDIA_LIBS) \
                                $(OPENCV_LIBS)
 
-libmmutil_imgcv_la_CFLAGS += -lttrace -DLIBPREFIX=\"$(libdir)\"
+libmmutil_imgcv_la_CFLAGS += -DLIBPREFIX=\"$(libdir)\"
 
 pcfiles = mmutil-imgcv.pc
 pkgconfigdir = $(libdir)/pkgconfig
index d736c30..2667a8c 100755 (executable)
@@ -38,7 +38,7 @@
 
 static int _mm_util_imgcv_init(mm_util_imgcv_s *handle, int width, int height)
 {
-       mm_util_debug("Enter _mm_util_imgcv_init");
+       mm_util_fenter();
 
        handle->width = width;
        handle->height = height;
@@ -62,26 +62,26 @@ static int _mm_util_imgcv_init(mm_util_imgcv_s *handle, int width, int height)
        handle->vRanges[0] = 0;
        handle->vRanges[1] = DEFAULT_RANGE_VALUE;
 
-       mm_util_debug("Leave _mm_util_imgcv_uninit");
+       mm_util_fleave();
 
        return MM_UTIL_ERROR_NONE;
 }
 
 static void _mm_util_imgcv_uninit(mm_util_imgcv_s *handle)
 {
-       mm_util_debug("Enter _mm_util_imgcv_uninit");
+       mm_util_fenter();
 
        if (handle->inImg != NULL) {
                cvReleaseImageHeader(&handle->inImg);
                handle->inImg = NULL;
        }
 
-       mm_util_debug("Leave _mm_util_imgcv_uninit");
+       mm_util_fleave();
 }
 
 static int _mm_util_imgcv_set_buffer(mm_util_imgcv_s *handle, void *image_buffer)
 {
-       mm_util_debug("Enter _mm_util_imgcv_set_buffer");
+       mm_util_fenter();
 
        unsigned char *buffer = (unsigned char *)image_buffer;
 
@@ -91,14 +91,14 @@ static int _mm_util_imgcv_set_buffer(mm_util_imgcv_s *handle, void *image_buffer
        if (handle->inImg == NULL)
                return  MM_UTIL_ERROR_INVALID_OPERATION;
 
-       mm_util_debug("Leave _mm_util_imgcv_set_buffer");
+       mm_util_fleave();
 
        return MM_UTIL_ERROR_NONE;
 }
 
 static void _convert_hsv_to_rgb(int hVal, int sVal, int vVal, float *rVal, float *gVal, float *bVal)
 {
-       mm_util_debug("Enter _convert_hsv_to_rgb");
+       mm_util_fenter();
 
        CvMat *mat1 = cvCreateMat(1, 1 , CV_8UC3);
        cvSet2D(mat1, 0, 0, cvScalar((double)hVal, (double)sVal, (double)vVal, 0.0));
@@ -115,13 +115,10 @@ static void _convert_hsv_to_rgb(int hVal, int sVal, int vVal, float *rVal, float
        mm_util_debug("from HSV[%f, %f, %f]", (float)hVal, (float)sVal, (float)vVal);
        mm_util_debug("to BGR[%f, %f, %f]", *bVal, *gVal, *rVal);
 
-       mm_util_debug("Leave _convert_hsv_to_rgb");
 }
 
 static int _mm_util_imgcv_calculate_hist(mm_util_imgcv_s *handle, unsigned char *rgb_r, unsigned char *rgb_g, unsigned char *rgb_b)
 {
-       mm_util_debug("Enter _mm_util_imgcv_calculate_hist");
-
        int nh = 0;
        int ns = 0;
        int nv = 0;
@@ -137,6 +134,8 @@ static int _mm_util_imgcv_calculate_hist(mm_util_imgcv_s *handle, unsigned char
        unsigned int maxBinVal = 0;
        int max_bin_idx[3] = {-1, -1, -1};
 
+       mm_util_fenter();
+
        IplImage *hsvImg = cvCreateImage(cvSize(handle->width, handle->height), IPL_DEPTH_8U, HSV_COLOR_CHANNELS);
        IplImage *hImg = cvCreateImage(cvSize(handle->width, handle->height), IPL_DEPTH_8U, 1);
        IplImage *sImg = cvCreateImage(cvSize(handle->width, handle->height), IPL_DEPTH_8U, 1);
@@ -196,24 +195,23 @@ static int _mm_util_imgcv_calculate_hist(mm_util_imgcv_s *handle, unsigned char
 
        cvReleaseHist(&hist);
 
-       mm_util_debug("Leave _mm_util_imgcv_calculate_hist");
+       mm_util_fleave();
 
        return MM_UTIL_ERROR_NONE;
 }
 
 int mm_util_cv_extract_representative_color(void *image_buffer, int width, int height, unsigned char *r_color, unsigned char *g_color, unsigned char *b_color)
 {
-       mm_util_debug("Enter mm_util_cv_extract_representative_color");
+       mm_util_fenter();
+
        if (image_buffer == NULL) {
                mm_util_error("#ERROR#: image buffer is NULL");
-
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        mm_util_imgcv_s *handle = (mm_util_imgcv_s *)calloc(1, sizeof(mm_util_imgcv_s));
        if (handle == NULL) {
                mm_util_error("#ERROR#: fail to create handle");
-
                return MM_UTIL_ERROR_OUT_OF_MEMORY;
        }
 
@@ -221,9 +219,7 @@ int mm_util_cv_extract_representative_color(void *image_buffer, int width, int h
        if (ret != MM_UTIL_ERROR_NONE) {
                _mm_util_imgcv_uninit(handle);
                MMUTIL_SAFE_FREE(handle);
-
                mm_util_error("#ERROR#: Fail to mm_util_imgcv_init: ret=%d", ret);
-
                return ret;
        }
 
@@ -231,9 +227,7 @@ int mm_util_cv_extract_representative_color(void *image_buffer, int width, int h
        if (ret != MM_UTIL_ERROR_NONE) {
                _mm_util_imgcv_uninit(handle);
                MMUTIL_SAFE_FREE(handle);
-
                mm_util_error("#ERROR#: Fail to mm_util_imgcv_set_buffer: ret=%d", ret);
-
                return ret;
        }
 
@@ -241,9 +235,7 @@ int mm_util_cv_extract_representative_color(void *image_buffer, int width, int h
        if (ret != MM_UTIL_ERROR_NONE) {
                _mm_util_imgcv_uninit(handle);
                MMUTIL_SAFE_FREE(handle);
-
                mm_util_error("#ERROR#: Fail to mm_util_imgcv_calculate_hist: ret=%d", ret);
-
                return ret;
        }
 
@@ -251,7 +243,7 @@ int mm_util_cv_extract_representative_color(void *image_buffer, int width, int h
 
        MMUTIL_SAFE_FREE(handle);
 
-       mm_util_debug("Leave mm_util_cv_extract_representative_color");
+       mm_util_fleave();
 
        return MM_UTIL_ERROR_NONE;
 }
index eaf13fb..bc1c68e 100755 (executable)
@@ -32,7 +32,7 @@ libmmutil_imgp_la_LIBADD = $(GLIB_LIBS) \
                            $(DRI2_LIBS) \
                            $(DLOG_LIBS)
 
-libmmutil_imgp_la_CFLAGS += -lcapi-media-tool -lttrace -DLIBPREFIX=\"$(libdir)\"
+libmmutil_imgp_la_CFLAGS += -lcapi-media-tool -DLIBPREFIX=\"$(libdir)\"
 
 pcfiles = mmutil-imgp.pc
 pkgconfigdir = $(libdir)/pkgconfig
index facb368..2f4128e 100755 (executable)
@@ -245,11 +245,10 @@ static int __mm_util_get_crop_image_size(mm_util_img_format format, unsigned int
        int size, w2, h2, size2;
        int stride, stride2;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:GET_SIZE");
+       mm_util_fenter();
 
        if (!imgsize) {
                mm_util_error("imgsize can't be null");
-               TTRACE_END();
                return MM_UTIL_ERROR_NO_SUCH_FILE;
        }
 
@@ -257,7 +256,6 @@ static int __mm_util_get_crop_image_size(mm_util_img_format format, unsigned int
 
        if (check_valid_picture_size(width, height) < 0) {
                mm_util_error("invalid width and height");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -323,12 +321,11 @@ static int __mm_util_get_crop_image_size(mm_util_img_format format, unsigned int
 
        default:
                mm_util_error("Not supported format");
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
+
        mm_util_debug("format: %d, *imgsize: %d", format, *imgsize);
 
-       TTRACE_END();
        return ret;
 }
 
@@ -340,11 +337,10 @@ int __mm_util_get_buffer_size(mm_util_img_format format, unsigned int width, uns
        int size, w2, h2, size2;
        int stride, stride2;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:GET_SIZE");
+       mm_util_fenter();
 
        if (!imgsize) {
                mm_util_error("imgsize can't be null");
-               TTRACE_END();
                return MM_UTIL_ERROR_NO_SUCH_FILE;
        }
 
@@ -352,7 +348,6 @@ int __mm_util_get_buffer_size(mm_util_img_format format, unsigned int width, uns
 
        if (check_valid_picture_size(width, height) < 0) {
                mm_util_error("invalid width and height");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -418,12 +413,11 @@ int __mm_util_get_buffer_size(mm_util_img_format format, unsigned int width, uns
 
        default:
                mm_util_error("Not supported format");
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
+
        mm_util_debug("format: %d, *imgsize: %d", format, *imgsize);
 
-       TTRACE_END();
        return ret;
 }
 
@@ -1390,18 +1384,14 @@ int mm_util_create(mm_util_imgp_h *imgp_handle)
 {
        int ret = MM_UTIL_ERROR_NONE;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:CREATE");
-
        if (imgp_handle == NULL) {
                mm_util_error("Invalid arguments [tag null]");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        mm_util_s *handle = calloc(1, sizeof(mm_util_s));
        if (!handle) {
                mm_util_error("[ERROR] - _handle");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_OPERATION;
        }
 
@@ -1409,13 +1399,11 @@ int mm_util_create(mm_util_imgp_h *imgp_handle)
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("_mm_util_handle_init failed");
                MMUTIL_SAFE_FREE(handle);
-               TTRACE_END();
                return ret;
        }
 
        *imgp_handle = (mm_util_imgp_h)handle;
 
-       TTRACE_END();
        return ret;
 }
 
@@ -1424,17 +1412,13 @@ int mm_util_set_hardware_acceleration(mm_util_imgp_h imgp_handle, bool mode)
        int ret = MM_UTIL_ERROR_NONE;
        mm_util_s *handle = (mm_util_s *) imgp_handle;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:SET_HARDWARE_ACCELERATION");
-
        if (!handle) {
                mm_util_error("[ERROR] - handle");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_OPERATION;
        }
 
        handle->hardware_acceleration = mode;
 
-       TTRACE_END();
        return ret;
 }
 
@@ -1443,8 +1427,6 @@ int mm_util_set_colorspace_convert(mm_util_imgp_h imgp_handle, mm_util_img_forma
        int ret = MM_UTIL_ERROR_NONE;
        mm_util_s *handle = (mm_util_s *) imgp_handle;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:SET_HARDWARE_ACCELERATION");
-
        if (!handle) {
                mm_util_error("[ERROR] - handle");
                return MM_UTIL_ERROR_INVALID_OPERATION;
@@ -1454,7 +1436,6 @@ int mm_util_set_colorspace_convert(mm_util_imgp_h imgp_handle, mm_util_img_forma
        handle->dst_format = colorspace;
        mm_util_debug("imgp fmt: %d", handle->dst_format);
 
-       TTRACE_END();
        return ret;
 }
 
@@ -1463,8 +1444,6 @@ int mm_util_set_resolution(mm_util_imgp_h imgp_handle, unsigned int width, unsig
        int ret = MM_UTIL_ERROR_NONE;
        mm_util_s *handle = (mm_util_s *) imgp_handle;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:SET_RESOLUTION");
-
        if (!handle) {
                mm_util_error("[ERROR] - handle");
                return MM_UTIL_ERROR_INVALID_OPERATION;
@@ -1474,7 +1453,6 @@ int mm_util_set_resolution(mm_util_imgp_h imgp_handle, unsigned int width, unsig
        handle->dst_width = width;
        handle->dst_height = height;
 
-       TTRACE_END();
        return ret;
 }
 
@@ -1483,18 +1461,15 @@ int mm_util_set_rotation(mm_util_imgp_h imgp_handle, mm_util_img_rotate_type rot
        int ret = MM_UTIL_ERROR_NONE;
        mm_util_s *handle = (mm_util_s *) imgp_handle;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:SET_ROTATION");
 
        if (!handle) {
                mm_util_error("[ERROR] - handle");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_OPERATION;
        }
 
        handle->set_rotate = TRUE;
        handle->dst_rotation = rotation;
 
-       TTRACE_END();
        return ret;
 }
 
@@ -1503,14 +1478,11 @@ int mm_util_set_crop_area(mm_util_imgp_h imgp_handle, unsigned int start_x, unsi
        int ret = MM_UTIL_ERROR_NONE;
        mm_util_s *handle = (mm_util_s *) imgp_handle;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:SET_CROP_AREA");
-
        unsigned int dest_width = end_x - start_x;
        unsigned int dest_height = end_y - start_y;
 
        if (!handle) {
                mm_util_error("[ERROR] - handle");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_OPERATION;
        }
 
@@ -1520,7 +1492,6 @@ int mm_util_set_crop_area(mm_util_imgp_h imgp_handle, unsigned int start_x, unsi
        handle->dst_width = dest_width;
        handle->dst_height = dest_height;
 
-       TTRACE_END();
        return ret;
 }
 
@@ -1529,17 +1500,15 @@ int mm_util_transform(mm_util_imgp_h imgp_handle, media_packet_h src_packet, mm_
        int ret = MM_UTIL_ERROR_NONE;
        mm_util_s *handle = (mm_util_s *) imgp_handle;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:TRANSFORM");
+       mm_util_fenter();
 
        if (!handle) {
                mm_util_error("[ERROR] - handle");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_OPERATION;
        }
 
        if (!src_packet) {
                mm_util_error("[ERROR] - src_packet");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        } else {
                mm_util_debug("src: %p", src_packet);
@@ -1547,7 +1516,6 @@ int mm_util_transform(mm_util_imgp_h imgp_handle, media_packet_h src_packet, mm_
 
        if (!completed_callback) {
                mm_util_error("[ERROR] - completed_callback");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -1566,14 +1534,14 @@ int mm_util_transform(mm_util_imgp_h imgp_handle, media_packet_h src_packet, mm_
                ret = __mm_util_create_thread(handle);
                if (ret != MM_UTIL_ERROR_NONE) {
                        mm_util_error("ERROR - Create thread");
-                       TTRACE_END();
                        return ret;
                } else {
                        mm_util_debug("Success -__mm_util_create_thread");
                }
        }
 
-       TTRACE_END();
+       mm_util_fleave();
+
        return ret;
 }
 
@@ -1583,24 +1551,19 @@ int mm_util_transform_is_completed(mm_util_imgp_h imgp_handle, bool *is_complete
 
        mm_util_s *handle = (mm_util_s *) imgp_handle;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:TRANSFORM_IS_COMPLETED");
-
        if (!handle) {
                mm_util_error("[ERROR] - handle");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if (!is_completed) {
                mm_util_error("[ERROR] - is_completed");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        *is_completed = handle->is_completed;
        mm_util_debug("[Transform....] %d", *is_completed);
 
-       TTRACE_END();
        return ret;
 }
 
@@ -1609,27 +1572,24 @@ int mm_util_destroy(mm_util_imgp_h imgp_handle)
        int ret = MM_UTIL_ERROR_NONE;
        mm_util_s *handle = (mm_util_s *) imgp_handle;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:DESTROY");
-       mm_util_debug("enter");
+       mm_util_fenter();
 
        if (!handle) {
                mm_util_error("[ERROR] - handle");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        /* Close */
        if (_mm_util_handle_finalize(handle) != MM_UTIL_ERROR_NONE) {
                mm_util_error("_mm_util_handle_finalize)");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        MMUTIL_SAFE_FREE(handle->_util_cb);
        MMUTIL_SAFE_FREE(handle);
-       mm_util_debug("Success - Destroy Handle");
 
-       TTRACE_END();
+       mm_util_fleave();
+
        return ret;
 }
 
@@ -1639,25 +1599,20 @@ EXPORT_API int mm_util_convert_colorspace(const unsigned char *src, unsigned int
        unsigned char *output_buffer = NULL;
        unsigned int output_buffer_size = 0;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:CONVERT_COLORSPACE");
-
        mm_util_fenter();
 
        if (!src || !dst) {
                mm_util_error("invalid src or dst");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((src_format < MM_UTIL_IMG_FMT_YUV420) || (src_format > MM_UTIL_IMG_FMT_NUM) || (dst_format < MM_UTIL_IMG_FMT_YUV420) || (dst_format > MM_UTIL_IMG_FMT_NUM)) {
                mm_util_error("#ERROR# src_format : [%d] dst_format : [%d] value ", src_format, dst_format);
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if (__mm_cannot_convert_format(src_format, dst_format)) {
                mm_util_error("#ERROR# Cannot Support Image Format Convert");
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
 
@@ -1666,7 +1621,6 @@ EXPORT_API int mm_util_convert_colorspace(const unsigned char *src, unsigned int
        imgp_info_s *_imgp_info_s = (imgp_info_s *) calloc(1, sizeof(imgp_info_s));
        if (_imgp_info_s == NULL) {
                mm_util_error("ERROR - alloc handle");
-               TTRACE_END();
                return MM_UTIL_ERROR_OUT_OF_MEMORY;
        }
 
@@ -1696,7 +1650,6 @@ EXPORT_API int mm_util_convert_colorspace(const unsigned char *src, unsigned int
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("__mm_set_imgp_info_s failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
        mm_util_debug("Sucess __mm_set_imgp_info_s");
@@ -1705,7 +1658,6 @@ EXPORT_API int mm_util_convert_colorspace(const unsigned char *src, unsigned int
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("__mm_set_imgp_info_s failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
-               TTRACE_END();
                return ret;
        }
 
@@ -1713,7 +1665,6 @@ EXPORT_API int mm_util_convert_colorspace(const unsigned char *src, unsigned int
        if (output_buffer == NULL) {
                mm_util_error("memory allocation failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
-               TTRACE_END();
                return MM_UTIL_ERROR_OUT_OF_MEMORY;
        }
        mm_util_debug("memory allocation outputbuffer: %p (%d)", output_buffer, output_buffer_size);
@@ -1728,14 +1679,12 @@ EXPORT_API int mm_util_convert_colorspace(const unsigned char *src, unsigned int
                        mm_util_error("image processing failed");
                        __mm_util_imgp_finalize(_module, _imgp_info_s);
                        MMUTIL_SAFE_FREE(output_buffer);
-                       TTRACE_END();
                        return ret;
                }
        } else {
                mm_util_error("g_module_symbol failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
                MMUTIL_SAFE_FREE(output_buffer);
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -1744,7 +1693,6 @@ EXPORT_API int mm_util_convert_colorspace(const unsigned char *src, unsigned int
                if (ret != MM_UTIL_ERROR_NONE) {
                        mm_util_error("__mm_util_imgp_finalize failed");
                        MMUTIL_SAFE_FREE(output_buffer);
-                       TTRACE_END();
                        return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
                }
        } else {
@@ -1760,7 +1708,6 @@ EXPORT_API int mm_util_convert_colorspace(const unsigned char *src, unsigned int
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("__mm_util_imgp_finalize failed");
                MMUTIL_SAFE_FREE(output_buffer);
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
 
@@ -1768,8 +1715,6 @@ EXPORT_API int mm_util_convert_colorspace(const unsigned char *src, unsigned int
 
        mm_util_fleave();
 
-       TTRACE_END();
-
        return ret;
 }
 
@@ -1779,31 +1724,25 @@ EXPORT_API int mm_util_resize_image(const unsigned char *src, unsigned int src_w
        unsigned char *output_buffer = NULL;
        unsigned int output_buffer_size = 0;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:RESIZE_IMAGE");
-
        mm_util_fenter();
 
        if (!src || !dst) {
                mm_util_error("invalid argument");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((src_format < MM_UTIL_IMG_FMT_YUV420) || (src_format > MM_UTIL_IMG_FMT_NUM)) {
                mm_util_error("#ERROR# src_format value ");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if (!dst_width || !dst_height) {
                mm_util_error("#ERROR# dst width/height buffer is NULL");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if (!src_width || !src_height) {
                mm_util_error("#ERROR# src_width || src_height valuei is 0 ");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -1812,7 +1751,6 @@ EXPORT_API int mm_util_resize_image(const unsigned char *src, unsigned int src_w
        imgp_info_s *_imgp_info_s = (imgp_info_s *) calloc(1, sizeof(imgp_info_s));
        if (_imgp_info_s == NULL) {
                mm_util_error("ERROR - alloc handle");
-               TTRACE_END();
                return MM_UTIL_ERROR_OUT_OF_MEMORY;
        }
 
@@ -1842,7 +1780,6 @@ EXPORT_API int mm_util_resize_image(const unsigned char *src, unsigned int src_w
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("__mm_set_imgp_info_s failed [%d]", ret);
                __mm_util_imgp_finalize(_module, _imgp_info_s);
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -1852,7 +1789,6 @@ EXPORT_API int mm_util_resize_image(const unsigned char *src, unsigned int src_w
                if (__mm_gst_can_resize_format(_imgp_info_s->input_format_label) == FALSE) {
                        mm_util_error("#RESIZE ERROR# IMAGE_NOT_SUPPORT_FORMAT");
                        __mm_util_imgp_finalize(_module, _imgp_info_s);
-                       TTRACE_END();
                        return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
                }
        }
@@ -1861,7 +1797,6 @@ EXPORT_API int mm_util_resize_image(const unsigned char *src, unsigned int src_w
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("__mm_set_imgp_info_s failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
-               TTRACE_END();
                return ret;
        }
 
@@ -1869,7 +1804,6 @@ EXPORT_API int mm_util_resize_image(const unsigned char *src, unsigned int src_w
        if (output_buffer == NULL) {
                mm_util_error("memory allocation failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
-               TTRACE_END();
                return MM_UTIL_ERROR_OUT_OF_MEMORY;
        }
 
@@ -1885,14 +1819,12 @@ EXPORT_API int mm_util_resize_image(const unsigned char *src, unsigned int src_w
                        mm_util_error("image processing failed");
                        __mm_util_imgp_finalize(_module, _imgp_info_s);
                        MMUTIL_SAFE_FREE(output_buffer);
-                       TTRACE_END();
                        return ret;
                }
        } else {
                mm_util_error("g_module_symbol failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
                MMUTIL_SAFE_FREE(output_buffer);
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -1915,15 +1847,12 @@ EXPORT_API int mm_util_resize_image(const unsigned char *src, unsigned int src_w
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("__mm_util_imgp_finalize failed");
                MMUTIL_SAFE_FREE(output_buffer);
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
 
        MMUTIL_SAFE_FREE(output_buffer);
 
-       mm_util_fenter();
-
-       TTRACE_END();
+       mm_util_fleave();
 
        return ret;
 }
@@ -1934,37 +1863,30 @@ EXPORT_API int mm_util_rotate_image(const unsigned char *src, unsigned int src_w
        unsigned char *output_buffer = NULL;
        unsigned int output_buffer_size = 0;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:ROTATE_IMAGE");
-
        mm_util_fenter();
 
        if (!src || !dst) {
                mm_util_error("invalid argument");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((src_format < MM_UTIL_IMG_FMT_YUV420) || (src_format > MM_UTIL_IMG_FMT_NUM)) {
                mm_util_error("#ERROR# src_format value");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if (!dst_width || !dst_height) {
                mm_util_error("#ERROR# dst width/height buffer is NUL");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if (!src_width || !src_height) {
                mm_util_error("#ERROR# src_width || src_height value is 0 ");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((angle < MM_UTIL_ROTATE_0) || (angle > MM_UTIL_ROTATE_NUM)) {
                mm_util_error("#ERROR# angle vaule");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -1973,7 +1895,6 @@ EXPORT_API int mm_util_rotate_image(const unsigned char *src, unsigned int src_w
        imgp_info_s *_imgp_info_s = (imgp_info_s *) calloc(1, sizeof(imgp_info_s));
        if (_imgp_info_s == NULL) {
                mm_util_error("ERROR - alloc handle");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
        IMGPInfoFunc _mm_util_imgp_func = NULL;
@@ -2001,7 +1922,6 @@ EXPORT_API int mm_util_rotate_image(const unsigned char *src, unsigned int src_w
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("dst_width || dest_height size Error");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -2010,7 +1930,6 @@ EXPORT_API int mm_util_rotate_image(const unsigned char *src, unsigned int src_w
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("__mm_set_imgp_info_s failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
        mm_util_debug("Sucess __mm_set_imgp_info_s");
@@ -2019,7 +1938,6 @@ EXPORT_API int mm_util_rotate_image(const unsigned char *src, unsigned int src_w
                if (__mm_gst_can_rotate_format(_imgp_info_s->input_format_label) == FALSE) {
                        mm_util_error("#gstreamer ROTATE ERROR# IMAGE_NOT_SUPPORT_FORMAT");
                        __mm_util_imgp_finalize(_module, _imgp_info_s);
-                       TTRACE_END();
                        return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
                }
        }
@@ -2028,7 +1946,6 @@ EXPORT_API int mm_util_rotate_image(const unsigned char *src, unsigned int src_w
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("__mm_set_imgp_info_s failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
-               TTRACE_END();
                return ret;
        }
 
@@ -2036,7 +1953,6 @@ EXPORT_API int mm_util_rotate_image(const unsigned char *src, unsigned int src_w
        if (output_buffer == NULL) {
                mm_util_error("memory allocation failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
-               TTRACE_END();
                return MM_UTIL_ERROR_OUT_OF_MEMORY;
        }
 
@@ -2051,14 +1967,12 @@ EXPORT_API int mm_util_rotate_image(const unsigned char *src, unsigned int src_w
                        mm_util_error("image processing failed");
                        __mm_util_imgp_finalize(_module, _imgp_info_s);
                        MMUTIL_SAFE_FREE(output_buffer);
-                       TTRACE_END();
                        return ret;
                }
        } else {
                mm_util_error("g_module_symbol failed");
                __mm_util_imgp_finalize(_module, _imgp_info_s);
                MMUTIL_SAFE_FREE(output_buffer);
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
 
@@ -2093,7 +2007,6 @@ EXPORT_API int mm_util_rotate_image(const unsigned char *src, unsigned int src_w
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("__mm_util_imgp_finalize failed");
                MMUTIL_SAFE_FREE(output_buffer);
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
 
@@ -2101,8 +2014,6 @@ EXPORT_API int mm_util_rotate_image(const unsigned char *src, unsigned int src_w
 
        mm_util_fleave();
 
-       TTRACE_END();
-
        return ret;
 }
 
@@ -2111,23 +2022,20 @@ unsigned int crop_start_x, unsigned int crop_start_y, unsigned int *crop_dest_wi
 {
        int ret = MM_UTIL_ERROR_NONE;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:CROP_IMAGE");
+       mm_util_fenter();
 
        if (!src || !dst) {
                mm_util_error("invalid argument");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((src_format < MM_UTIL_IMG_FMT_YUV420) || (src_format > MM_UTIL_IMG_FMT_NUM)) {
                mm_util_error("#ERROR# src_format value");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((crop_start_x + *crop_dest_width > src_width) || (crop_start_y + *crop_dest_height > src_height)) {
                mm_util_error("#ERROR# dest width | height value");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -2172,7 +2080,8 @@ unsigned int crop_start_x, unsigned int crop_start_y, unsigned int *crop_dest_wi
                ret = MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
 
-       TTRACE_END();
+       mm_util_fleave();
+
        return ret;
 }
 
@@ -2184,11 +2093,10 @@ EXPORT_API int mm_util_get_image_size(mm_util_img_format format, unsigned int wi
        int size, w2, h2, size2;
        int stride, stride2;
 
-       TTRACE_BEGIN("MM_UTILITY:IMGP:GET_SIZE");
+       mm_util_fenter();
 
        if (!imgsize) {
                mm_util_error("imgsize can't be null");
-               TTRACE_END();
                return MM_UTIL_ERROR_NO_SUCH_FILE;
        }
 
@@ -2196,7 +2104,6 @@ EXPORT_API int mm_util_get_image_size(mm_util_img_format format, unsigned int wi
 
        if (check_valid_picture_size(width, height) < 0) {
                mm_util_error("invalid width and height");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -2262,12 +2169,11 @@ EXPORT_API int mm_util_get_image_size(mm_util_img_format format, unsigned int wi
 
        default:
                mm_util_error("Not supported format");
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
+
        mm_util_debug("format: %d, *imgsize: %d", format, *imgsize);
 
-       TTRACE_END();
        return ret;
 }
 
index 8218336..e2fc256 100755 (executable)
@@ -15,7 +15,7 @@ libmmutil_jpeg_la_CFLAGS = -I$(srcdir)/include \
                                -I/usr/include \
                                $(srcdir)/../imgp/libmmutil_imgp.la
 
-libmmutil_jpeg_la_LIBADD = $(GLIB_LIBS) -ljpeg -ldl -lttrace -lturbojpeg\
+libmmutil_jpeg_la_LIBADD = $(GLIB_LIBS) -ljpeg -ldl -lturbojpeg\
                                $(GMODULE_LIBS) \
                                $(MEDIA_LIBS)
 
index 4e1f674..d2d77e0 100755 (executable)
@@ -471,7 +471,7 @@ static int __mm_image_encode_to_jpeg_file_with_libjpeg(const char *pFileName, vo
        data[1] = cb;
        data[2] = cr;
 
-       mm_util_debug("Enter");
+       mm_util_fenter();
 
        cinfo.err = jpeg_std_error(&jerr);
 
@@ -664,9 +664,7 @@ static int __mm_image_encode_to_jpeg_memory_with_libjpeg(void **mem, unsigned in
        data[1] = cb;
        data[2] = cr;
 
-       mm_util_debug("Enter");
-       mm_util_debug("#Before Enter#, mem: %p\t rawdata:%p\t width: %d\t height: %d\t fmt: %d\t quality: %d"
-               , mem, rawdata, width, height, fmt, quality);
+       mm_util_debug("#Before Enter#, mem: %p\t rawdata:%p\t width: %d\t height: %d\t fmt: %d\t quality: %d", mem, rawdata, width, height, fmt, quality);
 
        if (rawdata == NULL) {
                mm_util_error("Exit on error -rawdata");
@@ -854,7 +852,7 @@ static int __mm_image_decode_from_jpeg_file_with_libjpeg(mm_util_jpeg_yuv_data *
        JSAMPROW image, u_image, v_image;
        JSAMPROW row; /* point to buffer[0] */
 
-       mm_util_debug("Enter");
+       mm_util_fenter();
 
        if (!pFileName) {
                mm_util_error("pFileName");
@@ -887,7 +885,7 @@ static int __mm_image_decode_from_jpeg_file_with_libjpeg(mm_util_jpeg_yuv_data *
                jpeg_destroy_decompress(&dinfo);
                MMUTIL_SAFE_FREE(decoded_data->data);
                fclose(infile);
-               mm_util_debug("fclose");
+               mm_util_fleave();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -1030,7 +1028,8 @@ static int __mm_image_decode_from_jpeg_file_with_libjpeg(mm_util_jpeg_yuv_data *
        jpeg_destroy_decompress(&dinfo);
 
        fclose(infile);
-       mm_util_debug("fclose");
+
+       mm_util_fleave();
 
        return iErrorCode;
 }
@@ -1045,7 +1044,7 @@ static int __mm_image_decode_from_jpeg_memory_with_libjpeg(mm_util_jpeg_yuv_data
        JSAMPROW image, u_image, v_image;
        JSAMPROW row; /* point to buffer[0] */
 
-       mm_util_debug("Enter");
+       mm_util_fenter();
 
        if (src == NULL) {
                mm_util_error("[infile] Exit on error");
@@ -1215,7 +1214,7 @@ static int __mm_image_decode_from_jpeg_memory_with_libjpeg(mm_util_jpeg_yuv_data
        jpeg_destroy_decompress(&dinfo);
        mm_util_debug("jpeg_destroy_decompress");
 
-       mm_util_debug("fclose");
+       mm_util_fleave();
 
        return iErrorCode;
 }
@@ -1224,37 +1223,31 @@ EXPORT_API int mm_util_jpeg_encode_to_file(const char *filename, void* src, int
 {
        int ret = MM_UTIL_ERROR_NONE;
 
-       TTRACE_BEGIN("MM_UTILITY:JPEG:ENCODE_TO_FILE");
+       mm_util_fenter();
 
        if (!filename || !src) {
                mm_util_error("#ERROR# filename || src buffer is NULL");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((width <= 0) || (height <= 0)) {
-               mm_util_error("#ERROR# src_width || src_height value ");
-               TTRACE_END();
+               mm_util_error("#ERROR# src_width [%d] || src_height value [%d]", width, height);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((fmt < MM_UTIL_JPEG_FMT_YUV420) || (fmt > MM_UTIL_JPEG_FMT_ARGB8888)) {
-               mm_util_error("#ERROR# fmt value");
-               TTRACE_END();
+               mm_util_error("#ERROR# fmt value [%d]", fmt);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((quality < 1) || (quality > 100)) {
-               mm_util_error("#ERROR# quality vaule");
-               TTRACE_END();
+               mm_util_error("#ERROR# quality vaule [%d]", quality);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
 #if LIBJPEG_TURBO
        mm_util_debug("#START# LIBJPEG_TURBO");
        ret = __mm_image_encode_to_jpeg_file_with_libjpeg_turbo(filename, src, width, height, fmt, quality);
-       mm_util_debug("#End# libjpeg, Success!! ret: %d", ret);
-
 #else
        mm_util_debug("#START# LIBJPEG");
        if (fmt == MM_UTIL_JPEG_FMT_NV12) {
@@ -1267,18 +1260,17 @@ EXPORT_API int mm_util_jpeg_encode_to_file(const char *filename, void* src, int
                        ret = __mm_image_encode_to_jpeg_file_with_libjpeg(filename, dst, width, height, MM_UTIL_JPEG_FMT_YUV420, quality);
                        MMUTIL_SAFE_FREE(dst);
                } else {
-                       TTRACE_END();
                        return MM_UTIL_ERROR_OUT_OF_MEMORY;
                }
        } else if (fmt == MM_UTIL_JPEG_FMT_NV21) {
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        } else {
                ret = __mm_image_encode_to_jpeg_file_with_libjpeg(filename, src, width, height, fmt, quality);
        }
-       mm_util_debug("#END# libjpeg, Success!! ret: %d", ret);
 #endif
-       TTRACE_END();
+
+       mm_util_debug("#End# libjpeg, Success!! ret: %d", ret);
+
        return ret;
 }
 
@@ -1286,37 +1278,32 @@ EXPORT_API int mm_util_jpeg_encode_to_memory(void **mem, unsigned int *size, voi
 {
        int ret = MM_UTIL_ERROR_NONE;
 
-       TTRACE_BEGIN("MM_UTILITY:JPEG:ENCODE_TO_MEMORY");
+       mm_util_fenter();
 
        if (!mem || !size || !src) {
                mm_util_error("#ERROR# filename ||size || src buffer is NULL");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((width <= 0) || (height <= 0)) {
-               mm_util_error("#ERROR# src_width || src_height value ");
-               TTRACE_END();
+               mm_util_error("#ERROR# src_width [%d] || src_height value [%d]", width, height);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((fmt < MM_UTIL_JPEG_FMT_YUV420) || (fmt > MM_UTIL_JPEG_FMT_ARGB8888)) {
-               mm_util_error("#ERROR# fmt value");
-               TTRACE_END();
+               mm_util_error("#ERROR# fmt value [%d]", fmt);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((quality < 1) || (quality > 100)) {
-               mm_util_error("#ERROR# quality vaule");
-               TTRACE_END();
+               mm_util_error("#ERROR# quality vaule [%d]", quality);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
-       #if LIBJPEG_TURBO
+#if LIBJPEG_TURBO
        mm_util_debug("#START# libjpeg-turbo");
        ret = __mm_image_encode_to_jpeg_memory_with_libjpeg_turbo(mem, size, src, width, height, fmt, quality);
-       mm_util_debug("#END# libjpeg-turbo, Success!! ret: %d", ret);
-       #else /* LIBJPEG_TURBO */
+#else /* LIBJPEG_TURBO */
        mm_util_debug("#START# libjpeg");
        if (fmt == MM_UTIL_JPEG_FMT_NV12) {
                unsigned int dst_size = 0;
@@ -1328,11 +1315,9 @@ EXPORT_API int mm_util_jpeg_encode_to_memory(void **mem, unsigned int *size, voi
                        ret = __mm_image_encode_to_jpeg_memory_with_libjpeg(mem, size, dst, width, height, MM_UTIL_JPEG_FMT_YUV420, quality);
                        MMUTIL_SAFE_FREE(dst);
                } else {
-                       TTRACE_END();
                        return MM_UTIL_ERROR_OUT_OF_MEMORY;
                }
        } else if (fmt == MM_UTIL_JPEG_FMT_NV21) {
-               TTRACE_END();
                return MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        } else {
                ret = __mm_image_encode_to_jpeg_memory_with_libjpeg(mem, size, src, width, height, fmt, quality);
@@ -1340,7 +1325,6 @@ EXPORT_API int mm_util_jpeg_encode_to_memory(void **mem, unsigned int *size, voi
 #endif /* LIBJPEG_TURBO */
        mm_util_debug("#END# libjpeg, Success!! ret: %d", ret);
 
-       TTRACE_END();
        return ret;
 }
 
@@ -1348,17 +1332,15 @@ EXPORT_API int mm_util_decode_from_jpeg_file(mm_util_jpeg_yuv_data *decoded, con
 {
        int ret = MM_UTIL_ERROR_NONE;
 
-       TTRACE_BEGIN("MM_UTILITY:JPEG:DECODE_FROM_JPEG_FILE");
+       mm_util_fenter();
 
        if (!decoded || !filename) {
                mm_util_error("#ERROR# decoded || filename buffer is NULL");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((fmt < MM_UTIL_JPEG_FMT_YUV420) || (fmt > MM_UTIL_JPEG_FMT_ARGB8888)) {
-               mm_util_error("#ERROR# fmt value");
-               TTRACE_END();
+               mm_util_error("#ERROR# fmt value [%d]", fmt);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -1375,17 +1357,14 @@ EXPORT_API int mm_util_decode_from_jpeg_file(mm_util_jpeg_yuv_data *decoded, con
        } else {
                mm_util_error("[infile] file open [%s]", filename);
                mm_util_stderror("file open failed");
-               TTRACE_END();
                return MM_UTIL_ERROR_NO_SUCH_FILE;
        }
 
        if (magic[0] == 0xff && magic[1] == 0xd8) {
-               #if LIBJPEG_TURBO
+#if LIBJPEG_TURBO
                mm_util_debug("#START# LIBJPEG_TURBO");
                ret = __mm_image_decode_from_jpeg_file_with_libjpeg_turbo(decoded, filename, fmt);
-               mm_util_debug("decoded->data: %p\t width: %d\t height: %d\t size: %u", decoded->data, decoded->width, decoded->height, decoded->size);
-               mm_util_debug("#End# LIBJPEG_TURBO, Success!! ret: %d", ret);
-               #else
+#else
                mm_util_debug("#START# libjpeg");
                if (fmt == MM_UTIL_JPEG_FMT_NV12) {
                        unsigned int dst_size = 0;
@@ -1405,7 +1384,6 @@ EXPORT_API int mm_util_decode_from_jpeg_file(mm_util_jpeg_yuv_data *decoded, con
                                        if (decoded->data == NULL) {
                                                mm_util_debug("memory allocation failed");
                                                MMUTIL_SAFE_FREE(dst);
-                                               TTRACE_END();
                                                return MM_UTIL_ERROR_OUT_OF_MEMORY;
                                        }
                                        memcpy(decoded->data, dst, dst_size);
@@ -1413,17 +1391,15 @@ EXPORT_API int mm_util_decode_from_jpeg_file(mm_util_jpeg_yuv_data *decoded, con
                                        MMUTIL_SAFE_FREE(dst);
                                } else {
                                        mm_util_debug("memory allocation failed");
-                                       TTRACE_END();
                                        return MM_UTIL_ERROR_OUT_OF_MEMORY;
                                }
                        }
                } else {
                        ret = __mm_image_decode_from_jpeg_file_with_libjpeg(decoded, filename, fmt, MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1);
                }
-
-               mm_util_debug("decoded->data: %p\t width: %d\t height:%d\t size: %u", decoded->data, decoded->width, decoded->height, decoded->size);
+#endif
+               mm_util_debug("decoded->data: %p\t width: %d\t height: %d\t size: %u", decoded->data, decoded->width, decoded->height, decoded->size);
                mm_util_debug("#End# libjpeg, Success!! ret: %d", ret);
-               #endif
        } else if (magic[0] == 0x47 && magic[1] == 0x49) {
                mm_util_error("Not JPEG IMAGE - GIF");
                ret = MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
@@ -1438,7 +1414,8 @@ EXPORT_API int mm_util_decode_from_jpeg_file(mm_util_jpeg_yuv_data *decoded, con
                ret = MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
 
-       TTRACE_END();
+       mm_util_fleave();
+
        return ret;
 }
 
@@ -1446,28 +1423,22 @@ EXPORT_API int mm_util_decode_from_jpeg_memory(mm_util_jpeg_yuv_data *decoded, v
 {
        int ret = MM_UTIL_ERROR_NONE;
 
-       TTRACE_BEGIN("MM_UTILITY:JPEG:DECODE_FROM_JPEG_MEMORY");
+       mm_util_fenter();
 
        if (!decoded || !src) {
                mm_util_error("#ERROR# decoded || src buffer is NULL");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((fmt < MM_UTIL_JPEG_FMT_YUV420) || (fmt > MM_UTIL_JPEG_FMT_ARGB8888)) {
-               mm_util_error("#ERROR# fmt value");
-               TTRACE_END();
+               mm_util_error("#ERROR# fmt value [%d]", fmt);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
-       #if LIBJPEG_TURBO
+#if LIBJPEG_TURBO
        mm_util_debug("#START# libjpeg");
        ret = __mm_image_decode_from_jpeg_memory_with_libjpeg_turbo(decoded, src, size, fmt);
-
-       mm_util_debug("decoded->data: %p\t width: %d\t height: %u\t size: %u", decoded->data, decoded->width, decoded->height, decoded->size);
-       mm_util_debug("#END# libjpeg, Success!! ret: %d", ret);
-
-       #else
+#else
        mm_util_debug("#START# libjpeg");
        if (fmt == MM_UTIL_JPEG_FMT_NV12) {
                unsigned int dst_size = 0;
@@ -1488,7 +1459,6 @@ EXPORT_API int mm_util_decode_from_jpeg_memory(mm_util_jpeg_yuv_data *decoded, v
                                if (decoded->data == NULL) {
                                        mm_util_debug("memory allocation failed");
                                        MMUTIL_SAFE_FREE(dst);
-                                       TTRACE_END();
                                        return MM_UTIL_ERROR_OUT_OF_MEMORY;
                                }
                                memcpy(decoded->data, dst, dst_size);
@@ -1496,19 +1466,16 @@ EXPORT_API int mm_util_decode_from_jpeg_memory(mm_util_jpeg_yuv_data *decoded, v
                                MMUTIL_SAFE_FREE(dst);
                        } else {
                                mm_util_debug("memory allocation failed");
-                               TTRACE_END();
                                return MM_UTIL_ERROR_OUT_OF_MEMORY;
                        }
                }
        } else {
                ret = __mm_image_decode_from_jpeg_memory_with_libjpeg(decoded, src, size, fmt, MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1);
        }
-
+#endif
        mm_util_debug("decoded->data: %p\t width: %d\t height: %d\t size: %u", decoded->data, decoded->width, decoded->height, decoded->size);
        mm_util_debug("#END# libjpeg, Success!! ret: %d", ret);
-       #endif
 
-       TTRACE_END();
        return ret;
 }
 
@@ -1516,24 +1483,21 @@ EXPORT_API int mm_util_decode_from_jpeg_file_with_downscale(mm_util_jpeg_yuv_dat
 {
        int ret = MM_UTIL_ERROR_NONE;
 
-       TTRACE_BEGIN("MM_UTILITY:JPEG:DECODE_FROM_JPEG_FILE_WITH_DOWNSCALE");
+       mm_util_fenter();
 
        if (!decoded || !filename) {
                mm_util_error("#ERROR# decoded || filename buffer is NULL");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((fmt < MM_UTIL_JPEG_FMT_YUV420) || (fmt > MM_UTIL_JPEG_FMT_ARGB8888)) {
-               mm_util_error("#ERROR# fmt value");
-               TTRACE_END();
+               mm_util_error("#ERROR# fmt value [%d]", fmt);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((downscale != MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1) && (downscale != MM_UTIL_JPEG_DECODE_DOWNSCALE_1_2)
                 && (downscale != MM_UTIL_JPEG_DECODE_DOWNSCALE_1_4) && (downscale != MM_UTIL_JPEG_DECODE_DOWNSCALE_1_8)) {
-               mm_util_error("#ERROR# fmt value");
-               TTRACE_END();
+               mm_util_error("#ERROR# downscale value [%d]", downscale);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
@@ -1550,16 +1514,13 @@ EXPORT_API int mm_util_decode_from_jpeg_file_with_downscale(mm_util_jpeg_yuv_dat
        } else {
                mm_util_error("[infile] file open [%s]", filename);
                mm_util_stderror("file open failed");
-               TTRACE_END();
                return MM_UTIL_ERROR_NO_SUCH_FILE;
        }
        if (magic[0] == 0xff && magic[1] == 0xd8) {
-               #if LIBJPEG_TURBO
+#if LIBJPEG_TURBO
                mm_util_debug("#START# LIBJPEG_TURBO");
                ret = __mm_image_decode_from_jpeg_file_with_libjpeg_turbo(decoded, filename, fmt);
-               mm_util_debug("decoded->data: %p\t width: %d\t height: %d\t size: %u", decoded->data, decoded->width, decoded->height, decoded->size);
-               mm_util_debug("#End# LIBJPEG_TURBO, Success!! ret: %d", ret);
-               #else
+#else
                mm_util_debug("#START# libjpeg");
                if (fmt == MM_UTIL_JPEG_FMT_NV12) {
                        unsigned int dst_size = 0;
@@ -1579,7 +1540,6 @@ EXPORT_API int mm_util_decode_from_jpeg_file_with_downscale(mm_util_jpeg_yuv_dat
                                        if (decoded->data == NULL) {
                                                mm_util_debug("memory allocation failed");
                                                MMUTIL_SAFE_FREE(dst);
-                                               TTRACE_END();
                                                return MM_UTIL_ERROR_OUT_OF_MEMORY;
                                        }
                                        memcpy(decoded->data, dst, dst_size);
@@ -1587,7 +1547,6 @@ EXPORT_API int mm_util_decode_from_jpeg_file_with_downscale(mm_util_jpeg_yuv_dat
                                        MMUTIL_SAFE_FREE(dst);
                                } else {
                                        mm_util_debug("memory allocation failed");
-                                       TTRACE_END();
                                        return MM_UTIL_ERROR_OUT_OF_MEMORY;
                                }
                        }
@@ -1595,9 +1554,9 @@ EXPORT_API int mm_util_decode_from_jpeg_file_with_downscale(mm_util_jpeg_yuv_dat
                        ret = __mm_image_decode_from_jpeg_file_with_libjpeg(decoded, filename, fmt, downscale);
                }
 
-               mm_util_debug("decoded->data: %p\t width: %d\t height:%d\t size: %u", decoded->data, decoded->width, decoded->height, decoded->size);
+#endif
+               mm_util_debug("decoded->data: %p\t width: %d\t height: %d\t size: %u", decoded->data, decoded->width, decoded->height, decoded->size);
                mm_util_debug("#End# libjpeg, Success!! ret: %d", ret);
-               #endif
        } else if (magic[0] == 0x47 && magic[1] == 0x49) {
                mm_util_error("Not JPEG IMAGE - GIF");
                ret = MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
@@ -1612,7 +1571,7 @@ EXPORT_API int mm_util_decode_from_jpeg_file_with_downscale(mm_util_jpeg_yuv_dat
                ret = MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT;
        }
 
-       TTRACE_END();
+       mm_util_fleave();
        return ret;
 }
 
@@ -1620,35 +1579,28 @@ EXPORT_API int mm_util_decode_from_jpeg_memory_with_downscale(mm_util_jpeg_yuv_d
 {
        int ret = MM_UTIL_ERROR_NONE;
 
-       TTRACE_BEGIN("MM_UTILITY:JPEG:DECODE_FROM_JPEG_MEMORY_WITH_DOWNSCALE");
+       mm_util_fenter();
 
        if (!decoded || !src) {
                mm_util_error("#ERROR# decoded || src buffer is NULL");
-               TTRACE_END();
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((fmt < MM_UTIL_JPEG_FMT_YUV420) || (fmt > MM_UTIL_JPEG_FMT_ARGB8888)) {
-               mm_util_error("#ERROR# fmt value");
-               TTRACE_END();
+               mm_util_error("#ERROR# fmt value [%d]", fmt);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
        if ((downscale != MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1) && (downscale != MM_UTIL_JPEG_DECODE_DOWNSCALE_1_2)
                 && (downscale != MM_UTIL_JPEG_DECODE_DOWNSCALE_1_4) && (downscale != MM_UTIL_JPEG_DECODE_DOWNSCALE_1_8)) {
-               mm_util_error("#ERROR# fmt value");
-               TTRACE_END();
+               mm_util_error("#ERROR# downscale value [%d]", downscale);
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
-       #if LIBJPEG_TURBO
+#if LIBJPEG_TURBO
        mm_util_debug("#START# libjpeg");
        ret = __mm_image_decode_from_jpeg_memory_with_libjpeg_turbo(decoded, src, size, fmt);
-
-       mm_util_debug("decoded->data: %p\t width: %d\t height: %d\t size: %u", decoded->data, decoded->width, decoded->height, decoded->size);
-       mm_util_debug("#END# libjpeg, Success!! ret: %d", ret);
-
-       #else
+#else
        mm_util_debug("#START# libjpeg");
        if (fmt == MM_UTIL_JPEG_FMT_NV12) {
                unsigned int dst_size = 0;
@@ -1669,7 +1621,6 @@ EXPORT_API int mm_util_decode_from_jpeg_memory_with_downscale(mm_util_jpeg_yuv_d
                                if (decoded->data == NULL) {
                                        mm_util_debug("memory allocation failed");
                                        MMUTIL_SAFE_FREE(dst);
-                                       TTRACE_END();
                                        return MM_UTIL_ERROR_OUT_OF_MEMORY;
                                }
                                memcpy(decoded->data, dst, dst_size);
@@ -1677,18 +1628,16 @@ EXPORT_API int mm_util_decode_from_jpeg_memory_with_downscale(mm_util_jpeg_yuv_d
                                MMUTIL_SAFE_FREE(dst);
                        } else {
                                mm_util_debug("memory allocation failed");
-                               TTRACE_END();
                                return MM_UTIL_ERROR_OUT_OF_MEMORY;
                        }
                }
        } else {
                ret = __mm_image_decode_from_jpeg_memory_with_libjpeg(decoded, src, size, fmt, downscale);
        }
+#endif
 
        mm_util_debug("decoded->data: %p\t width: %d\t height: %d\t size: %u", decoded->data, decoded->width, decoded->height, decoded->size);
        mm_util_debug("#END# libjpeg, Success!! ret: %d", ret);
-       #endif
 
-       TTRACE_END();
        return ret;
 }
index 0cb6501..7d5e7dc 100755 (executable)
@@ -17,7 +17,6 @@ BuildRequires:  libjpeg-turbo-devel
 BuildRequires:  pkgconfig(libtzplatform-config)
 BuildRequires:  pkgconfig(capi-media-tool)
 BuildRequires:  pkgconfig(opencv)
-BuildRequires:  pkgconfig(ttrace)
 BuildRequires:  libpng-devel
 BuildRequires:  giflib-devel
 BuildRequires:  libbmp-devel
index 9a4c57b..c39bf87 100644 (file)
@@ -15,7 +15,7 @@ libmmutil_png_la_CFLAGS = -I$(srcdir)/include \
                                -I/usr/include \
                                $(srcdir)/../imgp/libmmutil_imgp.la
 
-libmmutil_png_la_LIBADD = $(GLIB_LIBS) -lpng -ldl -lttrace\
+libmmutil_png_la_LIBADD = $(GLIB_LIBS) -lpng -ldl \
                                $(GMODULE_LIBS) \
                                $(MEDIA_LIBS)