Use mm_util_color_format_e instead of format_label or colorspace. format_label and... 26/170026/3 accepted/tizen/unified/20180214.144548 submit/tizen/20180212.075159
authorhj kim <backto.kim@samsung.com>
Tue, 13 Feb 2018 03:18:22 +0000 (12:18 +0900)
committerhj kim <backto.kim@samsung.com>
Tue, 13 Feb 2018 03:21:31 +0000 (12:21 +0900)
Change-Id: Ibc5c313746564b8f32819a0147600e706e8f3544

gstcs/include/mm_util_gstcs.h
gstcs/include/mm_util_gstcs_internal.h
gstcs/mm_util_gstcs.c

index 98350c0..f12b9b1 100755 (executable)
@@ -52,28 +52,34 @@ typedef enum {
 
 typedef enum {
        /* YUV planar format */
-       MM_UTIL_IMG_FMT_YUV420 = 0x00,  /**< YUV420 format - planer */
-       MM_UTIL_IMG_FMT_YUV422,         /**< YUV422 format - planer */
-       MM_UTIL_IMG_FMT_I420,           /**< YUV420 format - planar */
-       MM_UTIL_IMG_FMT_NV12,           /**< NV12 format - planer */
+       MM_UTIL_COLOR_YUV420,                   /**< YUV420 format - planer YV12*/
+       MM_UTIL_COLOR_YUV422,                   /**< YUV422 format - planer */
+       MM_UTIL_COLOR_I420,                             /**< YUV420 format - planar */
+       MM_UTIL_COLOR_NV12,                             /**< NV12 format - planer */
 
        /* YUV packed format */
-       MM_UTIL_IMG_FMT_UYVY,           /**< UYVY format - YUV packed format */
-       MM_UTIL_IMG_FMT_YUYV,           /**< YUYV format - YUV packed format */
+       MM_UTIL_COLOR_UYVY,                             /**< UYVY format - YUV packed format */
+       MM_UTIL_COLOR_YUYV,                             /**< YUYV format - YUV packed format */
 
        /* RGB color */
-       MM_UTIL_IMG_FMT_RGB565,         /**< RGB565 pixel format */
-       MM_UTIL_IMG_FMT_RGB888,         /**< RGB888 pixel format */
-       MM_UTIL_IMG_FMT_ARGB8888,       /**< ARGB8888 pixel format */
-
-       //added by yh8004.kim
-       MM_UTIL_IMG_FMT_BGRA8888,      /**< BGRA8888 pixel format */
-       MM_UTIL_IMG_FMT_RGBA8888,      /**< RGBA8888 pixel format */
-       MM_UTIL_IMG_FMT_BGRX8888,      /**<BGRX8888 pixel format */
+       MM_UTIL_COLOR_RGB16,            /**< RGB565 pixel format */
+       MM_UTIL_COLOR_RGB24,                    /**< RGB888 pixel format */
+       MM_UTIL_COLOR_ARGB,                             /**< ARGB8888 pixel format */
+
+       MM_UTIL_COLOR_BGRA,                             /**< BGRA8888 pixel format */
+       MM_UTIL_COLOR_RGBA,                             /**< RGBA8888 pixel format */
+       MM_UTIL_COLOR_BGRX,                             /**< BGRX8888 pixel format */
+
        /* non-standard format */
-       MM_UTIL_IMG_FMT_NV12_TILED,     /**< Customized color format in s5pc110 */
-       MM_UTIL_IMG_FMT_NUM,            /**< Number of image formats */
-} mm_util_img_format_e;
+       MM_UTIL_COLOR_NV12_TILED,               /**< Customized color format in s5pc110 */
+       MM_UTIL_COLOR_NV16,                             /**< NV16 pixel format */
+       MM_UTIL_COLOR_NV61,                             /**< NV61 pixel format */
+       MM_UTIL_COLOR_NV21,                     /**< NV21 format - planer */
+
+       /* GrayScale */
+       MM_UTIL_COLOR_GRAYSCALE,                /**< Grayscale pixel format */
+       MM_UTIL_COLOR_NUM,                              /**< Number of image formats */
+} mm_util_color_format_e;
 
 typedef enum {
        GSTCS_ERROR_NONE =              0,       /**< Successful */
@@ -89,11 +95,11 @@ typedef enum {
  */
 typedef struct _imgp_info_s {
        char *input_format_label;
-       mm_util_img_format_e src_format;
+       mm_util_color_format_e src_format;
        unsigned int src_width;
        unsigned int src_height;
        char *output_format_label;
-       mm_util_img_format_e dst_format;
+       mm_util_color_format_e dst_format;
        unsigned int dst_width;
        unsigned int dst_height;
        unsigned int output_stride;
index da87e6a..d35c2ff 100755 (executable)
@@ -75,8 +75,7 @@ extern "C" {
 
 #define GSTCS_FREE(src) { if (src) {g_free(src); src = NULL; } }
 typedef struct _image_format_s {
-       char *format_label; /*I420, AYUV, RGB888, BGRA8888 */
-       char *colorspace; /* yuv, rgb, RGBA */
+       mm_util_color_format_e color_format;
        int width;
        int height;
        int stride;
index 4f28610..76b087a 100755 (executable)
@@ -90,27 +90,37 @@ _mm_on_src_message(GstBus * bus, GstMessage * message, gpointer user_data)
        return TRUE;
 }
 
-static int
-_mm_get_byte_per_pixcel(const char *__format_label)
+static int _mm_get_byte_per_pixcel(mm_util_color_format_e color_format)
 {
        int byte_per_pixcel = 1;
-       if (strcmp(__format_label, "RGB565") == 0) {
+
+       switch (color_format) {
+       case MM_UTIL_COLOR_YUV420:
+       case MM_UTIL_COLOR_YUV422:
+       case MM_UTIL_COLOR_I420:
+       case MM_UTIL_COLOR_NV12:
+       case MM_UTIL_COLOR_UYVY:
+       case MM_UTIL_COLOR_YUYV:
+               byte_per_pixcel = 1;
+               break;
+       case MM_UTIL_COLOR_RGB16:
                byte_per_pixcel = 2;
-       } else if (strcmp(__format_label, "RGB888") == 0 ||
-               strcmp(__format_label, "BGR888") == 0) {
+               break;
+       case MM_UTIL_COLOR_RGB24:
                byte_per_pixcel = 3;
-       } else if (strcmp(__format_label, "RGBA8888") == 0 ||
-               strcmp(__format_label, "ARGB8888") == 0 ||
-               strcmp(__format_label, "BGRA8888") == 0 ||
-               strcmp(__format_label, "ABGR8888") == 0 ||
-               strcmp(__format_label, "RGBX") == 0 ||
-               strcmp(__format_label, "XRGB") == 0 ||
-               strcmp(__format_label, "BGRX") == 0 ||
-               strcmp(__format_label, "XBGR") == 0) {
+               break;
+       case MM_UTIL_COLOR_ARGB:
+       case MM_UTIL_COLOR_BGRA:
+       case MM_UTIL_COLOR_RGBA:
+       case MM_UTIL_COLOR_BGRX:
                byte_per_pixcel = 4;
+               break;
+       default:
+               gstcs_error("Not supported format");
+               break;
        }
 
-       gstcs_debug("byte per pixcel : %d", byte_per_pixcel);
+       gstcs_debug("color_format [%d] byte per pixcel [%d]", color_format, byte_per_pixcel);
 
        return byte_per_pixcel;
 }
@@ -188,7 +198,7 @@ _mm_link_pipeline(gstreamer_s* pGstreamer_s, int value)
        g_object_set(pGstreamer_s->appsink, "emit-signals", TRUE, "sync", FALSE, NULL);
 }
 
-static GstVideoFormat _mm_get_video_format(char *format_label)
+static GstVideoFormat _mm_get_video_format(mm_util_color_format_e color_format)
 {
        GstVideoFormat videoFormat = GST_VIDEO_FORMAT_UNKNOWN;
        int _bpp = 0;
@@ -199,55 +209,55 @@ static GstVideoFormat _mm_get_video_format(char *format_label)
        int _alpha_mask = 0;
        int _endianness = 0;
 
-       if (format_label == NULL) {
-               gstcs_error("Wrong format label");
-               return videoFormat;
-       }
-
-       if (strcmp(format_label, "I420") == 0)
-               videoFormat = GST_VIDEO_FORMAT_I420;
-       else if (strcmp(format_label, "Y42B") == 0)
-               videoFormat = GST_VIDEO_FORMAT_Y42B;
-       else if (strcmp(format_label, "Y444") == 0)
-               videoFormat = GST_VIDEO_FORMAT_Y444;
-       else if (strcmp(format_label, "YV12") == 0)
+       switch (color_format) {
+       case MM_UTIL_COLOR_YUV420:
                videoFormat = GST_VIDEO_FORMAT_YV12;
-       else if (strcmp(format_label, "NV12") == 0)
+               break;
+       case MM_UTIL_COLOR_YUV422:
+               videoFormat = GST_VIDEO_FORMAT_Y42B;
+               break;
+       case MM_UTIL_COLOR_I420:
+               videoFormat = GST_VIDEO_FORMAT_I420;
+               break;
+       case MM_UTIL_COLOR_NV12:
                videoFormat = GST_VIDEO_FORMAT_NV12;
-       else if (strcmp(format_label, "UYVY") == 0)
+               break;
+       case MM_UTIL_COLOR_UYVY:
                videoFormat = GST_VIDEO_FORMAT_UYVY;
-       else if (strcmp(format_label, "YUYV") == 0)
+               break;
+       case MM_UTIL_COLOR_YUYV:
                videoFormat = GST_VIDEO_FORMAT_YVYU;
-       else if (strcmp(format_label, "RGB888") == 0) {
-               _bpp = 24; _depth = 24; _red_mask = 16711680; _green_mask = 65280; _blue_mask = 255; _endianness = 4321; _alpha_mask = 0;
-               videoFormat = gst_video_format_from_masks(_depth, _bpp, _endianness, _red_mask, _green_mask, _blue_mask, _alpha_mask);
-       } else if (strcmp(format_label, "BGR888") == 0) {
-               _bpp = 24; _depth = 24; _red_mask = 255; _green_mask = 65280; _blue_mask = 16711680; _endianness = 4321; _alpha_mask = 0;
-               videoFormat = gst_video_format_from_masks(_depth, _bpp, _endianness, _red_mask, _green_mask, _blue_mask, _alpha_mask);
-       } else if (strcmp(format_label, "RGB565") == 0) {
+               break;
+       case MM_UTIL_COLOR_RGB16:
                _bpp = 16; _depth = 16; _red_mask = 63488; _green_mask = 2016; _blue_mask = 31; _endianness = 1234; _alpha_mask = 0;
                videoFormat = gst_video_format_from_masks(_depth, _bpp, _endianness, _red_mask, _green_mask, _blue_mask, _alpha_mask);
-       } else if ((strcmp(format_label, "BGRX") == 0)) {
-               _bpp = 32; _depth = 24; _red_mask = 65280; _green_mask = 16711680; _blue_mask = -16777216; _endianness = 4321; _alpha_mask = 0;
+               break;
+       case MM_UTIL_COLOR_RGB24:
+               _bpp = 24; _depth = 24; _red_mask = 16711680; _green_mask = 65280; _blue_mask = 255; _endianness = 4321; _alpha_mask = 0;
                videoFormat = gst_video_format_from_masks(_depth, _bpp, _endianness, _red_mask, _green_mask, _blue_mask, _alpha_mask);
-       } else if (strcmp(format_label, "ARGB8888") == 0) { /*[Low Arrary Address] ARGBARGB... [High Array Address]*/
-               gstcs_debug("ARGB8888");
+               break;
+       case MM_UTIL_COLOR_ARGB:
                _bpp = 32; _depth = 32; _red_mask = 16711680; _green_mask = 65280; _blue_mask = 255; _alpha_mask = -16777216; _endianness = 4321;
                videoFormat = gst_video_format_from_masks(_depth, _bpp, _endianness, _red_mask, _green_mask, _blue_mask, _alpha_mask);
-       } else if (strcmp(format_label, "BGRA8888") == 0) { /*[Low Arrary Address] BGRABGRA...[High Array Address]*/
-               gstcs_debug("BGRA8888");
+               break;
+       case MM_UTIL_COLOR_BGRA:
                _bpp = 32; _depth = 32; _red_mask = 65280; _green_mask = 16711680; _blue_mask = -16777216; _alpha_mask = 255; _endianness = 4321;
-       } else if (strcmp(format_label, "RGBA8888") == 0) { /*[Low Arrary Address] RGBARGBA...[High Array Address]*/
-               gstcs_debug("RGBA8888");
+               videoFormat = gst_video_format_from_masks(_depth, _bpp, _endianness, _red_mask, _green_mask, _blue_mask, _alpha_mask);
+               break;
+       case MM_UTIL_COLOR_RGBA:
                _bpp = 32; _depth = 32; _red_mask = -16777216; _green_mask = 16711680; _blue_mask = 65280; _alpha_mask = 255; _endianness = 4321;
-       } else if (strcmp(format_label, "ABGR8888") == 0) { /*[Low Arrary Address] ABGRABGR...[High Array Address]*/
-               gstcs_debug("ABGR8888");
-               _bpp = 32; _depth = 32; _red_mask = 255; _green_mask = 65280; _blue_mask = 16711680; _alpha_mask = -16777216; _endianness = 4321;
-       } else {
-               gstcs_error("***Wrong format cs type***");
+               videoFormat = gst_video_format_from_masks(_depth, _bpp, _endianness, _red_mask, _green_mask, _blue_mask, _alpha_mask);
+               break;
+       case MM_UTIL_COLOR_BGRX:
+               _bpp = 32; _depth = 24; _red_mask = 65280; _green_mask = 16711680; _blue_mask = -16777216; _endianness = 4321; _alpha_mask = 0;
+               videoFormat = gst_video_format_from_masks(_depth, _bpp, _endianness, _red_mask, _green_mask, _blue_mask, _alpha_mask);
+               break;
+       default:
+               gstcs_error("Not supported format");
+               break;
        }
 
-       gstcs_debug("format_label [%s], Chosen video format [%s]", format_label, gst_video_format_to_string(videoFormat));
+       gstcs_debug("color_format [%d], Chosen video format [%s]", color_format, gst_video_format_to_string(videoFormat));
 
        return videoFormat;
 
@@ -262,7 +272,7 @@ static void _mm_set_capabilities(image_format_s* __format)
                return;
        }
 
-       videoFormat = _mm_get_video_format(__format->format_label);
+       videoFormat = _mm_get_video_format(__format->color_format);
 
        __format->caps = gst_caps_new_simple("video/x-raw",
                        "format", G_TYPE_STRING, gst_video_format_to_string(videoFormat),
@@ -281,24 +291,6 @@ static void _mm_set_capabilities(image_format_s* __format)
        }
 }
 
-static void _mm_set_image_colorspace(image_format_s* __format)
-{
-       gstcs_debug("format_label: %s\n", __format->format_label);
-
-       if ((strcmp(__format->format_label, "I420") == 0) || (strcmp(__format->format_label, "Y42B") == 0) || (strcmp(__format->format_label, "Y444") == 0)
-               || (strcmp(__format->format_label, "YV12") == 0) || (strcmp(__format->format_label, "NV12") == 0) || (strcmp(__format->format_label, "UYVY") == 0) || (strcmp(__format->format_label, "YUYV") == 0)) {
-               __format->colorspace = g_strdup("YUV");
-       } else if ((strcmp(__format->format_label, "RGB888") == 0) || (strcmp(__format->format_label, "BGR888") == 0) || (strcmp(__format->format_label, "RGB565") == 0)) {
-               __format->colorspace = g_strdup("RGB");
-       } else if ((strcmp(__format->format_label, "ARGB8888") == 0) || (strcmp(__format->format_label, "BGRA8888") == 0) || (strcmp(__format->format_label, "RGBA8888") == 0)  || (strcmp(__format->format_label, "ABGR8888") == 0)) {
-               __format->colorspace = g_strdup("RGBA");
-       } else if ((strcmp(__format->format_label, "BGRX") == 0)) {
-               __format->colorspace = g_strdup("BGRX");
-       } else {
-               gstcs_error("Check your colorspace format label");
-       }
-}
-
 static int _gstcs_create_image_format(image_format_s **format)
 {
        int ret = GSTCS_ERROR_NONE;
@@ -324,25 +316,40 @@ static void _gstcs_destroy_image_format(image_format_s *format)
 {
        if (format != NULL) {
                gst_caps_unref(format->caps);
-               GSTCS_FREE(format->format_label);
-               GSTCS_FREE(format->colorspace);
                GSTCS_FREE(format);
        }
 }
 
 static void _mm_round_up_widh_height(image_format_s* pFormat)
 {
-       if (strcmp(pFormat->colorspace, "YUV") == 0) {
+       switch (pFormat->color_format) {
+       case MM_UTIL_COLOR_YUV420:
+       case MM_UTIL_COLOR_YUV422:
+       case MM_UTIL_COLOR_I420:
+       case MM_UTIL_COLOR_NV12:
+       case MM_UTIL_COLOR_UYVY:
+       case MM_UTIL_COLOR_YUYV:
                pFormat->stride = pFormat->width;
                pFormat->elevation = pFormat->height;
-       } else if (strcmp(pFormat->colorspace, "RGB") == 0) {
+               break;
+       case MM_UTIL_COLOR_RGB16:
+       case MM_UTIL_COLOR_RGB24:
                pFormat->stride = MM_UTIL_ROUND_UP_4(pFormat->width);
                pFormat->elevation = MM_UTIL_ROUND_UP_2(pFormat->height);
-       } else if ((strcmp(pFormat->colorspace, "RGBA") == 0) || (strcmp(pFormat->colorspace, "BGRX") == 0)) {
+               break;
+       case MM_UTIL_COLOR_ARGB:
+       case MM_UTIL_COLOR_BGRA:
+       case MM_UTIL_COLOR_RGBA:
+       case MM_UTIL_COLOR_BGRX:
                pFormat->stride = pFormat->width;
                pFormat->elevation = MM_UTIL_ROUND_UP_2(pFormat->height);
+               break;
+       default:
+               gstcs_error("Not supported format");
+               break;
        }
-       gstcs_debug("stride: %d, elevation: %d", pFormat->stride, pFormat->elevation);
+
+       gstcs_debug("color_format [%d] stride [%d], elevation [%d]", pFormat->color_format, pFormat->stride, pFormat->elevation);
 }
 
 static image_format_s* _mm_set_input_image_format_s_struct(imgp_info_s* pImgp_info)
@@ -356,17 +363,13 @@ static image_format_s* _mm_set_input_image_format_s_struct(imgp_info_s* pImgp_in
                return NULL;
        }
 
-       __format->format_label = g_strdup(pImgp_info->input_format_label);
-       _mm_set_image_colorspace(__format);
-
+       __format->color_format = pImgp_info->src_format;
        __format->width = pImgp_info->src_width;
        __format->height = pImgp_info->src_height;
        _mm_round_up_widh_height(__format);
 
        _mm_set_capabilities(__format);
 
-       gstcs_debug("input_format_label: %s", pImgp_info->input_format_label);
-
        return __format;
 }
 
@@ -381,9 +384,7 @@ static image_format_s* _mm_set_output_image_format_s_struct(imgp_info_s* pImgp_i
                return NULL;
        }
 
-       __format->format_label = g_strdup(pImgp_info->output_format_label);
-       _mm_set_image_colorspace(__format);
-
+       __format->color_format = pImgp_info->dst_format;
        __format->width = pImgp_info->dst_width;
        __format->height = pImgp_info->dst_height;
        _mm_round_up_widh_height(__format);
@@ -393,49 +394,53 @@ static image_format_s* _mm_set_output_image_format_s_struct(imgp_info_s* pImgp_i
        pImgp_info->output_stride = __format->stride;
        pImgp_info->output_elevation = __format->elevation;
 
-       gstcs_debug("output_format_label: %s", pImgp_info->output_format_label);
-
        return __format;
 }
 
-static int _mm_setup_image_size(const char* _format_label, int width, int height)
+static int _mm_setup_image_size(mm_util_color_format_e color_format, int width, int height)
 {
        int size = 0;
 
-       if (strcmp(_format_label, "I420") == 0)
-               size = (MM_UTIL_ROUND_UP_4(width) * MM_UTIL_ROUND_UP_2(height) + MM_UTIL_ROUND_UP_8(width) * MM_UTIL_ROUND_UP_2(height) /2); /*width * height *1.5; */
-       else if (strcmp(_format_label, "Y42B") == 0)
-               size = (MM_UTIL_ROUND_UP_4(width) * height + MM_UTIL_ROUND_UP_8(width) * height); /*width * height *2; */
-       else if (strcmp(_format_label, "YUV422") == 0)
-               size = (MM_UTIL_ROUND_UP_4(width) * height + MM_UTIL_ROUND_UP_8(width) * height); /*width * height *2; */
-       else if (strcmp(_format_label, "Y444") == 0)
-               size = (MM_UTIL_ROUND_UP_4(width) * height * 3); /* width * height *3; */
-       else if (strcmp(_format_label, "YV12") == 0)
+       gstcs_debug("color_format: %d", color_format);
+
+       switch (color_format) {
+       case MM_UTIL_COLOR_YUV420:
                size = (MM_UTIL_ROUND_UP_4(width) * MM_UTIL_ROUND_UP_2(height) + MM_UTIL_ROUND_UP_8(width) * MM_UTIL_ROUND_UP_2(height) / 2); /* width * height *1; */
-       else if (strcmp(_format_label, "NV12") == 0)
+               break;
+       case MM_UTIL_COLOR_YUV422:
+               size = (MM_UTIL_ROUND_UP_4(width) * height + MM_UTIL_ROUND_UP_8(width) * height); /*width * height *2; */
+               break;
+       case MM_UTIL_COLOR_I420:
+               size = (MM_UTIL_ROUND_UP_4(width) * MM_UTIL_ROUND_UP_2(height) + MM_UTIL_ROUND_UP_8(width) * MM_UTIL_ROUND_UP_2(height) /2); /*width * height *1.5; */
+               break;
+       case MM_UTIL_COLOR_NV12:
                size = (MM_UTIL_ROUND_UP_4(width) * MM_UTIL_ROUND_UP_2(height) * 1.5); /* width * height *1.5; */
-       else if (strcmp(_format_label, "RGB565") == 0)
-               size = (MM_UTIL_ROUND_UP_4(width) * 2 * height); /* width * height *2; */
-       else if (strcmp(_format_label, "RGB888") == 0)
-               size = (MM_UTIL_ROUND_UP_4(width) * 3 * height); /* width * height *3; */
-       else if (strcmp(_format_label, "BGR888") == 0)
-               size = (MM_UTIL_ROUND_UP_4(width) * 3 * height); /* width * height *3; */
-       else if (strcmp(_format_label, "UYVY") == 0)
+               break;
+       case MM_UTIL_COLOR_UYVY:
                size = (MM_UTIL_ROUND_UP_2(width) * 2 * height); /* width * height *2; */
-       else if (strcmp(_format_label, "YUYV") == 0)
+               break;
+       case MM_UTIL_COLOR_YUYV:
                size = (MM_UTIL_ROUND_UP_2(width) * 2 * height); /* width * height *2; */
-       else if (strcmp(_format_label, "ARGB8888") == 0)
-               size = width * height *4;
-       else if (strcmp(_format_label, "BGRA8888") == 0)
-               size = width * height *4;
-       else if (strcmp(_format_label, "RGBA8888") == 0)
-               size = width * height *4;
-       else if (strcmp(_format_label, "ABGR8888") == 0)
-               size = width * height *4;
-       else if (strcmp(_format_label, "BGRX") == 0)
+               break;
+       case MM_UTIL_COLOR_RGB16:
+               size = (MM_UTIL_ROUND_UP_4(width) * 2 * height); /* width * height *2; */
+               break;
+       case MM_UTIL_COLOR_RGB24:
+               size = (MM_UTIL_ROUND_UP_4(width) * 3 * height); /* width * height *3; */
+               break;
+       case MM_UTIL_COLOR_ARGB:
+       case MM_UTIL_COLOR_BGRA:
+       case MM_UTIL_COLOR_RGBA:
+       case MM_UTIL_COLOR_BGRX:
                size = width * height *4;
+               break;
+       default:
+               gstcs_error("Not supported format");
+               break;
+       }
+
 
-       gstcs_debug("file_size: %d\n", size);
+       gstcs_debug("Image size: %d", size);
 
        return size;
 }
@@ -450,7 +455,7 @@ _mm_push_buffer_into_pipeline(imgp_info_s* pImgp_info, unsigned char *src, gstre
                return GSTCS_ERROR_INVALID_PARAMETER;
        }
 
-       gsize data_size = _mm_setup_image_size(pImgp_info->input_format_label, pImgp_info->src_width, pImgp_info->src_height);
+       gsize data_size = _mm_setup_image_size(pImgp_info->src_format, pImgp_info->src_width, pImgp_info->src_height);
        GstBuffer* gst_buf = gst_buffer_new_wrapped_full(GST_MEMORY_FLAG_READONLY, src, data_size, 0, data_size, NULL, NULL);
 
        if (gst_buf == NULL) {
@@ -478,10 +483,10 @@ _mm_push_buffer_into_pipeline_new(image_format_s *input_format, unsigned char *s
        }
 
        gstcs_debug("stride: %d, elevation: %d", stride, elevation);
-       src_size = _mm_setup_image_size(input_format->format_label, stride, elevation);
+       src_size = _mm_setup_image_size(input_format->color_format, stride, elevation);
        gstcs_debug("buffer size (src): %d", src_size);
 
-       int byte_per_pixcel = _mm_get_byte_per_pixcel(input_format->format_label);
+       int byte_per_pixcel = _mm_get_byte_per_pixcel(input_format->color_format);
        unsigned int src_row = input_format->width * byte_per_pixcel;
        unsigned int stride_row = stride * byte_per_pixcel;
        unsigned int i = 0, y = 0;
@@ -597,7 +602,7 @@ _mm_imgp_gstcs_processing(gstreamer_s* pGstreamer_s, unsigned char *src, unsigne
                        int buffer_size = mapinfo.size;
                        int calc_buffer_size = 0;
 
-                       calc_buffer_size = _mm_setup_image_size(pImgp_info->output_format_label, output_format->stride, output_format->elevation);
+                       calc_buffer_size = _mm_setup_image_size(pImgp_info->dst_format, output_format->stride, output_format->elevation);
 
                        gstcs_debug("buffer size: %d, calc: %d\n", buffer_size, calc_buffer_size);
                        if (buffer_size != calc_buffer_size) {