Remove useless code. Don't need to check colospace. YUV's w/h is alwasy same as strid... 57/169957/1
authorhj kim <backto.kim@samsung.com>
Mon, 12 Feb 2018 09:15:22 +0000 (18:15 +0900)
committerhj kim <backto.kim@samsung.com>
Mon, 12 Feb 2018 09:15:22 +0000 (18:15 +0900)
Change-Id: I417ec48df97c8c4a3b72c53d133aa2f17f8d4d65

gstcs/mm_util_gstcs.c

index 8cdc877e80597aaa72d554767fd2b6a5d8df6f98..ab10568bc266bb0abfa812cb5230923191d6e032 100755 (executable)
@@ -262,8 +262,6 @@ static void _mm_set_capabilities(image_format_s* __format)
                return;
        }
 
-       gstcs_debug("colorspace: %s(%d)\n", __format->colorspace, strlen(__format->colorspace));
-
        videoFormat = _mm_get_video_format(__format->format_label);
 
        __format->caps = gst_caps_new_simple("video/x-raw",
@@ -497,14 +495,14 @@ _mm_imgp_gstcs_processing(gstreamer_s* pGstreamer_s, unsigned char *src, unsigne
        gst_app_src_set_caps(GST_APP_SRC(pGstreamer_s->appsrc), input_format->caps);
        gst_app_sink_set_caps(GST_APP_SINK(pGstreamer_s->appsink), output_format->caps);
 
-       if (((input_format->width != input_format->stride) || (input_format->height != input_format->elevation)) &&
-               ((strcmp(input_format->colorspace, "RGB") == 0) || (strcmp(input_format->colorspace, "RGBA") == 0))) {
+       if ((input_format->width != input_format->stride) || (input_format->height != input_format->elevation)) {
                gstcs_debug("Start _mm_push_buffer_into_pipeline_new");
                ret = _mm_push_buffer_into_pipeline_new(input_format, src, pGstreamer_s);
        } else {
                gstcs_debug("Start mm_push_buffer_into_pipeline");
                ret = _mm_push_buffer_into_pipeline(pImgp_info, src, pGstreamer_s);
        }
+
        if (ret != GSTCS_ERROR_NONE) {
                gstcs_error("ERROR - mm_push_buffer_into_pipeline ");
                gst_object_unref(pGstreamer_s->pipeline);
@@ -556,13 +554,9 @@ _mm_imgp_gstcs_processing(gstreamer_s* pGstreamer_s, unsigned char *src, unsigne
                        gst_buffer_map(pGstreamer_s->output_buffer, &mapinfo, GST_MAP_READ);
                        int buffer_size = mapinfo.size;
                        int calc_buffer_size = 0;
-                       if (((pImgp_info->dst_width != (unsigned int)(output_format->stride)) || (pImgp_info->dst_height != (unsigned int)(output_format->elevation))) &&
-                               ((strcmp(input_format->colorspace, "RGB") == 0) || (strcmp(input_format->colorspace, "RGBA") == 0))) {
-                               gstcs_debug("calculate image size with stride & elevation");
-                               calc_buffer_size = mm_setup_image_size(pImgp_info->output_format_label, output_format->stride, output_format->elevation);
-                       } else {
-                               calc_buffer_size = mm_setup_image_size(pImgp_info->output_format_label, pImgp_info->dst_width, pImgp_info->dst_height);
-                       }
+
+                       calc_buffer_size = mm_setup_image_size(pImgp_info->output_format_label, 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) {
                                gstcs_debug("Buffer size is different \n");