diff options
author | Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org> | 2014-08-26 16:28:49 +0200 |
---|---|---|
committer | Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org> | 2014-09-30 14:09:14 +0200 |
commit | 561e2cae46730cdbadf485dfa7ab449e60524bae (patch) | |
tree | 5d2127e248aac6750950cbd2352976729baa4bc7 /src/media-thumbnail.c | |
parent | 1b8cf739c37f1103b7fa613b788f0d5e32f5bad9 (diff) | |
download | libmedia-thumbnail-561e2cae46730cdbadf485dfa7ab449e60524bae.tar.gz libmedia-thumbnail-561e2cae46730cdbadf485dfa7ab449e60524bae.tar.bz2 libmedia-thumbnail-561e2cae46730cdbadf485dfa7ab449e60524bae.zip |
Multiuser featuretizen_3.0.m14.3_ivi_releasetizen_3.0.2014.q3_common_releasesubmit/tizen_mobile/20141120.000000submit/tizen_ivi/20141007.222222submit/tizen_common/20141001.125034accepted/tizen/ivi/20141008.075209accepted/tizen/common/20141001.131249tizen_3.0.m14.3_ivitizen_3.0.2014.q3_commonaccepted/tizen_3.0.m14.3_iviaccepted/tizen_3.0.2014.q3_common
Use User UID to write or read into database
Use Unix socket
Fix-Tizen: TC-1482
Change-Id: I557a28de1650c9af1a30ef7d795d64464eaa2e8f
Signed-off-by: Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Diffstat (limited to 'src/media-thumbnail.c')
-rwxr-xr-x | src/media-thumbnail.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/media-thumbnail.c b/src/media-thumbnail.c index 420414e..c52c42a 100755 --- a/src/media-thumbnail.c +++ b/src/media-thumbnail.c @@ -28,7 +28,7 @@ #include <glib.h> -int thumbnail_request_from_db(const char *origin_path, char *thumb_path, int max_length) +int thumbnail_request_from_db(const char *origin_path, char *thumb_path, int max_length, uid_t uid) { int err = -1; //int need_update_db = 0; @@ -73,7 +73,7 @@ int thumbnail_request_from_db(const char *origin_path, char *thumb_path, int max } */ /* Request for thumb file to the daemon "Thumbnail generator" */ - err = _media_thumb_request(THUMB_REQUEST_DB_INSERT, MEDIA_THUMB_LARGE, origin_path, thumb_path, max_length, &thumb_info); + err = _media_thumb_request(THUMB_REQUEST_DB_INSERT, MEDIA_THUMB_LARGE, origin_path, thumb_path, max_length, &thumb_info, uid); if (err < 0) { thumb_err("_media_thumb_request failed : %d", err); //_media_thumb_db_disconnect(); @@ -93,7 +93,7 @@ int thumbnail_request_from_db(const char *origin_path, char *thumb_path, int max return MEDIA_THUMB_ERROR_NONE; } -int thumbnail_request_save_to_file(const char *origin_path, media_thumb_type thumb_type, const char *thumb_path) +int thumbnail_request_save_to_file(const char *origin_path, media_thumb_type thumb_type, const char *thumb_path, uid_t uid) { int err = -1; @@ -109,7 +109,7 @@ int thumbnail_request_save_to_file(const char *origin_path, media_thumb_type thu tmp_thumb_path[sizeof(tmp_thumb_path) - 1] = '\0'; /* Request for thumb file to the daemon "Thumbnail generator" */ - err = _media_thumb_request(THUMB_REQUEST_SAVE_FILE, thumb_type, origin_path, tmp_thumb_path, sizeof(tmp_thumb_path), &thumb_info); + err = _media_thumb_request(THUMB_REQUEST_SAVE_FILE, thumb_type, origin_path, tmp_thumb_path, sizeof(tmp_thumb_path), &thumb_info, uid); if (err < 0) { thumb_err("_media_thumb_request failed : %d", err); return err; @@ -118,7 +118,7 @@ int thumbnail_request_save_to_file(const char *origin_path, media_thumb_type thu return MEDIA_THUMB_ERROR_NONE; } -int thumbnail_request_from_db_with_size(const char *origin_path, char *thumb_path, int max_length, int *origin_width, int *origin_height) +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 err = -1; //int need_update_db = 0; @@ -168,7 +168,7 @@ int thumbnail_request_from_db_with_size(const char *origin_path, char *thumb_pat } */ /* Request for thumb file to the daemon "Thumbnail generator" */ - err = _media_thumb_request(THUMB_REQUEST_DB_INSERT, MEDIA_THUMB_LARGE, origin_path, thumb_path, max_length, &thumb_info); + err = _media_thumb_request(THUMB_REQUEST_DB_INSERT, MEDIA_THUMB_LARGE, origin_path, thumb_path, max_length, &thumb_info, uid); if (err < 0) { thumb_err("_media_thumb_request failed : %d", err); //_media_thumb_db_disconnect(); @@ -182,7 +182,7 @@ int thumbnail_request_from_db_with_size(const char *origin_path, char *thumb_pat return MEDIA_THUMB_ERROR_NONE; } -int thumbnail_request_extract_all_thumbs(void) +int thumbnail_request_extract_all_thumbs(uid_t uid) { int err = -1; @@ -192,7 +192,7 @@ int thumbnail_request_extract_all_thumbs(void) char tmp_thumb_path[MAX_PATH_SIZE] = {0,}; /* Request for thumb file to the daemon "Thumbnail generator" */ - err = _media_thumb_request(THUMB_REQUEST_ALL_MEDIA, thumb_type, tmp_origin_path, tmp_thumb_path, sizeof(tmp_thumb_path), &thumb_info); + err = _media_thumb_request(THUMB_REQUEST_ALL_MEDIA, thumb_type, tmp_origin_path, tmp_thumb_path, sizeof(tmp_thumb_path), &thumb_info, uid); if (err < 0) { thumb_err("_media_thumb_request failed : %d", err); return err; @@ -201,7 +201,7 @@ int thumbnail_request_extract_all_thumbs(void) return MEDIA_THUMB_ERROR_NONE; } -int thumbnail_request_from_db_async(const char *origin_path, ThumbFunc func, void *user_data) +int thumbnail_request_from_db_async(const char *origin_path, ThumbFunc func, void *user_data, uid_t uid) { int err = -1; @@ -231,7 +231,7 @@ int thumbnail_request_from_db_async(const char *origin_path, ThumbFunc func, voi userData->user_data = user_data; /* Request for thumb file to the daemon "Thumbnail generator" */ - err = _media_thumb_request_async(THUMB_REQUEST_DB_INSERT, MEDIA_THUMB_LARGE, origin_path, userData); + err = _media_thumb_request_async(THUMB_REQUEST_DB_INSERT, MEDIA_THUMB_LARGE, origin_path, userData, uid); if (err < 0) { thumb_err("_media_thumb_request failed : %d", err); SAFE_FREE(userData); @@ -249,7 +249,7 @@ int _media_thumbnail_cancel_cb(int error_code, char* path, void* data) return MEDIA_THUMB_ERROR_NONE; } -int thumbnail_request_cancel_media(const char *origin_path) +int thumbnail_request_cancel_media(const char *origin_path, uid_t uid) { int err = -1; @@ -260,7 +260,7 @@ int thumbnail_request_cancel_media(const char *origin_path) return MEDIA_THUMB_ERROR_INVALID_PARAMETER; } - err = _media_thumb_request_async(THUMB_REQUEST_CANCEL_MEDIA, thumb_type, origin_path, NULL); + err = _media_thumb_request_async(THUMB_REQUEST_CANCEL_MEDIA, thumb_type, origin_path, NULL, uid); if (err < 0) { thumb_err("_media_thumb_request failed : %d", err); return err; @@ -269,7 +269,7 @@ int thumbnail_request_cancel_media(const char *origin_path) return MEDIA_THUMB_ERROR_NONE; } -int thumbnail_request_cancel_all() +int thumbnail_request_cancel_all(uid_t uid) { int err = -1; @@ -279,7 +279,7 @@ int thumbnail_request_cancel_all() char tmp_thumb_path[MAX_PATH_SIZE] = {0,}; /* Request for thumb file to the daemon "Thumbnail generator" */ - err = _media_thumb_request(THUMB_REQUEST_CANCEL_ALL, thumb_type, tmp_origin_path, tmp_thumb_path, sizeof(tmp_thumb_path), &thumb_info); + err = _media_thumb_request(THUMB_REQUEST_CANCEL_ALL, thumb_type, tmp_origin_path, tmp_thumb_path, sizeof(tmp_thumb_path), &thumb_info, uid); if (err < 0) { thumb_err("_media_thumb_request failed : %d", err); return err; |