summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaejeong Kim <backto.kim@samsung.com>2017-03-30 00:59:15 (GMT)
committerHaejeong Kim <backto.kim@samsung.com>2017-03-30 00:59:15 (GMT)
commitaee150adb2f1ea46f8ab3e1ee32896338bc811eb (patch)
tree5aff090d4422911a3c3647ca9044a0a41388ff36
parentb309bbcdcb5dafd7c22dcd669b918117b25076b6 (diff)
downloadlibmedia-thumbnail-aee150adb2f1ea46f8ab3e1ee32896338bc811eb.zip
libmedia-thumbnail-aee150adb2f1ea46f8ab3e1ee32896338bc811eb.tar.gz
libmedia-thumbnail-aee150adb2f1ea46f8ab3e1ee32896338bc811eb.tar.bz2
Change-Id: I6951f5a5bf334838c9d17dba0edb03be10a30c96
-rw-r--r--packaging/libmedia-thumbnail.spec2
-rwxr-xr-xsrc/include/codec/AGifFrameInfo.h17
-rwxr-xr-x[-rw-r--r--]src/include/codec/IfegDecodeAGIF.h2
-rwxr-xr-xsrc/include/codec/img-codec-common.h143
-rwxr-xr-x[-rw-r--r--]src/include/codec/img-codec-config.h2
-rwxr-xr-x[-rw-r--r--]src/include/codec/img-codec-osal.h50
-rwxr-xr-xsrc/include/codec/img-codec-parser.h29
-rwxr-xr-xsrc/include/codec/img-codec.h2
-rwxr-xr-xsrc/include/media-thumb-internal.h18
-rwxr-xr-xsrc/include/util/media-thumb-debug.h12
-rwxr-xr-xsrc/include/util/media-thumb-util.h13
-rwxr-xr-xsrc/media-thumb-internal.c15
-rwxr-xr-xsrc/util/media-thumb-db.c2
-rwxr-xr-xsrc/util/media-thumb-debug.c10
14 files changed, 148 insertions, 169 deletions
diff --git a/packaging/libmedia-thumbnail.spec b/packaging/libmedia-thumbnail.spec
index 6968387..5ab4763 100644
--- a/packaging/libmedia-thumbnail.spec
+++ b/packaging/libmedia-thumbnail.spec
@@ -1,6 +1,6 @@
Name: libmedia-thumbnail
Summary: Media thumbnail service library for multimedia applications
-Version: 0.1.103
+Version: 0.1.104
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0 and public domain
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
index 9510c64..3504ff6 100644..100755
--- 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
index a918e16..7b49c56 100644..100755
--- 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
index 67b6921..68bcc5d 100644..100755
--- 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;
diff --git a/src/media-thumb-internal.c b/src/media-thumb-internal.c
index 1fd2614..adc96e4 100755
--- a/src/media-thumb-internal.c
+++ b/src/media-thumb-internal.c
@@ -261,8 +261,7 @@ int _media_thumb_rotate_argb(unsigned char *source, const unsigned int size, int
height = *ori_height;
/* rotate image to 90 degree clockwise */
- for (y = 0; y < height; y++)
- {
+ for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
for (i = 0; i < dpp; i++) {
temp_buf[(x * height + (height - y - 1)) * dpp + i] = source[(y * width + x) * dpp + i];
@@ -894,12 +893,12 @@ int _media_thumb_decode_with_evas(const char *origin_path,
mm_util_img_format _media_thumb_get_format(media_thumb_format src_format)
{
switch (src_format) {
- case MEDIA_THUMB_BGRA:
- return MM_UTIL_IMG_FMT_BGRA8888;
- case MEDIA_THUMB_RGB888:
- return MM_UTIL_IMG_FMT_RGB888;
- default:
- return MS_MEDIA_ERR_INVALID_PARAMETER;
+ case MEDIA_THUMB_BGRA:
+ return MM_UTIL_IMG_FMT_BGRA8888;
+ case MEDIA_THUMB_RGB888:
+ return MM_UTIL_IMG_FMT_RGB888;
+ default:
+ return MS_MEDIA_ERR_INVALID_PARAMETER;
}
}
diff --git a/src/util/media-thumb-db.c b/src/util/media-thumb-db.c
index 9b1e670..62ff2cb 100755
--- a/src/util/media-thumb-db.c
+++ b/src/util/media-thumb-db.c
@@ -27,7 +27,7 @@
#include <string.h>
#include <unistd.h>
-static __thread MediaDBHandle *db_handle;
+static __thread MediaDBHandle *db_handle;
sqlite3 *_media_thumb_db_get_handle()
{
diff --git a/src/util/media-thumb-debug.c b/src/util/media-thumb-debug.c
index 9515505..f293afd 100755
--- a/src/util/media-thumb-debug.c
+++ b/src/util/media-thumb-debug.c
@@ -88,25 +88,21 @@ void thumb_print_debug_time(char *time_string)
double totaltime = 0.0;
gettimeofday(&time, NULL);
- totaltime =
- (double)(time.tv_sec * 1000000 + time.tv_usec -
- g_time_usec) / CLOCKS_PER_SEC;
+ totaltime = (double)(time.tv_sec * 1000000 + time.tv_usec - g_time_usec) / CLOCKS_PER_SEC;
thumb_dbg("time [%s] : %f", time_string, totaltime);
#endif
}
void
-thumb_print_debug_time_ex(long start, long end, const char *func_name,
- char *time_string)
+thumb_print_debug_time_ex(long start, long end, const char *func_name, char *time_string)
{
#ifdef _PERFORMANCE_CHECK_
double totaltime = 0.0;
totaltime = (double)(end - start) / CLOCKS_PER_SEC;
- thumb_dbg("time [%s: %s] : %f", func_name, time_string,
- totaltime);
+ thumb_dbg("time [%s: %s] : %f", func_name, time_string, totaltime);
#endif
}
#endif \ No newline at end of file