Code clean up of removing unused define, macro and variables 56/158756/1 accepted/tizen/unified/20171103.162253 submit/tizen/20171103.020449
authorJiyong Min <jiyong.min@samsung.com>
Fri, 3 Nov 2017 01:16:44 +0000 (10:16 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Fri, 3 Nov 2017 01:18:47 +0000 (10:18 +0900)
Change-Id: Ia00a96b050141df12abee7255072b96d7e816c3f
Signed-off-by: Jiyong Min <jiyong.min@samsung.com>
imgp/include/mm_util_imgp_internal.h
imgp/mm_util_imgp.c

index 4abb74b..77b58ad 100755 (executable)
 
 #define IMGP_FUNC_NAME                         "mm_imgp"
 #define IMGP_FREE(src) { if (src != NULL) {g_free(src); src = NULL; } }
-#define SCMN_IMGB_MAX_PLANE         (4)
-#define MAX_SRC_BUF_NUM          12    /* Max number of upstream src plugins's buffer */
-#define MAX_DST_BUF_NUM          12
-#define SCMN_Y_PLANE                 0
-#define SCMN_CB_PLANE                1
-#define SCMN_CR_PLANE                2
-#define MM_UTIL_DST_WIDTH_DEFAULT 0
-#define MM_UTIL_DST_WIDTH_MIN 0
-#define MM_UTIL_DST_WIDTH_MAX 32767
-#define MM_UTIL_DST_HEIGHT_DEFAULT 0
-#define MM_UTIL_DST_HEIGHT_MIN 0
-#define MM_UTIL_DST_HEIGHT_MAX 32767
-#define MM_UTIL_DST_BUFFER_MIN 2
-#define MM_UTIL_DST_BUFFER_DEFAULT 3
-#define MM_UTIL_DST_BUFFER_MAX 12
-#define MAX_IPP_EVENT_BUFFER_SIZE 1024
-
-/* macro for align ***********************************************************/
-#define ALIGN_TO_2B(x)         ((((x)  + (1 <<  1) - 1) >>  1) <<  1)
-#define ALIGN_TO_4B(x)         ((((x)  + (1 <<  2) - 1) >>  2) <<  2)
-#define ALIGN_TO_8B(x)         ((((x)  + (1 <<  3) - 1) >>  3) <<  3)
-#define ALIGN_TO_16B(x)                ((((x)  + (1 <<  4) - 1) >>  4) <<  4)
-#define ALIGN_TO_32B(x)                ((((x)  + (1 <<  5) - 1) >>  5) <<  5)
-#define ALIGN_TO_128B(x)       ((((x)  + (1 <<  7) - 1) >>  7) <<  7)
-#define ALIGN_TO_2KB(x)                ((((x)  + (1 << 11) - 1) >> 11) << 11)
-#define ALIGN_TO_8KB(x)                ((((x)  + (1 << 13) - 1) >> 13) << 13)
-#define ALIGN_TO_64KB(x)       ((((x)  + (1 << 16) - 1) >> 16) << 16)
-
 #define SAFE_STRCPY(dst, src, n)       g_strlcpy(dst, src, n)
 
 /**
@@ -120,18 +92,7 @@ typedef struct {
        mm_util_completed_callback completed_cb;
 } mm_util_cb_s;
 
-typedef enum {
-       GEM_FOR_SRC = 0,
-       GEM_FOR_DST = 1,
-} ConvertGemCreateType;
-
-typedef enum {
-       MM_UTIL_IPP_CTRL_STOP = 0,
-       MM_UTIL_IPP_CTRL_START = 1,
-} ConvertIppCtrl;
-
 typedef struct {
-       media_packet_h src_packet;
        void *src;
        mm_util_img_format src_format;
        unsigned int src_width;
@@ -139,7 +100,6 @@ typedef struct {
        media_packet_h dst_packet;
        void *dst;
        mm_util_img_format dst_format;
-       media_format_mimetype_e dst_format_mime;
        unsigned int start_x;
        unsigned int start_y;
        unsigned int dst_width;
index 30d8bbb..1e02879 100755 (executable)
@@ -806,7 +806,6 @@ static int __mm_util_handle_init(mm_util_s *handle)
        handle->src = NULL;
        handle->dst = NULL;
        handle->dst_format = MM_UTIL_IMG_FMT_NUM;
-       handle->dst_format_mime = -1;
        handle->dst_rotation = MM_UTIL_ROTATION_NONE;
 
        handle->start_x = -1;
@@ -1216,19 +1215,17 @@ static int __mm_get_info_from_media_packet(media_packet_h pkt, media_format_h *f
        handle->src_width = width;
        handle->src_height = height;
        handle->src_buf_size = (guint)size;
-       handle->src_packet = pkt;
        handle->src = ptr;
 
        if (handle->dst_format == MM_UTIL_IMG_FMT_NUM) {
                mm_util_debug("dst format is equal to src format");
                handle->dst_format = handle->src_format;
-               handle->dst_format_mime = mimetype;
        }
 
        return MM_UTIL_ERROR_NONE;
 }
 
-static int __mm_create_media_format(media_format_h fmt, media_format_mimetype_e mimetype, unsigned int width, unsigned int height, media_format_h *new_fmt)
+static int __mm_create_media_format(media_format_h fmt, mm_util_img_format format, unsigned int width, unsigned int height, media_format_h *new_fmt)
 {
        int err = MEDIA_FORMAT_ERROR_NONE;
 
@@ -1243,7 +1240,7 @@ static int __mm_create_media_format(media_format_h fmt, media_format_mimetype_e
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
 
-       err = media_format_set_video_mime(*new_fmt, mimetype);
+       err = media_format_set_video_mime(*new_fmt, __mm_util_mapping_imgp_format_to_mime(format));
        if (err != MEDIA_FORMAT_ERROR_NONE) {
                media_format_unref(*new_fmt);
                mm_util_error("media_format_set_video_mime failed (%d)", err);
@@ -1335,11 +1332,11 @@ static int __mm_util_transform_exec(mm_util_s *handle, media_packet_h src_packet
                handle->dst_packet = NULL;
                return MM_UTIL_ERROR_INVALID_PARAMETER;
        }
-       mm_util_debug("handle->src_packet: %p [%d] %d X %d (%d) => handle->dst_packet: %p [%d] %d X %d (%d)",
-               handle->src_packet, handle->src_format, handle->src_width, handle->src_height, handle->src_buf_size,
-               handle->dst_packet, handle->dst_format, handle->dst_width, handle->dst_height, handle->dst_buf_size);
+       mm_util_debug("handle->src: %p [%d] %d X %d (%d) => handle->dst: %p [%d] %d X %d (%d)",
+               handle->src, handle->src_format, handle->src_width, handle->src_height, handle->src_buf_size,
+               handle->dst, handle->dst_format, handle->dst_width, handle->dst_height, handle->dst_buf_size);
 
-       ret = __mm_create_media_format(src_fmt, handle->dst_format_mime, handle->dst_width, handle->dst_height, &dst_fmt);
+       ret = __mm_create_media_format(src_fmt, handle->dst_format, handle->dst_width, handle->dst_height, &dst_fmt);
        if (ret != MM_UTIL_ERROR_NONE) {
                mm_util_error("__mm_create_media_format failed");
                media_format_unref(src_fmt);
@@ -1454,8 +1451,7 @@ int mm_util_set_colorspace_convert(mm_util_imgp_h imgp_handle, mm_util_img_forma
 
        handle->set_convert = TRUE;
        handle->dst_format = colorspace;
-       handle->dst_format_mime = __mm_util_mapping_imgp_format_to_mime(colorspace);
-       mm_util_debug("imgp fmt: %d mimetype: %d", handle->dst_format, handle->dst_format_mime);
+       mm_util_debug("imgp fmt: %d", handle->dst_format);
 
        TTRACE_END();
        return ret;