From aee150adb2f1ea46f8ab3e1ee32896338bc811eb Mon Sep 17 00:00:00 2001 From: Haejeong Kim Date: Thu, 30 Mar 2017 09:59:15 +0900 Subject: Just Apply Tizen Coding Rule Change-Id: I6951f5a5bf334838c9d17dba0edb03be10a30c96 --- src/include/codec/AGifFrameInfo.h | 17 ++--- src/include/codec/IfegDecodeAGIF.h | 2 +- src/include/codec/img-codec-common.h | 143 ++++++++++++++++------------------- src/include/codec/img-codec-config.h | 2 +- src/include/codec/img-codec-osal.h | 50 ++++++------ src/include/codec/img-codec-parser.h | 29 ++++--- src/include/codec/img-codec.h | 2 +- src/include/media-thumb-internal.h | 18 ++--- src/include/util/media-thumb-debug.h | 12 +-- src/include/util/media-thumb-util.h | 13 ++-- 10 files changed, 136 insertions(+), 152 deletions(-) mode change 100644 => 100755 src/include/codec/IfegDecodeAGIF.h mode change 100644 => 100755 src/include/codec/img-codec-config.h mode change 100644 => 100755 src/include/codec/img-codec-osal.h (limited to 'src/include') diff --git a/src/include/codec/AGifFrameInfo.h b/src/include/codec/AGifFrameInfo.h index e9c69b8..e5ab7b1 100755 --- a/src/include/codec/AGifFrameInfo.h +++ b/src/include/codec/AGifFrameInfo.h @@ -22,8 +22,7 @@ #ifndef _AGIFFRAMEINFO_H_ #define _AGIFFRAMEINFO_H_ -typedef struct tagFrameInfo -{ +typedef struct tagFrameInfo { int height; int width; unsigned int backcolor; @@ -32,13 +31,13 @@ typedef struct tagFrameInfo int inputSize; unsigned char *pEncodedData; - void *pOutBits; + void *pOutBits; - unsigned char *pPrevImg; - unsigned int *pGlobal_table; - unsigned short *pPrefix; - unsigned char *pDstack; - unsigned char *pSuffix; + unsigned char *pPrevImg; + unsigned int *pGlobal_table; + unsigned short *pPrefix; + unsigned char *pDstack; + unsigned char *pSuffix; int flag; int size; @@ -60,6 +59,6 @@ typedef struct tagFrameInfo unsigned char bOneFrame; #endif -}AGifFrameInfo; +} AGifFrameInfo; #endif // _AGIFFRAMEINFO_H_ diff --git a/src/include/codec/IfegDecodeAGIF.h b/src/include/codec/IfegDecodeAGIF.h old mode 100644 new mode 100755 index 9510c64..3504ff6 --- a/src/include/codec/IfegDecodeAGIF.h +++ b/src/include/codec/IfegDecodeAGIF.h @@ -45,7 +45,7 @@ extern "C" { #endif -int FastImgGetNextFrameAGIF (AGifFrameInfo* pFrameData, BOOL bCenterAlign); +int FastImgGetNextFrameAGIF(AGifFrameInfo* pFrameData, BOOL bCenterAlign); AGifFrameInfo* FastImgCreateAGIFFrameData(unsigned int width, unsigned int height, unsigned char *pEncodedData, unsigned int file_size, unsigned int ui_backcolor, BOOL bLoop); void FastImgDestroyAGIFFrameData(AGifFrameInfo* pFrameData); diff --git a/src/include/codec/img-codec-common.h b/src/include/codec/img-codec-common.h index 91887f5..91c01b4 100755 --- a/src/include/codec/img-codec-common.h +++ b/src/include/codec/img-codec-common.h @@ -41,12 +41,12 @@ extern "C" { #define ImgDebug(type, fmt, arg...) \ do { \ fprintf(stderr, "[Media-SVC]"fmt, ##arg); \ - }while(0) + } while (0) #define SysRequireEx(expr, retValue) \ if (!(expr)) { \ - fprintf(stderr, "[Media-SVC][%s] INVALID_PARAM (%d lines in %s)\n",__FUNCTION__, __LINE__, __FILE__); \ + fprintf(stderr, "[Media-SVC][%s] INVALID_PARAM (%d lines in %s)\n", __FUNCTION__, __LINE__, __FILE__); \ return (retValue); \ } #define SysDebug(X) ImgDebug X @@ -61,45 +61,40 @@ extern "C" { ////////////////////////////////////////////////////////////// -typedef enum -{ - IMG_INFO_DECODING_FAIL = 0, - IMG_INFO_DECODING_SUCCESS = 1, - IMG_INFO_AGIF_LAST_FRAME = 2, - IMG_INFO_TOO_BIG_FILE_SIZE = -1, - IMG_INFO_TOO_LARGE_SCALE = -2, - IMG_INFO_TOO_BIG_PROGRESSIVE= -3, - IMG_INFO_UNKNOWN_FORMAT = -4, +typedef enum { + IMG_INFO_DECODING_FAIL = 0, + IMG_INFO_DECODING_SUCCESS = 1, + IMG_INFO_AGIF_LAST_FRAME = 2, + IMG_INFO_TOO_BIG_FILE_SIZE = -1, + IMG_INFO_TOO_LARGE_SCALE = -2, + IMG_INFO_TOO_BIG_PROGRESSIVE = -3, + IMG_INFO_UNKNOWN_FORMAT = -4, IMG_INFO_FILE_ERR = -5, IMG_INFO_MEM_ALLOC_FAIL = -6 -}ImgFastCodecInfo; +} ImgFastCodecInfo; -typedef enum inputFlag -{ +typedef enum inputFlag { IMG_RGB_888_OUTPUT = 0x0001, IMG_RGB_OUTPUT = 0x0002, IMG_YUV_OUTPUT = 0x0005 -}ImgInputFlag; +} ImgInputFlag; -typedef enum resize -{ +typedef enum resize { /* During resizing aspect ratio will be maintained */ IMG_RESIZE_MAINTAIN_ASPECT_RATIO = 0x0001, IMG_RESIZE = 0x0002 } ImgResizeInput; -typedef struct tagImgImageInfo -{ +typedef struct tagImgImageInfo { unsigned int width; unsigned int height; - unsigned int numberOfFrame; + unsigned int numberOfFrame; unsigned int delay; //deprecated. unsigned int bOrientation; //deprecated. -}ImgImageInfo; +} ImgImageInfo; -typedef struct tagImgBitmap -{ +typedef struct tagImgBitmap { int width; int height; UCHAR bitsPerPixel; /* For TIF it should be 8 or 4 or 1 always @@ -110,14 +105,14 @@ typedef struct tagImgBitmap */ void *pBits; - BOOL bChromaKeyFlag; /* Flag to indicate chroma key + BOOL bChromaKeyFlag; /* Flag to indicate chroma key * Default: FALSE */ ULONG chromaKey; /* This is the colour which needs to be (or is) transparent. * This colour will be in 5, 5, 5 RGB format as below. * First 16 MS Bits 0, R (5), G (5), 0 (1), B (5) */ - UCHAR disposal; /* Disposal action to take during + UCHAR disposal; /* Disposal action to take during * display of current flag * Default: 0 */ @@ -128,19 +123,18 @@ typedef struct tagImgBitmap * Default: FALSE */ - BOOL interlace; /* Interlace indicator flag - * Default: FALSE - */ - BYTE *pLocalColorMap;/* Local color palette pointer - * Default: NULL - */ - /* For TIF :Should be given if PALETTE color type. - */ - USHORT localColorMapSize; - /* Local color palette size */ - /* In TIF: Should be given if PALETTE color type. - */ - void *pAlphaChannel; /* An alpha channel, representing transparency + BOOL interlace; /* Interlace indicator flag + * Default: FALSE + */ + BYTE *pLocalColorMap; /* Local color palette pointer + * Default: NULL + */ + /* For TIF :Should be given if PALETTE color type. + */ + USHORT localColorMapSize; /* Local color palette size */ + /* In TIF: Should be given if PALETTE color type. + */ + void *pAlphaChannel; /* An alpha channel, representing transparency * information on a per-pixel basis */ BYTE colorType ; /* Indicates the color type of image. It can be @@ -155,12 +149,12 @@ typedef struct tagImgBitmap BYTE filter ; /* Type of filter to apply. Could be one of NONE, * SUB, UP, AVERAGE or PAETH */ - BYTE compressionMethod ; /* Type of compression in zLib to apply. Could be - * one of NONE, FIXED or DYANMIC - */ - /* For TIF : IT could be TIF_COMP_NOCOMP , - * TIF_COMP_PACKBIT or TIF_COMP_HUFFMAN (only for bilevel) - */ + BYTE compressionMethod; /* Type of compression in zLib to apply. Could be + * one of NONE, FIXED or DYANMIC + */ + /* For TIF : IT could be TIF_COMP_NOCOMP , + * TIF_COMP_PACKBIT or TIF_COMP_HUFFMAN (only for bilevel) + */ UCHAR colorConversion; /* Indicates whether color conversion has to * be done or not @@ -181,61 +175,56 @@ typedef struct tagImgBitmap */ } ImgBitmap; -typedef struct tagImgCodecColor -{ +typedef struct tagImgCodecColor { UINT16 red; UINT16 green; UINT16 blue; } ImgCodecColor; +typedef struct { + int width, height, bpp; -typedef struct -{ - int width, height, bpp; - - BOOL tRNSFlag; - ImgCodecColor tRNSColor; + BOOL tRNSFlag; + ImgCodecColor tRNSColor; - BOOL bKGDFlag; - ImgCodecColor bKGDColor; + BOOL bKGDFlag; + ImgCodecColor bKGDColor; - BOOL AlphaChannelFlag; - unsigned short *pAlphaChannel; + BOOL AlphaChannelFlag; + unsigned short *pAlphaChannel; } ImgTrnsInfo; typedef struct tagImgBitmapElem ImgBitmapElem; -struct tagImgBitmapElem -{ +struct tagImgBitmapElem { int x; int y; ImgBitmap *pbmBitmap; ImgBitmapElem *pNext; }; -typedef struct gifDecode ImgGIFFrame ; +typedef struct gifDecode ImgGIFFrame; -typedef struct tagImgImage -{ - int dataSize; /* Holds the total number of bytes required - * to hold the image - */ - int width; - int height; +typedef struct tagImgImage { + int dataSize; /* Holds the total number of bytes required + * to hold the image + */ + int width; + int height; - USHORT flag; /* This contains flags as defined - * in ImgCodecFlagType - */ - ULONG backGroundColor; /* The backgroundColor specifies a default background - * color to present the image against. - * Note that viewers are not bound to honor this color. - * A viewer can choose to use a different background. - */ - BYTE *pGlobalColorMap; /* Global color palette pointer + USHORT flag; /* This contains flags as defined + * in ImgCodecFlagType + */ + ULONG backGroundColor; /* The backgroundColor specifies a default background + * color to present the image against. + * Note that viewers are not bound to honor this color. + * A viewer can choose to use a different background. + */ + BYTE *pGlobalColorMap; /* Global color palette pointer * Default: NULL */ - USHORT globalColorMapSize; /* Local color palette size */ - ULONG gamma; /* The value is encoded as a 4-byte unsigned integer, + USHORT globalColorMapSize; /* Local color palette size */ + ULONG gamma; /* The value is encoded as a 4-byte unsigned integer, * representing gamma times 100000. For example, a * gamma of 0.45 would be stored as the integer 45000. */ diff --git a/src/include/codec/img-codec-config.h b/src/include/codec/img-codec-config.h old mode 100644 new mode 100755 index a918e16..7b49c56 --- a/src/include/codec/img-codec-config.h +++ b/src/include/codec/img-codec-config.h @@ -23,4 +23,4 @@ #define _IMGCODEC_CONFIG_H_ #define INTERNAL_IMGCODEC -#endif // _IMGCODEC_CONFIG_H_ +#endif // _IMGCODEC_CONFIG_H_ diff --git a/src/include/codec/img-codec-osal.h b/src/include/codec/img-codec-osal.h old mode 100644 new mode 100755 index 67b6921..68bcc5d --- a/src/include/codec/img-codec-osal.h +++ b/src/include/codec/img-codec-osal.h @@ -46,17 +46,17 @@ extern "C" { #ifndef USHORT -#define USHORT unsigned short +#define USHORT unsigned short #endif #ifndef UINT16 -#define UINT16 unsigned short +#define UINT16 unsigned short #endif #ifndef UINT32 -#define UINT32 unsigned short +#define UINT32 unsigned short #endif #ifndef UINT @@ -66,12 +66,12 @@ extern "C" { #ifndef INT32 -#define INT32 unsigned int +#define INT32 unsigned int #endif #ifndef ULONG -#define ULONG unsigned long +#define ULONG unsigned long #endif #ifndef TRUE @@ -79,7 +79,7 @@ extern "C" { #endif #ifndef FALSE -#define FALSE false +#define FALSE false #endif #ifndef INVALID_HOBJ @@ -90,14 +90,13 @@ extern "C" { typedef void* HFile; -#define AcMemalloc IfegMemAlloc -#define AcMemfree IfegMemFree -#define AcMemcmp IfegMemcmp -#define AcMemset IfegMemset -#define AcMemcpy IfegMemcpy +#define AcMemalloc IfegMemAlloc +#define AcMemfree IfegMemFree +#define AcMemcmp IfegMemcmp +#define AcMemset IfegMemset +#define AcMemcpy IfegMemcpy -typedef struct -{ +typedef struct { ULONG fileSize; // File size ULONG* startAddr; // Only used at LFS ULONG attribute; // file attribute like directory or file, hidden, readonly, system, ... @@ -105,20 +104,20 @@ typedef struct ULONG allocatedSize; // real allocated size of file & directory in sub System } FmFileAttribute; -void * IfegMemAlloc(unsigned int size); -void IfegMemFree(void* pMem); -void * IfegMemcpy( void *dest, const void *src, unsigned int count ); -void * IfegMemset( void *dest, int c, unsigned int count ); -int IfegMemcmp(const void* pMem1, const void* pMem2, size_t length); +void *IfegMemAlloc(unsigned int size); +void IfegMemFree(void* pMem); +void *IfegMemcpy(void *dest, const void *src, unsigned int count); +void *IfegMemset(void *dest, int c, unsigned int count); +int IfegMemcmp(const void* pMem1, const void* pMem2, size_t length); -ULONG IfegGetAvailableMemSize(void); +ULONG IfegGetAvailableMemSize(void); -HFile DrmOpenFile(const char* szPathName); -BOOL DrmReadFile(HFile hFile, void* pBuffer, ULONG bufLen, ULONG* pReadLen); -long DrmTellFile(HFile hFile); -BOOL DrmSeekFile(HFile hFile, long position, long offset); -BOOL DrmGetFileAttributes(const char* szPathName, FmFileAttribute* pFileAttr); -BOOL DrmCloseFile(HFile hFile); +HFile DrmOpenFile(const char* szPathName); +BOOL DrmReadFile(HFile hFile, void* pBuffer, ULONG bufLen, ULONG* pReadLen); +long DrmTellFile(HFile hFile); +BOOL DrmSeekFile(HFile hFile, long position, long offset); +BOOL DrmGetFileAttributes(const char* szPathName, FmFileAttribute* pFileAttr); +BOOL DrmCloseFile(HFile hFile); #ifdef __cplusplus } @@ -126,4 +125,3 @@ BOOL DrmCloseFile(HFile hFile); #endif // _IMGCODEC_OSAL_H_ - diff --git a/src/include/codec/img-codec-parser.h b/src/include/codec/img-codec-parser.h index b412416..550db1b 100755 --- a/src/include/codec/img-codec-parser.h +++ b/src/include/codec/img-codec-parser.h @@ -37,21 +37,20 @@ extern "C" { #define TIFF_IMAGE_WIDTH 0x100 #define TIFF_IMAGE_HEIGHT 0x101 -typedef enum -{ - IMG_CODEC_UNKNOWN_TYPE = -2, - IMG_CODEC_BIG_PROGRESSIVE_JPEG = -1, - IMG_CODEC_NONE = 0, - IMG_CODEC_GIF = ( 1 << 0), - IMG_CODEC_PNG = ( 1 << 1), - IMG_CODEC_WBMP = ( 1 << 2), - IMG_CODEC_JPEG = ( 1 << 3), - IMG_CODEC_BMP = ( 1 << 4), - IMG_CODEC_TIF = ( 1 << 5), - IMG_CODEC_AGIF = ( 1 << 6), - IMG_CODEC_PROGRESSIVE_JPEG = ( 1 << 7), - IMG_CODEC_DRM = ( 1 << 8), -} ImgCodecType; +typedef enum { + IMG_CODEC_UNKNOWN_TYPE = -2, + IMG_CODEC_BIG_PROGRESSIVE_JPEG = -1, + IMG_CODEC_NONE = 0, + IMG_CODEC_GIF = (1 << 0), + IMG_CODEC_PNG = (1 << 1), + IMG_CODEC_WBMP = (1 << 2), + IMG_CODEC_JPEG = (1 << 3), + IMG_CODEC_BMP = (1 << 4), + IMG_CODEC_TIF = (1 << 5), + IMG_CODEC_AGIF = (1 << 6), + IMG_CODEC_PROGRESSIVE_JPEG = (1 << 7), + IMG_CODEC_DRM = (1 << 8), +} ImgCodecType; //ImgCodecType ImgGetInfoFile(const char*filePath, ImgImageInfo *imgInfo); int ImgGetImageInfo(const char *filePath, ImgCodecType *type, unsigned int *width, unsigned int *height); diff --git a/src/include/codec/img-codec.h b/src/include/codec/img-codec.h index d365705..2af624a 100755 --- a/src/include/codec/img-codec.h +++ b/src/include/codec/img-codec.h @@ -39,7 +39,7 @@ AGifFrameInfo* ImgCreateAGIFFrame(const char *szFileName, unsigned int width, un void ImgDestroyAGIFFrame(AGifFrameInfo* pFrameData); -ImgFastCodecInfo ImgGetNextAGIFFrame (AGifFrameInfo *gFrameData, BOOL bCenterAlign); +ImgFastCodecInfo ImgGetNextAGIFFrame(AGifFrameInfo *gFrameData, BOOL bCenterAlign); #ifdef __cplusplus } diff --git a/src/include/media-thumb-internal.h b/src/include/media-thumb-internal.h index 10cc140..da9165b 100755 --- a/src/include/media-thumb-internal.h +++ b/src/include/media-thumb-internal.h @@ -49,15 +49,15 @@ typedef struct { } media_thumb_info; enum Exif_Orientation { - NOT_AVAILABLE=0, - NORMAL =1, - HFLIP =2, - ROT_180 =3, - VFLIP =4, - TRANSPOSE =5, - ROT_90 =6, - TRANSVERSE =7, - ROT_270 =8 + NOT_AVAILABLE = 0, + NORMAL = 1, + HFLIP = 2, + ROT_180 = 3, + VFLIP = 4, + TRANSPOSE = 5, + ROT_90 = 6, + TRANSVERSE = 7, + ROT_270 = 8 }; typedef struct { diff --git a/src/include/util/media-thumb-debug.h b/src/include/util/media-thumb-debug.h index 66ae59e..47b519e 100755 --- a/src/include/util/media-thumb-debug.h +++ b/src/include/util/media-thumb-debug.h @@ -45,23 +45,23 @@ #define FONT_COLOR_CYAN "\033[36m" #define FONT_COLOR_GRAY "\033[37m" -#define thumb_dbg(fmt, arg...) do{ \ +#define thumb_dbg(fmt, arg...) do { \ LOGD(FONT_COLOR_RESET fmt "\n", ##arg); \ } while (0) -#define thumb_warn(fmt, arg...) do{ \ +#define thumb_warn(fmt, arg...) do { \ LOGW(FONT_COLOR_GREEN fmt "\n", ##arg); \ } while (0) -#define thumb_err(fmt, arg...) do{ \ +#define thumb_err(fmt, arg...) do { \ LOGE(FONT_COLOR_RED fmt "\n", ##arg); \ } while (0) -#define thumb_dbg_slog(fmt, arg...) do{ \ +#define thumb_dbg_slog(fmt, arg...) do { \ SECURE_LOGD(FONT_COLOR_RESET fmt "\n", ##arg); \ } while (0) -#define thumb_warn_slog(fmt, arg...) do{ \ +#define thumb_warn_slog(fmt, arg...) do { \ SECURE_LOGW(FONT_COLOR_GREEN fmt "\n", ##arg); \ } while (0) @@ -76,7 +76,7 @@ void thumb_init_file_debug(); void thumb_close_file_debug(); FILE* get_fp(); -#define thumb_file_dbg(fmt,arg...) fprintf( get_fp(), "[%s: %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg) +#define thumb_file_dbg(fmt, arg...) fprintf(get_fp(), "[%s: %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg) #endif diff --git a/src/include/util/media-thumb-util.h b/src/include/util/media-thumb-util.h index 9c2e4d3..f8ff57a 100755 --- a/src/include/util/media-thumb-util.h +++ b/src/include/util/media-thumb-util.h @@ -25,9 +25,9 @@ #ifndef _MEDIA_THUMB_UTIL_H_ #define _MEDIA_THUMB_UTIL_H_ -#define SAFE_FREE(src) { if (src) {free(src); src = NULL;}} -#define THUMB_MALLOC(src, size) { if (size <= 0) {src = NULL;} \ - else { src = malloc(size); if (src) memset(src, 0x0, size);} } +#define SAFE_FREE(src) { if (src) {free(src); src = NULL; } } +#define THUMB_MALLOC(src, size) { if (size <= 0) {src = NULL; } \ + else { src = malloc(size); if (src) memset(src, 0x0, size); } } typedef enum { MEDIA_THUMB_BGRA, /* BGRA, especially provided for evas users */ @@ -38,16 +38,15 @@ typedef enum { #define THUMB_IMAGE_TYPE 0 /* Image */ #define THUMB_VIDEO_TYPE 1 /* Video */ -#define THUMB_PATH_PHONE MEDIA_ROOT_PATH_INTERNAL /**< File path prefix of files stored in phone */ -#define THUMB_PATH_MMC MEDIA_ROOT_PATH_SDCARD /**< File path prefix of files stored in mmc card */ +#define THUMB_PATH_PHONE MEDIA_ROOT_PATH_INTERNAL /**< File path prefix of files stored in phone */ +#define THUMB_PATH_MMC MEDIA_ROOT_PATH_SDCARD /**< File path prefix of files stored in mmc card */ #define THUMB_PHONE_PATH tzplatform_mkpath(TZ_USER_SHARE, "media/.thumb/phone") #define THUMB_MMC_PATH tzplatform_mkpath(TZ_USER_SHARE, "media/.thumb/mmc") #define THUMB_DEFAULT_PATH tzplatform_mkpath(TZ_USER_SHARE, "media/.thumb/thumb_default.png") -typedef enum -{ +typedef enum { THUMB_PHONE, /**< Stored only in phone */ THUMB_MMC /**< Stored only in MMC */ } media_thumb_store_type; -- cgit v1.2.3