From: Jiyong Min Date: Mon, 30 Apr 2018 05:16:17 +0000 (+0900) Subject: Remove unused code X-Git-Tag: submit/tizen/20180508.063724~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f079a54cd4327b06ca708391a4766bb8667e9b00;p=platform%2Fcore%2Fmultimedia%2Flibmm-utility.git Remove unused code Change-Id: Ib85a27107c181b586b1e820d71dbe28f1ae2dd78 --- diff --git a/gif/include/mm_util_gif.h b/gif/include/mm_util_gif.h index 5d51625..545f51e 100755 --- a/gif/include/mm_util_gif.h +++ b/gif/include/mm_util_gif.h @@ -102,11 +102,6 @@ typedef struct { unsigned long width; /**< Width */ unsigned long height; /**< Height */ size_t size; /**< Size */ - unsigned int image_count; /**< ImageCount */ - gboolean screen_desc_updated; /**< Check if screen description is updated */ - unsigned int current_count; /**< ImageCount */ - write_data write_data_ptr; /**< Encoded output data attached to callback */ - void *GifFile; /**< GifFile opened */ void *data; /**< Frames */ } mm_util_gif_data; @@ -136,57 +131,6 @@ int mm_util_decode_from_gif_file(mm_util_gif_data * decoded, const char *filenam */ int mm_util_decode_from_gif_memory(mm_util_gif_data * decoded, void *memory); -/** - * This function creates gif file for output file - * - * @param encoded [in ] pointer of mm_util_gif_data. - * @param filename [out] output file name on to which the encoded stream will be written. - * @return This function returns zero on success, or negative value with error code. - * @remark image_count should be set to a valid value depending on number of images - * to be encoded in the gif file. - * @see mm_util_gif_data - * @since R1, 1.0 - */ -int mm_util_encode_open_gif_file(mm_util_gif_data *encoded, const char *filename); - -/** - * This function creates gif file for output memory - * - * @param encoded [in ] pointer of mm_util_gif_data. - * @param filename [out] output file memory on to which the encoded stream will be written. - * @return This function returns zero on success, or negative value with error code. - * @remark image_count should be set to a valid value depending on number of images - * to be encoded in the gif file. - * @see mm_util_gif_data - * @since R1, 1.0 - */ -int mm_util_encode_open_gif_memory(mm_util_gif_data *encoded, void **data); - -/** - * This function encodes raw data to gif file/memory - * - * @param encoded [in ] pointer of mm_util_gif_data. - * @param filename [out] output file name on to which the encoded stream will be written. - * @return This function returns zero on success, or negative value with error code. - * @remark image_count should be set to a valid value depending on number of images - * to be encoded in the gif file. - * @see mm_util_gif_data - * @since R1, 1.0 - */ -int mm_util_encode_gif(mm_util_gif_data *encoded); - -/** - * This function closes and deallocates all the memory allocated with giffile. - * - * @param encoded [in ] pointer of mm_util_gif_data. - * @return This function returns zero on success, or negative value with error code. - * @remark image_count should be set to a valid value depending on number of images - * to be encoded in the gif file. - * @see mm_util_gif_data - * @since R1, 1.0 - */ -int mm_util_encode_close_gif(mm_util_gif_data *encoded); - /** * This function creates the handle of the single image(frame). * diff --git a/gif/mm_util_gif.c b/gif/mm_util_gif.c index 359544b..0dc85c9 100755 --- a/gif/mm_util_gif.c +++ b/gif/mm_util_gif.c @@ -283,53 +283,6 @@ static int __write_function(GifFileType *gft, const GifByteType *data, int size) return size; } -int mm_util_encode_open_gif_file(mm_util_gif_data *encoded, const char *filename) -{ - mm_util_debug("mm_util_encode_open_gif_file"); - if (filename) { - if ((encoded->GifFile = EGifOpenFileName(filename, 0, NULL)) == NULL) { - mm_util_error("could not open file"); - return MM_UTIL_ERROR_INVALID_OPERATION; - } - } else - return MM_UTIL_ERROR_INVALID_PARAMETER; - - return MM_UTIL_ERROR_NONE; -} - -int mm_util_encode_open_gif_memory(mm_util_gif_data *encoded, void **data) -{ - mm_util_debug("mm_util_encode_open_gif_memory"); - if (data) { - encoded->write_data_ptr.mem = data; - encoded->write_data_ptr.size = 0; - - if ((encoded->GifFile = EGifOpen(&(encoded->write_data_ptr), __write_function, NULL)) == NULL) { - mm_util_error("could not open File"); - return MM_UTIL_ERROR_INVALID_OPERATION; - } - } else - return MM_UTIL_ERROR_INVALID_PARAMETER; - - return MM_UTIL_ERROR_NONE; -} - -int mm_util_encode_close_gif(mm_util_gif_data *encoded) -{ - mm_util_debug("mm_util_encode_close_gif"); - if (encoded->GifFile == NULL) { - mm_util_error("Invalid parameter"); - return MM_UTIL_ERROR_INVALID_PARAMETER; - } - if (EGifCloseFile(encoded->GifFile, NULL) == GIF_ERROR) { - mm_util_error("could not close file"); - return MM_UTIL_ERROR_INVALID_OPERATION; - } - encoded->GifFile = NULL; - - return MM_UTIL_ERROR_NONE; -} - static const int DEFAULT_COLORMAP_SIZE = (1 << 8); int _gif_image_alloc_glob_ext_block(GifFileType *gif_file, int function, int byte_count, ExtensionBlock **ext_block); @@ -584,13 +537,12 @@ int _gif_image_write_image_data(gif_file_s *gif_file, gif_image_s *gif_image) mm_util_retvm_if(gif_image->image_data == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter"); /* encode OutputBuffer to GifFile */ - unsigned char *ptr = gif_image->intermediate_image; mm_util_retvm_if(gif_image->intermediate_image == NULL, MM_UTIL_ERROR_INVALID_OPERATION, "Intermediate_image is null"); mm_util_debug("put pixel count: %lu", (gif_image->intermediate_image_size / sizeof(GifPixelType))); for (idx = 0; idx < (gif_image->intermediate_image_size / sizeof(GifPixelType)); idx++) { - GifPixelType pixel = (GifPixelType)ptr[idx]; + GifPixelType pixel = (GifPixelType)gif_image->intermediate_image[idx]; if (EGifPutPixel(gif_file->GifFile, pixel) == GIF_ERROR) { mm_util_error("could not put pixel"); return MM_UTIL_ERROR_INVALID_OPERATION;