summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Barinov <v.barinov@samsung.com>2016-04-12 16:24:27 +0300
committerSlava Barinov <v.barinov@samsung.com>2016-04-12 17:12:29 +0300
commit64a88dfa125b3df80f68c72df33fa543a58354f0 (patch)
tree64ed18ea2283507d3395d1f356aec08e3e3be467
parentc842c7fc4b4e1bcd48d551387b828f9968f173be (diff)
downloadlibmedia-thumbnail-sandbox/vbarinov/vis.tar.gz
libmedia-thumbnail-sandbox/vbarinov/vis.tar.bz2
libmedia-thumbnail-sandbox/vbarinov/vis.zip
-rwxr-xr-xCMakeLists.txt12
-rwxr-xr-xinclude/media-thumbnail.h19
-rwxr-xr-xsrc/include/codec/img-codec-parser.h9
3 files changed, 28 insertions, 12 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 56f96db..ffa9f0c 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,7 +45,7 @@ FOREACH(flag ${pkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -flto ")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -flto -fvisibility=hidden")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_C_FLAGS_RELEASE "-O2 -fPIC")
@@ -61,6 +61,7 @@ ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
ADD_DEFINITIONS("-D_GNU_SOURCE")
+
#ADD_DEFINITIONS("-D_PERFORMANCE_CHECK_")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--hash-style=both")
@@ -81,7 +82,14 @@ INSTALL(TARGETS ${MEDIATHUMB-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
INSTALL(TARGETS ${MEDIAHASH-LIB} LIBRARY DESTINATION ${LIB_INSTALL_DIR})
ADD_SUBDIRECTORY(server)
-ADD_SUBDIRECTORY(test)
+IF(CMAKE_BUILD_TYPE MATCHES DEBUG)
+ ADD_SUBDIRECTORY(test)
+ ADD_DEFINITIONS("-DEXPORT_API=")
+ ELSE
+ ADD_DEFINITIONS("-DEXPORT_API=__attribute__((visibility(\"default\")))")
+ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG)
+
+
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/media-thumbnail.h DESTINATION include/${MEDIATHUMB-LIB})
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/include/codec/img-codec-parser.h DESTINATION include/${MEDIATHUMB-LIB})
diff --git a/include/media-thumbnail.h b/include/media-thumbnail.h
index a5fe4ca..1bc1053 100755
--- a/include/media-thumbnail.h
+++ b/include/media-thumbnail.h
@@ -30,6 +30,11 @@
extern "C" {
#endif
+#ifndef EXPORT_API
+#define EXPORT_API
+#endif // EXPORT_API
+
+
@@ -37,19 +42,19 @@ typedef int (*ThumbFunc) (int error_code, char* path, void* data);
typedef void (*ThumbRawFunc) (int error_code, int request_id, const char* org_path, int thumb_width, int thumb_height, unsigned char* thumb_data, int thumb_size, void* data);
-int thumbnail_request_from_db_async(unsigned int request_id, const char *origin_path, ThumbFunc func, void *user_data, uid_t uid);
+EXPORT_API int thumbnail_request_from_db_async(unsigned int request_id, const char *origin_path, ThumbFunc func, void *user_data, uid_t uid);
-int thumbnail_request_extract_raw_data_async(int request_id, const char *origin_path, int width, int height, ThumbRawFunc func, void *user_data, uid_t uid);
+EXPORT_API int thumbnail_request_extract_raw_data_async(int request_id, const char *origin_path, int width, int height, ThumbRawFunc func, void *user_data, uid_t uid);
-int thumbnail_request_extract_all_thumbs(uid_t uid);
+EXPORT_API int thumbnail_request_extract_all_thumbs(uid_t uid);
-int thumbnail_request_from_db_with_size(const char *origin_path, char *thumb_path, int max_length, int *origin_width, int *origin_height, uid_t uid);
+EXPORT_API int thumbnail_request_from_db_with_size(const char *origin_path, char *thumb_path, int max_length, int *origin_width, int *origin_height, uid_t uid);
-int thumbnail_request_cancel_media(unsigned int request_id, const char *origin_path);
+EXPORT_API int thumbnail_request_cancel_media(unsigned int request_id, const char *origin_path);
-int thumbnail_request_cancel_raw_data(int request_id);
+EXPORT_API int thumbnail_request_cancel_raw_data(int request_id);
-int thumbnail_request_cancel_all(bool is_raw_data);
+EXPORT_API int thumbnail_request_cancel_all(bool is_raw_data);
#ifdef __cplusplus
}
diff --git a/src/include/codec/img-codec-parser.h b/src/include/codec/img-codec-parser.h
index b412416..1123023 100755
--- a/src/include/codec/img-codec-parser.h
+++ b/src/include/codec/img-codec-parser.h
@@ -37,6 +37,10 @@ extern "C" {
#define TIFF_IMAGE_WIDTH 0x100
#define TIFF_IMAGE_HEIGHT 0x101
+#ifndef EXPORT_API
+#define EXPORT_API
+#endif // EXPORT_API
+
typedef enum
{
IMG_CODEC_UNKNOWN_TYPE = -2,
@@ -54,12 +58,11 @@ typedef enum
} ImgCodecType;
//ImgCodecType ImgGetInfoFile(const char*filePath, ImgImageInfo *imgInfo);
-int ImgGetImageInfo(const char *filePath, ImgCodecType *type, unsigned int *width, unsigned int *height);
-int ImgGetImageInfoForThumb(const char *filePath, ImgCodecType *type, unsigned int *width, unsigned int *height);
+EXPORT_API int ImgGetImageInfo(const char *filePath, ImgCodecType *type, unsigned int *width, unsigned int *height);
+EXPORT_API int ImgGetImageInfoForThumb(const char *filePath, ImgCodecType *type, unsigned int *width, unsigned int *height);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
-