From: Jiyong Min Date: Mon, 11 Sep 2017 02:12:32 +0000 (+0900) Subject: Modify 'mm_util_gif_image_set_image' due to unused parameter was removed & X-Git-Tag: submit/tizen/20170911.075345^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F148798%2F5;p=platform%2Fcore%2Fapi%2Fimage-util.git Modify 'mm_util_gif_image_set_image' due to unused parameter was removed & the description of releasing the output buffer has been added. Change-Id: I0432c784d5d2c4de213be7849582d77bdc1ded57 Signed-off-by: Jiyong Min --- diff --git a/decode-test/image_util_decode_encode_testsuite.c b/decode-test/image_util_decode_encode_testsuite.c index e5bee2c..07ed864 100755 --- a/decode-test/image_util_decode_encode_testsuite.c +++ b/decode-test/image_util_decode_encode_testsuite.c @@ -634,7 +634,7 @@ gboolean test_encode_gif_frame_by_frame() if (ret != IMAGE_UTIL_ERROR_NONE) continue; - ret = image_util_frame_set_frame(frame, g_test_decode[i].decoded, g_test_decode[i].decode_size); + ret = image_util_frame_set_frame(frame, g_test_decode[i].decoded); if (ret != IMAGE_UTIL_ERROR_NONE) { image_util_frame_destroy(frame); continue; diff --git a/include/image_util.h b/include/image_util.h index 7ede6ff..57744fd 100755 --- a/include/image_util.h +++ b/include/image_util.h @@ -779,6 +779,7 @@ int image_util_decode_set_input_buffer(image_util_decode_h handle, const unsigne * @remarks Either image_util_decode_set_input_path() or image_util_decode_set_input_buffer() should be set.\n * By default the decoded output buffer colorspace will be IMAGE_UTIL_COLORSPACE_RGBA8888. * Use image_util_decode_set_colorspace to change the colorspace. +* @a dst_buffer should be released after @a image_util_decode_run() or @a image_util_decode_run_async(). * * @param[in] handle The handle to image util decoding * @param[in] dst_buffer The decoded output buffer @@ -1231,6 +1232,7 @@ int image_util_encode_set_output_path(image_util_encode_h handle, const char *pa * Before 4.0, output buffer setting is not supported for bmp. IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT will be returned for bmp.\n * Since 4.0, output buffer setting has been supported for bmp. Applications can set the output buffer to write encoded bmp.\n * In case of gif encoding, the output buffer will be completely available only after image_util_encode_destroy(). +* @a dst_buffer should be released after @a image_util_encode_run() or @a image_util_encode_run_async(). * * @param[in] handle The handle to image util encoding * @param[in] dst_buffer The output image buffer diff --git a/include/image_util_internal.h b/include/image_util_internal.h index bf09186..eae8bb5 100755 --- a/include/image_util_internal.h +++ b/include/image_util_internal.h @@ -277,15 +277,13 @@ int image_util_frame_set_gif_disposal_mode(image_util_frame_h frame_h, const int /** * @internal -* @brief Sets the delay of the gif. +* @brief Sets the frame buffer. * @since_tizen 4.0 * -* @remarks The unit of the delay time is 10ms. If the delay time set to 50ms, the value of @delay_time should be 5. -* If the delay time set to 1 sec, the value of @delay_time should be 100. +* @remarks You must release the @a buffer using free() after @image_util_frame_destroy. * * @param[in] frame_h The frame handle to encode * @param[in] buffer The frame buffer to encode -* @param[in] buffer The size of the frame buffer to encode * * @return @c 0 on success, * otherwise a negative error value @@ -297,7 +295,7 @@ int image_util_frame_set_gif_disposal_mode(image_util_frame_h frame_h, const int * @pre image_util_encode_frame_create() * @see image_util_encode_frame_create() */ -int image_util_frame_set_frame(image_util_frame_h frame_h, unsigned char *buffer, const unsigned long size); +int image_util_frame_set_frame(image_util_frame_h frame_h, unsigned char *buffer); /** * @internal diff --git a/packaging/capi-media-image-util.spec b/packaging/capi-media-image-util.spec index a95a38c..dcbb97b 100755 --- a/packaging/capi-media-image-util.spec +++ b/packaging/capi-media-image-util.spec @@ -1,6 +1,6 @@ Name: capi-media-image-util Summary: A Image Utility library in Tizen Native API -Version: 0.1.24 +Version: 0.1.25 Release: 2 Group: Multimedia/API License: Apache-2.0 diff --git a/src/image_util.c b/src/image_util.c index 7ea122b..a86a3c3 100755 --- a/src/image_util.c +++ b/src/image_util.c @@ -1838,7 +1838,7 @@ int image_util_encode_set_input_buffer(image_util_encode_h handle, const unsigne image_util_error("_image_util_encode_get_gif_frame is failed %d", err); return _convert_image_util_error_code(__func__, err); } - err = mm_util_gif_image_set_image(frame, src_buffer, (unsigned long)sizeof(src_buffer)); + err = mm_util_gif_image_set_image(frame, src_buffer); if (err != MM_UTIL_ERROR_NONE) { image_util_error("mm_util_gif_image_set_delay_time is failed %d", err); return _convert_image_util_error_code(__func__, err); diff --git a/src/image_util_internal.c b/src/image_util_internal.c index f616931..e8502ad 100755 --- a/src/image_util_internal.c +++ b/src/image_util_internal.c @@ -94,17 +94,16 @@ int image_util_frame_set_gif_delay(image_util_frame_h frame_h, const int delay_t return IMAGE_UTIL_ERROR_NONE; } -int image_util_frame_set_frame(image_util_frame_h frame_h, unsigned char *buffer, const unsigned long size) +int image_util_frame_set_frame(image_util_frame_h frame_h, unsigned char *buffer) { int ret = IMAGE_UTIL_ERROR_NONE; image_util_retvm_if((frame_h == NULL), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid Handle"); image_util_retvm_if((buffer == NULL), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid Buffer"); - image_util_retvm_if((size == 0), MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid Buffer Size"); frame_s *frame = (frame_s *)frame_h; - ret = mm_util_gif_image_set_image(frame->frame_h, buffer, size); + ret = mm_util_gif_image_set_image(frame->frame_h, buffer); if (ret != IMAGE_UTIL_ERROR_NONE) { image_util_error("mm_util_gif_image_set_image is failed(%d).", ret); return MM_UTIL_ERROR_INVALID_OPERATION;