diff options
author | Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org> | 2014-08-26 16:28:12 +0200 |
---|---|---|
committer | Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org> | 2014-09-30 14:09:41 +0200 |
commit | 1c6f7e60ed7b2ac21cb63f066406664c9b758397 (patch) | |
tree | 676442638b645d05343b8bd5053fbbdcffa5ee44 /src/include | |
parent | f9d91e58b273253f324e5b7982103c3ce6a8664f (diff) | |
download | libmedia-service-tizen_3.0.m14.3_ivi.tar.gz libmedia-service-tizen_3.0.m14.3_ivi.tar.bz2 libmedia-service-tizen_3.0.m14.3_ivi.zip |
Multiuser featuretizen_3.0_ivi_releasetizen_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.075212accepted/tizen/common/20141001.131251tizen_3.0_ivitizen_3.0.m14.3_ivitizen_3.0.2015.q1_commontizen_3.0.2014.q4_commontizen_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: I302a3cee78003cae500f1c170ea61bf03552e8d4
Signed-off-by: Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Diffstat (limited to 'src/include')
-rwxr-xr-x | src/include/common/media-svc-album.h | 3 | ||||
-rwxr-xr-x | src/include/common/media-svc-db-utils.h | 26 | ||||
-rwxr-xr-x | src/include/common/media-svc-media-folder.h | 8 | ||||
-rwxr-xr-x | src/include/common/media-svc-media.h | 27 | ||||
-rwxr-xr-x | src/include/common/media-svc-util.h | 9 |
5 files changed, 38 insertions, 35 deletions
diff --git a/src/include/common/media-svc-album.h b/src/include/common/media-svc-album.h index e7fb882..a36c083 100755 --- a/src/include/common/media-svc-album.h +++ b/src/include/common/media-svc-album.h @@ -23,10 +23,11 @@ #define _MEDIA_SVC_ALBUM_H_ #include <sqlite3.h> +#include <sys/types.h> int _media_svc_get_album_id(sqlite3 *handle, const char *album, const char *artist, int * album_id); int _media_svc_get_album_art_by_album_id(sqlite3 *handle, int album_id, char **album_art); -int _media_svc_append_album(sqlite3 *handle, const char *album, const char *artist, const char *album_art, int * album_id); +int _media_svc_append_album(sqlite3 *handle, const char *album, const char *artist, const char *album_art, int * album_id, uid_t uid); int _media_svc_get_media_count_with_album_id_by_path(sqlite3 *handle, const char *path, int *count); #endif /*_MEDIA_SVC_ALBUM_H_*/ diff --git a/src/include/common/media-svc-db-utils.h b/src/include/common/media-svc-db-utils.h index 8493a64..e5685b6 100755 --- a/src/include/common/media-svc-db-utils.h +++ b/src/include/common/media-svc-db-utils.h @@ -30,20 +30,20 @@ int _media_svc_connect_db_with_handle(sqlite3 **db_handle); int _media_svc_disconnect_db_with_handle(sqlite3 *db_handle); -int _media_svc_create_media_table(sqlite3 *db_handle); -int _media_svc_create_folder_table(sqlite3 *db_handle); -int _media_svc_create_playlist_table(sqlite3 *db_handle); -int _media_svc_create_album_table(sqlite3 *db_handle); -int _media_svc_create_tag_table(sqlite3 *db_handle); -int _media_svc_create_bookmark_table(sqlite3 *db_handle); -int _media_svc_create_custom_table(sqlite3 *db_handle); -int _media_svc_request_update_db(const char *sql_str); -int _media_svc_sql_query(sqlite3 *db_handle, const char *sql_str); +int _media_svc_create_media_table(sqlite3 *db_handle, uid_t uid); +int _media_svc_create_folder_table(sqlite3 *db_handle, uid_t uid); +int _media_svc_create_playlist_table(sqlite3 *db_handle, uid_t uid); +int _media_svc_create_album_table(sqlite3 *db_handle, uid_t uid); +int _media_svc_create_tag_table(sqlite3 *db_handle, uid_t uid); +int _media_svc_create_bookmark_table(sqlite3 *db_handle, uid_t uid); +int _media_svc_create_custom_table(sqlite3 *db_handle, uid_t uid); +int _media_svc_request_update_db(const char *sql_str, uid_t uid); +int _media_svc_sql_query(sqlite3 *db_handle, const char *sql_str, uid_t uid); int _media_svc_sql_prepare_to_step(sqlite3 *handle, const char *sql_str, sqlite3_stmt** stmt); -int _media_svc_sql_begin_trans(sqlite3 *handle); -int _media_svc_sql_end_trans(sqlite3 *handle); -int _media_svc_sql_rollback_trans(sqlite3 *handle); -int _media_svc_sql_query_list(sqlite3 *handle, GList **query_list); +int _media_svc_sql_begin_trans(sqlite3 *handle, uid_t uid); +int _media_svc_sql_end_trans(sqlite3 *handle, uid_t uid); +int _media_svc_sql_rollback_trans(sqlite3 *handle, uid_t uid); +int _media_svc_sql_query_list(sqlite3 *handle, GList **query_list, uid_t uid); void _media_svc_sql_query_add(GList **query_list, char **query); void _media_svc_sql_query_release(GList **query_list); diff --git a/src/include/common/media-svc-media-folder.h b/src/include/common/media-svc-media-folder.h index 3b9897a..1a17e27 100755 --- a/src/include/common/media-svc-media-folder.h +++ b/src/include/common/media-svc-media-folder.h @@ -27,9 +27,9 @@ #include "media-svc-types.h" int _media_svc_get_folder_id_by_foldername(sqlite3 *handle, const char *folder_name, char *folder_id); -int _media_svc_append_folder(sqlite3 *handle, media_svc_storage_type_e storage_type, const char *folder_id, const char *path_name, const char *folder_name, int modified_date); -int _media_svc_update_folder_modified_time_by_folder_uuid(sqlite3 *handle, const char *folder_uuid, const char *folder_path, bool stack_query); -int _media_svc_get_and_append_folder_id_by_path(sqlite3 *handle, const char *path, media_svc_storage_type_e storage_type, char *folder_id); -int _media_svc_update_folder_table(sqlite3 *handle); +int _media_svc_append_folder(sqlite3 *handle, media_svc_storage_type_e storage_type, const char *folder_id, const char *path_name, const char *folder_name, int modified_date, uid_t uid); +int _media_svc_update_folder_modified_time_by_folder_uuid(sqlite3 *handle, const char *folder_uuid, const char *folder_path, bool stack_query, uid_t uid); +int _media_svc_get_and_append_folder_id_by_path(sqlite3 *handle, const char *path, media_svc_storage_type_e storage_type, char *folder_id, uid_t uid); +int _media_svc_update_folder_table(sqlite3 *handle, uid_t uid); #endif /*_MEDIA_SVC_MEDIA_FOLDER_H_*/ diff --git a/src/include/common/media-svc-media.h b/src/include/common/media-svc-media.h index d7e0ba6..b29c503 100755 --- a/src/include/common/media-svc-media.h +++ b/src/include/common/media-svc-media.h @@ -29,25 +29,26 @@ #include "media-svc-noti.h" int _media_svc_count_record_with_path(sqlite3 *handle, const char *path, int *count); -int _media_svc_insert_item_with_data(sqlite3 *handle, media_svc_content_info_s *content_info, int is_burst, bool stack_query); -int _media_svc_update_item_with_data(sqlite3 *handle, media_svc_content_info_s *content_info); +int _media_svc_insert_item_with_data(sqlite3 *handle, media_svc_content_info_s *content_info, int is_burst, bool stack_query, uid_t uid); +int _media_svc_update_item_with_data(sqlite3 *handle, media_svc_content_info_s *content_info, uid_t uid); int _media_svc_get_thumbnail_path_by_path(sqlite3 *handle, const char *path, char *thumbnail_path); int _media_svc_get_media_type_by_path(sqlite3 *handle, const char *path, int *media_type); int _media_svc_get_burst_id(sqlite3 *handle, int *id); -int _media_svc_delete_item_by_path(sqlite3 *handle, const char *path); -int _media_svc_truncate_table(sqlite3 *handle, media_svc_storage_type_e storage_type); -int _media_svc_delete_invalid_items(sqlite3 *handle, media_svc_storage_type_e storage_type); -int _media_svc_delete_invalid_folder_items(sqlite3 *handle, const char *folder_path); -int _media_svc_update_storage_item_validity(sqlite3 *handle, media_svc_storage_type_e storage_type, int validity); -int _media_svc_update_folder_item_validity(sqlite3 *handle, const char *folder_path, int validity); -int _media_svc_update_recursive_folder_item_validity(sqlite3 *handle, const char *folder_path, int validity); -int _media_svc_update_item_validity(sqlite3 *handle, const char *path, int validity, bool stack_query); -int _media_svc_update_item_by_path(sqlite3 *handle, const char *src_path, media_svc_storage_type_e dest_storage, const char *dest_path, const char *file_name, int modified_time, const char *folder_uuid, const char *thumb_path, bool stack_query); -int _media_svc_list_query_do(sqlite3 *handle, media_svc_query_type_e query_type); +int _media_svc_delete_item_by_path(sqlite3 *handle, const char *path, uid_t uid); +int _media_svc_truncate_table(sqlite3 *handle, media_svc_storage_type_e storage_type, uid_t uid); +int _media_svc_delete_invalid_items(sqlite3 *handle, media_svc_storage_type_e storage_type, uid_t uid); +int _media_svc_delete_invalid_folder_items(sqlite3 *handle, const char *folder_path, uid_t uid); +int _media_svc_update_storage_item_validity(sqlite3 *handle, media_svc_storage_type_e storage_type, int validity, uid_t uid); +int _media_svc_update_folder_item_validity(sqlite3 *handle, const char *folder_path, int validity, uid_t uid); +int _media_svc_update_recursive_folder_item_validity(sqlite3 *handle, const char *folder_path, int validity, uid_t uid); +int _media_svc_update_item_validity(sqlite3 *handle, const char *path, int validity, bool stack_query, uid_t uid); +int _media_svc_update_item_by_path(sqlite3 *handle, const char *src_path, media_svc_storage_type_e dest_storage, const char *dest_path, const char *file_name, int modified_time, const char *folder_uuid, const char *thumb_path, bool stack_query, uid_t uid); +int _media_svc_list_query_do(sqlite3 *handle, media_svc_query_type_e query_type, uid_t uid); int _media_svc_get_media_id_by_path(sqlite3 *handle, const char *path, char *media_uuid, int max_length); -int _media_svc_update_thumbnail_path(sqlite3 *handle, const char *path, const char *thumb_path); +int _media_svc_update_thumbnail_path(sqlite3 *handle, const char *path, const char *thumb_path, uid_t uid); int _media_svc_get_noti_info(sqlite3 *handle, const char *path, int update_item, media_svc_noti_item **item); int _media_svc_count_invalid_folder_items(sqlite3 *handle, const char *folder_path, int *count); int _media_svc_get_thumbnail_count(sqlite3 *handle, const char *thumb_path, int *count); +char* _media_svc_get_thumb_default_path(uid_t uid); #endif /*_MEDIA_SVC_MEDIA_H_*/ diff --git a/src/include/common/media-svc-util.h b/src/include/common/media-svc-util.h index 1272641..f05888d 100755 --- a/src/include/common/media-svc-util.h +++ b/src/include/common/media-svc-util.h @@ -54,19 +54,20 @@ int _media_svc_rename_file( const char *old_name, const char *new_name); bool _media_svc_remove_file(const char *path); int _media_svc_remove_all_files_in_dir(const char *dir_path); char *_media_svc_get_title_from_filepath (const char *path); -int _media_svc_save_image(void *image, int size, char *image_path); -bool _media_svc_get_thumbnail_path(media_svc_storage_type_e storage_type, char *thumb_path, const char *pathname, const char *img_format); +int _media_svc_save_image(void *image, int size, char *image_path, uid_t uid); +bool _media_svc_get_thumbnail_path(media_svc_storage_type_e storage_type, char *thumb_path, const char *pathname, const char *img_format, uid_t uid); bool _media_svc_get_file_ext(const char *file_path, char *file_ext); int _media_svc_get_file_time(const char *full_path); int _media_svc_set_media_info(media_svc_content_info_s *content_info, media_svc_storage_type_e storage_type, const char *path, media_svc_media_type_e *media_type, bool refresh, drm_content_info_s **drm_contentInfo); int _media_svc_extract_image_metadata(media_svc_content_info_s *content_info, media_svc_media_type_e media_type); -int _media_svc_extract_media_metadata(sqlite3 *handle, media_svc_content_info_s *content_info, media_svc_media_type_e media_type, drm_content_info_s *drm_contentInfo); +int _media_svc_extract_media_metadata(sqlite3 *handle, media_svc_content_info_s *content_info, media_svc_media_type_e media_type, drm_content_info_s *drm_contentInfo, uid_t uid); int __media_svc_malloc_and_strncpy(char **dst, const char *src); void _media_svc_destroy_content_info(media_svc_content_info_s *content_info); int _media_svc_get_store_type_by_path(const char *path, media_svc_storage_type_e *storage_type); char *_media_svc_replace_path(char *s, const char *olds, const char *news); - +char* _media_svc_get_thumb_internal_path(uid_t uid); +char* _media_svc_get_thumb_external_path(uid_t uid); int _media_svc_error_convert(int error); /* Define data structures for media type and mime type */ |