[ITC][capi-media-image-util][ACR-1389][Add/Deprecate Update Image Decoding APIs] 04/206704/3
authormansankar <karanam.s@samsung.com>
Thu, 23 May 2019 08:52:21 +0000 (14:22 +0530)
committershobhit verma <shobhit.v@samsung.com>
Fri, 24 May 2019 11:14:17 +0000 (11:14 +0000)
Change-Id: I9167de955d5538d8f741de6ec439d21fd8e9963a
Signed-off-by: mansankar <karanam.s@samsung.com>
src/itc/image-util/ITs-image-util-image.c
src/itc/image-util/ITs-image-util.c
src/itc/image-util/tct-image-util-native_mobile.h
src/itc/image-util/tct-image-util-native_tizeniot.h
src/itc/image-util/tct-image-util-native_wearable.h

index ef225ad4d9e497ff8fac77fd49d2eb5c475709c8..5647ad33dca3417cabe6dc5a94fa32d3f4c60512 100644 (file)
@@ -111,6 +111,7 @@ static int ITc_decode_jpeg(void)
 {
        int nRet = IMAGE_UTIL_ERROR_NONE;
        image_util_decode_h hImageDecoder = NULL;
+       image_util_image_h hDecodedImage = NULL;
 
        nRet = image_util_decode_create(&hImageDecoder);
        if (nRet != IMAGE_UTIL_ERROR_NONE){
@@ -130,20 +131,22 @@ static int ITc_decode_jpeg(void)
                FPRINTF("[Line : %d][%s] image_util_decode_set_colorspace failed.nRet = %d\\n", __LINE__, API_NAMESPACE, nRet);
                return nRet;
        }
-       nRet = image_util_decode_set_output_buffer(hImageDecoder, &g_hDecodedImage.buffer);
+       nRet = image_util_decode_run2(hImageDecoder, &hDecodedImage);
        if (nRet != IMAGE_UTIL_ERROR_NONE){
                image_util_decode_destroy(hImageDecoder);
-               FPRINTF("[Line : %d][%s] image_util_decode_set_output_buffer failed.nRet = %d\\n", __LINE__, API_NAMESPACE, nRet);
+               FPRINTF("[Line : %d][%s] image_util_decode_run2 failed.nRet = %d\\n", __LINE__, API_NAMESPACE, nRet);
                return nRet;
        }
-       nRet = image_util_decode_run(hImageDecoder, &g_hDecodedImage.width, &g_hDecodedImage.height, &g_hDecodedImage.size);
+       image_util_decode_destroy(hImageDecoder);
+       nRet = image_util_get_image(hDecodedImage, &g_hDecodedImage.width, &g_hDecodedImage.height, NULL, &g_hDecodedImage.buffer, &g_hDecodedImage.size);
        if (nRet != IMAGE_UTIL_ERROR_NONE){
-               image_util_decode_destroy(hImageDecoder);
-               FPRINTF("[Line : %d][%s] image_util_decode_set_input_path failed.nRet = %d\\n", __LINE__, API_NAMESPACE, nRet);
+               image_util_destroy_image(hDecodedImage);
+               FPRINTF("[Line : %d][%s] image_util_get_image failed.nRet = %d\\n", __LINE__, API_NAMESPACE, nRet);
                return nRet;
        }
 
-       image_util_decode_destroy(hImageDecoder);
+       image_util_destroy_image(hDecodedImage);
+
        return nRet;
 }
 
index 5859d64496f265603815c8a27a35f383553ad3a2..c7d16624f49aa544ccd3f3b7fbbc00a7461df25b 100755 (executable)
@@ -98,7 +98,7 @@ bool ImageUtilSupportedJpegCallback(image_util_colorspace_e  Colourspace,  void
 * @description         Called when transform is finished just before returning the output.
 * @parameter[IN]       The error code of image-util transfrom
 * @parameter[IN]       Media packet handle     
-* @parameter[IN]       The user data passed from the for each function                 
+* @parameter[IN]       The user data passed from the for each function
 * @return                      NA
 */
 void Image_util_transform_completed_CallBack(media_packet_h *packet, int error_code, void *user_data)
@@ -127,7 +127,7 @@ void Image_util_transform_completed_CallBack(media_packet_h *packet, int error_c
 * @description                 Create and Destroy a  handle to image-util transform.  
 * @scenario                            Creates a handle to image-util transform\n
 *                                              Destroy handle to image-util transform.
-* @apicovered                  image_util_transform_create, image_util_transform_destroy                                               
+* @apicovered                  image_util_transform_create, image_util_transform_destroy
 * @passcase                            When image_util_transform_create and  image_util_transform_destory are successful.
 * @failcase                            If target API image_util_transform_create or image_util_transform_destory or any precondition API fails.
 * @precondition                        NA
@@ -162,7 +162,7 @@ int ITc_image_util_transform_create_destroy_p(void)
 *                                              To Set the information of the converting\n
 *                                              To get the information of the converting\n
 *                                              Destroy handle to image-util transform.
-* @apicovered                  image_util_transform_set_crop_area,image_util_transform_get_colorspace,image_util_transform_set_colorspace                                      
+* @apicovered                  image_util_transform_set_crop_area,image_util_transform_get_colorspace,image_util_transform_set_colorspace
 * @passcase                            When image_util_transform_get_colorspace and  image_util_transform_set_colorspace are successful.
 * @failcase                            If target API image_util_transform_get_colorspace or image_util_transform_set_colorspace or any precondition API fails.
 * @precondition                        image_util_transform_create, image_util_transform_set_crop_area must be called
@@ -208,12 +208,12 @@ int ITc_image_util_transform_set_get_colorspace_p(void)
 * @author              SRID(sk.roy)
 * @reviewer            SRID(gupta.sanjay)
 * @type                                auto
-* @description                 To Set and Get the information of the cropping  
+* @description                 To Set and Get the information of the cropping
 * @scenario                            Create a handle to image-util transform\n
 *                                              Set the startX startY endX endY positions of cropped image buffer\n
 *                                              Get the startX startY endX endY positions of cropped image buffer\n
 *                                              Destroy handle to image-util transform.
-* @apicovered                  image_util_transform_set_crop_area, image_util_transform_set_crop_area                                          
+* @apicovered                  image_util_transform_set_crop_area, image_util_transform_set_crop_area
 * @passcase                            When image_util_transform_set_crop_area and  image_util_transform_set_crop_area are successful.
 * @failcase                            If target API image_util_transform_set_crop_area or image_util_transform_set_crop_area or any precondition API fails.
 * @precondition                        NA
@@ -244,7 +244,7 @@ int ITc_image_util_transform_set_get_crop_area_p(void)
                FPRINTF("\\n [Line : %d][%s] crop_area set and get values mismatch\\n", __LINE__, API_NAMESPACE);
                return 1;
        }
-       
+
        nRet = image_util_transform_destroy(stHandle);
        PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_transform_destroy", ImageUtilGetError(nRet));
 
@@ -254,17 +254,17 @@ int ITc_image_util_transform_set_get_crop_area_p(void)
 //& purpose: To Set and Get the resolution of the image buffer
 //& type: auto 
 /**
-* @testcase                    ITc_image_util_transform_set_get_resolution_p
+* @testcase                            ITc_image_util_transform_set_get_resolution_p
 * @since_tizen                 2.3
-* @author              SRID(sk.roy)
-* @reviewer            SRID(gupta.sanjay)
+* @author                                      SRID(sk.roy)
+* @reviewer                            SRID(gupta.sanjay)
 * @type                                auto
 * @description                 To Set and Get the resolution of the image buffer 
 * @scenario                            Create a handle to image-util transform\n
 *                                              Set the width and height of source image buffer\n
 *                                              Get the width and height of source image buffer\n
 *                                              Destroy handle to image-util transform.
-* @apicovered                  image_util_transform_set_resolution, image_util_transform_get_resolution                                                
+* @apicovered                  image_util_transform_set_resolution, image_util_transform_get_resolution
 * @passcase                            When image_util_transform_set_resolution and  image_util_transform_get_resolution are successful.
 * @failcase                            If target API image_util_transform_set_resolution or image_util_transform_get_resolution or any precondition API fails.
 * @precondition                        NA
@@ -314,7 +314,7 @@ int ITc_image_util_transform_set_get_resolution_p(void)
 *                                              Set rotation value of image buffer\n
 *                                              Get rotation value of image buffer\n
 *                                              Destroy handle to image-util transform.
-* @apicovered                  image_util_transform_set_rotation, image_util_transform_get_rotation                                            
+* @apicovered                  image_util_transform_set_rotation, image_util_transform_get_rotation
 * @passcase                            When image_util_transform_set_rotation and  image_util_transform_get_rotation are successful.
 * @failcase                            If target API image_util_transform_set_rotation or image_util_transform_get_rotation or any precondition API fails.
 * @precondition                        NA
@@ -393,13 +393,13 @@ int ITc_image_util_transform_set_get_rotation_p(void)
 * @author              SRID(sk.roy)
 * @reviewer            SRID(gupta.sanjay)
 * @type                                auto
-* @description                 To Transform the image for given image-util handle. 
+* @description                 To Transform the image for given image-util handle.
 * @scenario                            Create a handle to image-util transform\n
 *                                              Media format is to be called\n
 *                                              image_util_transform_completed_cb callback is invoked\n
 *                                              Get rotation value of image buffer\n
 *                                              Destroy handle to image-util transform.
-* @apicovered                  image_util_transform_run                                                
+* @apicovered                  image_util_transform_run
 * @passcase                            When image_util_transform_run, media_format_create, media_format_set_video_mime, media_format_set_video_width
 *                                              media_format_set_video_height, media_format_set_video_avg_bps, media_format_set_video_max_bps,media_packet_create_alloc
 *                                              image_util_transform_set_resolution, media_packet_destroy,image_util_transform_destroy  is successful.
@@ -480,7 +480,7 @@ int ITc_image_util_transform_run_p(void)
 }
 
 //& purpose: To extract representative colour from an image buffer.
-//& type: auto 
+//& type: auto
 /**
 * @testcase                    ITc_image_util_extract_color_from_memory_p
 * @since_tizen                         3.0
@@ -504,6 +504,7 @@ int ITc_image_util_extract_color_from_memory_p(void)
     unsigned char rgb_r, rgb_g, rgb_b;
        unsigned long long unDecodeSize = 0;
        image_util_decode_h dstHandle = NULL;
+       image_util_image_h stDecodedImage = NULL;
        unsigned long nDecWidth = 0;
        unsigned long nDecHeight = 0;
 
@@ -524,16 +525,19 @@ int ITc_image_util_extract_color_from_memory_p(void)
        nRet = image_util_decode_set_colorspace(dstHandle, IMAGE_UTIL_COLORSPACE_RGB888);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_colorspace", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
 
-       nRet = image_util_decode_set_output_buffer(dstHandle, &puszImageSourceBuffer);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
-
-       nRet = image_util_decode_run(dstHandle, &nDecWidth, &nDecHeight, &unDecodeSize);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
-       CHECK_RETURN_CLEANUP(nWidth, "image_util_decode_run", image_util_decode_destroy(dstHandle));
-       CHECK_RETURN_CLEANUP(nHeight, "image_util_decode_run", image_util_decode_destroy(dstHandle));
+       nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+       CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(dstHandle));
 
        nRet = image_util_decode_destroy(dstHandle);
-       PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+
+       nRet = image_util_get_image(stDecodedImage, &nDecWidth, &nDecHeight, NULL, &puszImageSourceBuffer, &unDecodeSize);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_get_image", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+       CHECK_HANDLE_CLEANUP(puszImageSourceBuffer, "image_util_get_image", image_util_destroy_image(stDecodedImage));
+
+       nRet = image_util_destroy_image(stDecodedImage);
+       PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
 
        nWidth = (int)nDecWidth;
        nWidth = (int)nDecHeight;
@@ -543,8 +547,8 @@ int ITc_image_util_extract_color_from_memory_p(void)
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_extract_color_from_memory", ImageUtilGetError(nRet), FREE_MEMORY(puszImageSourceBuffer));
 
        FREE_MEMORY(puszImageSourceBuffer);
-   
-    return 0;
+
+       return 0;
 }
 //& purpose: To create and destroy a handle to image util decoding. 
 //& type: auto 
@@ -554,7 +558,7 @@ int ITc_image_util_extract_color_from_memory_p(void)
 * @author              SRID(manu.tiwari)
 * @reviewer            SRID(parshant.v)
 * @type                                auto
-* @description                 To create and destroy a handle to image util decoding. 
+* @description                 To create and destroy a handle to image util decoding.
 * @scenario                            Get the size of buffer\n
 *                                              Allocate it to image-util buffer
 * @apicovered                  image_util_decode_create,image_util_decode_destroy
@@ -579,12 +583,12 @@ int ITc_image_util_decode_create_destroy_p(void)
 //& purpose: To set the input file path from which to decode. 
 //& type: auto 
 /**
-* @testcase                    ITc_image_util_decode_set_input_path_p
+* @testcase                    ITc_image_util_decode_set_input_path_p
 * @since_tizen                 3.0
-* @author              SRID(manu.tiwari)
-* @reviewer            SRID(parshant.v)
+* @author                              SRID(manu.tiwari)
+* @reviewer                    SRID(parshant.v)
 * @type                                auto
-* @description                 To set the input file path from which to decode. 
+* @description                 To set the input file path from which to decode.
 * @scenario                            Get the size of buffer\n
 *                                              Allocate it to image-util buffer
 * @apicovered                  image_util_decode_set_input_path
@@ -617,15 +621,15 @@ int ITc_image_util_decode_set_input_path_p(void)
 
        return 0;
 }
-//& purpose: To create a handle to image util decoding. 
-//& type: auto 
+//& purpose: To create a handle to image util decoding.
+//& type: auto
 /**
-* @testcase                    ITc_image_util_decode_set_input_buffer_p
+* @testcase                            ITc_image_util_decode_set_input_buffer_p
 * @since_tizen                 3.0
-* @author              SRID(manu.tiwari)
-* @reviewer            SRID(parshant.v)
+* @author                              SRID(manu.tiwari)
+* @reviewer                    SRID(parshant.v)
 * @type                                auto
-* @description                 To set the input buffer to image util decoding. 
+* @description                 To set the input buffer to image util decoding.
 * @scenario                            To set the input buffer to image util decoding.
 * @apicovered                  image_util_decode_set_input_buffer
 * @passcase                            When image_util_decode_set_input_buffer is successful.
@@ -636,10 +640,11 @@ int ITc_image_util_decode_set_input_path_p(void)
 int ITc_image_util_decode_set_input_buffer_p(void)
 {
        START_TEST;
-       
+
        image_util_encode_h stEncHandle = NULL;
        image_util_decode_h stDecHandle = NULL;
        image_util_decode_h stDecodedHandle = NULL;
+       image_util_image_h stDecodedImage = NULL;
        unsigned char *puszImageInputBuffer = NULL;
        unsigned char *puszImageOutputbuffer = NULL;
        unsigned long long nDecsize;
@@ -650,7 +655,7 @@ int ITc_image_util_decode_set_input_buffer_p(void)
        int nRet = image_util_decode_create(&stDecHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
        CHECK_HANDLE(stDecHandle,"image_util_decode_create");
-       
+
        char pPath[PATH_LEN] = {0,};
        if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
        {
@@ -661,19 +666,24 @@ int ITc_image_util_decode_set_input_buffer_p(void)
        nRet = image_util_decode_set_input_path(stDecHandle, pPath);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
 
-       nRet = image_util_decode_set_output_buffer(stDecHandle, &puszImageOutputbuffer);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
-
-       nRet = image_util_decode_run(stDecHandle, &nDecWidth, &nDecHeight, &nDecsize);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
+       nRet = image_util_decode_run2(stDecHandle, &stDecodedImage);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
+       CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(stDecHandle));
 
        nRet = image_util_decode_destroy(stDecHandle);
-       PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
-       
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+
+       nRet = image_util_get_image(stDecodedImage, &nDecWidth, &nDecHeight, NULL, &puszImageOutputbuffer, &nDecsize);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_get_image", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+       CHECK_HANDLE_CLEANUP(puszImageOutputbuffer, "image_util_get_image", image_util_destroy_image(stDecodedImage));
+
+       nRet = image_util_destroy_image(stDecodedImage);
+       PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+
        nRet = image_util_encode_create(IMAGE_UTIL_PNG, &stEncHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
        CHECK_HANDLE(stEncHandle,"image_util_encode_create");
-       
+
        nRet = image_util_encode_set_resolution(stEncHandle, nDecWidth, nDecHeight);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_resolution", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
 
@@ -682,7 +692,7 @@ int ITc_image_util_decode_set_input_buffer_p(void)
 
        nRet = image_util_encode_set_output_buffer(stEncHandle, &puszImageInputBuffer);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_output_buffer", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
-       
+
        nRet = image_util_encode_run(stEncHandle, &nEncsize);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_run", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
 
@@ -703,49 +713,15 @@ int ITc_image_util_decode_set_input_buffer_p(void)
        return 0;
 }
 
-//& purpose: To create a handle to image util decoding. 
-//& type: auto 
-/**
-* @testcase                    ITc_image_util_decode_set_output_buffer_p
-* @since_tizen                 3.0
-* @author              SRID(manu.tiwari)
-* @reviewer            SRID(parshant.v)
-* @type                                auto
-* @description                 To set output buffer to image util decoding. 
-* @scenario                            To set output buffer to image util decoding.
-* @apicovered                  image_util_decode_set_output_buffer
-* @passcase                            When image_util_decode_set_output_buffer is successful.
-* @failcase                            If target API image_util_decode_set_output_buffer fails or any precondition API fails.
-* @precondition                        NA
-* @postcondition               NA
-*/
-int ITc_image_util_decode_set_output_buffer_p(void)
-{
-       START_TEST;
-       image_util_decode_h stHandle = NULL;
-       unsigned char *puszImageOutputBuffer = NULL;
-       
-       int nRet = image_util_decode_create(&stHandle);
-       PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
-       CHECK_HANDLE(stHandle,"image_util_decode_create");
-       //target api
-       nRet = image_util_decode_set_output_buffer(stHandle, &puszImageOutputBuffer);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stHandle));
-       
-       nRet = image_util_decode_destroy(stHandle);
-       PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
-
-       return 0;
-}
-//& purpose: To create and destroy a handle to image util decoding. 
-//& type: auto 
+//& purpose: To create and destroy a handle to image util decoding.
+//& type: auto
 /**
-* @testcase                    ITc_image_util_encode_create_destroy_p
+* @testcase                    ITc_image_util_encode_create_destroy_p
 * @since_tizen                 3.0
 * @author              SRID(manu.tiwari)
 * @reviewer            SRID(parshant.v)
 * @type                                auto
-* @description                 To create and destroy a handle to image util encoding. 
+* @description                 To create and destroy a handle to image util encoding.
 * @scenario                            To create and destroy a handle to image util encoding
 * @apicovered                  image_util_encode_create,image_util_encode_destroy
 * @passcase                            When image_util_encode_create and image_util_encode_destroy is successful.
@@ -756,7 +732,7 @@ int ITc_image_util_decode_set_output_buffer_p(void)
 int ITc_image_util_encode_create_destroy_p(void)
 {
        START_TEST;
-       
+
        image_util_encode_h stHandle = NULL;
        image_util_type_e eImageUtilType[] = 
        {
@@ -784,10 +760,10 @@ int ITc_image_util_encode_create_destroy_p(void)
 //& purpose: To create a handle to image util decoding. 
 //& type: auto 
 /**
-* @testcase                    ITc_image_util_encode_set_resolution_p
+* @testcase                    ITc_image_util_encode_set_resolution_p
 * @since_tizen                 3.0
-* @author              SRID(manu.tiwari)
-* @reviewer            SRID(parshant.v)
+* @author                              SRID(manu.tiwari)
+* @reviewer                    SRID(parshant.v)
 * @type                                auto
 * @description                 To set the resolution to image util decoding. 
 * @scenario                            To set the resolution to image util decoding.
@@ -820,8 +796,8 @@ int ITc_image_util_encode_set_resolution_p(void)
 /**
 * @testcase                    ITc_image_util_encode_set_png_compression_p
 * @since_tizen                 3.0
-* @author              SRID(manu.tiwari)
-* @reviewer            SRID(parshant.v)
+* @author                              SRID(manu.tiwari)
+* @reviewer                    SRID(parshant.v)
 * @type                                auto
 * @description                 To set png compression to image util decoding. 
 * @scenario                            To set png compression to image util decoding
@@ -848,16 +824,16 @@ int ITc_image_util_encode_set_png_compression_p(void)
 
        return 0;
 }
-//& purpose: To create a handle to image util decoding. 
-//& type: auto 
+//& purpose: To create a handle to image util decoding.
+//& type: auto
 /**
-* @testcase                    ITc_image_util_encode_set_input_buffer_p
+* @testcase                    ITc_image_util_encode_set_input_buffer_p
 * @since_tizen                 3.0
-* @author              SRID(manu.tiwari)
-* @reviewer            SRID(parshant.v)
+* @author                              SRID(manu.tiwari)
+* @reviewer                    SRID(parshant.v)
 * @type                                auto
-* @description                 To set the input buffer to image util encoding. 
-* @scenario                            To set the input buffer to image util encoding. 
+* @description                 To set the input buffer to image util encoding.
+* @scenario                            To set the input buffer to image util encoding.
 * @apicovered                  image_util_encode_set_input_buffer
 * @passcase                            When image_util_encode_set_input_buffer is successful.
 * @failcase                            If target API image_util_encode_set_input_buffer fails or any precondition API fails.
@@ -867,9 +843,10 @@ int ITc_image_util_encode_set_png_compression_p(void)
 int ITc_image_util_encode_set_input_buffer_p(void)
 {
        START_TEST;
-       
+
        image_util_encode_h stEncHandle = NULL;
        image_util_decode_h stDecHandle = NULL;
+       image_util_image_h stDecodedImage = NULL;
        unsigned char *puszImageInputBuffer = NULL;
        unsigned char *puszImageOutputbuffer = NULL;
        unsigned long long nDecsize;
@@ -880,7 +857,7 @@ int ITc_image_util_encode_set_input_buffer_p(void)
        int nRet = image_util_decode_create(&stDecHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
        CHECK_HANDLE(stDecHandle,"image_util_decode_create");
-       
+
        char pPath[PATH_LEN] = {0,};
        if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
        {
@@ -891,19 +868,24 @@ int ITc_image_util_encode_set_input_buffer_p(void)
        nRet = image_util_decode_set_input_path(stDecHandle, pPath);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_path", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
 
-       nRet = image_util_decode_set_output_buffer(stDecHandle, &puszImageOutputbuffer);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
-
-       nRet = image_util_decode_run(stDecHandle, &nDecWidth, &nDecHeight, &nDecsize);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
+       nRet = image_util_decode_run2(stDecHandle, &stDecodedImage);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(stDecHandle));
+       CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(stDecHandle));
 
        nRet = image_util_decode_destroy(stDecHandle);
-       PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
-       
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+
+       nRet = image_util_get_image(stDecodedImage, &nDecWidth, &nDecHeight, NULL, &puszImageOutputbuffer, &nDecsize);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_get_image", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+       CHECK_HANDLE_CLEANUP(puszImageOutputbuffer, "image_util_get_image", image_util_destroy_image(stDecodedImage));
+
+       nRet = image_util_destroy_image(stDecodedImage);
+       PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+
        nRet = image_util_encode_create(IMAGE_UTIL_PNG, &stEncHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
        CHECK_HANDLE(stEncHandle,"image_util_encode_create");
-       
+
        nRet = image_util_encode_set_resolution(stEncHandle, nDecWidth, nDecHeight);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_resolution", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
 
@@ -913,7 +895,7 @@ int ITc_image_util_encode_set_input_buffer_p(void)
 
        nRet = image_util_encode_set_output_buffer(stEncHandle, &puszImageInputBuffer);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_output_buffer", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
-       
+
        nRet = image_util_encode_run(stEncHandle, &nEncsize);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_run", ImageUtilGetError(nRet), image_util_encode_destroy(stEncHandle));
 
@@ -924,10 +906,10 @@ int ITc_image_util_encode_set_input_buffer_p(void)
 //& purpose: To set the input file path from which to decode. 
 //& type: auto 
 /**
-* @testcase                    ITc_image_util_encode_set_output_path_p
+* @testcase                    ITc_image_util_encode_set_output_path_p
 * @since_tizen                 3.0
-* @author              SRID(manu.tiwari)
-* @reviewer            SRID(parshant.v)
+* @author                              SRID(manu.tiwari)
+* @reviewer                    SRID(parshant.v)
 * @type                                auto
 * @description                 To set the output file path from which to encode. 
 * @scenario                            To set the output file path from which to encode. 
@@ -963,13 +945,13 @@ int ITc_image_util_encode_set_output_path_p(void)
 //& purpose: To create a handle to image util decoding. 
 //& type: auto 
 /**
-* @testcase                    ITc_image_util_encode_set_output_buffer_p
+* @testcase                    ITc_image_util_encode_set_output_buffer_p
 * @since_tizen                 3.0
-* @author              SRID(manu.tiwari)
-* @reviewer            SRID(parshant.v)
+* @author                              SRID(manu.tiwari)
+* @reviewer                    SRID(parshant.v)
 * @type                                auto
-* @description                 To set output buffer to image util encoding. 
-* @scenario                            To set output buffer to image util encoding. 
+* @description                 To set output buffer to image util encoding.
+* @scenario                            To set output buffer to image util encoding.
 * @apicovered                  image_util_encode_set_output_buffer
 * @passcase                            When image_util_encode_set_output_buffer is successful.
 * @failcase                            If target API image_util_encode_set_output_buffer fails or any precondition API fails.
@@ -981,75 +963,78 @@ int ITc_image_util_encode_set_output_buffer_p(void)
        START_TEST;
        image_util_encode_h stHandle = NULL;
        unsigned char *puszImageOutputBuffer = NULL;
-       
+
        int nRet = image_util_encode_create(IMAGE_UTIL_PNG, &stHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
        CHECK_HANDLE(stHandle,"image_util_encode_create");
        //target api
        nRet = image_util_encode_set_output_buffer(stHandle, &puszImageOutputBuffer);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_output_buffer", ImageUtilGetError(nRet), image_util_encode_destroy(stHandle));
-       
+
        nRet = image_util_encode_destroy(stHandle);
        PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_destroy", ImageUtilGetError(nRet));
 
        return 0;
 }
-//& purpose: To create a handle to image util decoding and encoding. 
-//& type: auto 
+//& purpose: To create a handle to image util encoding.
+//& type: auto
 /**
-* @testcase                    ITc_image_util_decode_encode_run_p
+* @testcase                    ITc_image_util_encode_run_p
 * @since_tizen                 3.0
-* @author              SRID(manu.tiwari)
-* @reviewer            SRID(parshant.v)
+* @author                              SRID(manu.tiwari)
+* @reviewer                    SRID(parshant.v)
 * @type                                auto
-* @description                 To run image util decoding and encoding. 
-* @scenario                            To run image util decoding and encoding. 
-* @apicovered                  image_util_encode_run,image_util_decode_run
-* @passcase                            When  image_util_encode_run and image_util_decode_run is successful.
-* @failcase                            If target API  image_util_encode_run and image_util_decode_run fails or any precondition API fails.
+* @description                 To run image util encoding.
+* @scenario                            To run image util encoding.
+* @apicovered                  image_util_encode_run
+* @passcase                            When  image_util_encode_run is successful.
+* @failcase                            If target API  image_util_encode_run fails or any precondition API fails.
 * @precondition                        NA
 * @postcondition               NA
 */
-int ITc_image_util_decode_encode_run_p(void)
+int ITc_image_util_encode_run_p(void)
 {
        START_TEST;
        image_util_encode_h stHandle = NULL;
        unsigned char *puszImageOutputBuffer = NULL;
        unsigned long long unSize = 0;
        unsigned long unHeight = 16,unWidth = 9;
-       image_util_decode_h dstHandle = NULL;   
+       image_util_decode_h dstHandle = NULL;
+       image_util_image_h stDecodedImage = NULL;
        unsigned long nWidth = 0, nHeight = 0;
 
        int nRet = image_util_decode_create(&dstHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
        CHECK_HANDLE(dstHandle,"image_util_decode_create");
 
-       nRet = image_util_decode_set_output_buffer(dstHandle, &puszImageOutputBuffer);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
-
        char pPath[PATH_LEN] = {0,};
        if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
        {
-       FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
-       return 1;
+               FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+               return 1;
        }
+
        nRet = image_util_decode_set_input_path(dstHandle, pPath);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
 
-       //target api
-       nRet = image_util_decode_run(dstHandle, &nWidth, &nHeight, &unSize);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
-       CHECK_RETURN_CLEANUP(nWidth, "image_util_decode_run", image_util_decode_destroy(dstHandle));
-       CHECK_RETURN_CLEANUP(nHeight, "image_util_decode_run", image_util_decode_destroy(dstHandle));
-       CHECK_RETURN_CLEANUP(unSize, "image_util_decode_run", image_util_decode_destroy(dstHandle));
+       nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+       CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(dstHandle));
 
        nRet = image_util_decode_destroy(dstHandle);
-       PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
-       
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+
+       nRet = image_util_get_image(stDecodedImage, &nWidth, &nHeight, NULL, &puszImageOutputBuffer, &unSize);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_get_image", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+       CHECK_HANDLE_CLEANUP(puszImageOutputBuffer, "image_util_get_image", image_util_destroy_image(stDecodedImage));
+
+       nRet = image_util_destroy_image(stDecodedImage);
+       PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+
        nRet = image_util_encode_create(IMAGE_UTIL_PNG, &stHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
        CHECK_HANDLE(stHandle,"image_util_encode_create");
-       
+
        nRet = image_util_encode_set_resolution(stHandle, unWidth, unHeight );
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_resolution", ImageUtilGetError(nRet), image_util_encode_destroy(stHandle));
 
@@ -1069,34 +1054,85 @@ int ITc_image_util_decode_encode_run_p(void)
        nRet = image_util_encode_run(stHandle, &unSize);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_run", ImageUtilGetError(nRet), image_util_encode_destroy(stHandle));
        CHECK_RETURN_CLEANUP(unSize, "image_util_encode_run", image_util_encode_destroy(stHandle));
-       
+
        nRet = image_util_encode_destroy(stHandle);
        PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_destroy", ImageUtilGetError(nRet));
 
        free(puszImageOutputBuffer);
        return 0;
 }
+
+//& purpose: To decode the image with the given decode handle.
+//& type: auto
+/**
+* @testcase                    ITc_image_util_encode_run_p
+* @since_tizen                 5.5
+* @author                              SRID(karanam.s)
+* @reviewer                    SRID(manoj.g2)
+* @type                                auto
+* @description                 To decode the image with the given decode handle.
+* @scenario                            To decode the image with the given decode handle.
+* @apicovered                  image_util_decode_run2
+* @passcase                            When  image_util_decode_run2 is successful.
+* @failcase                            If target API  image_util_decode_run2 fails or any precondition API fails.
+* @precondition                        NA
+* @postcondition               NA
+*/
+int ITc_image_util_decode_run2_p(void)
+{
+       START_TEST;
+       unsigned char *puszImageOutputBuffer = NULL;
+       image_util_decode_h dstHandle = NULL;
+       image_util_image_h stDecodedImage = NULL;
+
+       int nRet = image_util_decode_create(&dstHandle);
+       PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
+       CHECK_HANDLE(dstHandle,"image_util_decode_create");
+
+       char pPath[PATH_LEN] = {0,};
+       if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
+       {
+       FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+       return 1;
+       }
+
+       nRet = image_util_decode_set_input_path(dstHandle, pPath);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+
+       //target api
+       nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+       CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(dstHandle));
+
+       nRet = image_util_decode_destroy(dstHandle);
+       PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+       nRet = image_util_destroy_image(stDecodedImage);
+       PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+       return 0;
+}
+
 /**
-* @function                    Image_util_decode_completed_CallBack
+* @function                    Image_util_decode_completed2_CallBack
 * @description         Called when transform is finished just before returning the output.
 * @parameter[IN]       The error code of image-util transfrom
-* @parameter[IN]       Media packet handle     
-* @parameter[IN]       The user data passed from the for each function                 
+* @parameter[IN]       Media packet handle
+* @parameter[IN]       The user data passed from the for each function
 * @return                      NA
 */
-void Image_util_decode_completed_CallBack(int error_code, void *user_data, unsigned long width, unsigned long height, unsigned long long size)
+void Image_util_decode_completed2_CallBack(int error_code, image_util_image_h image, void *user_data)
 {
        g_bImageUtilDecodeCompletedCallback = true;
 #if DEBUG
-       FPRINTF("[Line : %d][%s] Image_util_decode_completed_CallBack is called\\n", __LINE__, API_NAMESPACE);
+       FPRINTF("[Line : %d][%s] Image_util_decode_completed2_CallBack is called\\n", __LINE__, API_NAMESPACE);
 #endif 
 }
+
 /**
 * @function                    Image_util_encode_completed_CallBack
 * @description         Called when transform is finished just before returning the output.
 * @parameter[IN]       The error code of image-util transfrom
-* @parameter[IN]       Media packet handle     
-* @parameter[IN]       The user data passed from the for each function                 
+* @parameter[IN]       Media packet handle
+* @parameter[IN]       The user data passed from the for each function
 * @return                      NA
 */
 void Image_util_encode_completed_CallBack(int error_code, void *user_data, unsigned long long size)
@@ -1104,25 +1140,26 @@ void Image_util_encode_completed_CallBack(int error_code, void *user_data, unsig
        g_bImageUtilEncodeCompletedCallback = true;
 #if DEBUG
        FPRINTF("[Line : %d][%s] Image_util_encode_completed_CallBack is called\\n", __LINE__, API_NAMESPACE);
-#endif 
+#endif
 }
-//& purpose: To create a handle to image util decoding. 
+
+//& purpose: To start encoding of the image and fill the output buffer.
 //& type: auto 
 /**
-* @testcase                    ITc_image_util_decode_encode_run_async_p
+* @testcase                            ITc_image_util_encode_run_async_p
 * @since_tizen                 3.0
-* @author              SRID(manu.tiwari)
-* @reviewer            SRID(parshant.v)
+* @author                              SRID(manu.tiwari)
+* @reviewer                    SRID(parshant.v)
 * @type                                auto
-* @description                 To run image_util_decode_encode_run_async. 
-* @scenario                            To run image_util_decode_encode_run_async.
-* @apicovered                    image_util_encode_run_async,image_util_decode_run_async
-* @passcase                            When   image_util_encode_run_async,image_util_decode_run_async is successful.
-* @failcase                            If target API image_util_encode_run_async or image_util_decode_run_async fails or any precondition API fails.
+* @description                 To create a handle to image util encoding.
+* @scenario                            To create a handle to image util encoding.
+* @apicovered                  image_util_encode_run_async
+* @passcase                            When image_util_encode_run_async is successful.
+* @failcase                            If target API image_util_encode_run_async fails or any precondition API fails.
 * @precondition                        NA
 * @postcondition               NA
 */
-int ITc_image_util_decode_encode_run_async_p(void)
+int ITc_image_util_encode_run_async_p(void)
 {
        START_TEST;
        image_util_encode_h stHandle = NULL;
@@ -1130,6 +1167,8 @@ int ITc_image_util_decode_encode_run_async_p(void)
        unsigned char *puszImageInputBuffer = NULL;
        unsigned long unHeight = 16,unWidth = 9;
        image_util_decode_h dstHandle = NULL;
+       image_util_image_h stDecodedImage = NULL;
+       unsigned long nDecWidth = 0, nDecHeight = 0, nDecsize = 0;
 
        int nRet = image_util_decode_create(&dstHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
@@ -1144,30 +1183,41 @@ int ITc_image_util_decode_encode_run_async_p(void)
        nRet = image_util_decode_set_input_path(dstHandle, pPath);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
 
-       nRet = image_util_decode_set_output_buffer(dstHandle, &puszImageOutputBuffer);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_output_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+       nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+       CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(dstHandle));
+
        g_bImageUtilDecodeCompletedCallback = false;
        //target api
-       nRet = image_util_decode_run_async(dstHandle, (image_util_decode_completed_cb) Image_util_decode_completed_CallBack, NULL);
-       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run_async", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+       nRet = image_util_decode_run_async2(dstHandle, (image_util_decode_completed2_cb) Image_util_decode_completed2_CallBack, NULL);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run_async2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
        wait_for_async();
 
        if ( !g_bImageUtilDecodeCompletedCallback )
        {
-               FPRINTF("[Line : %d][%s] Image_util_decode_completed_CallBack failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
+               FPRINTF("[Line : %d][%s] Image_util_decode_completed2_CallBack failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
                nRet = image_util_decode_destroy(dstHandle);
                PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+               nRet = image_util_destroy_image(stDecodedImage);
+               PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
                return 1;
        }
        else
        {
                #if DEBUG
-               FPRINTF("[Line : %d][%s] image_util_decode_run_async is successful\\n", __LINE__, API_NAMESPACE);
+               FPRINTF("[Line : %d][%s] image_util_decode_run_async2 is successful\\n", __LINE__, API_NAMESPACE);
                #endif
        }
 
        nRet = image_util_decode_destroy(dstHandle);
-       PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+
+       nRet = image_util_get_image(stDecodedImage, &nDecWidth, &nDecHeight, NULL, &puszImageOutputBuffer, &nDecsize);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_get_image", ImageUtilGetError(nRet), image_util_destroy_image(stDecodedImage));
+       CHECK_HANDLE_CLEANUP(puszImageOutputBuffer, "image_util_get_image", image_util_destroy_image(stDecodedImage));
+
+       nRet = image_util_destroy_image(stDecodedImage);
+       PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
 
        nRet = image_util_encode_create(IMAGE_UTIL_PNG, &stHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
@@ -1206,6 +1256,78 @@ int ITc_image_util_decode_encode_run_async_p(void)
        free(puszImageOutputBuffer);
        return 0;
 }
+
+//& purpose: To start decoding of the image with the given decode handle.
+//& type: auto
+/**
+* @testcase                    ITc_image_util_decode_run_async2_p
+* @since_tizen                 5.5
+* @author              SRID(karanam.s)
+* @reviewer            SRID(manoj.g2)
+* @type                                auto
+* @description                 To start decoding of the image with the given decode handle.
+* @scenario                            To start decoding of the image with the given decode handle.
+* @apicovered                    image_util_decode_run_async2
+* @passcase                            When image_util_decode_run_async2 is successful.
+* @failcase                            If target API image_util_decode_run_async2 fails or any precondition API fails.
+* @precondition                        Handle of image util decoding should be created.
+* @postcondition               NA
+*/
+int ITc_image_util_decode_run_async2_p(void)
+{
+       START_TEST;
+       unsigned char *puszImageInputBuffer = NULL;
+       image_util_decode_h dstHandle = NULL;
+       image_util_image_h stDecodedImage = NULL;
+
+       int nRet = image_util_decode_create(&dstHandle);
+       PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
+       CHECK_HANDLE(dstHandle,"image_util_decode_create");
+
+       char pPath[PATH_LEN] = {0,};
+       if ( false == ImageUtilAppendToAppDataPath(SAMPLE_FILE_PATH, pPath) )
+       {
+               FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+               return 1;
+       }
+       nRet = image_util_decode_set_input_path(dstHandle, pPath);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_set_input_buffer", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+
+       nRet = image_util_decode_run2(dstHandle, &stDecodedImage);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+       CHECK_HANDLE_CLEANUP(stDecodedImage,"image_util_decode_run2", image_util_decode_destroy(dstHandle));
+
+       g_bImageUtilDecodeCompletedCallback = false;
+       //target api
+       nRet = image_util_decode_run_async2(dstHandle, (image_util_decode_completed2_cb) Image_util_decode_completed2_CallBack, NULL);
+       PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_run_async2", ImageUtilGetError(nRet), image_util_decode_destroy(dstHandle));
+       wait_for_async();
+
+       if ( !g_bImageUtilDecodeCompletedCallback )
+       {
+               FPRINTF("[Line : %d][%s] Image_util_decode_completed2_CallBack failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE);
+               nRet = image_util_decode_destroy(dstHandle);
+               PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+               nRet = image_util_destroy_image(stDecodedImage);
+               PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+               return 1;
+       }
+       else
+       {
+               #if DEBUG
+               FPRINTF("[Line : %d][%s] image_util_decode_run_async2 is successful\\n", __LINE__, API_NAMESPACE);
+               #endif
+       }
+
+       nRet = image_util_decode_destroy(dstHandle);
+       PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
+
+       nRet = image_util_destroy_image(stDecodedImage);
+       PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_destroy_image", ImageUtilGetError(nRet));
+
+       return 0;
+}
+
 /**
 * @function                    Image_util_supported_colorspace_CallBack
 * @description         Called once for each supported image encode/decode colorspace.
@@ -1312,7 +1434,7 @@ int ITc_image_util_decode_set_colorspace_p(void)
        
        nRet = image_util_decode_destroy(stHandle);
        PRINT_RESULT_NORETURN(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_destroy", ImageUtilGetError(nRet));
-       
+
        return 0;
 }
 //& purpose: Sets the colorspace format for image encoding
@@ -1324,7 +1446,7 @@ int ITc_image_util_decode_set_colorspace_p(void)
 * @reviewer            SRID(parshant.v)
 * @type                                auto
 * @description                 Sets the colorspace format for image encoding
-* @scenario                            
+* @scenario
 * @apicovered                  image_util_encode_set_colorspace
 * @passcase                            When image_util_encode_set_colorspace is successful.
 * @failcase                            If target API image_util_encode_set_colorspace fails or any precondition API fails.
@@ -1356,7 +1478,7 @@ int ITc_image_util_encode_set_colorspace_p(void)
 * @reviewer            SRID(parshant.v)
 * @type                                auto
 * @description                 Sets the downscale value at which JPEG image should be decoded.
-* @scenario                            
+* @scenario
 * @apicovered                  image_util_decode_set_jpeg_downscale
 * @passcase                            When image_util_decode_set_jpeg_downscale is successful.
 * @failcase                            If target API image_util_decode_set_jpeg_downscale fails or any precondition API fails.
@@ -1367,7 +1489,7 @@ int ITc_image_util_decode_set_jpeg_downscale_p(void)
 {
        START_TEST;
        image_util_decode_h stHandle = NULL;
-       
+
        int nRet = image_util_decode_create(&stHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_decode_create", ImageUtilGetError(nRet));
        CHECK_HANDLE(stHandle,"image_util_decode_create");
@@ -1387,7 +1509,7 @@ int ITc_image_util_decode_set_jpeg_downscale_p(void)
 * @reviewer            SRID(parshant.v)
 * @type                                auto
 * @description                 Sets the quality for JPEG image encoding.
-* @scenario                            
+* @scenario
 * @apicovered                  image_util_encode_set_quality
 * @passcase                            When image_util_encode_set_quality is successful.
 * @failcase                            If target API image_util_encode_set_quality fails or any precondition API fails.
@@ -1417,7 +1539,7 @@ int ITc_image_util_encode_set_quality_p(void)
 /**
 * @testcase                    ITc_image_util_encode_set_gif_frame_delay_time_p
 * @since_tizen                 3.0
-* @author              SRID(nibha.sharma)
+* @author                                      SRID(nibha.sharma)
 * @reviewer            SRID(parshant.v)
 * @type                                auto
 * @description                 Sets the time delay between each frame in the encoded animated gif image
@@ -1438,8 +1560,8 @@ int ITc_image_util_encode_set_gif_frame_delay_time_p(void)
     int nRet = image_util_encode_create(IMAGE_UTIL_GIF, &hImageHandle);
        PRINT_RESULT(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_create", ImageUtilGetError(nRet));
        CHECK_HANDLE(hImageHandle,"image_util_encode_create");
-       
-       
+
+
        //Target API
        nRet = image_util_encode_set_gif_frame_delay_time(hImageHandle, nDelayTime);
        PRINT_RESULT_CLEANUP(IMAGE_UTIL_ERROR_NONE, nRet, "image_util_encode_set_gif_frame_delay_time", ImageUtilGetError(nRet), image_util_encode_destroy(hImageHandle));
index b5871c0812945d3fff935991c4d26a4c745759ea..1f6556b0062b0c19f0a484f29c816b50814cc880 100755 (executable)
@@ -34,15 +34,16 @@ extern int ITc_image_util_extract_color_from_memory_p(void);
 extern int ITc_image_util_decode_create_destroy_p(void);
 extern int ITc_image_util_decode_set_input_path_p(void);
 extern int ITc_image_util_decode_set_input_buffer_p(void);
-extern int ITc_image_util_decode_set_output_buffer_p(void);
 extern int ITc_image_util_encode_create_destroy_p(void);
 extern int ITc_image_util_encode_set_resolution_p(void);
 extern int ITc_image_util_encode_set_png_compression_p(void);
 extern int ITc_image_util_encode_set_input_buffer_p(void);
 extern int ITc_image_util_encode_set_output_path_p(void);
 extern int ITc_image_util_encode_set_output_buffer_p(void);
-extern int ITc_image_util_decode_encode_run_p(void);
-extern int ITc_image_util_decode_encode_run_async_p(void);
+extern int ITc_image_util_encode_run_p(void);
+extern int ITc_image_util_decode_run2_p(void);
+extern int ITc_image_util_encode_run_async_p(void);
+extern int ITc_image_util_decode_run_async2_p(void);
 extern int ITc_image_util_foreach_supported_colorspace_p(void);
 extern int ITc_image_util_decode_set_colorspace_p(void);
 extern int ITc_image_util_encode_set_colorspace_p(void);
@@ -66,15 +67,16 @@ testcase tc_array[] = {
        {"ITc_image_util_decode_create_destroy_p",ITc_image_util_decode_create_destroy_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_decode_set_input_path_p",ITc_image_util_decode_set_input_path_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_decode_set_input_buffer_p",ITc_image_util_decode_set_input_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
-       {"ITc_image_util_decode_set_output_buffer_p",ITc_image_util_decode_set_output_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_create_destroy_p",ITc_image_util_encode_create_destroy_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_resolution_p",ITc_image_util_encode_set_resolution_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_png_compression_p",ITc_image_util_encode_set_png_compression_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_input_buffer_p",ITc_image_util_encode_set_input_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_output_path_p",ITc_image_util_encode_set_output_path_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_output_buffer_p",ITc_image_util_encode_set_output_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
-       {"ITc_image_util_decode_encode_run_p",ITc_image_util_decode_encode_run_p,ITs_image_util_startup,ITs_image_util_cleanup},
-       {"ITc_image_util_decode_encode_run_async_p",ITc_image_util_decode_encode_run_async_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_encode_run_p",ITc_image_util_encode_run_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_decode_run2_p",ITc_image_util_decode_run2_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_encode_run_async_p",ITc_image_util_encode_run_async_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_decode_run_async2_p",ITc_image_util_decode_run_async2_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_foreach_supported_colorspace_p",ITc_image_util_foreach_supported_colorspace_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_decode_set_colorspace_p",ITc_image_util_decode_set_colorspace_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_colorspace_p",ITc_image_util_encode_set_colorspace_p,ITs_image_util_startup,ITs_image_util_cleanup},
index 0acb734deceda5d22f3675348cc3027d72659708..3cb1374b7c3b8636ee8b4f6e4ed69073548e7940 100755 (executable)
@@ -34,15 +34,16 @@ extern int ITc_image_util_extract_color_from_memory_p(void);
 extern int ITc_image_util_decode_create_destroy_p(void);
 extern int ITc_image_util_decode_set_input_path_p(void);
 extern int ITc_image_util_decode_set_input_buffer_p(void);
-extern int ITc_image_util_decode_set_output_buffer_p(void);
 extern int ITc_image_util_encode_create_destroy_p(void);
 extern int ITc_image_util_encode_set_resolution_p(void);
 extern int ITc_image_util_encode_set_png_compression_p(void);
 extern int ITc_image_util_encode_set_input_buffer_p(void);
 extern int ITc_image_util_encode_set_output_path_p(void);
 extern int ITc_image_util_encode_set_output_buffer_p(void);
-extern int ITc_image_util_decode_encode_run_p(void);
-extern int ITc_image_util_decode_encode_run_async_p(void);
+extern int ITc_image_util_encode_run_p(void);
+extern int ITc_image_util_decode_run2_p(void);
+extern int ITc_image_util_encode_run_async_p(void);
+extern int ITc_image_util_decode_run_async2_p(void);
 extern int ITc_image_util_foreach_supported_colorspace_p(void);
 extern int ITc_image_util_decode_set_colorspace_p(void);
 extern int ITc_image_util_encode_set_colorspace_p(void);
@@ -66,15 +67,16 @@ testcase tc_array[] = {
        {"ITc_image_util_decode_create_destroy_p",ITc_image_util_decode_create_destroy_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_decode_set_input_path_p",ITc_image_util_decode_set_input_path_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_decode_set_input_buffer_p",ITc_image_util_decode_set_input_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
-       {"ITc_image_util_decode_set_output_buffer_p",ITc_image_util_decode_set_output_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_create_destroy_p",ITc_image_util_encode_create_destroy_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_resolution_p",ITc_image_util_encode_set_resolution_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_png_compression_p",ITc_image_util_encode_set_png_compression_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_input_buffer_p",ITc_image_util_encode_set_input_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_output_path_p",ITc_image_util_encode_set_output_path_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_output_buffer_p",ITc_image_util_encode_set_output_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
-       {"ITc_image_util_decode_encode_run_p",ITc_image_util_decode_encode_run_p,ITs_image_util_startup,ITs_image_util_cleanup},
-       {"ITc_image_util_decode_encode_run_async_p",ITc_image_util_decode_encode_run_async_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_encode_run_p",ITc_image_util_encode_run_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_decode_run2_p",ITc_image_util_decode_run2_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_encode_run_async_p",ITc_image_util_encode_run_async_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_decode_run_async2_p",ITc_image_util_decode_run_async2_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_foreach_supported_colorspace_p",ITc_image_util_foreach_supported_colorspace_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_decode_set_colorspace_p",ITc_image_util_decode_set_colorspace_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_colorspace_p",ITc_image_util_encode_set_colorspace_p,ITs_image_util_startup,ITs_image_util_cleanup},
index 9bc3ef14adb507ae68f83005a3e82d85e524c2a9..e91b7ef3e3fc97dc5e5c15fef959106cfe71429f 100755 (executable)
@@ -34,15 +34,16 @@ extern int ITc_image_util_extract_color_from_memory_p(void);
 extern int ITc_image_util_decode_create_destroy_p(void);
 extern int ITc_image_util_decode_set_input_path_p(void);
 extern int ITc_image_util_decode_set_input_buffer_p(void);
-extern int ITc_image_util_decode_set_output_buffer_p(void);
 extern int ITc_image_util_encode_create_destroy_p(void);
 extern int ITc_image_util_encode_set_resolution_p(void);
 extern int ITc_image_util_encode_set_png_compression_p(void);
 extern int ITc_image_util_encode_set_input_buffer_p(void);
 extern int ITc_image_util_encode_set_output_path_p(void);
 extern int ITc_image_util_encode_set_output_buffer_p(void);
-extern int ITc_image_util_decode_encode_run_p(void);
-extern int ITc_image_util_decode_encode_run_async_p(void);
+extern int ITc_image_util_encode_run_p(void);
+extern int ITc_image_util_decode_run2_p(void);
+extern int ITc_image_util_encode_run_async_p(void);
+extern int ITc_image_util_decode_run_async2_p(void);
 extern int ITc_image_util_foreach_supported_colorspace_p(void);
 extern int ITc_image_util_decode_set_colorspace_p(void);
 extern int ITc_image_util_encode_set_colorspace_p(void);
@@ -65,15 +66,16 @@ testcase tc_array[] = {
        {"ITc_image_util_decode_create_destroy_p",ITc_image_util_decode_create_destroy_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_decode_set_input_path_p",ITc_image_util_decode_set_input_path_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_decode_set_input_buffer_p",ITc_image_util_decode_set_input_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
-       {"ITc_image_util_decode_set_output_buffer_p",ITc_image_util_decode_set_output_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_create_destroy_p",ITc_image_util_encode_create_destroy_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_resolution_p",ITc_image_util_encode_set_resolution_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_png_compression_p",ITc_image_util_encode_set_png_compression_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_input_buffer_p",ITc_image_util_encode_set_input_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_output_path_p",ITc_image_util_encode_set_output_path_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_output_buffer_p",ITc_image_util_encode_set_output_buffer_p,ITs_image_util_startup,ITs_image_util_cleanup},
-       {"ITc_image_util_decode_encode_run_p",ITc_image_util_decode_encode_run_p,ITs_image_util_startup,ITs_image_util_cleanup},
-       {"ITc_image_util_decode_encode_run_async_p",ITc_image_util_decode_encode_run_async_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_encode_run_p",ITc_image_util_encode_run_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_decode_run2_p",ITc_image_util_decode_run2_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_encode_run_async_p",ITc_image_util_encode_run_async_p,ITs_image_util_startup,ITs_image_util_cleanup},
+       {"ITc_image_util_decode_run_async2_p",ITc_image_util_decode_run_async2_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_foreach_supported_colorspace_p",ITc_image_util_foreach_supported_colorspace_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_decode_set_colorspace_p",ITc_image_util_decode_set_colorspace_p,ITs_image_util_startup,ITs_image_util_cleanup},
        {"ITc_image_util_encode_set_colorspace_p",ITc_image_util_encode_set_colorspace_p,ITs_image_util_startup,ITs_image_util_cleanup},