Remove unused code 05/177705/2
authorJiyong Min <jiyong.min@samsung.com>
Mon, 30 Apr 2018 05:16:17 +0000 (14:16 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Thu, 3 May 2018 07:23:32 +0000 (16:23 +0900)
Change-Id: Ib85a27107c181b586b1e820d71dbe28f1ae2dd78

gif/include/mm_util_gif.h
gif/mm_util_gif.c

index 5d51625fc9e9f330db9da03776747db7557d3a7b..545f51e49b4e37d54d9842f6441453ea7f786d2b 100755 (executable)
@@ -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).
  *
index 359544b569e0c49f6a151a46731a9947288fbaa8..0dc85c9be72f287c4ef0b74eaaa301ed0bbbb926 100755 (executable)
@@ -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;