summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHyunjun Ko <zzoon.ko@samsung.com>2012-08-21 17:59:20 +0900
committerHyunjun Ko <zzoon.ko@samsung.com>2012-08-21 17:59:20 +0900
commit933fd44374830be92e08801629bd7eb00e8e1b71 (patch)
treeb561e00c8ff48055ee15e701572a8298f025f6e1 /include
parent69a56c3e83fe93a7b4286623e28d0059a9cbbe05 (diff)
downloadlibmedia-thumbnail-933fd44374830be92e08801629bd7eb00e8e1b71.tar.gz
libmedia-thumbnail-933fd44374830be92e08801629bd7eb00e8e1b71.tar.bz2
libmedia-thumbnail-933fd44374830be92e08801629bd7eb00e8e1b71.zip
Tizen 2.0 beta
Diffstat (limited to 'include')
-rwxr-xr-xinclude/media-thumbnail.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/include/media-thumbnail.h b/include/media-thumbnail.h
index 2d77601..76de9e8 100755
--- a/include/media-thumbnail.h
+++ b/include/media-thumbnail.h
@@ -49,6 +49,13 @@ extern "C" {
/**
+ * Callback function, which is used to call thumbnail_request_from_db_async
+ */
+
+typedef int (*ThumbFunc) (int error_code, char* path, void* data);
+
+
+/**
* thumbnail_request_from_db:
* This function connects to the media database and find thumbnail path of the passed original image.
* If found, the thumbnail path will be returned, or starts to generate thumbnail
@@ -88,6 +95,51 @@ void gen_thumbs()
int thumbnail_request_from_db(const char *origin_path, char *thumb_path, int max_length);
/**
+ * thumbnail_request_from_db_async:
+ * This function connects to the media database and find thumbnail path of the passed original image.
+ * If found, the thumbnail path will be returned through callback, which is registered by user.
+ *
+ * @return This function returns zero(MEDIA_THUMB_ERROR_NONE) on success, or negative value with error code.
+ * Please refer 'media-thumb-error.h' to know the exact meaning of the error.
+ * @param[in] origin_path The path of the original image
+ * @param[in] func The callback, which is registered by user
+ * @param[in] user_data User data, which is used by user in callback
+ * @see None.
+ * @pre None.
+ * @post None.
+ * @remark The database name is "/opt/dbspace/.media.db".
+ * @par example
+ * @code
+
+#include <media-thumbnail.h>
+
+int _thumb_cb(int error_code, char *path, void *user_data)
+{
+ printf("Error code : %d\n", error_code);
+ printf("Thumb path : %s\n", path);
+}
+
+void gen_thumbs()
+{
+ int ret = MEDIA_THUMB_ERROR_NONE;
+ const char *origin_path = "/opt/media/test.jpg";
+ char thumb_path[255];
+
+ ret = thumbnail_request_from_db_async(origin_path, _thumb_cb, NULL);
+
+ if (ret < 0)
+ {
+ printf( "thumbnail_request_from_db_async fails. error code->%d", ret);
+ }
+
+ return;
+}
+
+ * @endcode
+ */
+int thumbnail_request_from_db_async(const char *origin_path, ThumbFunc func, void *user_data);
+
+/**
* thumbnail_request_save_to_file:
* This function generates thumbnail of the original path and save it to the file system as jpeg format with the passed thumbnail path.
* This function doesn't care about media DB.