From a6aed1e4b2724da45788a8d85462f5fe6e022a4c Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Wed, 7 Nov 2018 10:53:22 +0900 Subject: [PATCH] [ACR-1308] Remove deprecated APIs Change-Id: If80cbeb11bc18a18d97c293c53e171072fe9794f Signed-off-by: Minje Ahn --- doc/media_content_doc.h | 73 +- include/media_audio.h | 35 +- include/media_content_type.h | 259 +--- include/media_folder.h | 130 +- include/media_image.h | 89 +- include/media_info.h | 839 +---------- include/media_info_private.h | 72 +- include/media_storage.h | 20 - include/media_video.h | 35 +- include_product/media_audio.h | 35 +- include_product/media_content_product.h | 45 + include_product/media_content_type.h | 259 +--- include_product/media_content_type_product.h | 4 + include_product/media_folder.h | 130 +- include_product/media_image.h | 89 +- include_product/media_info.h | 839 +---------- include_product/media_info_private.h | 71 +- include_product/media_storage.h | 20 - include_product/media_video.h | 35 +- src/media_audio.c | 13 - src/media_content.c | 752 +--------- src/media_db.c | 22 +- src/media_folder.c | 179 +-- src/media_image.c | 95 -- src/media_info.c | 1914 ++++---------------------- src/media_storage.c | 16 - src/media_video.c | 13 - test/media-content_test.c | 443 ------ 28 files changed, 403 insertions(+), 6123 deletions(-) diff --git a/doc/media_content_doc.h b/doc/media_content_doc.h index b55616c..cee3c85 100755 --- a/doc/media_content_doc.h +++ b/doc/media_content_doc.h @@ -63,7 +63,7 @@ * * @ref CAPI_CONTENT_MEDIA_INFO_MODULE * Provide generic information about media content items (i.e. image, audio, video and others).\n - * Provide details about audio files (e.g. name, author, genre etc) present in the device.\n + * Provide details about audio files (e.g. name, genre etc) present in the device.\n * Provide details about image files (e.g. width, height, orientation etc) present in the device.\n * Provide details about video files (e.g. width, height, duration etc) present in the device . * @@ -382,11 +382,6 @@ * MEDIA_RATING * Get from metadata if exist. * - * - * author - * MEDIA_AUTHOR - * Get from metadata if exist. - * * * \n * @@ -596,16 +591,6 @@ * Get from EXIF if exist. * * - * burst_id - * MEDIA_BURST_ID - * ID for the burst images. - * - * - * is_burst_shot - * - * Whether burst shot or not. - * - * * is_360_content * MEDIA_360 * Whether 360 content or not. @@ -724,11 +709,6 @@ * Get from metadata if exist. * * - * author - * MEDIA_AUTHOR - * Get from metadata if exist. - * - * * rotation * MEDIA_ORIENTATION * Video rotation @@ -803,7 +783,6 @@ * - start and cancel face detection with image files * *

- * To obtain the media handle (#media_info_h), call the #media_info_create() function.\n * To start face detection, call the #media_info_start_face_detection() function.\n * To cancel face detection after it's been started, call the #media_info_cancel_face_detection() function.\n * @@ -965,56 +944,6 @@ * User data. Not guarantee independence between applications. * * - * provider - * MEDIA_PROVIDER - * User data. Not guarantee independence between applications. - * - * - * category - * MEDIA_CATEGORY - * User data. Not guarantee independence between applications. - * - * - * location_tag - * MEDIA_LOCATION_TAG - * User data. Not guarantee independence between applications. - * - * - * age_rating - * MEDIA_AGE_RATING - * User data. Not guarantee independence between applications. - * - * - * weather - * MEDIA_WEATHER - * User data. Not guarantee independence between applications. - * - * - * played_count - * MEDIA_PLAYED_COUNT - * User data. Not guarantee independence between applications. (deprecated since 4.0) - * - * - * played_time - * MEDIA_LAST_PLAYED_TIME - * User data. Not guarantee independence between applications. (deprecated since 4.0) - * - * - * played_position - * MEDIA_LAST_PLAYED_POSITION - * User data. Not guarantee independence between applications. (deprecated since 4.0) - * - * - * content_name - * MEDIA_CONTENT_NAME - * User data. Not guarantee independence between applications. (deprecated since 4.0) - * - * - * keyword - * MEDIA_KEYWORD - * User data. Not guarantee independence between applications. (deprecated since 4.0) - * - * * thumbnail_path * MEDIA_THUMBNAIL_PATH * Thumbnail path(album art for Audio) if exist. diff --git a/include/media_audio.h b/include/media_audio.h index 3f30c6b..2dcd046 100755 --- a/include/media_audio.h +++ b/include/media_audio.h @@ -27,7 +27,7 @@ extern "C" { /** * @file media_audio.h * @brief This file contains the audio metadata API and related functions to proceed with audio metadata. \n - * Description of the audio content involves: album, artist, album_artist, author, genre and description tags. \n + * Description of the audio content involves: album, artist, album_artist, genre and description tags. \n * Parameters of the recording are also supported such as format, bitrate, duration, size etc. */ @@ -362,39 +362,6 @@ int audio_meta_get_channel(audio_meta_h audio, int *channel); int audio_meta_get_duration(audio_meta_h audio, int *duration); /** - * @deprecated Deprecated since 4.0. Related setter functions are deprecated, therefore this function is not needed anymore. - * @brief Updates an audio metadata with modified attributes in the media database. - * @details The function updates the given audio meta in the media database. The function should be called after any change in audio attributes, to be updated to the media - * database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db(). - * - * @param[in] audio The handle to the audio metadata - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - */ -int audio_meta_update_to_db(audio_meta_h audio) TIZEN_DEPRECATED_API; - -/** *@} */ diff --git a/include/media_content_type.h b/include/media_content_type.h index 36cd9b3..bd6702c 100755 --- a/include/media_content_type.h +++ b/include/media_content_type.h @@ -30,7 +30,7 @@ extern "C" { * @brief This file contains API related to media-content enumerations for media data types, groups, orientations, \n * classes of errors and definitions of media-data. \n * Listed APIs are called when iterating over lists of album, group, bookmark and other media, \n - * when media items and burst shot are inserted completely and when notification of media DB change is subscribed. + * when media items are inserted completely and when notification of media DB change is subscribed. */ /** @@ -65,7 +65,6 @@ typedef enum { MEDIA_CONTENT_STORAGE_INTERNAL = 0, /**< The device's internal storage */ MEDIA_CONTENT_STORAGE_EXTERNAL = 1, /**< The device's external storage like sd card*/ MEDIA_CONTENT_STORAGE_EXTERNAL_USB = 2, /**< The external USB storage (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */ - MEDIA_CONTENT_STORAGE_CLOUD = 100, /**< The Cloud storage (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, Deprecated since 4.0) */ } media_content_storage_e; /** @@ -181,17 +180,8 @@ typedef enum { MEDIA_CONTENT_GROUP_LONGITUDE, /**< Media group ID for the longitude*/ MEDIA_CONTENT_GROUP_LATITUDE, /**< Media group ID for the latitude*/ MEDIA_CONTENT_GROUP_ALTITUDE, /**< Media group ID for the altitude*/ - MEDIA_CONTENT_GROUP_BURST_IMAGE, /**< Media group ID for the burst shot (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_RATING, /**< Media group ID for a rating*/ - MEDIA_CONTENT_GROUP_AUTHOR, /**< Media group ID for an author (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_PROVIDER, /**< Media group ID for a provider (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_CONTENT_NAME, /**< Media group ID for the content name (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_CATEGORY, /**< Media group ID for a category (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_LOCATION_TAG, /**< Media group ID for a location tag (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_AGE_RATING, /**< Media group ID for an age rating (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_KEYWORD, /**< Media group ID for a keyword (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_WEATHER, /**< Media group ID for the weather (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_MAX /**< Invalid media group ID*/ + MEDIA_CONTENT_GROUP_RATING = 20, /**< Media group ID for a rating*/ + MEDIA_CONTENT_GROUP_MAX = 29 /**< Invalid media group ID*/ } media_group_e; /** @@ -398,33 +388,6 @@ typedef void (*media_insert_completed_cb)(media_content_error_e error, void * us /** - * @deprecated Deprecated since 4.0. - * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE - * @brief Called when the burst shot is inserted completely. - * @details The following error codes can be received: \n - * #MEDIA_CONTENT_ERROR_NONE : Success \n - * #MEDIA_CONTENT_ERROR_INVALID_PARAMETER : Invalid parameter \n - * #MEDIA_CONTENT_ERROR_INVALID_OPERATION : Invalid operation \n - * #MEDIA_CONTENT_ERROR_PERMISSION_DENIED : Permission denied \n - * #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY : Out of memory \n - * #MEDIA_CONTENT_ERROR_DB_FAILED : DB Operation failed \n - * #MEDIA_CONTENT_ERROR_DB_BUSY : DB Operation busy \n - * #MEDIA_CONTENT_ERROR_NETWORK : Network fail \n - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The callback is called in a separate thread(not in the main loop). - * - * @param[in] error The error code - * @param[in] user_data The user data passed from the foreach function - * - * @pre media_info_insert_burst_shot_to_db() - * @see media_info_insert_burst_shot_to_db() - * - */ -typedef void (*media_insert_burst_shot_completed_cb)(media_content_error_e error, void * user_data); - - -/** * @deprecated Deprecated since 5.0. * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE * @brief Called when creating a thumbnail image. @@ -953,42 +916,6 @@ typedef bool (*media_face_cb)(media_face_h face, void *user_data); #define MEDIA_ORIENTATION "MEDIA_ORIENTATION" /** - * @deprecated Deprecated since 4.0. - * @brief Media burst ID. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_BURST_ID "BURST_ID" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media playedcount. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_PLAYED_COUNT "MEDIA_PLAYED_COUNT" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media last played time. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_LAST_PLAYED_TIME "MEDIA_LAST_PLAYED_TIME" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media last played position of file. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_LAST_PLAYED_POSITION "MEDIA_LAST_PLAYED_POSITION" - -/** * @brief Media rating. * @details You can use above define to set the condition of media filter and order keyword. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif @@ -1005,78 +932,6 @@ typedef bool (*media_face_cb)(media_face_h face, void *user_data); #define MEDIA_FAVOURITE "MEDIA_FAVOURITE" /** - * @deprecated Deprecated since 4.0. - * @brief Media author. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_AUTHOR "MEDIA_AUTHOR" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media provider. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_PROVIDER "MEDIA_PROVIDER" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media content name. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_CONTENT_NAME "MEDIA_CONTENT_NAME" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media category. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_CATEGORY "MEDIA_CATEGORY" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media location tag. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_LOCATION_TAG "MEDIA_LOCATION_TAG" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media age rating. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_AGE_RATING "MEDIA_AGE_RATING" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media keyword. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_KEYWORD "MEDIA_KEYWORD" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media weather. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_WEATHER "MEDIA_WEATHER" - -/** * @brief Is DRM. * @details There are 2 types:\n * 0-not drm, 1-drm\n @@ -1229,90 +1084,6 @@ typedef bool (*media_face_cb)(media_face_h face, void *user_data); #define MEDIA_DESCRIPTION_PINYIN "MEDIA_DESCRIPTION_PINYIN" /** - * @deprecated Deprecated since 4.0. - * @brief Media author pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_AUTHOR_PINYIN "MEDIA_AUTHOR_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media provider pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_PROVIDER_PINYIN "MEDIA_PROVIDER_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media content name pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_CONTENT_NAME_PINYIN "MEDIA_CONTENT_NAME_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media category pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_CATEGORY_PINYIN "MEDIA_CATEGORY_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media location tag pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_LOCATION_TAG_PINYIN "MEDIA_LOCATION_TAG_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media age rating pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_AGE_RATING_PINYIN "MEDIA_AGE_RATING_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media keyword pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_KEYWORD_PINYIN "MEDIA_KEYWORD_PINYIN" - -/** * @brief Virtual Reality content. * @details You can use above define to set the condition of media filter and order keyword. * @since_tizen 3.0 @@ -1342,14 +1113,6 @@ typedef bool (*media_face_cb)(media_face_h face, void *user_data); #define FOLDER_NAME "FOLDER_NAME" /** - * @deprecated Deprecated since 4.0. - * @brief Folder modified time. - * @details You can use above define to set the condition of folder filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ -#define FOLDER_MODIFIED_TIME "FOLDER_MODIFIED_TIME" - -/** * @deprecated Deprecated since 5.0. * @brief Folder storage. * @details There are 2 types:\n @@ -1370,22 +1133,6 @@ typedef bool (*media_face_cb)(media_face_h face, void *user_data); #define FOLDER_NAME_PINYIN "FOLDER_NAME_PINYIN" /** - * @deprecated Deprecated since 4.0. - * @brief Folder order info. - * @details You can use above define to set the condition of folder filter and order keyword. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - */ -#define FOLDER_ORDER "FOLDER_ORDER" - -/** - * @deprecated Deprecated since 4.0. - * @brief Parent folder id. - * @details You can use above define to set the condition of folder filter and order keyword. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - */ -#define FOLDER_PARENT_FOLDER_ID "FOLDER_PARENT_FOLDER_ID" - -/** * @brief Playlist name. * @details You can use above define to set the condition of playlist filter and order keyword. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif diff --git a/include/media_folder.h b/include/media_folder.h index 8622309..94adaf9 100755 --- a/include/media_folder.h +++ b/include/media_folder.h @@ -31,8 +31,7 @@ extern "C" { * @brief This file contains API related to all operations with media folder in DB. \n * These functions include getting the number of folders and media files filtered from DB, \n * iterating through media files and folders filtered in the given folder from DB; \n - * cloning and destroying the media folder, getting its name, ID, absolute path and date \n - * and updating the media folder to the media database. + * cloning and destroying the media folder, getting its name, ID, absolute path. */ /** @@ -220,24 +219,6 @@ int media_folder_destroy(media_folder_h folder); int media_folder_get_folder_id(media_folder_h folder, char **folder_id); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the parent folder ID. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @remarks The @a parent_folder_id should be released using free(). - * - * @param[in] folder The handle to the media folder - * @param[out] parent_folder_id The ID of the upper media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_folder_get_parent_folder_id(media_folder_h folder, char **parent_folder_id) TIZEN_DEPRECATED_API; - -/** * @brief Gets the absolute path to the media folder. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -275,22 +256,6 @@ int media_folder_get_path(media_folder_h folder, char **path); int media_folder_get_name(media_folder_h folder, char **folder_name); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the modified date of the folder. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] folder The handle to the media folder - * @param[out] date The modified date of the media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_folder_get_modified_time(media_folder_h folder, time_t *date) TIZEN_DEPRECATED_API; - -/** * @deprecated Deprecated since 5.0. Use storage_get_type_dev() instead. * @brief Gets the folder storage type. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif @@ -326,26 +291,6 @@ int media_folder_get_storage_type(media_folder_h folder, media_content_storage_e int media_folder_get_storage_id(media_folder_h folder, char **storage_id) TIZEN_DEPRECATED_API; /** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee order independence between applications. It is recommended that the viewing order is managed by the application. - * - * @brief Gets the folder viewing order. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @param[in] folder The handle to the media folder - * @param[out] order The viewing order of the media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_folder_update_to_db() - */ -int media_folder_get_order(media_folder_h folder, int *order) TIZEN_DEPRECATED_API; - -/** * @brief Gets the media folder from the media database. * * @details This function creates a new media folder handle from the media database by the given @a folder_id. @@ -375,79 +320,6 @@ int media_folder_get_order(media_folder_h folder, int *order) TIZEN_DEPRECATED_A int media_folder_get_folder_from_db(const char *folder_id, media_folder_h *folder); /** - * @deprecated Deprecated since 4.0. Use media_content_scan_folder() or media_info_move_to_db() instead. - * @brief Sets the folder name. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] folder The handle to the media folder - * @param[in] name The name of the media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - */ -int media_folder_set_name(media_folder_h folder, const char *name) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee order independence between applications. It is recommended that the viewing order is managed by the application. - * @brief Sets the folder viewing order. - * @details If you set the order value for each folder, you can sort in ascending or descending order as the set order values using the filter. \n - * Moreover, more detailed settings are possible when used with the filter. \n - * - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * @remarks If you don't set the order value, the order value will be set default value. Default is 0. \n - * If you don't use the filter, the set order value does not effect the folder viewing order. - * - * @param[in] folder The handle to the media folder - * @param[in] order The viewing order of the media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_folder_set_order(media_folder_h folder, int order) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Related setter functions are deprecated, therefore this function is not needed anymore. - * @brief Updates the media folder to the media database. - * - * @details The function updates the given media folder in the media database. The function should be called after any change in folder attributes, to be updated to the media - * database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @param[in] folder The handle to the media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - * @see media_folder_destroy() - */ -int media_folder_update_to_db(media_folder_h folder) TIZEN_DEPRECATED_API; - -/** * @} */ diff --git a/include/media_image.h b/include/media_image.h index bb3bd5e..6666edd 100755 --- a/include/media_image.h +++ b/include/media_image.h @@ -28,7 +28,7 @@ extern "C" { /** * @brief This file contains the image metadata API and related functions to proceed with them. * Functions include cloning and destroying the image metadata, getting image metadata such as width, height, \n - * orientation, date taken, title, burst shot id and updating image to DB. + * orientation, date taken, title. */ /** @@ -163,26 +163,6 @@ int image_meta_get_orientation(image_meta_h image, media_content_orientation_e * int image_meta_get_date_taken(image_meta_h image, char **date_taken); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the burst shot ID. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a burst_id should be released using free(). - * - * @param[in] image The handle to the image metadata - * @param[out] burst_id The ID of the burst shot\ n - * If @a burst_id is @c NULL, this is not burst shot - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int image_meta_get_burst_id(image_meta_h image, char **burst_id) TIZEN_DEPRECATED_API; - -/** * @brief Gets the exposure time from EXIF. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @@ -253,73 +233,6 @@ int image_meta_get_iso(image_meta_h image, int *iso); int image_meta_get_model(image_meta_h image, char **model); /** - * @deprecated Deprecated since 4.0. - * @brief Checks whether the media is a burst shot image. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] image The handle to the image metadata - * @param[out] is_burst_shot @c true if the media is a burst shot image, - * otherwise @c false if the media is not a burst shot image - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets an orientation of the image. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] image The handle to the image metadata - * @param[in] orientation The image orientation - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Related setter functions are deprecated, therefore this function is not needed anymore. - * @brief Updates the image to the media database. - * - * @details The function updates the given image meta in the media database. \n - * The function should be called after any change in image attributes, to be updated to the media database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db(). - * - * @param[in] image The handle to the image metadata - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - */ -int image_meta_update_to_db(image_meta_h image) TIZEN_DEPRECATED_API; - -/** * @} */ diff --git a/include/media_info.h b/include/media_info.h index ec2c0de..9b67dae 100755 --- a/include/media_info.h +++ b/include/media_info.h @@ -30,7 +30,7 @@ extern "C" { * @file media_info.h * @brief This file contains the media info function and related functions to proceed with it. \n * You can use the functions to insert, delete, count and get list of content files from media database. \n - * You can get properties of content file such as size, mime_type, modified_time etc. And you can set properties such as provider, favorite etc. \n + * You can get properties of content file such as size, mime_type, modified_time etc. And you can set properties such as favorite etc. \n * And you can get bookmark, face, tag info related the content file. */ @@ -132,49 +132,6 @@ int media_info_insert_to_db(const char *path, media_info_h *info); int media_info_insert_batch_to_db(const char **path_array, unsigned int array_length, media_insert_completed_cb callback, void *user_data); /** - * @deprecated Deprecated since 4.0. - * @brief Inserts the burst shot images into the media database, asynchronously. - * @details This function inserts burst images into the media database. - * media_insert_burst_shot_completed_cb() will be called when insertion to media database is finished. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write \n - * %http://tizen.org/privilege/mediastorage \n - * %http://tizen.org/privilege/externalstorage - * - * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n - * If you want to access only internal storage with this function, you should add privilege http://tizen.org/privilege/mediastorage. \n - * Or if you want to access only external storage with this function, you should add privilege http://tizen.org/privilege/externalstorage. \n - * If you can access both storage, you must add all privilege. \n - * Since 4.0, This function does not allow a symbolic link. \n - * - * @param[in] path_array The path array of the burst shot images to add - * @param[in] array_length The length of the array - * @param[in] callback The callback function to be invoked when the images are inserted completely - * @param[in] user_data The user data to be passed to the callback function - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - * @see media_insert_burst_shot_completed_cb() - */ -int media_info_insert_burst_shot_to_db(const char **path_array, unsigned int array_length, media_insert_burst_shot_completed_cb callback, void *user_data) TIZEN_DEPRECATED_API; - -/** * @deprecated Deprecated since 5.0. Use media_content_scan_file() instead. * @brief Deletes the media information from the media database. * @details This function only remove media information in the media database. \n @@ -206,36 +163,6 @@ int media_info_insert_burst_shot_to_db(const char **path_array, unsigned int arr */ int media_info_delete_from_db(const char *media_id) TIZEN_DEPRECATED_API; -/** - * @deprecated Deprecated since 4.0. - * @brief Deletes media information that meets the conditions of the filter from the media database. - * @details This function can delete multiple media information from the media database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @param[in] filter The handle to the media filter - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - * @see media_filter_create() - */ -int media_info_delete_batch_from_db(filter_h filter) TIZEN_DEPRECATED_API; - /** * @brief Destroys media info. @@ -263,8 +190,6 @@ int media_info_destroy(media_info_h media); * @brief Clones the media info handle. * * @details This function copies the media info handle from a source to the destination. - * There is no media_info_create() function. The media_info_h is created internally and - * available through media info foreach function such as media_info_foreach_media_from_db() or media_info_insert_to_db(). * To use this handle outside of these foreach functions, use this function. * * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif @@ -818,24 +743,6 @@ int media_info_get_latitude(media_info_h media, double* latitude); int media_info_get_altitude(media_info_h media, double* altitude); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the weather of content file. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks The @a weather should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] weather The weather of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_get_weather(media_info_h media, char **weather) TIZEN_DEPRECATED_API; - -/** * @brief Gets the rating of content file. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -869,65 +776,6 @@ int media_info_get_rating(media_info_h media, int *rating); int media_info_get_favorite(media_info_h media, bool* favorite); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the author of content file. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a author should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] author The author of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_get_author(media_info_h media, char **author) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Gets the provider of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a provider should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] provider The provider of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_provider(media_info_h media, char **provider) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Redundant, use media_info_get_display_name() instead. - * @brief Gets the content name of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a content_name should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] content_name The content name of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_content_name(media_info_h media, char **content_name) TIZEN_DEPRECATED_API; - -/** * @brief Gets the title of content file. * @details If the content file does not have a title, this method returns the filename without the extension. * @@ -948,86 +796,6 @@ int media_info_get_content_name(media_info_h media, char **content_name) TIZEN_D int media_info_get_title(media_info_h media, char **title); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the category of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a category should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] category The category of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_category(media_info_h media, char **category) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Gets the location tag of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a location_tag should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] location_tag The location of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_location_tag(media_info_h media, char **location_tag) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Gets the age_rating of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a age_rating should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] age_rating The age rating of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_age_rating(media_info_h media, char **age_rating) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Use media_tag_insert_to_db() instead. - * @brief Gets the keyword of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a keyword should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] keyword The keyword of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_keyword(media_info_h media, char **keyword) TIZEN_DEPRECATED_API; - -/** * @deprecated Deprecated since 5.0. * @brief Gets the storage id of content file. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif @@ -1095,42 +863,6 @@ int media_info_is_360_content(media_info_h media, bool *is_360); int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type) TIZEN_DEPRECATED_API; /** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee independence of the played count value between applications. It is recommended that the value is managed by the application. - * @brief Gets number which represents how many times given content has been played. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @param[in] media The handle to the media info - * @param[out] played_count The counter of content played - * - * @return 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_get_played_count(media_info_h media, int *played_count) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee independence of the played time value between applications. It is recommended that the value is managed by the application. - * @brief Gets the content's played time parameter. - * @details Function returns content's elapsed playback time parameter as period - * starting from the beginning of the track. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @param[in] media The handle to the media info - * @param[out] played_time The elapsed time of the content - * - * @return 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_get_played_time(media_info_h media, time_t *played_time) TIZEN_DEPRECATED_API; - -/** * @brief Gets the media info from the media database. * * @details This function creates a new media handle from the media database by the given @a media_id. @@ -1160,425 +892,72 @@ int media_info_get_played_time(media_info_h media, time_t *played_time) TIZEN_DE int media_info_get_media_from_db(const char *media_id, media_info_h *media); /** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee independence of the played count value between applications. It is recommended that the value is managed by the application. - * @brief Increments the played count to content meta handle. - * @details You can increase the played(opened) count of the content file. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif + * @brief Sets the favorite of media info. + * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n + * So, If you use it in order parameter, you can sort the order of the time was a favorite. \n + * Or, if you use it in condition parameter, you can get the result of the favorite media. + * + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * * @param[in] media The handle to the media info + * @param[in] favorite Set @c true to set the media info as favorite, + * otherwise set @c false to not set the media info as favorite * - * @return 0 on success, + * @return @c 0 on success, * otherwise a negative error value * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_NONE Successful * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() */ -int media_info_increase_played_count(media_info_h media) TIZEN_DEPRECATED_API; +int media_info_set_favorite(media_info_h media, bool favorite); /** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee independence of the played time value between applications. It is recommended that the value is managed by the application. - * @brief Sets the played time to content meta handle. - * @details You can set the latest played(opened) time of the content file. the latest played time to be set the current time on the system. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @param[in] media The handle to the media info - * - * @return 0 on success, - * otherwise a negative error value + * @brief Updates the media info to the media database. * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @details The function updates the given media info in the media database. * - * @post media_info_update_to_db() - */ -int media_info_set_played_time(media_info_h media) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Redundant, use media_info_move_to_db() instead. - * @brief Sets the file name including the extension of the content file. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/content.write + * + * @remarks The function should be called after any change in media, to be updated to the media + * database. For example, after using media_info_set_favorite() + * for setting the name of the media, the media_info_update_to_db() function should be called so as to update + * the given media info attributes in the media database. * * @param[in] media The handle to the media info - * @param[in] display_name The file name including the extension of the content file. * * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation + * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed + * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy + * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail + * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied * - * @post media_info_update_to_db(). + * @pre This function requires opened connection to content service by media_content_connect(). * + * @see media_content_connect() + * @see media_info_set_favorite() */ -int media_info_set_display_name(media_info_h media, const char *display_name) TIZEN_DEPRECATED_API; +int media_info_update_to_db(media_info_h media); /** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the description of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @brief Moves the media info to the given destination path in the media database. + * @details After moving or renaming a file in the filesystem, call this function to update the database. \n + * If the source path and destination path are the same, then this function does nothing. + * If you want to refresh media information, you should use media_content_scan_file() function. * - * @param[in] media The handle to the media info - * @param[in] description The description of the media info + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - * - */ -int media_info_set_description(media_info_h media, const char *description) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the longitude of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] longitude The longitude of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - */ -int media_info_set_longitude(media_info_h media, double longitude) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the latitude of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] latitude The latitude of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - */ -int media_info_set_latitude(media_info_h media, double latitude) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the altitude of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] altitude The altitude of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - */ -int media_info_set_altitude(media_info_h media, double altitude) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the weather of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] weather The weather of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - * - */ -int media_info_set_weather(media_info_h media, const char *weather) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the rating of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] rating The rating of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - */ -int media_info_set_rating(media_info_h media, int rating) TIZEN_DEPRECATED_API; - -/** - * @brief Sets the favorite of media info. - * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n - * So, If you use it in order parameter, you can sort the order of the time was a favorite. \n - * Or, if you use it in condition parameter, you can get the result of the favorite media. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] favorite Set @c true to set the media info as favorite, - * otherwise set @c false to not set the media info as favorite - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_favorite(media_info_h media, bool favorite); - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the author of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] author The author of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_author(media_info_h media, const char *author) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the provider of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] provider The provider of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_provider(media_info_h media, const char *provider) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Redundant, use media_info_move_to_db() instead. - * @brief Sets the content name of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] content_name The content name of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_content_name(media_info_h media, const char *content_name) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the category of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] category The category of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_category(media_info_h media, const char *category) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the location tag of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] location_tag The location of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_location_tag(media_info_h media, const char *location_tag) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the age rating of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] age_rating The age rating of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_age_rating(media_info_h media, const char *age_rating) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Use media_tag_insert_to_db() instead. - * @brief Sets the keyword of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] keyword The keyword of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_keyword(media_info_h media, const char *keyword) TIZEN_DEPRECATED_API; - -/** - * @brief Updates the media info to the media database. - * - * @details The function updates the given media info in the media database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @remarks The function should be called after any change in media, to be updated to the media - * database. For example, after using media_info_set_favorite() - * for setting the name of the media, the media_info_update_to_db() function should be called so as to update - * the given media info attributes in the media database. - * - * @param[in] media The handle to the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - * @see media_info_set_favorite() - */ -int media_info_update_to_db(media_info_h media); - -/** - * @deprecated Deprecated since 4.0. Use media_content_scan_file() instead. - * @brief Refreshes the media metadata to the media database. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write \n - * %http://tizen.org/privilege/mediastorage \n - * %http://tizen.org/privilege/externalstorage - * - * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n - * If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n - * Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n - * If you can access both storage, you should add all privilege. - * - * @param[in] media_id The media ID - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - */ -int media_info_refresh_metadata_to_db(const char *media_id) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the added time of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] added_time The added time of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_added_time(media_info_h media, time_t added_time) TIZEN_DEPRECATED_API; - -/** - * @brief Moves the media info to the given destination path in the media database. - * @details After moving or renaming a file in the filesystem, call this function to update the database. \n - * If the source path and destination path are the same, then this function does nothing. - * If you want to refresh media information, you should use media_content_scan_file() function. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write \n - * %http://tizen.org/privilege/mediastorage \n - * %http://tizen.org/privilege/externalstorage + * @privlevel public + * @privilege %http://tizen.org/privilege/content.write \n + * %http://tizen.org/privilege/mediastorage \n + * %http://tizen.org/privilege/externalstorage * * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n * If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n @@ -1783,144 +1162,6 @@ int media_info_start_face_detection(media_info_h media, media_face_detection_com int media_info_cancel_face_detection(media_info_h media); /** - * @deprecated Deprecated since 4.0. Use media_info_insert_to_db() instead. - * @brief Creates the media info handle. - * @details If the information about the file that is already known, you can use this function to generate empty handler. - * @since_tizen 3.0 - * - * - * @privilege %http://tizen.org/privilege/mediastorage \n - * %http://tizen.org/privilege/externalstorage - * - * @remarks The @a media should be released using media_info_destroy(). - * @remarks If you want to access only internal storage with this function, you should add privilege http://tizen.org/privilege/mediastorage. \n - * Or if you want to access only external storage with this function, you should add privilege http://tizen.org/privilege/externalstorage. \n - * If you can access both storage, you must add all privilege. - * - * @param[in] path The path to create the media info handle - * @param[out] media The handle to the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * - * @see media_info_destroy() - */ -int media_info_create(const char *path, media_info_h *media) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Use media_info_insert_to_db() instead. - * @brief Inserts media info to database with media info data. - * @since_tizen 3.0 - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @remarks The @a media should be released using media_info_destroy(). - * - * @param[in] media The handle to the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - */ -int media_info_insert_to_db_with_data(media_info_h media) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets the title of media info handle. - * @since_tizen 3.0 - * - * @param[in] media The handle to the media info - * @param[in] title The title of media info handle - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_title(media_info_h media, const char *title) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets the album of media info handle. - * @since_tizen 3.0 - * - * @param[in] media The handle to the media info - * @param[in] album The album of the media - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_album(media_info_h media, const char *album) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets the artist of media info handle. - * @since_tizen 3.0 - * - * @param[in] media The handle to the media info - * @param[in] artist The artist of media info handle - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_artist(media_info_h media, const char *artist) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets the genre of media info handle. - * @since_tizen 3.0 - * - * @param[in] media The handle to the media info - * @param[in] genre The genre of media info handle - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_genre(media_info_h media, const char *genre) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets the recorded date of media info handle. - * @since_tizen 3.0 - * - * @param[in] media The handle to the media info - * @param[in] recorded_date The recorded date of media info handle - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_recorded_date(media_info_h media, const char *recorded_date) TIZEN_DEPRECATED_API; - -/** * @} */ diff --git a/include/media_info_private.h b/include/media_info_private.h index c7b42b6..0812ebb 100755 --- a/include/media_info_private.h +++ b/include/media_info_private.h @@ -48,7 +48,7 @@ extern "C" { * * @file media_info_private.h * @brief This file contains the media info API and related structure and enumeration. \n -* Description of the audio, video,image content involves: album, artist, album_artist, author, genre and description tags. \n +* Description of the audio, video,image content involves: album, artist, album_artist, genre and description tags. \n * Parameters of the recording are also supported, as: format, bitrate, duration, size etc. \n * Defenitions of media DB fields and tables, operations with media data relating to DB and handling with media filter attributes. */ @@ -89,13 +89,6 @@ typedef enum { MEDIA_INFO_DESCRIPTION, MEDIA_INFO_RATING, MEDIA_INFO_FAVOURITE, - MEDIA_INFO_AUTHOR, - MEDIA_INFO_PROVIDER, - MEDIA_INFO_CONTENT_NAME, - MEDIA_INFO_CATEGORY, - MEDIA_INFO_LOCATION_TAG, - MEDIA_INFO_AGE_RATING, - MEDIA_INFO_KEYWORD, MEDIA_INFO_IS_DRM, MEDIA_INFO_STORAGE_TYPE, MEDIA_INFO_LONGITUDE, @@ -122,14 +115,9 @@ typedef enum { MEDIA_INFO_BITRATE, MEDIA_INFO_BITPERSAMPLE, MEDIA_INFO_DURATION, - MEDIA_INFO_PLAYED_COUNT, - MEDIA_INFO_LAST_PLAYED_TIME, - MEDIA_INFO_LAST_PLAYED_POSITION, MEDIA_INFO_SAMPLERATE, MEDIA_INFO_CHANNEL, - MEDIA_INFO_BURST_ID, MEDIA_INFO_TIMELINE, - MEDIA_INFO_WEATHER, MEDIA_INFO_SYNC_STATUS, MEDIA_INFO_STORAGE_UUID, MEDIA_INFO_IS_360, @@ -170,11 +158,6 @@ typedef enum { MEDIA_GROUP_FACE_BY_MEDIA_ID, } group_list_e; -typedef enum { - MEDIA_BATCH_INSERT_NORMAL, - MEDIA_BATCH_INSERT_BURSTSHOT, -} media_batch_insert_e; - typedef struct _filter_s { char *storage_id; char *condition; @@ -192,10 +175,8 @@ typedef struct { char *folder_id; char *path; char *name; - time_t modified_time; media_content_storage_e storage_type; char *storage_uuid; - int folder_order; } media_folder_s; typedef struct { @@ -232,7 +213,6 @@ typedef struct { int height; char *date_taken; char *title; - char *burst_id; char *exposure_time; double fnumber; int iso; @@ -293,22 +273,11 @@ typedef struct { double longitude; double latitude; double altitude; - char *weather; int rating; time_t favourite; char *title; - char *author; - char *provider; - char *content_name; - char *category; - char *location_tag; - char *age_rating; - char *keyword; int is_drm; int storage_type; - int played_count; - time_t played_time; - int played_position; char *storage_uuid; int sync_status; unsigned int request_id; @@ -447,20 +416,8 @@ typedef struct _media_content_cb_data { #define DB_FIELD_MEDIA_HEIGHT "height" #define DB_FIELD_MEDIA_DATETAKEN "datetaken" #define DB_FIELD_MEDIA_ORIENTATION "orientation" -#define DB_FIELD_MEDIA_BURST_ID "burst_id" -#define DB_FIELD_MEDIA_PLAYED_COUNT "played_count" -#define DB_FIELD_MEDIA_LAST_PLAYED_TIME "last_played_time" -#define DB_FIELD_MEDIA_LAST_PLAYED_POSITION "last_played_position" #define DB_FIELD_MEDIA_RATING "rating" #define DB_FIELD_MEDIA_FAVOURITE "favourite" -#define DB_FIELD_MEDIA_AUTHOR "author" -#define DB_FIELD_MEDIA_PROVIDER "provider" -#define DB_FIELD_MEDIA_CONTENT_NAME "content_name" -#define DB_FIELD_MEDIA_CATEGORY "category" -#define DB_FIELD_MEDIA_LOCATION_TAG "location_tag" -#define DB_FIELD_MEDIA_AGE_RATING "age_rating" -#define DB_FIELD_MEDIA_KEYWORD "keyword" -#define DB_FIELD_MEDIA_WEATHER "weather" #define DB_FIELD_MEDIA_IS_DRM "is_drm" #define DB_FIELD_MEDIA_STORAGE_TYPE "storage_type" @@ -473,23 +430,14 @@ typedef struct _media_content_cb_data { #define DB_FIELD_MEDIA_COMPOSER_PINYIN "composer_pinyin" #define DB_FIELD_MEDIA_COPYRIGHT_PINYIN "copyright_pinyin" #define DB_FIELD_MEDIA_DESCRIPTION_PINYIN "description_pinyin" -#define DB_FIELD_MEDIA_AUTHOR_PINYIN "author_pinyin" -#define DB_FIELD_MEDIA_PROVIDER_PINYIN "provider_pinyin" -#define DB_FIELD_MEDIA_CONTENT_NAME_PINYIN "content_name_pinyin" -#define DB_FIELD_MEDIA_CATEGORY_PINYIN "category_pinyin" -#define DB_FIELD_MEDIA_LOCATION_TAG_PINYIN "location_tag_pinyin" -#define DB_FIELD_MEDIA_AGE_RATING_PINYIN "age_rating_pinyin" -#define DB_FIELD_MEDIA_KEYWORD_PINYIN "keyword_pinyin" #define DB_FIELD_MEDIA_360 "is_360" /* DB field for folder */ #define DB_FIELD_FOLDER_ID "folder_uuid" #define DB_FIELD_FOLDER_PATH "path" #define DB_FIELD_FOLDER_NAME "name" -#define DB_FIELD_FOLDER_MODIFIED_TIME "modified_time" #define DB_FIELD_FOLDER_STORAGE_TYPE "storage_type" #define DB_FIELD_FOLDER_NAME_PINYIN "name_pinyin" -#define DB_FIELD_FOLDER_ORDER "folder_order" /* DB field for playlist */ #define DB_FIELD_PLAYLIST_ID "playlist_id" @@ -536,7 +484,7 @@ typedef struct _media_content_cb_data { #define SELECT_ALBUM_LIST "SELECT DISTINCT a.album_id, a.name, a.artist, a.album_art FROM "ALBUM_MEDIA_JOIN #define SELECT_MEDIA_GROUP_LIST "SELECT DISTINCT %s FROM '%s' WHERE validity=1 " -#define SELECT_FOLDER_LIST "SELECT DISTINCT f.folder_uuid, f.path, f.name, f.storage_type, f.modified_time, f.storage_uuid, f.folder_order FROM "FOLDER_MEDIA_JOIN +#define SELECT_FOLDER_LIST "SELECT DISTINCT f.folder_uuid, f.path, f.name, f.storage_type, f.storage_uuid FROM "FOLDER_MEDIA_JOIN #define SELECT_FOLDER_LIST_BY_STORAGE_ID SELECT_FOLDER_LIST"AND f.storage_uuid='%s' " #define SELECT_TAG_LIST "SELECT DISTINCT tag_id, name FROM "DB_VIEW_TAG" WHERE 1 " #define SELECT_PLAYLIST_LIST "SELECT DISTINCT playlist_id, name, p_thumbnail_path FROM "DB_VIEW_PLAYLIST" WHERE 1 " @@ -564,7 +512,7 @@ typedef struct _media_content_cb_data { /* Get Group Info by Group ID*/ #define SELECT_ALBUM_FROM_ALBUM "SELECT * FROM "DB_TABLE_ALBUM" WHERE album_id=%d" -#define SELECT_FOLDER_FROM_FOLDER "SELECT * FROM "DB_TABLE_FOLDER" WHERE folder_uuid='%s'" +#define SELECT_FOLDER_FROM_FOLDER "SELECT folder_uuid, path, name, storage_type, storage_uuid FROM "DB_TABLE_FOLDER" WHERE folder_uuid='%s'" #define SELECT_PLAYLIST_FROM_PLAYLIST "SELECT * FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d" #define SELECT_TAG_FROM_TAG "SELECT * FROM "DB_TABLE_TAG" WHERE tag_id=%d" #define SELECT_TAG_BY_NAME "SELECT * FROM "DB_TABLE_TAG" WHERE name='%q'" @@ -578,11 +526,7 @@ typedef struct _media_content_cb_data { /* Get Media list of Group */ #define MEDIA_INFO_ITEM "media_uuid, path, file_name, media_type, mime_type, size, added_time, modified_time, thumbnail_path, description, \ - rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status, storage_uuid, is_360" - -/*Folder info*/ -#define UPDATE_FOLDER_ORDER "UPDATE "DB_TABLE_FOLDER" SET folder_order=%d WHERE folder_uuid=%Q" -#define SELECT_FOLDER_ID_BY_PATH "SELECT folder_uuid FROM "DB_TABLE_FOLDER" WHERE path = '%s'" + rating, favourite, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, samplerate, channel, timeline, sync_status, storage_uuid, is_360" /* Playlist Info */ #define INSERT_PLAYLIST_TO_PLAYLIST "INSERT INTO "DB_TABLE_PLAYLIST" (name) VALUES (%Q)" @@ -604,9 +548,6 @@ typedef struct _media_content_cb_data { #define UPDATE_BOOKMARK_FROM_BOOKMARK "UPDATE "DB_TABLE_BOOKMARK" SET name=%Q WHERE bookmark_id=%d;" -/* Update Meta*/ -#define UPDATE_IMAGE_META_FROM_MEDIA "UPDATE '%s' SET orientation=%d WHERE media_uuid='%q'" - #define SELECT_MEDIA_ITEM "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1" #define SELECT_MEDIA_FROM_MEDIA "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND media_uuid='%s'" #define SELECT_MEDIA_BY_PATH "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND path='%q'" @@ -621,15 +562,10 @@ typedef struct _media_content_cb_data { #define SELECT_MEDIA_STORAGE_ID_BY_ID "SELECT storage_uuid FROM "DB_VIEW_MEDIA" WHERE media_uuid='%q'" /* Delete */ -#define DELETE_MEDIA_FROM_MEDIA_BATCH "DELETE FROM '%s' WHERE %s AND storage_type = %d" #define DELETE_PLAYLIST_FROM_PLAYLIST "DELETE FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d" #define DELETE_TAG_FROM_TAG "DELETE FROM "DB_TABLE_TAG" WHERE tag_id=%d" #define DELETE_BOOKMARK_FROM_BOOKMARK "DELETE FROM "DB_TABLE_BOOKMARK" WHERE bookmark_id=%d" -/*For batch remove*/ -#define SELECT_STORAGE_BY_FILTER "SELECT DISTINCT storage_uuid, storage_type FROM "DB_VIEW_MEDIA" WHERE %s" -#define SELECT_THUMBNAIL_BY_FILTER "SELECT DISTINCT thumbnail_path FROM '%s' WHERE %s AND storage_type = %d" - /* Storage*/ #define SELECT_STORAGE_COUNT "SELECT COUNT(*) FROM "DB_TABLE_STORAGE" WHERE validity=1" #define SELECT_STORAGE_LIST "SELECT storage_uuid, storage_path, storage_type FROM "DB_TABLE_STORAGE" WHERE validity=1" diff --git a/include/media_storage.h b/include/media_storage.h index 3a2a52f..51c26f5 100755 --- a/include/media_storage.h +++ b/include/media_storage.h @@ -250,26 +250,6 @@ int media_storage_clone(media_storage_h *dst, media_storage_h src) TIZEN_DEPRECA int media_storage_get_id(media_storage_h storage, char **storage_id) TIZEN_DEPRECATED_API; /** - * @deprecated Deprecated since 4.0. - * @brief Gets the storage name of media storage. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @remarks The @a storage_name should be released using free(). - * If the requested storage is not the cloud storage, this function returns NULL. - * - * @param[in] storage The media storage handle - * @param[out] storage_name The storage name of the media storage - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - */ -int media_storage_get_name(media_storage_h storage, char **storage_name) TIZEN_DEPRECATED_API; - -/** * @deprecated Deprecated since 5.0. Use @ref CAPI_SYSTEM_STORAGE_MODULE instead. * @brief Gets the storage path of media storage. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif diff --git a/include/media_video.h b/include/media_video.h index 6930747..7883094 100755 --- a/include/media_video.h +++ b/include/media_video.h @@ -28,7 +28,7 @@ extern "C" { * @file media_video.h * @brief This file contains the video metadata API and related functions to proceed with video metadata. \n * Functions include cloning and destroying video metadata, getting video metadata such as width, height, \n - * album, genre, played parameters etc. and updating video to DB. + * album, genre, etc. */ /** @@ -363,39 +363,6 @@ int video_meta_get_height(video_meta_h video, int *height); int video_meta_get_rotation(video_meta_h video, int *rotation); /** - * @deprecated Deprecated since 4.0. Related setter functions are deprecated, therefore this function is not needed anymore. - * @brief Updates an video metadata with modified attributes in the media database. - * @details The function updates the given video meta in the media database. The function should be called after any change in video attributes, to be updated to the media - * database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db(). - * - * @param[in] video The handle to the video metadata - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - */ -int video_meta_update_to_db(video_meta_h video) TIZEN_DEPRECATED_API; - -/** *@} */ diff --git a/include_product/media_audio.h b/include_product/media_audio.h index 3f30c6b..2dcd046 100755 --- a/include_product/media_audio.h +++ b/include_product/media_audio.h @@ -27,7 +27,7 @@ extern "C" { /** * @file media_audio.h * @brief This file contains the audio metadata API and related functions to proceed with audio metadata. \n - * Description of the audio content involves: album, artist, album_artist, author, genre and description tags. \n + * Description of the audio content involves: album, artist, album_artist, genre and description tags. \n * Parameters of the recording are also supported such as format, bitrate, duration, size etc. */ @@ -362,39 +362,6 @@ int audio_meta_get_channel(audio_meta_h audio, int *channel); int audio_meta_get_duration(audio_meta_h audio, int *duration); /** - * @deprecated Deprecated since 4.0. Related setter functions are deprecated, therefore this function is not needed anymore. - * @brief Updates an audio metadata with modified attributes in the media database. - * @details The function updates the given audio meta in the media database. The function should be called after any change in audio attributes, to be updated to the media - * database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db(). - * - * @param[in] audio The handle to the audio metadata - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - */ -int audio_meta_update_to_db(audio_meta_h audio) TIZEN_DEPRECATED_API; - -/** *@} */ diff --git a/include_product/media_content_product.h b/include_product/media_content_product.h index 246dd48..4278699 100755 --- a/include_product/media_content_product.h +++ b/include_product/media_content_product.h @@ -80,6 +80,17 @@ int media_info_get_played_position(media_info_h media, int *played_position); int media_info_get_modified_month(media_info_h media, char **modified_month); /** + * @brief Gets the played count to content meta handle. + * + * @param[in] media The handle to media info + * @param[out] played_count The played count of content + * @return 0 on success, otherwise a negative error value. + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + */ +int media_info_get_played_count(media_info_h media, int *played_count); + +/** * @brief Sets the played count to content meta handle. * * @param[in] media The handle to media info @@ -102,6 +113,40 @@ int media_info_set_played_count(media_info_h media, int played_count); * @post media_info_update_to_db() */ int media_info_set_played_position(media_info_h media, int played_position); + +/** + * @brief Gets the content's played time parameter. + * @details Function returns content's elapsed playback time parameter as period + * starting from the beginning of the track. + * + * @param[in] media The handle to the media info + * @param[out] played_time The elapsed time of the content + * + * @return 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + */ +int media_info_get_played_time(media_info_h media, time_t *played_time); + +/** + * @brief Sets the played time to content meta handle. + * @details You can set the latest played(opened) time of the content file. the latest played time to be set the current time on the system. + * + * @param[in] media The handle to the media info + * + * @return 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * + * @post media_info_update_to_db() + */ +int media_info_set_played_time(media_info_h media); + + int media_info_get_media_info_by_path_from_db(const char* path, media_info_h* media); #ifdef _USE_SENIOR_MODE int media_info_insert_to_db_with_contact_data(const char *path, const char* contact, const char* app_data, media_info_h *info); diff --git a/include_product/media_content_type.h b/include_product/media_content_type.h index 13c0ce4..25e4179 100755 --- a/include_product/media_content_type.h +++ b/include_product/media_content_type.h @@ -36,7 +36,7 @@ extern "C" { * @brief This file contains API related to media-content enumerations for media data types, groups, orientations, \n * classes of errors and definitions of media-data. \n * Listed APIs are called when iterating over lists of album, group, bookmark and other media, \n - * when media items and burst shot are inserted completely and when notification of media DB change is subscribed. + * when media items are inserted completely and when notification of media DB change is subscribed. */ /** @@ -74,7 +74,6 @@ typedef enum { MEDIA_CONTENT_STORAGE_INTERNAL = 0, /**< The device's internal storage */ MEDIA_CONTENT_STORAGE_EXTERNAL = 1, /**< The device's external storage like sd card*/ MEDIA_CONTENT_STORAGE_EXTERNAL_USB = 2, /**< The external USB storage (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */ - MEDIA_CONTENT_STORAGE_CLOUD = 100, /**< The Cloud storage (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif, Deprecated since 4.0) */ } media_content_storage_e; /** @@ -190,17 +189,8 @@ typedef enum { MEDIA_CONTENT_GROUP_LONGITUDE, /**< Media group ID for the longitude*/ MEDIA_CONTENT_GROUP_LATITUDE, /**< Media group ID for the latitude*/ MEDIA_CONTENT_GROUP_ALTITUDE, /**< Media group ID for the altitude*/ - MEDIA_CONTENT_GROUP_BURST_IMAGE, /**< Media group ID for the burst shot (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_RATING, /**< Media group ID for a rating*/ - MEDIA_CONTENT_GROUP_AUTHOR, /**< Media group ID for an author (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_PROVIDER, /**< Media group ID for a provider (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_CONTENT_NAME, /**< Media group ID for the content name (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_CATEGORY, /**< Media group ID for a category (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_LOCATION_TAG, /**< Media group ID for a location tag (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_AGE_RATING, /**< Media group ID for an age rating (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_KEYWORD, /**< Media group ID for a keyword (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_WEATHER, /**< Media group ID for the weather (Deprecated since 4.0)*/ - MEDIA_CONTENT_GROUP_MODIFIED_MONTH, /**< Media group ID for the modified time*/ + MEDIA_CONTENT_GROUP_RATING = 20, /**< Media group ID for a rating*/ + MEDIA_CONTENT_GROUP_MODIFIED_MONTH = 29, /**< Media group ID for the modified time*/ MEDIA_CONTENT_GROUP_MODIFIED_DATE, /**< Media group ID for the modified date*/ #ifdef _USE_SENIOR_MODE MEDIA_CONTENT_GROUP_CONTACT, @@ -464,33 +454,6 @@ typedef void (*media_insert_completed_cb)(media_content_error_e error, void * us /** - * @deprecated Deprecated since 4.0. - * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE - * @brief Called when the burst shot is inserted completely. - * @details The following error codes can be received: \n - * #MEDIA_CONTENT_ERROR_NONE : Success \n - * #MEDIA_CONTENT_ERROR_INVALID_PARAMETER : Invalid parameter \n - * #MEDIA_CONTENT_ERROR_INVALID_OPERATION : Invalid operation \n - * #MEDIA_CONTENT_ERROR_PERMISSION_DENIED : Permission denied \n - * #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY : Out of memory \n - * #MEDIA_CONTENT_ERROR_DB_FAILED : DB Operation failed \n - * #MEDIA_CONTENT_ERROR_DB_BUSY : DB Operation busy \n - * #MEDIA_CONTENT_ERROR_NETWORK : Network fail \n - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The callback is called in a separate thread(not in the main loop). - * - * @param[in] error The error code - * @param[in] user_data The user data passed from the foreach function - * - * @pre media_info_insert_burst_shot_to_db() - * @see media_info_insert_burst_shot_to_db() - * - */ -typedef void (*media_insert_burst_shot_completed_cb)(media_content_error_e error, void * user_data); - - -/** * @deprecated Deprecated since 5.0. * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE * @brief Called when creating a thumbnail image. @@ -1019,42 +982,6 @@ typedef bool (*media_face_cb)(media_face_h face, void *user_data); #define MEDIA_ORIENTATION "MEDIA_ORIENTATION" /** - * @deprecated Deprecated since 4.0. - * @brief Media burst ID. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_BURST_ID "BURST_ID" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media playedcount. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_PLAYED_COUNT "MEDIA_PLAYED_COUNT" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media last played time. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_LAST_PLAYED_TIME "MEDIA_LAST_PLAYED_TIME" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media last played position of file. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_LAST_PLAYED_POSITION "MEDIA_LAST_PLAYED_POSITION" - -/** * @brief Media rating. * @details You can use above define to set the condition of media filter and order keyword. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif @@ -1071,78 +998,6 @@ typedef bool (*media_face_cb)(media_face_h face, void *user_data); #define MEDIA_FAVOURITE "MEDIA_FAVOURITE" /** - * @deprecated Deprecated since 4.0. - * @brief Media author. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_AUTHOR "MEDIA_AUTHOR" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media provider. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_PROVIDER "MEDIA_PROVIDER" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media content name. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_CONTENT_NAME "MEDIA_CONTENT_NAME" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media category. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_CATEGORY "MEDIA_CATEGORY" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media location tag. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_LOCATION_TAG "MEDIA_LOCATION_TAG" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media age rating. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_AGE_RATING "MEDIA_AGE_RATING" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media keyword. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_KEYWORD "MEDIA_KEYWORD" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media weather. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - */ -#define MEDIA_WEATHER "MEDIA_WEATHER" - -/** * @brief Is DRM. * @details There are 2 types:\n * 0-not drm, 1-drm\n @@ -1295,90 +1150,6 @@ typedef bool (*media_face_cb)(media_face_h face, void *user_data); #define MEDIA_DESCRIPTION_PINYIN "MEDIA_DESCRIPTION_PINYIN" /** - * @deprecated Deprecated since 4.0. - * @brief Media author pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_AUTHOR_PINYIN "MEDIA_AUTHOR_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media provider pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_PROVIDER_PINYIN "MEDIA_PROVIDER_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media content name pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_CONTENT_NAME_PINYIN "MEDIA_CONTENT_NAME_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media category pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_CATEGORY_PINYIN "MEDIA_CATEGORY_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media location tag pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_LOCATION_TAG_PINYIN "MEDIA_LOCATION_TAG_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media age rating pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_AGE_RATING_PINYIN "MEDIA_AGE_RATING_PINYIN" - -/** - * @deprecated Deprecated since 4.0. - * @brief Media keyword pinyin. - * @details You can use above define to set the condition of media filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks Since 4.0, this keyword is related to the following feature:\n - * - %http://tizen.org/feature/content.filter.pinyin\n - * If this feature is not supported on the device, PINYIN search does not work. - * - */ -#define MEDIA_KEYWORD_PINYIN "MEDIA_KEYWORD_PINYIN" - -/** * @brief Virtual Reality content. * @details You can use above define to set the condition of media filter and order keyword. * @since_tizen 3.0 @@ -1408,14 +1179,6 @@ typedef bool (*media_face_cb)(media_face_h face, void *user_data); #define FOLDER_NAME "FOLDER_NAME" /** - * @deprecated Deprecated since 4.0. - * @brief Folder modified time. - * @details You can use above define to set the condition of folder filter and order keyword. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - */ -#define FOLDER_MODIFIED_TIME "FOLDER_MODIFIED_TIME" - -/** * @deprecated Deprecated since 5.0. * @brief Folder storage. * @details There are 2 types:\n @@ -1436,22 +1199,6 @@ typedef bool (*media_face_cb)(media_face_h face, void *user_data); #define FOLDER_NAME_PINYIN "FOLDER_NAME_PINYIN" /** - * @deprecated Deprecated since 4.0. - * @brief Folder order info. - * @details You can use above define to set the condition of folder filter and order keyword. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - */ -#define FOLDER_ORDER "FOLDER_ORDER" - -/** - * @deprecated Deprecated since 4.0. - * @brief Parent folder id. - * @details You can use above define to set the condition of folder filter and order keyword. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - */ -#define FOLDER_PARENT_FOLDER_ID "FOLDER_PARENT_FOLDER_ID" - -/** * @brief Playlist name. * @details You can use above define to set the condition of playlist filter and order keyword. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif diff --git a/include_product/media_content_type_product.h b/include_product/media_content_type_product.h index 118eca7..e4a54fc 100755 --- a/include_product/media_content_type_product.h +++ b/include_product/media_content_type_product.h @@ -84,6 +84,10 @@ typedef void *media_uhd_h; typedef bool (*media_pvr_cb)(media_pvr_h pvr, void *user_data); typedef bool (*media_uhd_cb)(media_uhd_h uhd, void *user_data); +#define MEDIA_PLAYED_COUNT "MEDIA_PLAYED_COUNT" +#define MEDIA_LAST_PLAYED_TIME "MEDIA_LAST_PLAYED_TIME" +#define MEDIA_LAST_PLAYED_POSITION "MEDIA_LAST_PLAYED_POSITION" + #define MEDIA_FOLDER_ID "MEDIA_FOLDER_ID" /**< Media folder ID */ #define MEDIA_MODIFIED_MONTH "MEDIA_MODIFIED_MONTH" /**< media modified month */ #define MEDIA_MODIFIED_DATE "MEDIA_MODIFIED_DATE" /**< media modified date */ diff --git a/include_product/media_folder.h b/include_product/media_folder.h index 8622309..94adaf9 100755 --- a/include_product/media_folder.h +++ b/include_product/media_folder.h @@ -31,8 +31,7 @@ extern "C" { * @brief This file contains API related to all operations with media folder in DB. \n * These functions include getting the number of folders and media files filtered from DB, \n * iterating through media files and folders filtered in the given folder from DB; \n - * cloning and destroying the media folder, getting its name, ID, absolute path and date \n - * and updating the media folder to the media database. + * cloning and destroying the media folder, getting its name, ID, absolute path. */ /** @@ -220,24 +219,6 @@ int media_folder_destroy(media_folder_h folder); int media_folder_get_folder_id(media_folder_h folder, char **folder_id); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the parent folder ID. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @remarks The @a parent_folder_id should be released using free(). - * - * @param[in] folder The handle to the media folder - * @param[out] parent_folder_id The ID of the upper media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_folder_get_parent_folder_id(media_folder_h folder, char **parent_folder_id) TIZEN_DEPRECATED_API; - -/** * @brief Gets the absolute path to the media folder. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -275,22 +256,6 @@ int media_folder_get_path(media_folder_h folder, char **path); int media_folder_get_name(media_folder_h folder, char **folder_name); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the modified date of the folder. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] folder The handle to the media folder - * @param[out] date The modified date of the media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_folder_get_modified_time(media_folder_h folder, time_t *date) TIZEN_DEPRECATED_API; - -/** * @deprecated Deprecated since 5.0. Use storage_get_type_dev() instead. * @brief Gets the folder storage type. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif @@ -326,26 +291,6 @@ int media_folder_get_storage_type(media_folder_h folder, media_content_storage_e int media_folder_get_storage_id(media_folder_h folder, char **storage_id) TIZEN_DEPRECATED_API; /** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee order independence between applications. It is recommended that the viewing order is managed by the application. - * - * @brief Gets the folder viewing order. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @param[in] folder The handle to the media folder - * @param[out] order The viewing order of the media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_folder_update_to_db() - */ -int media_folder_get_order(media_folder_h folder, int *order) TIZEN_DEPRECATED_API; - -/** * @brief Gets the media folder from the media database. * * @details This function creates a new media folder handle from the media database by the given @a folder_id. @@ -375,79 +320,6 @@ int media_folder_get_order(media_folder_h folder, int *order) TIZEN_DEPRECATED_A int media_folder_get_folder_from_db(const char *folder_id, media_folder_h *folder); /** - * @deprecated Deprecated since 4.0. Use media_content_scan_folder() or media_info_move_to_db() instead. - * @brief Sets the folder name. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] folder The handle to the media folder - * @param[in] name The name of the media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - */ -int media_folder_set_name(media_folder_h folder, const char *name) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee order independence between applications. It is recommended that the viewing order is managed by the application. - * @brief Sets the folder viewing order. - * @details If you set the order value for each folder, you can sort in ascending or descending order as the set order values using the filter. \n - * Moreover, more detailed settings are possible when used with the filter. \n - * - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * @remarks If you don't set the order value, the order value will be set default value. Default is 0. \n - * If you don't use the filter, the set order value does not effect the folder viewing order. - * - * @param[in] folder The handle to the media folder - * @param[in] order The viewing order of the media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_folder_set_order(media_folder_h folder, int order) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Related setter functions are deprecated, therefore this function is not needed anymore. - * @brief Updates the media folder to the media database. - * - * @details The function updates the given media folder in the media database. The function should be called after any change in folder attributes, to be updated to the media - * database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @param[in] folder The handle to the media folder - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - * @see media_folder_destroy() - */ -int media_folder_update_to_db(media_folder_h folder) TIZEN_DEPRECATED_API; - -/** * @} */ diff --git a/include_product/media_image.h b/include_product/media_image.h index bb3bd5e..6666edd 100755 --- a/include_product/media_image.h +++ b/include_product/media_image.h @@ -28,7 +28,7 @@ extern "C" { /** * @brief This file contains the image metadata API and related functions to proceed with them. * Functions include cloning and destroying the image metadata, getting image metadata such as width, height, \n - * orientation, date taken, title, burst shot id and updating image to DB. + * orientation, date taken, title. */ /** @@ -163,26 +163,6 @@ int image_meta_get_orientation(image_meta_h image, media_content_orientation_e * int image_meta_get_date_taken(image_meta_h image, char **date_taken); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the burst shot ID. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a burst_id should be released using free(). - * - * @param[in] image The handle to the image metadata - * @param[out] burst_id The ID of the burst shot\ n - * If @a burst_id is @c NULL, this is not burst shot - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int image_meta_get_burst_id(image_meta_h image, char **burst_id) TIZEN_DEPRECATED_API; - -/** * @brief Gets the exposure time from EXIF. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif * @@ -253,73 +233,6 @@ int image_meta_get_iso(image_meta_h image, int *iso); int image_meta_get_model(image_meta_h image, char **model); /** - * @deprecated Deprecated since 4.0. - * @brief Checks whether the media is a burst shot image. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] image The handle to the image metadata - * @param[out] is_burst_shot @c true if the media is a burst shot image, - * otherwise @c false if the media is not a burst shot image - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets an orientation of the image. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] image The handle to the image metadata - * @param[in] orientation The image orientation - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Related setter functions are deprecated, therefore this function is not needed anymore. - * @brief Updates the image to the media database. - * - * @details The function updates the given image meta in the media database. \n - * The function should be called after any change in image attributes, to be updated to the media database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db(). - * - * @param[in] image The handle to the image metadata - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - */ -int image_meta_update_to_db(image_meta_h image) TIZEN_DEPRECATED_API; - -/** * @} */ diff --git a/include_product/media_info.h b/include_product/media_info.h index ec2c0de..9b67dae 100755 --- a/include_product/media_info.h +++ b/include_product/media_info.h @@ -30,7 +30,7 @@ extern "C" { * @file media_info.h * @brief This file contains the media info function and related functions to proceed with it. \n * You can use the functions to insert, delete, count and get list of content files from media database. \n - * You can get properties of content file such as size, mime_type, modified_time etc. And you can set properties such as provider, favorite etc. \n + * You can get properties of content file such as size, mime_type, modified_time etc. And you can set properties such as favorite etc. \n * And you can get bookmark, face, tag info related the content file. */ @@ -132,49 +132,6 @@ int media_info_insert_to_db(const char *path, media_info_h *info); int media_info_insert_batch_to_db(const char **path_array, unsigned int array_length, media_insert_completed_cb callback, void *user_data); /** - * @deprecated Deprecated since 4.0. - * @brief Inserts the burst shot images into the media database, asynchronously. - * @details This function inserts burst images into the media database. - * media_insert_burst_shot_completed_cb() will be called when insertion to media database is finished. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write \n - * %http://tizen.org/privilege/mediastorage \n - * %http://tizen.org/privilege/externalstorage - * - * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n - * If you want to access only internal storage with this function, you should add privilege http://tizen.org/privilege/mediastorage. \n - * Or if you want to access only external storage with this function, you should add privilege http://tizen.org/privilege/externalstorage. \n - * If you can access both storage, you must add all privilege. \n - * Since 4.0, This function does not allow a symbolic link. \n - * - * @param[in] path_array The path array of the burst shot images to add - * @param[in] array_length The length of the array - * @param[in] callback The callback function to be invoked when the images are inserted completely - * @param[in] user_data The user data to be passed to the callback function - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - * @see media_insert_burst_shot_completed_cb() - */ -int media_info_insert_burst_shot_to_db(const char **path_array, unsigned int array_length, media_insert_burst_shot_completed_cb callback, void *user_data) TIZEN_DEPRECATED_API; - -/** * @deprecated Deprecated since 5.0. Use media_content_scan_file() instead. * @brief Deletes the media information from the media database. * @details This function only remove media information in the media database. \n @@ -206,36 +163,6 @@ int media_info_insert_burst_shot_to_db(const char **path_array, unsigned int arr */ int media_info_delete_from_db(const char *media_id) TIZEN_DEPRECATED_API; -/** - * @deprecated Deprecated since 4.0. - * @brief Deletes media information that meets the conditions of the filter from the media database. - * @details This function can delete multiple media information from the media database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @param[in] filter The handle to the media filter - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - * @see media_filter_create() - */ -int media_info_delete_batch_from_db(filter_h filter) TIZEN_DEPRECATED_API; - /** * @brief Destroys media info. @@ -263,8 +190,6 @@ int media_info_destroy(media_info_h media); * @brief Clones the media info handle. * * @details This function copies the media info handle from a source to the destination. - * There is no media_info_create() function. The media_info_h is created internally and - * available through media info foreach function such as media_info_foreach_media_from_db() or media_info_insert_to_db(). * To use this handle outside of these foreach functions, use this function. * * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif @@ -818,24 +743,6 @@ int media_info_get_latitude(media_info_h media, double* latitude); int media_info_get_altitude(media_info_h media, double* altitude); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the weather of content file. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @remarks The @a weather should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] weather The weather of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_get_weather(media_info_h media, char **weather) TIZEN_DEPRECATED_API; - -/** * @brief Gets the rating of content file. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -869,65 +776,6 @@ int media_info_get_rating(media_info_h media, int *rating); int media_info_get_favorite(media_info_h media, bool* favorite); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the author of content file. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a author should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] author The author of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_get_author(media_info_h media, char **author) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Gets the provider of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a provider should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] provider The provider of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_provider(media_info_h media, char **provider) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Redundant, use media_info_get_display_name() instead. - * @brief Gets the content name of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a content_name should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] content_name The content name of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_content_name(media_info_h media, char **content_name) TIZEN_DEPRECATED_API; - -/** * @brief Gets the title of content file. * @details If the content file does not have a title, this method returns the filename without the extension. * @@ -948,86 +796,6 @@ int media_info_get_content_name(media_info_h media, char **content_name) TIZEN_D int media_info_get_title(media_info_h media, char **title); /** - * @deprecated Deprecated since 4.0. - * @brief Gets the category of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a category should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] category The category of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_category(media_info_h media, char **category) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Gets the location tag of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a location_tag should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] location_tag The location of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_location_tag(media_info_h media, char **location_tag) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Gets the age_rating of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a age_rating should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] age_rating The age rating of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_age_rating(media_info_h media, char **age_rating) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Use media_tag_insert_to_db() instead. - * @brief Gets the keyword of content file which User set. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @remarks The @a keyword should be released using free(). - * - * @param[in] media The handle to the media info - * @param[out] keyword The keyword of the content file - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - */ -int media_info_get_keyword(media_info_h media, char **keyword) TIZEN_DEPRECATED_API; - -/** * @deprecated Deprecated since 5.0. * @brief Gets the storage id of content file. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif @@ -1095,42 +863,6 @@ int media_info_is_360_content(media_info_h media, bool *is_360); int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type) TIZEN_DEPRECATED_API; /** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee independence of the played count value between applications. It is recommended that the value is managed by the application. - * @brief Gets number which represents how many times given content has been played. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @param[in] media The handle to the media info - * @param[out] played_count The counter of content played - * - * @return 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_get_played_count(media_info_h media, int *played_count) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee independence of the played time value between applications. It is recommended that the value is managed by the application. - * @brief Gets the content's played time parameter. - * @details Function returns content's elapsed playback time parameter as period - * starting from the beginning of the track. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @param[in] media The handle to the media info - * @param[out] played_time The elapsed time of the content - * - * @return 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_get_played_time(media_info_h media, time_t *played_time) TIZEN_DEPRECATED_API; - -/** * @brief Gets the media info from the media database. * * @details This function creates a new media handle from the media database by the given @a media_id. @@ -1160,425 +892,72 @@ int media_info_get_played_time(media_info_h media, time_t *played_time) TIZEN_DE int media_info_get_media_from_db(const char *media_id, media_info_h *media); /** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee independence of the played count value between applications. It is recommended that the value is managed by the application. - * @brief Increments the played count to content meta handle. - * @details You can increase the played(opened) count of the content file. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif + * @brief Sets the favorite of media info. + * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n + * So, If you use it in order parameter, you can sort the order of the time was a favorite. \n + * Or, if you use it in condition parameter, you can get the result of the favorite media. + * + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * * @param[in] media The handle to the media info + * @param[in] favorite Set @c true to set the media info as favorite, + * otherwise set @c false to not set the media info as favorite * - * @return 0 on success, + * @return @c 0 on success, * otherwise a negative error value * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_NONE Successful * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() */ -int media_info_increase_played_count(media_info_h media) TIZEN_DEPRECATED_API; +int media_info_set_favorite(media_info_h media, bool favorite); /** - * @deprecated Deprecated since 4.0. \n - * This function does not guarantee independence of the played time value between applications. It is recommended that the value is managed by the application. - * @brief Sets the played time to content meta handle. - * @details You can set the latest played(opened) time of the content file. the latest played time to be set the current time on the system. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @param[in] media The handle to the media info - * - * @return 0 on success, - * otherwise a negative error value + * @brief Updates the media info to the media database. * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @details The function updates the given media info in the media database. * - * @post media_info_update_to_db() - */ -int media_info_set_played_time(media_info_h media) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Redundant, use media_info_move_to_db() instead. - * @brief Sets the file name including the extension of the content file. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @privlevel public + * @privilege %http://tizen.org/privilege/content.write + * + * @remarks The function should be called after any change in media, to be updated to the media + * database. For example, after using media_info_set_favorite() + * for setting the name of the media, the media_info_update_to_db() function should be called so as to update + * the given media info attributes in the media database. * * @param[in] media The handle to the media info - * @param[in] display_name The file name including the extension of the content file. * * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation + * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed + * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy + * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail + * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied * - * @post media_info_update_to_db(). + * @pre This function requires opened connection to content service by media_content_connect(). * + * @see media_content_connect() + * @see media_info_set_favorite() */ -int media_info_set_display_name(media_info_h media, const char *display_name) TIZEN_DEPRECATED_API; +int media_info_update_to_db(media_info_h media); /** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the description of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif + * @brief Moves the media info to the given destination path in the media database. + * @details After moving or renaming a file in the filesystem, call this function to update the database. \n + * If the source path and destination path are the same, then this function does nothing. + * If you want to refresh media information, you should use media_content_scan_file() function. * - * @param[in] media The handle to the media info - * @param[in] description The description of the media info + * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - * - */ -int media_info_set_description(media_info_h media, const char *description) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the longitude of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] longitude The longitude of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - */ -int media_info_set_longitude(media_info_h media, double longitude) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the latitude of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] latitude The latitude of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - */ -int media_info_set_latitude(media_info_h media, double latitude) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the altitude of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] altitude The altitude of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - */ -int media_info_set_altitude(media_info_h media, double altitude) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the weather of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] weather The weather of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - * - */ -int media_info_set_weather(media_info_h media, const char *weather) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the rating of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] rating The rating of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db(). - */ -int media_info_set_rating(media_info_h media, int rating) TIZEN_DEPRECATED_API; - -/** - * @brief Sets the favorite of media info. - * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n - * So, If you use it in order parameter, you can sort the order of the time was a favorite. \n - * Or, if you use it in condition parameter, you can get the result of the favorite media. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] favorite Set @c true to set the media info as favorite, - * otherwise set @c false to not set the media info as favorite - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_favorite(media_info_h media, bool favorite); - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the author of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] author The author of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_author(media_info_h media, const char *author) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the provider of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] provider The provider of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_provider(media_info_h media, const char *provider) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Redundant, use media_info_move_to_db() instead. - * @brief Sets the content name of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] content_name The content name of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_content_name(media_info_h media, const char *content_name) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the category of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] category The category of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_category(media_info_h media, const char *category) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the location tag of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] location_tag The location of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_location_tag(media_info_h media, const char *location_tag) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the age rating of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] age_rating The age rating of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_age_rating(media_info_h media, const char *age_rating) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Use media_tag_insert_to_db() instead. - * @brief Sets the keyword of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] keyword The keyword of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_keyword(media_info_h media, const char *keyword) TIZEN_DEPRECATED_API; - -/** - * @brief Updates the media info to the media database. - * - * @details The function updates the given media info in the media database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @remarks The function should be called after any change in media, to be updated to the media - * database. For example, after using media_info_set_favorite() - * for setting the name of the media, the media_info_update_to_db() function should be called so as to update - * the given media info attributes in the media database. - * - * @param[in] media The handle to the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - * @see media_info_set_favorite() - */ -int media_info_update_to_db(media_info_h media); - -/** - * @deprecated Deprecated since 4.0. Use media_content_scan_file() instead. - * @brief Refreshes the media metadata to the media database. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write \n - * %http://tizen.org/privilege/mediastorage \n - * %http://tizen.org/privilege/externalstorage - * - * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n - * If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n - * Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n - * If you can access both storage, you should add all privilege. - * - * @param[in] media_id The media ID - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - */ -int media_info_refresh_metadata_to_db(const char *media_id) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. This data cannot be saved to the file. - * @brief Sets the added time of media info. - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @param[in] media The handle to the media info - * @param[in] added_time The added time of the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * - * @post media_info_update_to_db() - */ -int media_info_set_added_time(media_info_h media, time_t added_time) TIZEN_DEPRECATED_API; - -/** - * @brief Moves the media info to the given destination path in the media database. - * @details After moving or renaming a file in the filesystem, call this function to update the database. \n - * If the source path and destination path are the same, then this function does nothing. - * If you want to refresh media information, you should use media_content_scan_file() function. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write \n - * %http://tizen.org/privilege/mediastorage \n - * %http://tizen.org/privilege/externalstorage + * @privlevel public + * @privilege %http://tizen.org/privilege/content.write \n + * %http://tizen.org/privilege/mediastorage \n + * %http://tizen.org/privilege/externalstorage * * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n * If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n @@ -1783,144 +1162,6 @@ int media_info_start_face_detection(media_info_h media, media_face_detection_com int media_info_cancel_face_detection(media_info_h media); /** - * @deprecated Deprecated since 4.0. Use media_info_insert_to_db() instead. - * @brief Creates the media info handle. - * @details If the information about the file that is already known, you can use this function to generate empty handler. - * @since_tizen 3.0 - * - * - * @privilege %http://tizen.org/privilege/mediastorage \n - * %http://tizen.org/privilege/externalstorage - * - * @remarks The @a media should be released using media_info_destroy(). - * @remarks If you want to access only internal storage with this function, you should add privilege http://tizen.org/privilege/mediastorage. \n - * Or if you want to access only external storage with this function, you should add privilege http://tizen.org/privilege/externalstorage. \n - * If you can access both storage, you must add all privilege. - * - * @param[in] path The path to create the media info handle - * @param[out] media The handle to the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * - * @see media_info_destroy() - */ -int media_info_create(const char *path, media_info_h *media) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. Use media_info_insert_to_db() instead. - * @brief Inserts media info to database with media info data. - * @since_tizen 3.0 - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @remarks The @a media should be released using media_info_destroy(). - * - * @param[in] media The handle to the media info - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - */ -int media_info_insert_to_db_with_data(media_info_h media) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets the title of media info handle. - * @since_tizen 3.0 - * - * @param[in] media The handle to the media info - * @param[in] title The title of media info handle - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_title(media_info_h media, const char *title) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets the album of media info handle. - * @since_tizen 3.0 - * - * @param[in] media The handle to the media info - * @param[in] album The album of the media - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_album(media_info_h media, const char *album) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets the artist of media info handle. - * @since_tizen 3.0 - * - * @param[in] media The handle to the media info - * @param[in] artist The artist of media info handle - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_artist(media_info_h media, const char *artist) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets the genre of media info handle. - * @since_tizen 3.0 - * - * @param[in] media The handle to the media info - * @param[in] genre The genre of media info handle - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_genre(media_info_h media, const char *genre) TIZEN_DEPRECATED_API; - -/** - * @deprecated Deprecated since 4.0. - * @brief Sets the recorded date of media info handle. - * @since_tizen 3.0 - * - * @param[in] media The handle to the media info - * @param[in] recorded_date The recorded date of media info handle - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - */ -int media_info_set_recorded_date(media_info_h media, const char *recorded_date) TIZEN_DEPRECATED_API; - -/** * @} */ diff --git a/include_product/media_info_private.h b/include_product/media_info_private.h index 04d03f4..9b42408 100755 --- a/include_product/media_info_private.h +++ b/include_product/media_info_private.h @@ -51,7 +51,7 @@ extern "C" { * * @file media_info_private.h * @brief This file contains the media info API and related structure and enumeration. \n -* Description of the audio, video,image content involves: album, artist, album_artist, author, genre and description tags. \n +* Description of the audio, video,image content involves: album, artist, album_artist, genre and description tags. \n * Parameters of the recording are also supported, as: format, bitrate, duration, size etc. \n * Defenitions of media DB fields and tables, operations with media data relating to DB and handling with media filter attributes. */ @@ -92,13 +92,6 @@ typedef enum { MEDIA_INFO_DESCRIPTION, MEDIA_INFO_RATING, MEDIA_INFO_FAVOURITE, - MEDIA_INFO_AUTHOR, - MEDIA_INFO_PROVIDER, - MEDIA_INFO_CONTENT_NAME, - MEDIA_INFO_CATEGORY, - MEDIA_INFO_LOCATION_TAG, - MEDIA_INFO_AGE_RATING, - MEDIA_INFO_KEYWORD, MEDIA_INFO_IS_DRM, MEDIA_INFO_STORAGE_TYPE, MEDIA_INFO_LONGITUDE, @@ -125,17 +118,15 @@ typedef enum { MEDIA_INFO_BITRATE, MEDIA_INFO_BITPERSAMPLE, MEDIA_INFO_DURATION, - MEDIA_INFO_PLAYED_COUNT, - MEDIA_INFO_LAST_PLAYED_TIME, - MEDIA_INFO_LAST_PLAYED_POSITION, MEDIA_INFO_SAMPLERATE, MEDIA_INFO_CHANNEL, - MEDIA_INFO_BURST_ID, MEDIA_INFO_TIMELINE, - MEDIA_INFO_WEATHER, MEDIA_INFO_SYNC_STATUS, MEDIA_INFO_STORAGE_UUID, MEDIA_INFO_IS_360, + MEDIA_INFO_PLAYED_COUNT, + MEDIA_INFO_LAST_PLAYED_TIME, + MEDIA_INFO_LAST_PLAYED_POSITION, MEDIA_INFO_STITCHED_INFO, MEDIA_INFO_EXTRACT_FLAG, MEDIA_INFO_MODIFIED_MONTH, @@ -182,11 +173,6 @@ typedef enum { MEDIA_GROUP_UHD, } group_list_e; -typedef enum { - MEDIA_BATCH_INSERT_NORMAL, - MEDIA_BATCH_INSERT_BURSTSHOT, -} media_batch_insert_e; - typedef struct _filter_s { char *storage_id; char *condition; @@ -204,10 +190,8 @@ typedef struct { char *folder_id; char *path; char *name; - time_t modified_time; media_content_storage_e storage_type; char *storage_uuid; - int folder_order; } media_folder_s; typedef struct { @@ -244,7 +228,6 @@ typedef struct { int height; char *date_taken; char *title; - char *burst_id; char *exposure_time; double fnumber; int iso; @@ -310,17 +293,9 @@ typedef struct { double longitude; double latitude; double altitude; - char *weather; int rating; time_t favourite; char *title; - char *author; - char *provider; - char *content_name; - char *category; - char *location_tag; - char *age_rating; - char *keyword; int is_drm; int storage_type; int played_count; @@ -543,20 +518,11 @@ typedef struct _media_content_scan_cb_data_v2 { #define DB_FIELD_MEDIA_HEIGHT "height" #define DB_FIELD_MEDIA_DATETAKEN "datetaken" #define DB_FIELD_MEDIA_ORIENTATION "orientation" -#define DB_FIELD_MEDIA_BURST_ID "burst_id" #define DB_FIELD_MEDIA_PLAYED_COUNT "played_count" #define DB_FIELD_MEDIA_LAST_PLAYED_TIME "last_played_time" #define DB_FIELD_MEDIA_LAST_PLAYED_POSITION "last_played_position" #define DB_FIELD_MEDIA_RATING "rating" #define DB_FIELD_MEDIA_FAVOURITE "favourite" -#define DB_FIELD_MEDIA_AUTHOR "author" -#define DB_FIELD_MEDIA_PROVIDER "provider" -#define DB_FIELD_MEDIA_CONTENT_NAME "content_name" -#define DB_FIELD_MEDIA_CATEGORY "category" -#define DB_FIELD_MEDIA_LOCATION_TAG "location_tag" -#define DB_FIELD_MEDIA_AGE_RATING "age_rating" -#define DB_FIELD_MEDIA_KEYWORD "keyword" -#define DB_FIELD_MEDIA_WEATHER "weather" #define DB_FIELD_MEDIA_IS_DRM "is_drm" #define DB_FIELD_MEDIA_STORAGE_TYPE "storage_type" #define DB_FIELD_MEDIA_MODIFIED_MONTH "modified_month" @@ -571,13 +537,6 @@ typedef struct _media_content_scan_cb_data_v2 { #define DB_FIELD_MEDIA_COMPOSER_PINYIN "composer_pinyin" #define DB_FIELD_MEDIA_COPYRIGHT_PINYIN "copyright_pinyin" #define DB_FIELD_MEDIA_DESCRIPTION_PINYIN "description_pinyin" -#define DB_FIELD_MEDIA_AUTHOR_PINYIN "author_pinyin" -#define DB_FIELD_MEDIA_PROVIDER_PINYIN "provider_pinyin" -#define DB_FIELD_MEDIA_CONTENT_NAME_PINYIN "content_name_pinyin" -#define DB_FIELD_MEDIA_CATEGORY_PINYIN "category_pinyin" -#define DB_FIELD_MEDIA_LOCATION_TAG_PINYIN "location_tag_pinyin" -#define DB_FIELD_MEDIA_AGE_RATING_PINYIN "age_rating_pinyin" -#define DB_FIELD_MEDIA_KEYWORD_PINYIN "keyword_pinyin" #define DB_FIELD_MEDIA_360 "is_360" #define DB_FIELD_MEDIA_STITCHED_INFO "stitched_info" #ifdef _USE_SENIOR_MODE @@ -589,10 +548,8 @@ typedef struct _media_content_scan_cb_data_v2 { #define DB_FIELD_FOLDER_ID "folder_uuid" #define DB_FIELD_FOLDER_PATH "path" #define DB_FIELD_FOLDER_NAME "name" -#define DB_FIELD_FOLDER_MODIFIED_TIME "modified_time" #define DB_FIELD_FOLDER_STORAGE_TYPE "storage_type" #define DB_FIELD_FOLDER_NAME_PINYIN "name_pinyin" -#define DB_FIELD_FOLDER_ORDER "folder_order" /* DB field for playlist */ #define DB_FIELD_PLAYLIST_ID "playlist_id" @@ -694,7 +651,7 @@ typedef struct _media_content_scan_cb_data_v2 { #define SELECT_ALBUM_LIST "SELECT DISTINCT a.album_id, a.name, a.artist, a.album_art FROM "ALBUM_MEDIA_JOIN #define SELECT_MEDIA_GROUP_LIST "SELECT DISTINCT %s FROM '%s' WHERE validity=1 " -#define SELECT_FOLDER_LIST "SELECT DISTINCT f.folder_uuid, f.path, f.name, f.storage_type, f.modified_time, f.storage_uuid, f.folder_order FROM "FOLDER_MEDIA_JOIN +#define SELECT_FOLDER_LIST "SELECT DISTINCT f.folder_uuid, f.path, f.name, f.storage_type, f.storage_uuid FROM "FOLDER_MEDIA_JOIN #define SELECT_FOLDER_LIST_BY_STORAGE_ID SELECT_FOLDER_LIST"AND f.storage_uuid='%s' " #define SELECT_TAG_LIST "SELECT DISTINCT tag_id, name FROM "DB_VIEW_TAG" WHERE 1 " #define SELECT_PLAYLIST_LIST "SELECT DISTINCT playlist_id, name, p_thumbnail_path FROM "DB_VIEW_PLAYLIST" WHERE 1 " @@ -722,7 +679,7 @@ typedef struct _media_content_scan_cb_data_v2 { /* Get Group Info by Group ID*/ #define SELECT_ALBUM_FROM_ALBUM "SELECT * FROM "DB_TABLE_ALBUM" WHERE album_id=%d" -#define SELECT_FOLDER_FROM_FOLDER "SELECT * FROM "DB_TABLE_FOLDER" WHERE folder_uuid='%s'" +#define SELECT_FOLDER_FROM_FOLDER "SELECT folder_uuid, path, name, storage_type, storage_uuid FROM "DB_TABLE_FOLDER" WHERE folder_uuid='%s'" #define SELECT_PLAYLIST_FROM_PLAYLIST "SELECT * FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d" #define SELECT_TAG_FROM_TAG "SELECT * FROM "DB_TABLE_TAG" WHERE tag_id=%d" #define SELECT_TAG_BY_NAME "SELECT * FROM "DB_TABLE_TAG" WHERE name='%q'" @@ -737,16 +694,12 @@ typedef struct _media_content_scan_cb_data_v2 { /* Get Media list of Group */ #ifdef _USE_SENIOR_MODE #define MEDIA_INFO_ITEM "media_uuid, path, file_name, media_type, mime_type, size, added_time, modified_time, thumbnail_path, description, \ - rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status, storage_uuid, is_360, stitched_info, extract_flag, modified_date, contact, app_data" + rating, favourite, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, timeline, sync_status, storage_uuid, is_360, stitched_info, extract_flag, modified_date, contact, app_data" #else #define MEDIA_INFO_ITEM "media_uuid, path, file_name, media_type, mime_type, size, added_time, modified_time, thumbnail_path, description, \ - rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status, storage_uuid, is_360, stitched_info, extract_flag, modified_date" + rating, favourite, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, timeline, sync_status, storage_uuid, is_360, stitched_info, extract_flag, modified_date" #endif -/*Folder info*/ -#define UPDATE_FOLDER_ORDER "UPDATE "DB_TABLE_FOLDER" SET folder_order=%d WHERE folder_uuid=%Q" -#define SELECT_FOLDER_ID_BY_PATH "SELECT folder_uuid FROM "DB_TABLE_FOLDER" WHERE path = '%s'" - /* Playlist Info */ #define INSERT_PLAYLIST_TO_PLAYLIST "INSERT INTO "DB_TABLE_PLAYLIST" (name) VALUES (%Q)" #define UPDATE_PLAYLIST_NAME_FROM_PLAYLIST "UPDATE "DB_TABLE_PLAYLIST" SET name='%q' WHERE playlist_id=%d;" @@ -767,9 +720,6 @@ typedef struct _media_content_scan_cb_data_v2 { #define UPDATE_BOOKMARK_FROM_BOOKMARK "UPDATE "DB_TABLE_BOOKMARK" SET name=%Q WHERE bookmark_id=%d;" -/* Update Meta*/ -#define UPDATE_IMAGE_META_FROM_MEDIA "UPDATE '%s' SET orientation=%d WHERE media_uuid='%q'" - #define SELECT_MEDIA_ITEM "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1" #define SELECT_MEDIA_FROM_MEDIA "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND media_uuid='%s'" #define SELECT_MEDIA_BY_PATH "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND path='%q'" @@ -784,15 +734,10 @@ typedef struct _media_content_scan_cb_data_v2 { #define SELECT_MEDIA_STORAGE_ID_BY_ID "SELECT storage_uuid FROM "DB_VIEW_MEDIA" WHERE media_uuid='%q'" /* Delete */ -#define DELETE_MEDIA_FROM_MEDIA_BATCH "DELETE FROM '%s' WHERE %s AND storage_type = %d" #define DELETE_PLAYLIST_FROM_PLAYLIST "DELETE FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d" #define DELETE_TAG_FROM_TAG "DELETE FROM "DB_TABLE_TAG" WHERE tag_id=%d" #define DELETE_BOOKMARK_FROM_BOOKMARK "DELETE FROM "DB_TABLE_BOOKMARK" WHERE bookmark_id=%d" -/*For batch remove*/ -#define SELECT_STORAGE_BY_FILTER "SELECT DISTINCT storage_uuid, storage_type FROM "DB_VIEW_MEDIA" WHERE %s" -#define SELECT_THUMBNAIL_BY_FILTER "SELECT DISTINCT thumbnail_path FROM '%s' WHERE %s AND storage_type = %d" - /* Storage*/ #define SELECT_STORAGE_COUNT "SELECT COUNT(*) FROM "DB_TABLE_STORAGE" WHERE validity=1" #define SELECT_STORAGE_LIST "SELECT storage_uuid, storage_path, storage_type FROM "DB_TABLE_STORAGE" WHERE validity=1" diff --git a/include_product/media_storage.h b/include_product/media_storage.h index 3a2a52f..51c26f5 100755 --- a/include_product/media_storage.h +++ b/include_product/media_storage.h @@ -250,26 +250,6 @@ int media_storage_clone(media_storage_h *dst, media_storage_h src) TIZEN_DEPRECA int media_storage_get_id(media_storage_h storage, char **storage_id) TIZEN_DEPRECATED_API; /** - * @deprecated Deprecated since 4.0. - * @brief Gets the storage name of media storage. - * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif - * - * @remarks The @a storage_name should be released using free(). - * If the requested storage is not the cloud storage, this function returns NULL. - * - * @param[in] storage The media storage handle - * @param[out] storage_name The storage name of the media storage - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - */ -int media_storage_get_name(media_storage_h storage, char **storage_name) TIZEN_DEPRECATED_API; - -/** * @deprecated Deprecated since 5.0. Use @ref CAPI_SYSTEM_STORAGE_MODULE instead. * @brief Gets the storage path of media storage. * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif diff --git a/include_product/media_video.h b/include_product/media_video.h index 6930747..7883094 100755 --- a/include_product/media_video.h +++ b/include_product/media_video.h @@ -28,7 +28,7 @@ extern "C" { * @file media_video.h * @brief This file contains the video metadata API and related functions to proceed with video metadata. \n * Functions include cloning and destroying video metadata, getting video metadata such as width, height, \n - * album, genre, played parameters etc. and updating video to DB. + * album, genre, etc. */ /** @@ -363,39 +363,6 @@ int video_meta_get_height(video_meta_h video, int *height); int video_meta_get_rotation(video_meta_h video, int *rotation); /** - * @deprecated Deprecated since 4.0. Related setter functions are deprecated, therefore this function is not needed anymore. - * @brief Updates an video metadata with modified attributes in the media database. - * @details The function updates the given video meta in the media database. The function should be called after any change in video attributes, to be updated to the media - * database. - * - * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif - * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write - * - * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db(). - * - * @param[in] video The handle to the video metadata - * - * @return @c 0 on success, - * otherwise a negative error value - * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful - * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory - * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation - * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed - * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy - * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail - * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied - * - * @pre This function requires opened connection to content service by media_content_connect(). - * - * @see media_content_connect() - */ -int video_meta_update_to_db(video_meta_h video) TIZEN_DEPRECATED_API; - -/** *@} */ diff --git a/src/media_audio.c b/src/media_audio.c index ed9d842..b82faac 100755 --- a/src/media_audio.c +++ b/src/media_audio.c @@ -417,16 +417,3 @@ int audio_meta_get_duration(audio_meta_h audio, int *duration) return ret; } - -int audio_meta_update_to_db(audio_meta_h audio) -{ - media_content_warn("DEPRECATION WARNING: audio_meta_update_to_db() is deprecated and will be removed from next release."); - audio_meta_s *_audio = (audio_meta_s*)audio; - - if (_audio == NULL) { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return MEDIA_CONTENT_ERROR_NONE; -} diff --git a/src/media_content.c b/src/media_content.c index a79076d..ebc8d68 100755 --- a/src/media_content.c +++ b/src/media_content.c @@ -26,11 +26,6 @@ static int ref_count = 0; static GMutex db_mutex; static uid_t content_g_uid = 0; -#if 0 -static int __media_content_create_attr_handle(void); -static int __media_content_create_alias_attr_handle(void); -static int __media_content_create_attribute_handle(void); -#endif static int __media_content_create_attribute_handles(void); static int __media_content_destroy_attribute_handle(void); @@ -75,20 +70,8 @@ static media_content_attribute_info_s g_content_attrs_info[] = { {MEDIA_HEIGHT, DB_FIELD_MEDIA_HEIGHT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_HEIGHT}, {MEDIA_DATETAKEN, DB_FIELD_MEDIA_DATETAKEN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DATETAKEN}, {MEDIA_ORIENTATION, DB_FIELD_MEDIA_ORIENTATION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ORIENTATION}, - {MEDIA_BURST_ID, DB_FIELD_MEDIA_BURST_ID, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_BURST_ID}, - {MEDIA_PLAYED_COUNT, DB_FIELD_MEDIA_PLAYED_COUNT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_PLAYED_COUNT}, - {MEDIA_LAST_PLAYED_TIME, DB_FIELD_MEDIA_LAST_PLAYED_TIME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LAST_PLAYED_TIME}, - {MEDIA_LAST_PLAYED_POSITION, DB_FIELD_MEDIA_LAST_PLAYED_POSITION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LAST_PLAYED_POSITION}, {MEDIA_RATING, DB_FIELD_MEDIA_RATING, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_RATING}, {MEDIA_FAVOURITE, DB_FIELD_MEDIA_FAVOURITE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_FAVOURITE}, - {MEDIA_AUTHOR, DB_FIELD_MEDIA_AUTHOR, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_AUTHOR}, - {MEDIA_PROVIDER, DB_FIELD_MEDIA_PROVIDER, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_PROVIDER}, - {MEDIA_CONTENT_NAME, DB_FIELD_MEDIA_CONTENT_NAME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CONTENT_NAME}, - {MEDIA_CATEGORY, DB_FIELD_MEDIA_CATEGORY, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CATEGORY}, - {MEDIA_LOCATION_TAG, DB_FIELD_MEDIA_LOCATION_TAG, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LOCATION_TAG}, - {MEDIA_AGE_RATING, DB_FIELD_MEDIA_AGE_RATING, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_AGE_RATING}, - {MEDIA_KEYWORD, DB_FIELD_MEDIA_KEYWORD, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_KEYWORD}, - {MEDIA_WEATHER, DB_FIELD_MEDIA_WEATHER, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_WEATHER}, {MEDIA_IS_DRM, DB_FIELD_MEDIA_IS_DRM, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_IS_DRM}, {MEDIA_STORAGE_TYPE, DB_FIELD_MEDIA_STORAGE_TYPE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_STORAGE_TYPE}, {MEDIA_360, DB_FIELD_MEDIA_360, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_360}, @@ -103,22 +86,13 @@ static media_content_attribute_info_s g_content_attrs_info[] = { {MEDIA_COMPOSER_PINYIN, DB_FIELD_MEDIA_COMPOSER_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_COMPOSER_PINYIN}, {MEDIA_COPYRIGHT_PINYIN, DB_FIELD_MEDIA_COPYRIGHT_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_COPYRIGHT_PINYIN}, {MEDIA_DESCRIPTION_PINYIN, DB_FIELD_MEDIA_DESCRIPTION_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DESCRIPTION_PINYIN}, - {MEDIA_AUTHOR_PINYIN, DB_FIELD_MEDIA_AUTHOR_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_AUTHOR_PINYIN}, - {MEDIA_PROVIDER_PINYIN, DB_FIELD_MEDIA_PROVIDER_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_PROVIDER_PINYIN}, - {MEDIA_CONTENT_NAME_PINYIN, DB_FIELD_MEDIA_CONTENT_NAME_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CONTENT_NAME_PINYIN}, - {MEDIA_CATEGORY_PINYIN, DB_FIELD_MEDIA_CATEGORY_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CATEGORY_PINYIN}, - {MEDIA_LOCATION_TAG_PINYIN, DB_FIELD_MEDIA_LOCATION_TAG_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LOCATION_TAG_PINYIN}, - {MEDIA_AGE_RATING_PINYIN, DB_FIELD_MEDIA_AGE_RATING_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_AGE_RATING_PINYIN}, - {MEDIA_KEYWORD_PINYIN, DB_FIELD_MEDIA_KEYWORD_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_KEYWORD_PINYIN}, /* Folder */ {FOLDER_ID, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_ID}, {FOLDER_PATH, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_PATH}, {FOLDER_NAME, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_NAME}, - {FOLDER_MODIFIED_TIME, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_MODIFIED_TIME}, {FOLDER_STORAGE_TYPE, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_STORAGE_TYPE}, {FOLDER_NAME_PINYIN, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_NAME_PINYIN}, - {FOLDER_ORDER, NULL, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_ORDER}, /* Playlist */ {MEDIA_PLAYLIST_ID, DB_FIELD_PLAYLIST_ID, NULL}, @@ -153,6 +127,9 @@ static media_content_attribute_info_s g_content_attrs_info[] = { {MEDIA_APP_DATA, DB_FIELD_MEDIA_APP_DATA, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_APP_DATA}, #endif #ifdef _USE_TVPD_MODE + {MEDIA_PLAYED_COUNT, DB_FIELD_MEDIA_PLAYED_COUNT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_PLAYED_COUNT}, + {MEDIA_LAST_PLAYED_TIME, DB_FIELD_MEDIA_LAST_PLAYED_TIME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LAST_PLAYED_TIME}, + {MEDIA_LAST_PLAYED_POSITION, DB_FIELD_MEDIA_LAST_PLAYED_POSITION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LAST_PLAYED_POSITION}, {MEDIA_FOLDER_ID, DB_FIELD_MEDIA_FOLDER_ID, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_FOLDER_ID}, {MEDIA_STITCHED_INFO, DB_FIELD_MEDIA_STITCHED_INFO, NULL}, {MEDIA_MODIFIED_MONTH, DB_FIELD_MEDIA_MODIFIED_MONTH, NULL}, @@ -213,729 +190,6 @@ static media_content_attribute_info_s g_content_attrs_info[] = { #endif }; -#if 0 -static int __media_content_create_attr_handle(void) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - - ret = _media_filter_attribute_create(&g_attr_handle); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Media Info */ - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_ID, DB_FIELD_MEDIA_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_PATH, DB_FIELD_MEDIA_PATH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_DISPLAY_NAME, DB_FIELD_MEDIA_DISPLAY_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_TYPE, DB_FIELD_MEDIA_TYPE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_MIME_TYPE, DB_FIELD_MEDIA_MIME_TYPE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_SIZE, DB_FIELD_MEDIA_SIZE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_ADDED_TIME, DB_FIELD_MEDIA_ADDED_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_MODIFIED_TIME, DB_FIELD_MEDIA_MODIFIED_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_TIMELINE, DB_FIELD_MEDIA_TIMELINE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_THUMBNAIL_PATH, DB_FIELD_MEDIA_THUMBNAIL_PATH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_TITLE, DB_FIELD_MEDIA_TITLE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_ALBUM, DB_FIELD_MEDIA_ALBUM); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_ARTIST, DB_FIELD_MEDIA_ARTIST); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_ALBUM_ARTIST, DB_FIELD_MEDIA_ALBUM_ARTIST); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_GENRE, DB_FIELD_MEDIA_GENRE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_COMPOSER, DB_FIELD_MEDIA_COMPOSER); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_YEAR, DB_FIELD_MEDIA_YEAR); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_RECORDED_DATE, DB_FIELD_MEDIA_RECORDED_DATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_COPYRIGHT, DB_FIELD_MEDIA_COPYRIGHT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_TRACK_NUM, DB_FIELD_MEDIA_TRACK_NUM); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_DESCRIPTION, DB_FIELD_MEDIA_DESCRIPTION); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_BITRATE, DB_FIELD_MEDIA_BITRATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_BITPERSAMPLE, DB_FIELD_MEDIA_BITPERSAMPLE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_SAMPLERATE, DB_FIELD_MEDIA_SAMPLERATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_CHANNEL, DB_FIELD_MEDIA_CHANNEL); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_DURATION, DB_FIELD_MEDIA_DURATION); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_LONGITUDE, DB_FIELD_MEDIA_LONGITUDE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_LATITUDE, DB_FIELD_MEDIA_LATITUDE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_ALTITUDE, DB_FIELD_MEDIA_ALTITUDE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_WIDTH, DB_FIELD_MEDIA_WIDTH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_HEIGHT, DB_FIELD_MEDIA_HEIGHT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_DATETAKEN, DB_FIELD_MEDIA_DATETAKEN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_ORIENTATION, DB_FIELD_MEDIA_ORIENTATION); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_BURST_ID, DB_FIELD_MEDIA_BURST_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_PLAYED_COUNT, DB_FIELD_MEDIA_PLAYED_COUNT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_LAST_PLAYED_TIME, DB_FIELD_MEDIA_LAST_PLAYED_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_LAST_PLAYED_POSITION, DB_FIELD_MEDIA_LAST_PLAYED_POSITION); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_RATING, DB_FIELD_MEDIA_RATING); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_FAVOURITE, DB_FIELD_MEDIA_FAVOURITE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_AUTHOR, DB_FIELD_MEDIA_AUTHOR); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_PROVIDER, DB_FIELD_MEDIA_PROVIDER); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_CONTENT_NAME, DB_FIELD_MEDIA_CONTENT_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_CATEGORY, DB_FIELD_MEDIA_CATEGORY); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_LOCATION_TAG, DB_FIELD_MEDIA_LOCATION_TAG); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_AGE_RATING, DB_FIELD_MEDIA_AGE_RATING); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_KEYWORD, DB_FIELD_MEDIA_KEYWORD); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_WEATHER, DB_FIELD_MEDIA_WEATHER); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_IS_DRM, DB_FIELD_MEDIA_IS_DRM); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_STORAGE_TYPE, DB_FIELD_MEDIA_STORAGE_TYPE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_360, DB_FIELD_MEDIA_360); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Pinyin*/ - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_FILE_NAME_PINYIN, DB_FIELD_MEDIA_FILE_NAME_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_TITLE_PINYIN, DB_FIELD_MEDIA_TITLE_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_ALBUM_PINYIN, DB_FIELD_MEDIA_ALBUM_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_ARTIST_PINYIN, DB_FIELD_MEDIA_ARTIST_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_ALBUM_ARTIST_PINYIN, DB_FIELD_MEDIA_ALBUM_ARTIST_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_GENRE_PINYIN, DB_FIELD_MEDIA_GENRE_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_COMPOSER_PINYIN, DB_FIELD_MEDIA_COMPOSER_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_COPYRIGHT_PINYIN, DB_FIELD_MEDIA_COPYRIGHT_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_DESCRIPTION_PINYIN, DB_FIELD_MEDIA_DESCRIPTION_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_AUTHOR_PINYIN, DB_FIELD_MEDIA_AUTHOR_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_PROVIDER_PINYIN, DB_FIELD_MEDIA_PROVIDER_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_CONTENT_NAME_PINYIN, DB_FIELD_MEDIA_CONTENT_NAME_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_CATEGORY_PINYIN, DB_FIELD_MEDIA_CATEGORY_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_LOCATION_TAG_PINYIN, DB_FIELD_MEDIA_LOCATION_TAG_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_AGE_RATING_PINYIN, DB_FIELD_MEDIA_AGE_RATING_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_KEYWORD_PINYIN, DB_FIELD_MEDIA_KEYWORD_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Playlist*/ - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_PLAYLIST_ID, DB_FIELD_PLAYLIST_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PLAYLIST_NAME, DB_FIELD_PLAYLIST_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PLAYLIST_MEMBER_ORDER, DB_FIELD_PLAYLIST_MEMBER_ORDER); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Playlist View */ - ret = _media_filter_attribute_add(g_attr_handle, PLAYLIST_MEDIA_COUNT, DB_FIELD_PLAYLIST_MEDIA_COUNT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Tag*/ - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_TAG_ID, DB_FIELD_TAG_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, TAG_NAME, DB_FIELD_TAG_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Tag View */ - ret = _media_filter_attribute_add(g_attr_handle, TAG_MEDIA_COUNT, DB_FIELD_TAG_MEDIA_COUNT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Bookmark*/ - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_BOOKMARK_ID, DB_FIELD_BOOKMARK_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, BOOKMARK_MARKED_TIME, DB_FIELD_BOOKMARK_MARKED_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, BOOKMARK_NAME, DB_FIELD_BOOKMARK_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Storage*/ - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_STORAGE_ID, DB_FIELD_STORAGE_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_STORAGE_PATH, DB_FIELD_STORAGE_PATH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Face */ - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_FACE_TAG, DB_FIELD_FACE_TAG); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_FACE_ID, DB_FIELD_FACE_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - -#ifdef _USE_SENIOR_MODE - if (_media_content_is_support_senior_mode()) { - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_CONTACT, DB_FIELD_MEDIA_CONTACT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_APP_DATA, DB_FIELD_MEDIA_APP_DATA); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - } -#endif -#ifdef _USE_TVPD_MODE - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_FOLDER_ID, DB_FIELD_MEDIA_FOLDER_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_STITCHED_INFO, DB_FIELD_MEDIA_STITCHED_INFO); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_MODIFIED_MONTH, DB_FIELD_MEDIA_MODIFIED_MONTH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_MODIFIED_DATE, DB_FIELD_MEDIA_MODIFIED_DATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* PVR*/ - ret = _media_filter_attribute_add(g_attr_handle, PVR_DURATION, DB_FIELD_PVR_DURATION); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_TIME_ZONE, DB_FIELD_PVR_TIME_ZONE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_PTC, DB_FIELD_PVR_PTC); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_MAJOR, DB_FIELD_PVR_MAJOR); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_MINOR, DB_FIELD_PVR_MINOR); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_CHANNEL_TYPE, DB_FIELD_PVR_CHANNEL_TYPE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_CHANNEL_NAME, DB_FIELD_PVR_CHANNEL_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_CHANNEL_NUM, DB_FIELD_PVR_CHANNEL_NUM); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_TITLE, DB_FIELD_PVR_PROGRAM_TITLE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_NUM, DB_FIELD_PVR_PROGRAM_NUM); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_CRID, DB_FIELD_PVR_PROGRAM_CRID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_GUIDANCE, DB_FIELD_PVR_GUIDANCE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_SYNOPSIS, DB_FIELD_PVR_SYNOPSIS); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_GENRE, DB_FIELD_PVR_GENRE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_LANGUAGE, DB_FIELD_PVR_LANGUAGE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_EMBARGO_TIME, DB_FIELD_PVR_EMBARGO_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_EXPIRY_TIME, DB_FIELD_PVR_EXPIRY_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_START_TIME, DB_FIELD_PVR_START_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_START_TIME, DB_FIELD_PVR_PROGRAM_START_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_END_TIME, DB_FIELD_PVR_PROGRAM_END_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_DATE, DB_FIELD_PVR_PROGRAM_DATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_PARENTAL_RATING, DB_FIELD_PVR_PARENTAL_RATING); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_TIMER_RECORD, DB_FIELD_PVR_TIMER_RECORD); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_SERIES_RECORD, DB_FIELD_PVR_SERIES_RECORD); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_HD, DB_FIELD_PVR_HD); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_SUBTITLE, DB_FIELD_PVR_SUBTITLE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_TTX, DB_FIELD_PVR_TTX); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_AD, DB_FIELD_PVR_AD); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_TTX, DB_FIELD_PVR_TTX); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_DATA_SERVICE, DB_FIELD_PVR_DATA_SERVICE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_LOCK, DB_FIELD_PVR_CONTENT_LOCK); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_WATCH, DB_FIELD_PVR_CONTENT_WATCH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_HAS_AUDIO_ONLY, DB_FIELD_PVR_HAS_AUDIO_ONLY); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_IS_LOCAL_RECORD, DB_FIELD_PVR_IS_LOCAL_RECORD); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_RESOLUTION, DB_FIELD_PVR_RESOLUTION); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_ASPECTRATIO, DB_FIELD_PVR_ASPECTRATIO); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_MODIFIED_MONTH, DB_FIELD_PVR_MODIFIED_DATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_MODIFIED_DATE, DB_FIELD_PVR_MODIFIED_DATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_SPORTS_TYPE, DB_FIELD_PVR_SPORTS_TYPE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_GUIDANCE_LENGTH, DB_FIELD_PVR_GUIDANCE_LENGTH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_TVMODE, DB_FIELD_PVR_TVMODE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_PLAY_COUNT, DB_FIELD_PVR_PLAY_COUNT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, PVR_PRIVATE_DATA, DB_FIELD_PVR_PRIVATE_DATA); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* UHD*/ - ret = _media_filter_attribute_add(g_attr_handle, UHD_CONTENT_TITLE, DB_FIELD_UHD_CONTENT_TITLE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, UHD_RELEASE_DATE, DB_FIELD_UHD_RELEASE_DATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, UHD_SUB_TYPE, DB_FIELD_UHD_SUB_TYPE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, UHD_FILE_NAME, DB_FIELD_UHD_FILE_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, UHD_FOLDER_ID, DB_FIELD_FOLDER_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, UHD_PLAYED_COUNT, DB_FIELD_UHD_PLAYED_COUNT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); -#endif - return ret; -} - -static int __media_content_create_alias_attr_handle(void) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - - ret = _media_filter_attribute_create(&g_alias_attr_handle); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Media Info */ - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_ID, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_PATH, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_PATH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_DISPLAY_NAME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DISPLAY_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_TYPE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TYPE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_MIME_TYPE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_MIME_TYPE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_SIZE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_SIZE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_ADDED_TIME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ADDED_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_MODIFIED_TIME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_MODIFIED_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_TIMELINE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TIMELINE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); -#ifdef _USE_TVPD_MODE - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_FOLDER_ID, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_FOLDER_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); -#endif - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_THUMBNAIL_PATH, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_THUMBNAIL_PATH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_TITLE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TITLE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_ALBUM, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ALBUM); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_ARTIST, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ARTIST); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_ALBUM_ARTIST, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ALBUM_ARTIST); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_GENRE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_GENRE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_COMPOSER, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_COMPOSER); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_YEAR, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_YEAR); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_RECORDED_DATE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_RECORDED_DATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_COPYRIGHT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_COPYRIGHT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_TRACK_NUM, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TRACK_NUM); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_DESCRIPTION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DESCRIPTION); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_BITRATE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_BITRATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_BITPERSAMPLE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_BITPERSAMPLE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_SAMPLERATE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_SAMPLERATE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_CHANNEL, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CHANNEL); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_DURATION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DURATION); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_LONGITUDE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LONGITUDE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_LATITUDE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LATITUDE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_ALTITUDE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ALTITUDE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_WIDTH, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_WIDTH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_HEIGHT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_HEIGHT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_DATETAKEN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DATETAKEN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_ORIENTATION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ORIENTATION); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_BURST_ID, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_BURST_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_PLAYED_COUNT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_PLAYED_COUNT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_LAST_PLAYED_TIME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LAST_PLAYED_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_LAST_PLAYED_POSITION, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LAST_PLAYED_POSITION); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_RATING, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_RATING); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_FAVOURITE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_FAVOURITE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_AUTHOR, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_AUTHOR); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_PROVIDER, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_PROVIDER); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_CONTENT_NAME, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CONTENT_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_CATEGORY, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CATEGORY); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_LOCATION_TAG, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LOCATION_TAG); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_AGE_RATING, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_AGE_RATING); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_KEYWORD, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_KEYWORD); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_WEATHER, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_WEATHER); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_IS_DRM, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_IS_DRM); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_STORAGE_TYPE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_STORAGE_TYPE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_360, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_360); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - -#ifdef _USE_SENIOR_MODE - if (_media_content_is_support_senior_mode()) { - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_CONTACT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CONTACT); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_APP_DATA, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_APP_DATA); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - } -#endif - - /* Pinyin*/ - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_FILE_NAME_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_FILE_NAME_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_TITLE_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TITLE_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_ALBUM_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ALBUM_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_ARTIST_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ARTIST_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_ALBUM_ARTIST_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_ALBUM_ARTIST_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_GENRE_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_GENRE_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_COMPOSER_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_COMPOSER_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_COPYRIGHT_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_COPYRIGHT_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_DESCRIPTION_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_DESCRIPTION_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_AUTHOR_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_AUTHOR_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_PROVIDER_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_PROVIDER_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_CONTENT_NAME_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CONTENT_NAME_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_CATEGORY_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CATEGORY_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_LOCATION_TAG_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_LOCATION_TAG_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_AGE_RATING_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_AGE_RATING_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_KEYWORD_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_KEYWORD_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Folder */ - ret = _media_filter_attribute_add(g_alias_attr_handle, FOLDER_ID, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, FOLDER_PATH, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_PATH); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, FOLDER_NAME, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, FOLDER_MODIFIED_TIME, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_MODIFIED_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, FOLDER_STORAGE_TYPE, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_STORAGE_TYPE); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, FOLDER_NAME_PINYIN, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_NAME_PINYIN); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, FOLDER_ORDER, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_ORDER); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, FOLDER_PARENT_FOLDER_ID, DB_TABLE_ALIAS_FOLDER"."DB_FIELD_FOLDER_PARENT_FOLDER_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Playlist*/ - ret = _media_filter_attribute_add(g_alias_attr_handle, PLAYLIST_NAME, DB_TABLE_ALIAS_PLAYLIST"."DB_FIELD_PLAYLIST_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, PLAYLIST_MEMBER_ORDER, DB_TABLE_ALIAS_PLAYLIST_MAP"."DB_FIELD_PLAYLIST_MEMBER_ORDER); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Tag*/ - ret = _media_filter_attribute_add(g_alias_attr_handle, TAG_NAME, DB_TABLE_ALIAS_TAG"."DB_FIELD_TAG_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Bookmark*/ - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_BOOKMARK_ID, DB_TABLE_ALIAS_BOOKMARK"."DB_FIELD_BOOKMARK_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, BOOKMARK_MARKED_TIME, DB_TABLE_ALIAS_BOOKMARK"."DB_FIELD_BOOKMARK_MARKED_TIME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_alias_attr_handle, BOOKMARK_NAME, DB_TABLE_ALIAS_BOOKMARK"."DB_FIELD_BOOKMARK_NAME); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - /* Face */ - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_FACE_TAG, DB_TABLE_ALIAS_FACE"."DB_FIELD_FACE_TAG); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = _media_filter_attribute_add(g_attr_handle, MEDIA_FACE_ID, DB_TABLE_ALIAS_FACE"."DB_FIELD_FACE_ID); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - return ret; -} - -static int __media_content_create_attribute_handle(void) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - - ret = __media_content_create_attr_handle(); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = __media_content_create_alias_attr_handle(); - if (ret != MEDIA_CONTENT_ERROR_NONE) - _media_filter_attribute_destory(g_attr_handle); - - return ret; -} -#endif - static int __media_content_create_attribute_handles(void) { int ret = MEDIA_CONTENT_ERROR_NONE; diff --git a/src/media_db.c b/src/media_db.c index 5d15b71..f7e4524 100755 --- a/src/media_db.c +++ b/src/media_db.c @@ -63,26 +63,8 @@ static char * __media_db_get_group_name(media_group_e group) return (char *) DB_FIELD_MEDIA_LATITUDE; case MEDIA_CONTENT_GROUP_ALTITUDE: return (char *) DB_FIELD_MEDIA_ALTITUDE; - case MEDIA_CONTENT_GROUP_BURST_IMAGE: - return (char *) DB_FIELD_MEDIA_BURST_ID; case MEDIA_CONTENT_GROUP_RATING: return (char *) DB_FIELD_MEDIA_RATING; - case MEDIA_CONTENT_GROUP_AUTHOR: - return (char *) DB_FIELD_MEDIA_AUTHOR; - case MEDIA_CONTENT_GROUP_PROVIDER: - return (char *) DB_FIELD_MEDIA_PROVIDER; - case MEDIA_CONTENT_GROUP_CONTENT_NAME: - return (char *) DB_FIELD_MEDIA_CONTENT_NAME; - case MEDIA_CONTENT_GROUP_CATEGORY: - return (char *) DB_FIELD_MEDIA_CATEGORY; - case MEDIA_CONTENT_GROUP_LOCATION_TAG: - return (char *) DB_FIELD_MEDIA_LOCATION_TAG; - case MEDIA_CONTENT_GROUP_AGE_RATING: - return (char *) DB_FIELD_MEDIA_AGE_RATING; - case MEDIA_CONTENT_GROUP_KEYWORD: - return (char *) DB_FIELD_MEDIA_KEYWORD; - case MEDIA_CONTENT_GROUP_WEATHER: - return (char *) DB_FIELD_MEDIA_WEATHER; #ifdef _USE_TVPD_MODE case MEDIA_CONTENT_GROUP_MODIFIED_MONTH: return (char *) DB_FIELD_MEDIA_MODIFIED_DATE; @@ -625,9 +607,7 @@ int _media_db_get_folder(filter_h filter, media_folder_cb callback, void *user_d _folder->path = g_strdup((const char *)sqlite3_column_text(stmt, 1)); _folder->name = g_strdup((const char *)sqlite3_column_text(stmt, 2)); _folder->storage_type = (int)sqlite3_column_int(stmt, 3); - _folder->modified_time = (int)sqlite3_column_int(stmt, 4); - _folder->storage_uuid = g_strdup((const char *)sqlite3_column_text(stmt, 5)); - _folder->folder_order = (int)sqlite3_column_int(stmt, 6); + _folder->storage_uuid = g_strdup((const char *)sqlite3_column_text(stmt, 4)); if (callback((media_folder_h)_folder, user_data) == false) { media_folder_destroy((media_folder_h) _folder); diff --git a/src/media_folder.c b/src/media_folder.c index f431eae..5462ac1 100755 --- a/src/media_folder.c +++ b/src/media_folder.c @@ -21,8 +21,6 @@ #include #endif -static char *g_src_path = NULL; - int media_folder_get_folder_count_from_db(filter_h filter, int *folder_count) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -193,8 +191,6 @@ int media_folder_clone(media_folder_h *dst, media_folder_h src) } _dst->storage_type = _src->storage_type; - _dst->modified_time = _src->modified_time; - _dst->folder_order = _src->folder_order; *dst = (media_folder_h)_dst; @@ -228,46 +224,6 @@ int media_folder_get_folder_id(media_folder_h folder, char **folder_id) return ret; } -int media_folder_get_parent_folder_id(media_folder_h folder, char **parent_folder_id) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_folder_get_parent_folder_id() is deprecated and will be removed from next release."); - media_folder_s *_folder = (media_folder_s*)folder; - sqlite3_stmt *stmt = NULL; - char tmp_path[MAX_PATH_LEN] = {0, }; - char *parent_path = NULL; - char select_query[MAX_QUERY_SIZE] = {0, }; - - /* Usage is low. So, DB access when this function is called */ - if (_folder) { - memset(tmp_path, 0x00, sizeof(tmp_path)); - memset(select_query, 0x00, sizeof(select_query)); - - _media_content_replace_path(_folder->path, tmp_path); - - parent_path = g_path_get_dirname(tmp_path); - snprintf(select_query, sizeof(select_query), SELECT_FOLDER_ID_BY_PATH, parent_path); - SAFE_FREE(parent_path); - - ret = _content_query_prepare(&stmt, select_query, NULL, NULL); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - if (sqlite3_step(stmt) == SQLITE_ROW) - *parent_folder_id = g_strdup((const char *)sqlite3_column_text(stmt, 0)); - else - *parent_folder_id = NULL; - - SQLITE3_FINALIZE(stmt); - - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - int media_folder_get_path(media_folder_h folder, char **path) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -313,23 +269,6 @@ int media_folder_get_name(media_folder_h folder, char **name) return ret; } -int media_folder_get_modified_time(media_folder_h folder, time_t* time) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_folder_get_modified_time() is deprecated and will be removed from next release."); - media_folder_s *_folder = (media_folder_s*)folder; - - if (_folder) { - *time = _folder->modified_time; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - int media_folder_get_storage_type(media_folder_h folder, media_content_storage_e* storage_type) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -370,24 +309,6 @@ int media_folder_get_storage_id(media_folder_h folder, char **storage_id) return ret; } -int media_folder_get_order(media_folder_h folder, int *order) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_folder_get_order() is deprecated and will be removed from next release."); - media_folder_s *_folder = (media_folder_s*)folder; - - if (_folder) { - *order = _folder->folder_order; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - - int media_folder_get_folder_from_db(const char *folder_id, media_folder_h *folder) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -417,10 +338,8 @@ int media_folder_get_folder_from_db(const char *folder_id, media_folder_h *folde _folder->folder_id = g_strdup((const char *)sqlite3_column_text(stmt, 0)); _folder->path = g_strdup((const char *)sqlite3_column_text(stmt, 1)); _folder->name = g_strdup((const char *)sqlite3_column_text(stmt, 2)); - _folder->modified_time = (int)sqlite3_column_int(stmt, 3); - _folder->storage_type = (int)sqlite3_column_int(stmt, 5); - _folder->storage_uuid = g_strdup((const char *)sqlite3_column_text(stmt, 6)); - _folder->folder_order = (int)sqlite3_column_int(stmt, 7); + _folder->storage_type = (int)sqlite3_column_int(stmt, 3); + _folder->storage_uuid = g_strdup((const char *)sqlite3_column_text(stmt, 4)); *folder = (media_folder_h)_folder; } @@ -429,100 +348,6 @@ int media_folder_get_folder_from_db(const char *folder_id, media_folder_h *folde return ret; } - -int media_folder_update_to_db(media_folder_h folder) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_folder_update_to_db() is deprecated and will be removed from next release."); - media_folder_s *_folder = (media_folder_s*)folder; - char *sql = NULL; - char repl_path[MAX_PATH_LEN] = {0, }; - - if ((_folder == NULL) || (_folder->folder_id == NULL)) { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - /* Update folder order */ - sql = sqlite3_mprintf(UPDATE_FOLDER_ORDER, _folder->folder_order, _folder->folder_id); - - ret = _content_query_sql(sql); - SQLITE3_SAFE_FREE(sql); - - if (STRING_VALID(_folder->folder_id) && g_src_path) { - ret = _media_content_replace_path(_folder->path, repl_path); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - SAFE_FREE(g_src_path); - return ret; - } - ret = media_svc_rename_folder(_content_get_db_handle(), _folder->storage_uuid, g_src_path, repl_path, _content_get_uid()); - SAFE_FREE(g_src_path); - - return _content_error_capi(MEDIA_CONTENT_TYPE, ret); - } - - return ret; -} - -int media_folder_set_name(media_folder_h folder, const char *name) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_folder_set_name() is deprecated and will be removed from next release."); - media_folder_s *_folder = (media_folder_s*)folder; - - if (_folder != NULL && STRING_VALID(name) && name[0] != '.') { - if (STRING_VALID(_folder->path) && STRING_VALID(_folder->name)) { - char *folder_path = NULL; - char new_folder_path[MAX_PATH_LEN] = {0,}; - char repl_path[MAX_PATH_LEN] = {0, }; - - memset(repl_path, 0, sizeof(repl_path)); - ret = _media_content_replace_path(_folder->path, repl_path); - media_content_retvm_if(!STRING_VALID(repl_path), MEDIA_CONTENT_ERROR_INVALID_OPERATION, "path replacement failed"); - - folder_path = g_path_get_dirname(repl_path); - media_content_sec_debug("Existed Folder Path : %s", repl_path); - snprintf(new_folder_path, sizeof(new_folder_path), "%s/%s", folder_path, name); - media_content_sec_debug("New Path : %s", new_folder_path); - - SAFE_FREE(g_src_path); - g_src_path = strdup(repl_path); - - SAFE_FREE(_folder->path); - SAFE_FREE(_folder->name); - SAFE_FREE(folder_path); - - _folder->path = strdup(new_folder_path); - media_content_retvm_if(_folder->path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - _folder->name = strdup(name); - media_content_retvm_if(_folder->name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - -int media_folder_set_order(media_folder_h folder, int order) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_folder_set_order() is deprecated and will be removed from next release."); - media_folder_s *_folder = (media_folder_s*)folder; - - if (_folder != NULL && order >= 0) { - _folder->folder_order = order; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} #ifdef _USE_TVPD_MODE int media_folder_insert_to_db(const char *path) { diff --git a/src/media_image.c b/src/media_image.c index 6c4468b..3eb55a9 100755 --- a/src/media_image.c +++ b/src/media_image.c @@ -34,7 +34,6 @@ int image_meta_destroy(image_meta_h image) SAFE_FREE(_image->media_id); SAFE_FREE(_image->date_taken); SAFE_FREE(_image->title); - SAFE_FREE(_image->burst_id); SAFE_FREE(_image->exposure_time); SAFE_FREE(_image->model); SAFE_FREE(_image); @@ -65,11 +64,6 @@ int image_meta_clone(image_meta_h *dst, image_meta_h src) media_content_retv_free_image_if(_dst->title == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (image_meta_h)_dst); } - if (STRING_VALID(_src->burst_id)) { - _dst->burst_id = strdup(_src->burst_id); - media_content_retv_free_image_if(_dst->burst_id == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (image_meta_h)_dst); - } - if (STRING_VALID(_src->exposure_time)) { _dst->exposure_time = strdup(_src->exposure_time); media_content_retv_free_image_if(_dst->exposure_time == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (image_meta_h)_dst); @@ -187,28 +181,6 @@ int image_meta_get_date_taken(image_meta_h image, char **date_taken) return ret; } -int image_meta_get_burst_id(image_meta_h image, char **burst_id) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: image_meta_get_burst_id() is deprecated and will be removed from next release."); - image_meta_s *_image = (image_meta_s*)image; - - if (_image && burst_id) { - if (STRING_VALID(_image->burst_id)) { - *burst_id = strdup(_image->burst_id); - media_content_retvm_if(*burst_id == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - *burst_id = NULL; - } - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - int image_meta_get_exposure_time(image_meta_h image, char **exposure_time) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -282,70 +254,3 @@ int image_meta_get_model(image_meta_h image, char **model) return ret; } - -int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: image_meta_is_burst_shot() is deprecated and will be removed from next release."); - image_meta_s *_image = (image_meta_s*)image; - - if (_image && is_burst_shot) { - if (STRING_VALID(_image->burst_id)) - *is_burst_shot = true; - else - *is_burst_shot = false; - - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - -int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: image_meta_set_orientation() is deprecated and will be removed from next release."); - image_meta_s *_image = (image_meta_s*)image; - - if (_image == NULL) { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - if ((orientation < MEDIA_CONTENT_ORIENTATION_NOT_AVAILABLE) || (orientation > MEDIA_CONTENT_ORIENTATION_ROT_270)) { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - _image->orientation = orientation; - - return ret; -} - -int image_meta_update_to_db(image_meta_h image) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: image_meta_update_to_db() is deprecated and will be removed from next release."); - image_meta_s *_image = (image_meta_s*)image; - char *sql = NULL; - - if (_image != NULL && STRING_VALID(_image->media_id)) { - char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0,}; - memset(storage_id, 0x00, sizeof(storage_id)); - - ret = _media_db_get_storage_id_by_media_id(_image->media_id, storage_id); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - sql = sqlite3_mprintf(UPDATE_IMAGE_META_FROM_MEDIA, storage_id, _image->orientation, _image->media_id); - ret = _content_query_sql(sql); - SQLITE3_SAFE_FREE(sql); - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} diff --git a/src/media_info.c b/src/media_info.c index 00dd2d0..f9b879f 100755 --- a/src/media_info.c +++ b/src/media_info.c @@ -34,8 +34,7 @@ static void __media_info_insert_completed_cb(media_request_result_s *result, void *user_data); static void __media_info_thumbnail_completed_cb(int error, const char *path, void *user_data); static void __media_info_face_completed_cb(int error, const int face_count, void *user_data); -static int __media_info_insert_batch(media_batch_insert_e insert_type, const char **path_array, unsigned int array_length, media_insert_completed_cb completed_cb, void *user_data); -static int __media_info_set_str_data(media_info_h media, media_info_item_e data_type, const char *str_data); +static int __media_info_insert_batch(const char **path_array, unsigned int array_length, media_insert_completed_cb completed_cb, void *user_data); static int __media_info_check_file_validity(const char *path); static int __media_info_get_media_path_by_id_from_db(const char *media_id, char **path) @@ -154,7 +153,7 @@ static void __media_info_face_completed_cb(int error, const int face_count, void return; } -static int __media_info_insert_batch(media_batch_insert_e insert_type, const char **path_array, +static int __media_info_insert_batch(const char **path_array, unsigned int array_length, media_insert_completed_cb completed_cb, void *user_data) @@ -239,13 +238,7 @@ static int __media_info_insert_batch(media_batch_insert_e insert_type, const cha _cb_data->user_data = user_data; _cb_data->insert_list_path = g_strdup(list_path); - if (insert_type == MEDIA_BATCH_INSERT_NORMAL) - ret = media_files_register(list_path, __media_info_insert_completed_cb, _cb_data, _content_get_uid()); - else if (insert_type == MEDIA_BATCH_INSERT_BURSTSHOT) - ret = media_burstshot_register(list_path, __media_info_insert_completed_cb, _cb_data, _content_get_uid()); - else - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - + ret = media_files_register(list_path, __media_info_insert_completed_cb, _cb_data, _content_get_uid()); if (ret != MEDIA_CONTENT_ERROR_NONE) { media_content_error("media_files_register failed : %d", ret); if (unlink(list_path) < 0) @@ -256,75 +249,6 @@ static int __media_info_insert_batch(media_batch_insert_e insert_type, const cha return ret; } -int __media_info_get_storage_list_to_remove(const char *condition_query, GArray **storage_list) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - char *query_string = NULL; - sqlite3_stmt *stmt = NULL; - - media_content_retv_if(storage_list == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - media_content_retv_if(!STRING_VALID(condition_query), MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - - query_string = sqlite3_mprintf(SELECT_STORAGE_BY_FILTER, condition_query); - - ret = _content_query_prepare(&stmt, query_string, NULL, NULL); - SQLITE3_SAFE_FREE(query_string); - - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - *storage_list = g_array_new(FALSE, FALSE, sizeof(media_storage_s *)); - - while (sqlite3_step(stmt) == SQLITE_ROW) { - media_storage_s *storage = (media_storage_s*)calloc(1, sizeof(media_storage_s)); - if (storage == NULL) { - media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY); - SQLITE3_FINALIZE(stmt); - return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY; - } - storage->storage_id = g_strdup((const char *)sqlite3_column_text(stmt, 0)); - storage->storage_type = (int)sqlite3_column_int(stmt, 1); - - g_array_append_val(*storage_list, storage); - } - - SQLITE3_FINALIZE(stmt); - - return ret; -} - -int __media_info_get_thumbnail_to_remove(const char *condition_query, const char *storage_id, int storage_type, GArray **thumb_list) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - char *query_string = NULL; - char *thumbnail_path = NULL; - sqlite3_stmt *stmt = NULL; - - media_content_retv_if(thumb_list == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - media_content_retv_if(storage_id == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - media_content_retv_if(!STRING_VALID(condition_query), MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - - query_string = sqlite3_mprintf(SELECT_THUMBNAIL_BY_FILTER, storage_id, condition_query, storage_type); - - ret = _content_query_prepare(&stmt, query_string, NULL, NULL); - SQLITE3_SAFE_FREE(query_string); - - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - *thumb_list = g_array_new(FALSE, FALSE, sizeof(char*)); - - while (sqlite3_step(stmt) == SQLITE_ROW) { - thumbnail_path = g_strdup((const char *)sqlite3_column_text(stmt, 0)); - if (STRING_VALID(thumbnail_path)) - g_array_append_val(*thumb_list, thumbnail_path); - else - SAFE_FREE(thumbnail_path); - } - - SQLITE3_FINALIZE(stmt); - - return ret; -} - static int __media_info_check_file_validity(const char *path) { bool ignore = FALSE; @@ -363,28 +287,20 @@ void _media_info_item_get_detail(sqlite3_stmt* stmt, media_info_h media) _media->description = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_DESCRIPTION)); _media->rating = (int)sqlite3_column_int(stmt, MEDIA_INFO_RATING); _media->favourite = (int)sqlite3_column_int(stmt, MEDIA_INFO_FAVOURITE); - _media->author = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_AUTHOR)); - _media->provider = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_PROVIDER)); - _media->content_name = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_CONTENT_NAME)); - _media->category = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_CATEGORY)); - _media->location_tag = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_LOCATION_TAG)); - _media->age_rating = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_AGE_RATING)); - _media->keyword = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_KEYWORD)); _media->is_drm = (int)sqlite3_column_int(stmt, MEDIA_INFO_IS_DRM); _media->storage_type = (int)sqlite3_column_int(stmt, MEDIA_INFO_STORAGE_TYPE); _media->longitude = (double)sqlite3_column_double(stmt, MEDIA_INFO_LONGITUDE); _media->latitude = (double)sqlite3_column_double(stmt, MEDIA_INFO_LATITUDE); _media->altitude = (double)sqlite3_column_double(stmt, MEDIA_INFO_ALTITUDE); - _media->played_count = sqlite3_column_int(stmt, MEDIA_INFO_PLAYED_COUNT); - _media->played_time = sqlite3_column_int(stmt, MEDIA_INFO_LAST_PLAYED_TIME); - _media->played_position = sqlite3_column_int(stmt, MEDIA_INFO_LAST_PLAYED_POSITION); _media->title = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_TITLE)); _media->timeline = (double)sqlite3_column_double(stmt, MEDIA_INFO_TIMELINE); - _media->weather = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_WEATHER)); _media->sync_status = (int)sqlite3_column_int(stmt, MEDIA_INFO_SYNC_STATUS); _media->storage_uuid = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_STORAGE_UUID)); _media->is_360 = (int)sqlite3_column_int(stmt, MEDIA_INFO_IS_360); #ifdef _USE_TVPD_MODE + _media->played_count = sqlite3_column_int(stmt, MEDIA_INFO_PLAYED_COUNT); + _media->played_time = sqlite3_column_int(stmt, MEDIA_INFO_LAST_PLAYED_TIME); + _media->played_position = sqlite3_column_int(stmt, MEDIA_INFO_LAST_PLAYED_POSITION); _media->stitched_info = (int)sqlite3_column_int(stmt, MEDIA_INFO_STITCHED_INFO); #endif @@ -399,7 +315,6 @@ void _media_info_item_get_detail(sqlite3_stmt* stmt, media_info_h media) _media->image_meta->date_taken = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_DATETAKEN)); _media->image_meta->orientation = sqlite3_column_int(stmt, MEDIA_INFO_ORIENTATION); _media->image_meta->title = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_TITLE)); - _media->image_meta->burst_id = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_BURST_ID)); _media->image_meta->exposure_time = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_EXPOSURE_TIME)); _media->image_meta->model = g_strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_MODEL)); } @@ -560,41 +475,7 @@ int media_info_insert_batch_to_db(const char **path_array, unsigned int array_le } } - ret = __media_info_insert_batch(MEDIA_BATCH_INSERT_NORMAL, (const char **)repl_path_array, array_length, completed_cb, user_data); - for (idx = 0; idx < array_length; idx++) - SAFE_FREE(repl_path_array[idx]); - - SAFE_FREE(repl_path_array); - - return ret; -} - -int media_info_insert_burst_shot_to_db(const char **path_array, unsigned int array_length, media_insert_burst_shot_completed_cb callback, void *user_data) -{ - char **repl_path_array = NULL; - int idx = 0; - int ret = MS_MEDIA_ERR_NONE; - char repl_path[MAX_PATH_LEN] = {0, }; - - media_content_warn("DEPRECATION WARNING: media_info_insert_burst_shot_to_db() is deprecated and will be removed from next release."); - - media_content_retvm_if(path_array == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid path_array"); - media_content_retvm_if(array_length <= 0, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid array_length"); - - repl_path_array = calloc(1, sizeof(char *) * array_length); - media_content_retvm_if(repl_path_array == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - - for (idx = 0; idx < array_length; idx++) { - if (STRING_VALID(path_array[idx])) { - memset(repl_path, 0, sizeof(repl_path)); - _media_content_replace_path(path_array[idx], repl_path); - repl_path_array[idx] = strndup(repl_path, strlen(repl_path)); - } else { - media_content_error("path[%d] is invalid string", idx); - } - } - - ret = __media_info_insert_batch(MEDIA_BATCH_INSERT_BURSTSHOT, (const char **)repl_path_array, array_length, callback, user_data); + ret = __media_info_insert_batch((const char **)repl_path_array, array_length, completed_cb, user_data); for (idx = 0; idx < array_length; idx++) SAFE_FREE(repl_path_array[idx]); @@ -603,96 +484,12 @@ int media_info_insert_burst_shot_to_db(const char **path_array, unsigned int arr return ret; } -#ifdef _USE_TVPD_MODE -int media_info_get_media_info_by_path_from_db(const char* path, media_info_h* media) -{ - char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0,}; - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_retvm_if(!STRING_VALID(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "invalid path"); - media_content_retvm_if(media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "invalid info"); - - memset(storage_id, 0x00, sizeof(storage_id)); - ret = media_svc_get_storage_id(_content_get_db_handle(), path, storage_id, tzplatform_getuid(TZ_USER_NAME)); - if (ret != MS_MEDIA_ERR_NONE) { - media_content_error("media_svc_get_storage_id failed : %d", ret); - return _content_error_capi(MEDIA_CONTENT_TYPE, ret); - } - - media_info_s *_media = (media_info_s*)calloc(1, sizeof(media_info_s)); - media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - - ret = _media_info_get_media_info_from_db(path, storage_id, (media_info_h)_media); - *media = (media_info_h)_media; - - return ret; -} -#endif - -#ifdef _USE_SENIOR_MODE -int media_info_set_contact(media_info_h media, const char *contact) -{ - return __media_info_set_str_data(media, MEDIA_INFO_CONTACT, contact); -} - -int media_info_set_app_data(media_info_h media, const char *app_data) -{ - return __media_info_set_str_data(media, MEDIA_INFO_APP_DATA, app_data); -} - -int media_info_insert_to_db_with_contact_data(const char *path, const char* contact, const char* app_data, media_info_h *info) -{ - int ret = media_info_insert_to_db(path, info); - media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_insert_to_db [%s] failed", path); - - ret = media_info_set_contact(*info, contact); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("media_info_set_contact [%s] failed", contact); - - media_info_s* _media_info = (media_info_s*)*info; - ret = media_info_delete_from_db(_media_info->media_id); - media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_delete_from_db [%s] failed", _media_info->media_id); - - media_info_destroy(*info); - return ret; - } - - ret = media_info_set_app_data(*info, app_data); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("media_info_set_app_data [%s] failed", app_data); - - media_info_s* _media_info = (media_info_s*)*info; - ret = media_info_delete_from_db(_media_info->media_id); - media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_delete_from_db [%s] failed", _media_info->media_id); - - media_info_destroy(*info); - return ret; - } - - ret = media_info_update_to_db(*info); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("media_info_update_to_db [] failed"); - - media_info_s* _media_info = (media_info_s*)*info; - ret = media_info_delete_from_db(_media_info->media_id); - media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_delete_from_db [%s] failed", _media_info->media_id); - - media_info_destroy(*info); - return ret; - } - - return ret; -} - -int media_info_delete_contact_from_db(const char* contact, const char* storage_id) -{ - return -1; -} - -int media_info_delete_item(const char *media_id) +int media_info_delete_from_db(const char *media_id) { int ret = MEDIA_CONTENT_ERROR_NONE; char *path = NULL; - char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0,}; + char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, }; + media_content_warn("DEPRECATION WARNING: media_info_delete_from_db() is deprecated and will be removed from next release. Use media_content_scan_file() instead."); if (!STRING_VALID(media_id)) { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); @@ -715,269 +512,84 @@ int media_info_delete_item(const char *media_id) return ret; } - ret = media_svc_delete_item_by_path(_content_get_db_handle(), storage_id, path, tzplatform_getuid(TZ_USER_NAME)); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("remove from DB failed : %d", ret); - SAFE_FREE(path); - return ret; - } - - ret = media_svc_remove_file(path); + ret = media_svc_delete_item_by_path(_content_get_db_handle(), storage_id, path, _content_get_uid()); SAFE_FREE(path); + return _content_error_capi(MEDIA_CONTENT_TYPE, ret); } +int media_info_destroy(media_info_h media) +{ + media_info_s *_media = (media_info_s*)media; + media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Handle is null"); + + SAFE_FREE(_media->media_id); + SAFE_FREE(_media->file_path); + SAFE_FREE(_media->display_name); + SAFE_FREE(_media->mime_type); + SAFE_FREE(_media->thumbnail_path); + SAFE_FREE(_media->description); + SAFE_FREE(_media->title); +#ifdef _USE_TVPD_MODE + SAFE_FREE(_media->modified_month); +#endif + SAFE_FREE(_media->storage_uuid); +#ifdef _USE_SENIOR_MODE + SAFE_FREE(_media->contact); + SAFE_FREE(_media->app_data); #endif -int media_info_delete_from_db(const char *media_id) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - char *path = NULL; - char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, }; - media_content_warn("DEPRECATION WARNING: media_info_delete_from_db() is deprecated and will be removed from next release. Use media_content_scan_file() instead."); + if (_media->image_meta) { + SAFE_FREE(_media->image_meta->media_id); + SAFE_FREE(_media->image_meta->date_taken); + SAFE_FREE(_media->image_meta->exposure_time); + SAFE_FREE(_media->image_meta->model); + SAFE_FREE(_media->image_meta->title); - if (!STRING_VALID(media_id)) { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + SAFE_FREE(_media->image_meta); } - memset(storage_id, 0x00, sizeof(storage_id)); + if (_media->video_meta) { + SAFE_FREE(_media->video_meta->media_id); + SAFE_FREE(_media->video_meta->title); + SAFE_FREE(_media->video_meta->album); + SAFE_FREE(_media->video_meta->artist); + SAFE_FREE(_media->video_meta->album_artist); + SAFE_FREE(_media->video_meta->genre); + SAFE_FREE(_media->video_meta->composer); + SAFE_FREE(_media->video_meta->year); + SAFE_FREE(_media->video_meta->recorded_date); + SAFE_FREE(_media->video_meta->copyright); + SAFE_FREE(_media->video_meta->track_num); - ret = __media_info_get_media_path_by_id_from_db(media_id, &path); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("__media_info_get_media_path_by_id_from_db failed : %d", ret); - SAFE_FREE(path); - return ret; + SAFE_FREE(_media->video_meta); } - ret = _media_db_get_storage_id_by_media_id(media_id, storage_id); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("_media_db_get_storage_id_by_media_id failed : %d", ret); - SAFE_FREE(path); - return ret; + if (_media->audio_meta) { + SAFE_FREE(_media->audio_meta->media_id); + SAFE_FREE(_media->audio_meta->title); + SAFE_FREE(_media->audio_meta->album); + SAFE_FREE(_media->audio_meta->artist); + SAFE_FREE(_media->audio_meta->album_artist); + SAFE_FREE(_media->audio_meta->genre); + SAFE_FREE(_media->audio_meta->composer); + SAFE_FREE(_media->audio_meta->year); + SAFE_FREE(_media->audio_meta->recorded_date); + SAFE_FREE(_media->audio_meta->copyright); + SAFE_FREE(_media->audio_meta->track_num); + + SAFE_FREE(_media->audio_meta); } - ret = media_svc_delete_item_by_path(_content_get_db_handle(), storage_id, path, _content_get_uid()); - SAFE_FREE(path); + SAFE_FREE(_media); - return _content_error_capi(MEDIA_CONTENT_TYPE, ret); + return MEDIA_CONTENT_ERROR_NONE; } -static int __media_info_delete_thumb_from_list(GArray *thumb_list) +int media_info_clone(media_info_h *dst, media_info_h src) { - int i = 0; - int list_len = 0; - char *thumb_path = NULL; - - if (thumb_list != NULL) { - list_len = thumb_list->len; - for (i = 0; i < list_len; i++) { - thumb_path = g_array_index(thumb_list, char*, i); - media_content_debug("thumb path [%s]", thumb_path); - if (unlink(thumb_path) < 0) - media_content_stderror("failed to delete"); - } - } - return MEDIA_CONTENT_ERROR_NONE; -} - -static int __media_info_release_thumb_list(GArray *thumb_list) -{ - int i = 0; - int list_len = 0; - char *thumb_path = NULL; - - if (thumb_list != NULL) { - list_len = thumb_list->len; - for (i = 0; i < list_len; i++) { - thumb_path = g_array_index(thumb_list, char*, 0); - g_array_remove_index(thumb_list, 0); - SAFE_FREE(thumb_path); - } - - g_array_free(thumb_list, FALSE); - } - - return MEDIA_CONTENT_ERROR_NONE; -} - -static int __media_info_release_storage_list(GArray *storage_list) -{ - int i = 0; - int list_len = 0; - media_storage_s *storage = NULL; - - if (storage_list != NULL) { - list_len = storage_list->len; - for (i = 0; i < list_len; i++) { - storage = g_array_index(storage_list, media_storage_s *, 0); - g_array_remove_index(storage_list, 0); - SAFE_FREE(storage->storage_id); - SAFE_FREE(storage); - } - - g_array_free(storage_list, FALSE); - } - - return MEDIA_CONTENT_ERROR_NONE; -} - -int media_info_delete_batch_from_db(filter_h filter) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - char *query_string = NULL; - filter_s *_filter = NULL; - attribute_h attr; - char *condition_query = NULL; - GArray *storage_list = NULL; - GArray *thumb_list = NULL; - int idx = 0; - media_storage_s *storage_item = NULL; - - media_content_warn("DEPRECATION WARNING: media_info_delete_batch_from_db() is deprecated and will be removed from next release."); - - media_content_retvm_if(filter == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid filter"); - - _filter = (filter_s*)filter; - - media_content_retvm_if(_filter->condition == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid condition"); - - attr = _content_get_attirbute_handle(); - - ret = _media_filter_attribute_generate(attr, filter, &condition_query); - media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "Invalid condition"); - - ret = __media_info_get_storage_list_to_remove(condition_query, &storage_list); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - SAFE_FREE(condition_query); - __media_info_release_storage_list(storage_list); - - return ret; - } - - for (idx = 0; idx < storage_list->len; idx++) { - storage_item = g_array_index(storage_list, media_storage_s *, idx); - /*media_content_debug("storage_id[%s] storage_type[%d]", storage_item->storage_id, storage_item->storage_type);*/ - - ret = __media_info_get_thumbnail_to_remove(condition_query, storage_item->storage_id, storage_item->storage_type, &thumb_list); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - SAFE_FREE(condition_query); - __media_info_release_storage_list(storage_list); - __media_info_release_thumb_list(thumb_list); - - return ret; - } - - query_string = sqlite3_mprintf(DELETE_MEDIA_FROM_MEDIA_BATCH, storage_item->storage_id, condition_query, storage_item->storage_type); - - ret = _content_query_sql(query_string); - SQLITE3_SAFE_FREE(query_string); - - if (ret == MEDIA_CONTENT_ERROR_NONE) { - media_content_debug("Batch deletion succeeded. Send notification for this"); - if (storage_item->storage_type == MEDIA_CONTENT_STORAGE_INTERNAL) { - media_svc_publish_noti(MS_MEDIA_ITEM_DIRECTORY, MS_MEDIA_ITEM_UPDATE, MEDIA_ROOT_PATH_INTERNAL, -1, NULL, NULL); - } else { - char *storage_path = NULL; - media_svc_get_storage_path(_content_get_db_handle(), storage_item->storage_id, &storage_path); - if (STRING_VALID(storage_path)) - media_svc_publish_noti(MS_MEDIA_ITEM_DIRECTORY, MS_MEDIA_ITEM_UPDATE, storage_path, -1, NULL, NULL); - - SAFE_FREE(storage_path); - } - __media_info_delete_thumb_from_list(thumb_list); - } - __media_info_release_thumb_list(thumb_list); - - } - - SAFE_FREE(condition_query); - __media_info_release_storage_list(storage_list); - - return ret; -} - -int media_info_destroy(media_info_h media) -{ - media_info_s *_media = (media_info_s*)media; - media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Handle is null"); - - SAFE_FREE(_media->media_id); - SAFE_FREE(_media->file_path); - SAFE_FREE(_media->display_name); - SAFE_FREE(_media->mime_type); - SAFE_FREE(_media->thumbnail_path); - SAFE_FREE(_media->description); - SAFE_FREE(_media->author); - SAFE_FREE(_media->provider); - SAFE_FREE(_media->content_name); - SAFE_FREE(_media->category); - SAFE_FREE(_media->location_tag); - SAFE_FREE(_media->age_rating); - SAFE_FREE(_media->keyword); - SAFE_FREE(_media->title); -#ifdef _USE_TVPD_MODE - SAFE_FREE(_media->modified_month); -#endif - SAFE_FREE(_media->weather); - SAFE_FREE(_media->storage_uuid); -#ifdef _USE_SENIOR_MODE - SAFE_FREE(_media->contact); - SAFE_FREE(_media->app_data); -#endif - - if (_media->image_meta) { - SAFE_FREE(_media->image_meta->media_id); - SAFE_FREE(_media->image_meta->date_taken); - SAFE_FREE(_media->image_meta->burst_id); - SAFE_FREE(_media->image_meta->exposure_time); - SAFE_FREE(_media->image_meta->model); - SAFE_FREE(_media->image_meta->title); - - SAFE_FREE(_media->image_meta); - } - - if (_media->video_meta) { - SAFE_FREE(_media->video_meta->media_id); - SAFE_FREE(_media->video_meta->title); - SAFE_FREE(_media->video_meta->album); - SAFE_FREE(_media->video_meta->artist); - SAFE_FREE(_media->video_meta->album_artist); - SAFE_FREE(_media->video_meta->genre); - SAFE_FREE(_media->video_meta->composer); - SAFE_FREE(_media->video_meta->year); - SAFE_FREE(_media->video_meta->recorded_date); - SAFE_FREE(_media->video_meta->copyright); - SAFE_FREE(_media->video_meta->track_num); - - SAFE_FREE(_media->video_meta); - } - - if (_media->audio_meta) { - SAFE_FREE(_media->audio_meta->media_id); - SAFE_FREE(_media->audio_meta->title); - SAFE_FREE(_media->audio_meta->album); - SAFE_FREE(_media->audio_meta->artist); - SAFE_FREE(_media->audio_meta->album_artist); - SAFE_FREE(_media->audio_meta->genre); - SAFE_FREE(_media->audio_meta->composer); - SAFE_FREE(_media->audio_meta->year); - SAFE_FREE(_media->audio_meta->recorded_date); - SAFE_FREE(_media->audio_meta->copyright); - SAFE_FREE(_media->audio_meta->track_num); - - SAFE_FREE(_media->audio_meta); - } - - SAFE_FREE(_media); - - return MEDIA_CONTENT_ERROR_NONE; -} - -int media_info_clone(media_info_h *dst, media_info_h src) -{ - media_info_s *_src = (media_info_s*)src; - media_content_retvm_if(_src == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Source handle is null"); + media_info_s *_src = (media_info_s*)src; + media_content_retvm_if(_src == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Source handle is null"); media_info_s *_dst = (media_info_s*)calloc(1, sizeof(media_info_s)); media_content_retvm_if(_dst == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); @@ -1007,43 +619,10 @@ int media_info_clone(media_info_h *dst, media_info_h src) media_content_retv_free_info_if(_dst->description == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); } - if (_src->weather != NULL) { - _dst->weather = g_strdup(_src->weather); - media_content_retv_free_info_if(_dst->weather == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); - } - if (_src->title != NULL) { _dst->title = g_strdup(_src->title); media_content_retv_free_info_if(_dst->title == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); } - if (_src->author != NULL) { - _dst->author = g_strdup(_src->author); - media_content_retv_free_info_if(_dst->author == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); - } - if (_src->provider != NULL) { - _dst->provider = g_strdup(_src->provider); - media_content_retv_free_info_if(_dst->provider == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); - } - if (_src->content_name != NULL) { - _dst->content_name = g_strdup(_src->content_name); - media_content_retv_free_info_if(_dst->content_name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); - } - if (_src->category != NULL) { - _dst->category = g_strdup(_src->category); - media_content_retv_free_info_if(_dst->category == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); - } - if (_src->location_tag != NULL) { - _dst->location_tag = g_strdup(_src->location_tag); - media_content_retv_free_info_if(_dst->location_tag == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); - } - if (_src->age_rating != NULL) { - _dst->age_rating = g_strdup(_src->age_rating); - media_content_retv_free_info_if(_dst->age_rating == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); - } - if (_src->keyword != NULL) { - _dst->keyword = g_strdup(_src->keyword); - media_content_retv_free_info_if(_dst->keyword == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); - } if (_src->storage_uuid != NULL) { _dst->storage_uuid = g_strdup(_src->storage_uuid); @@ -1079,14 +658,14 @@ int media_info_clone(media_info_h *dst, media_info_h src) _dst->favourite = _src->favourite; _dst->is_drm = _src->is_drm; _dst->storage_type = _src->storage_type; - _dst->played_count = _src->played_count; - _dst->played_time = _src->played_time; - _dst->played_position = _src->played_position; _dst->sync_status = _src->sync_status; _dst->request_id = _src->request_id; _dst->face_request_id = _src->face_request_id; _dst->is_360 = _src->is_360; #ifdef _USE_TVPD_MODE + _dst->played_count = _src->played_count; + _dst->played_time = _src->played_time; + _dst->played_position = _src->played_position; _dst->stitched_info = _src->stitched_info; _dst->extract_flag = _src->extract_flag; #endif @@ -1105,11 +684,6 @@ int media_info_clone(media_info_h *dst, media_info_h src) media_content_retv_free_info_if(_dst->image_meta->date_taken == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); } - if (_src->image_meta->burst_id != NULL) { - _dst->image_meta->burst_id = g_strdup(_src->image_meta->burst_id); - media_content_retv_free_info_if(_dst->image_meta->burst_id == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); - } - if (_src->image_meta->exposure_time != NULL) { _dst->image_meta->exposure_time = g_strdup(_src->image_meta->exposure_time); media_content_retv_free_info_if(_dst->image_meta->exposure_time == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, (media_info_h)_dst); @@ -1373,7 +947,6 @@ int media_info_get_image(media_info_h media, image_meta_h *image) _image->iso = _media->image_meta->iso; _image->date_taken = g_strdup(_media->image_meta->date_taken); _image->title = g_strdup(_media->image_meta->title); - _image->burst_id = g_strdup(_media->image_meta->burst_id); _image->exposure_time = g_strdup(_media->image_meta->exposure_time); _image->model = g_strdup(_media->image_meta->model); @@ -1656,23 +1229,6 @@ int media_info_get_title(media_info_h media, char **title) return ret; } -#ifdef _USE_TVPD_MODE -int media_info_get_extract_flag(media_info_h media, int *extract_flag) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_info_s *_media = (media_info_s *)media; - - if (_media && extract_flag) { - *extract_flag = _media->extract_flag; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} -#endif int media_info_get_description(media_info_h media, char **description) { @@ -1742,28 +1298,6 @@ int media_info_get_altitude(media_info_h media, double *altitude) return ret; } -int media_info_get_weather(media_info_h media, char **weather) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_weather() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; - - if (_media && weather) { - if (_media->weather != NULL) { - *weather = strdup(_media->weather); - media_content_retvm_if(*weather == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - *weather = NULL; - } - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - int media_info_get_rating(media_info_h media, int *rating) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -1796,20 +1330,20 @@ int media_info_get_favorite(media_info_h media, bool* favorite) return ret; } -int media_info_get_author(media_info_h media, char **author) +int media_info_get_storage_id(media_info_h media, char **storage_id) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_author() is deprecated and will be removed from next release."); + media_content_warn("DEPRECATION WARNING: media_info_get_storage_id() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; - if (_media && author) { - if (_media->author != NULL) { - *author = strdup(_media->author); - media_content_retvm_if(*author == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); + if (_media && storage_id) { + if (STRING_VALID(_media->storage_uuid)) { + *storage_id = strdup(_media->storage_uuid); + media_content_retvm_if(*storage_id == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); } else { - *author = NULL; + *storage_id = NULL; + ret = MEDIA_CONTENT_ERROR_DB_FAILED; } - ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -1818,19 +1352,13 @@ int media_info_get_author(media_info_h media, char **author) return ret; } -int media_info_get_provider(media_info_h media, char **provider) +int media_info_is_drm(media_info_h media, bool *is_drm) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_provider() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; - if (_media && provider) { - if (_media->provider != NULL) { - *provider = strdup(_media->provider); - media_content_retvm_if(*provider == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - *provider = NULL; - } + if (_media) { + *is_drm = _media->is_drm; ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); @@ -1840,19 +1368,13 @@ int media_info_get_provider(media_info_h media, char **provider) return ret; } -int media_info_get_content_name(media_info_h media, char **content_name) +int media_info_is_360_content(media_info_h media, bool *is_360) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_content_name() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; - if (_media && content_name) { - if (_media->content_name != NULL) { - *content_name = strdup(_media->content_name); - media_content_retvm_if(*content_name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - *content_name = NULL; - } + if (_media) { + *is_360 = _media->is_360; ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); @@ -1862,19 +1384,14 @@ int media_info_get_content_name(media_info_h media, char **content_name) return ret; } -int media_info_get_category(media_info_h media, char **category) +int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_category() is deprecated and will be removed from next release."); + media_content_warn("DEPRECATION WARNING: media_info_get_storage_type() is deprecated and will be removed from next release. Use storage_get_type_dev() instead."); media_info_s *_media = (media_info_s*)media; - if (_media && category) { - if (_media->category != NULL) { - *category = strdup(_media->category); - media_content_retvm_if(*category == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - *category = NULL; - } + if (_media && storage_type) { + *storage_type = _media->storage_type; ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); @@ -1884,20 +1401,20 @@ int media_info_get_category(media_info_h media, char **category) return ret; } -int media_info_get_location_tag(media_info_h media, char **location_tag) +#ifdef _USE_SENIOR_MODE +int media_info_set_contact(media_info_h media, const char *contact) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_location_tag() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; - if (_media && location_tag) { - if (_media->location_tag != NULL) { - *location_tag = strdup(_media->location_tag); - media_content_retvm_if(*location_tag == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); + if (_media != NULL) { + SAFE_FREE(_media->contact); + if (STRING_VALID(contact)) { + _media->contact = strdup(contact); + media_content_retvm_if(_media->contact == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); } else { - *location_tag = NULL; + _media->contact = NULL; } - ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -1906,20 +1423,19 @@ int media_info_get_location_tag(media_info_h media, char **location_tag) return ret; } -int media_info_get_age_rating(media_info_h media, char **age_rating) +int media_info_set_app_data(media_info_h media, const char *app_data) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_age_rating() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; - if (_media && age_rating) { - if (_media->age_rating != NULL) { - *age_rating = strdup(_media->age_rating); - media_content_retvm_if(*age_rating == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); + if (_media != NULL) { + SAFE_FREE(_media->app_data); + if (STRING_VALID(app_data)) { + _media->app_data = strdup(app_data); + media_content_retvm_if(_media->app_data == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); } else { - *age_rating = NULL; + _media->app_data = NULL; } - ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -1928,228 +1444,94 @@ int media_info_get_age_rating(media_info_h media, char **age_rating) return ret; } -int media_info_get_keyword(media_info_h media, char **keyword) +int media_info_insert_to_db_with_contact_data(const char *path, const char* contact, const char* app_data, media_info_h *info) { - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_keyword() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; - - if (_media && keyword) { - if (_media->keyword != NULL) { - *keyword = strdup(_media->keyword); - media_content_retvm_if(*keyword == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - *keyword = NULL; - } - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } + int ret = media_info_insert_to_db(path, info); + media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_insert_to_db [%s] failed", path); - return ret; -} + ret = media_info_set_contact(*info, contact); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + media_content_error("media_info_set_contact [%s] failed", contact); -int media_info_get_storage_id(media_info_h media, char **storage_id) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_storage_id() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; + media_info_s* _media_info = (media_info_s*)*info; + ret = media_info_delete_from_db(_media_info->media_id); + media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_delete_from_db [%s] failed", _media_info->media_id); - if (_media && storage_id) { - if (STRING_VALID(_media->storage_uuid)) { - *storage_id = strdup(_media->storage_uuid); - media_content_retvm_if(*storage_id == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - *storage_id = NULL; - ret = MEDIA_CONTENT_ERROR_DB_FAILED; - } - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + media_info_destroy(*info); + return ret; } - return ret; -} - -int media_info_is_drm(media_info_h media, bool *is_drm) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_info_s *_media = (media_info_s*)media; - - if (_media) { - *is_drm = _media->is_drm; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - -int media_info_is_360_content(media_info_h media, bool *is_360) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_info_s *_media = (media_info_s*)media; - - if (_media) { - *is_360 = _media->is_360; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} + ret = media_info_set_app_data(*info, app_data); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + media_content_error("media_info_set_app_data [%s] failed", app_data); -#ifdef _USE_TVPD_MODE -int media_info_get_stitched_state(media_info_h media, int *stitched_info) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_info_s *_media = (media_info_s*)media; + media_info_s* _media_info = (media_info_s*)*info; + ret = media_info_delete_from_db(_media_info->media_id); + media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_delete_from_db [%s] failed", _media_info->media_id); - if (_media) { - *stitched_info = (_media->stitched_info & 0xFFFF0000) >> 16; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + media_info_destroy(*info); + return ret; } - return ret; -} + ret = media_info_update_to_db(*info); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + media_content_error("media_info_update_to_db [] failed"); -int media_info_get_stitched_engine(media_info_h media, int *stitched_info) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_info_s *_media = (media_info_s*)media; + media_info_s* _media_info = (media_info_s*)*info; + ret = media_info_delete_from_db(_media_info->media_id); + media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_delete_from_db [%s] failed", _media_info->media_id); - if (_media) { - *stitched_info = _media->stitched_info & 0x0000FFFF; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + media_info_destroy(*info); + return ret; } return ret; } -#endif -int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type) +int media_info_delete_contact_from_db(const char* contact, const char* storage_id) { - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_storage_type() is deprecated and will be removed from next release. Use storage_get_type_dev() instead."); - media_info_s *_media = (media_info_s*)media; - - if (_media && storage_type) { - *storage_type = _media->storage_type; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; + return -1; } -#ifdef _USE_TVPD_MODE -int media_info_get_played_position(media_info_h media, int *played_position) +int media_info_delete_item(const char *media_id) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_info_s *_media = (media_info_s*)media; + char *path = NULL; + char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0,}; - if (_media) { - *played_position = _media->played_position; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { + if (!STRING_VALID(media_id)) { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; } - return ret; -} -#endif - -int media_info_get_played_count(media_info_h media, int *played_count) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_played_count() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; + memset(storage_id, 0x00, sizeof(storage_id)); - if (_media) { - *played_count = _media->played_count; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + ret = __media_info_get_media_path_by_id_from_db(media_id, &path); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + media_content_error("__media_info_get_media_path_by_id_from_db failed : %d", ret); + SAFE_FREE(path); + return ret; } - return ret; -} - -int media_info_get_played_time(media_info_h media, time_t* played_time) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_get_played_time() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; - - if (_media) { - *played_time = _media->played_time; - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + ret = _media_db_get_storage_id_by_media_id(media_id, storage_id); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + media_content_error("_media_db_get_storage_id_by_media_id failed : %d", ret); + SAFE_FREE(path); + return ret; } - return ret; -} - -int media_info_increase_played_count(media_info_h media) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_increase_played_count() is deprecated and will be removed from next release."); - - media_info_s *_media = (media_info_s*)media; - - if (_media) { - _media->played_count += 1; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + ret = media_svc_delete_item_by_path(_content_get_db_handle(), storage_id, path, tzplatform_getuid(TZ_USER_NAME)); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + media_content_error("remove from DB failed : %d", ret); + SAFE_FREE(path); + return ret; } - return ret; + ret = media_svc_remove_file(path); + SAFE_FREE(path); + return _content_error_capi(MEDIA_CONTENT_TYPE, ret); } -#ifdef _USE_TVPD_MODE -int media_info_get_modified_month(media_info_h media, char **modified_month) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_info_s *_media = (media_info_s*)media; - - if (_media && modified_month) { - if (STRING_VALID(_media->modified_month)) { - *modified_month = strdup(_media->modified_month); - if (*modified_month == NULL) { - media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY); - return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY; - } - } else { - *modified_month = NULL; - } - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} -#endif -#ifdef _USE_SENIOR_MODE int media_info_get_contact(media_info_h media, char **contact) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -2199,14 +1581,14 @@ int media_info_get_app_data(media_info_h media, char **app_data) } #endif #ifdef _USE_TVPD_MODE -int media_info_set_played_count(media_info_h media, int played_count) +int media_info_get_played_count(media_info_h media, int *played_count) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_info_s *_media = (media_info_s*)media; if (_media) { - _media->played_count = played_count; + *played_count = _media->played_count; + ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -2214,19 +1596,15 @@ int media_info_set_played_count(media_info_h media, int played_count) return ret; } -#endif -int media_info_set_played_time(media_info_h media) +int media_info_set_played_count(media_info_h media, int played_count) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_played_time() is deprecated and will be removed from next release."); - time_t current_time; media_info_s *_media = (media_info_s*)media; - if (_media != NULL) { - time(¤t_time); - _media->played_time = current_time; + if (_media) { + _media->played_count = played_count; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -2234,7 +1612,7 @@ int media_info_set_played_time(media_info_h media) return ret; } -#ifdef _USE_TVPD_MODE + int media_info_set_played_position(media_info_h media, int played_position) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -2249,120 +1627,15 @@ int media_info_set_played_position(media_info_h media, int played_position) return ret; } -#endif - -int media_info_get_media_from_db(const char *media_id, media_info_h *media) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - char select_query[DEFAULT_QUERY_SIZE] = {0, }; - char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, }; - sqlite3_stmt *stmt = NULL; - - if (!STRING_VALID(media_id) || (media == NULL)) { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - memset(select_query, 0x00, sizeof(select_query)); - memset(storage_id, 0x00, sizeof(storage_id)); - - ret = _media_db_get_storage_id_by_media_id(media_id, storage_id); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_MEDIA, storage_id, media_id); - - ret = _content_query_prepare(&stmt, select_query, NULL, NULL); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - media_info_s *_media = NULL; - - if (sqlite3_step(stmt) == SQLITE_ROW) { - _media = (media_info_s*)calloc(1, sizeof(media_info_s)); - - if (_media == NULL) { - media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY); - SQLITE3_FINALIZE(stmt); - return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY; - } - - _media_info_item_get_detail(stmt, (media_info_h)_media); - - *media = (media_info_h)_media; - } else { - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - SQLITE3_FINALIZE(stmt); - - return ret; -} - -int media_info_set_display_name(media_info_h media, const char *display_name) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_display_name() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; - - if (_media != NULL && STRING_VALID(display_name)) { - SAFE_FREE(_media->display_name); - - _media->display_name = strdup(display_name); - media_content_retvm_if(_media->display_name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - -int media_info_set_description(media_info_h media, const char *description) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_description() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; - - if (_media != NULL) { - SAFE_FREE(_media->description); - - if (STRING_VALID(description)) { - _media->description = strdup(description); - media_content_retvm_if(_media->description == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->description = NULL; - } - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - -int media_info_set_longitude(media_info_h media, double longitude) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_longitude() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; - - if (_media != NULL) { - _media->longitude = longitude; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - -int media_info_set_latitude(media_info_h media, double latitude) +int media_info_get_played_position(media_info_h media, int *played_position) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_latitude() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; - if (_media != NULL) { - _media->latitude = latitude; + if (_media) { + *played_position = _media->played_position; + ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -2371,37 +1644,16 @@ int media_info_set_latitude(media_info_h media, double latitude) return ret; } -int media_info_set_altitude(media_info_h media, double altitude) +int media_info_set_played_time(media_info_h media) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_altitude() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; - - if (_media != NULL) { - _media->altitude = altitude; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} + time_t current_time; -int media_info_set_weather(media_info_h media, const char *weather) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_weather() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; if (_media != NULL) { - SAFE_FREE(_media->weather); - - if (STRING_VALID(weather)) { - _media->weather = strdup(weather); - media_content_retvm_if(_media->weather == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->weather = NULL; - } + time(¤t_time); + _media->played_time = current_time; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -2410,14 +1662,14 @@ int media_info_set_weather(media_info_h media, const char *weather) return ret; } -int media_info_set_rating(media_info_h media, int rating) +int media_info_get_played_time(media_info_h media, time_t* played_time) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_rating() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; - if (_media != NULL) { - _media->rating = rating; + if (_media) { + *played_time = _media->played_time; + ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -2426,15 +1678,14 @@ int media_info_set_rating(media_info_h media, int rating) return ret; } -int media_info_set_added_time(media_info_h media, time_t added_time) +int media_info_get_extract_flag(media_info_h media, int *extract_flag) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_added_time() is deprecated and will be removed from next release."); - - media_info_s *_media = (media_info_s*)media; + media_info_s *_media = (media_info_s *)media; - if ((_media != NULL) && (added_time >= 0)) { - _media->added_time = added_time; + if (_media && extract_flag) { + *extract_flag = _media->extract_flag; + ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -2443,16 +1694,14 @@ int media_info_set_added_time(media_info_h media, time_t added_time) return ret; } -int media_info_set_favorite(media_info_h media, bool favorite) +int media_info_get_stitched_state(media_info_h media, int *stitched_info) { int ret = MEDIA_CONTENT_ERROR_NONE; media_info_s *_media = (media_info_s*)media; - if (_media != NULL) { - if (favorite == TRUE) - time(&_media->favourite); - else - _media->favourite = 0; + if (_media) { + *stitched_info = (_media->stitched_info & 0xFFFF0000) >> 16; + ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -2461,19 +1710,14 @@ int media_info_set_favorite(media_info_h media, bool favorite) return ret; } -int media_info_set_author(media_info_h media, const char *author) +int media_info_get_stitched_engine(media_info_h media, int *stitched_info) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_author() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; - if (_media != NULL) { - if (STRING_VALID(author)) { - _media->author = strdup(author); - media_content_retvm_if(_media->author == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->author = NULL; - } + if (_media) { + *stitched_info = _media->stitched_info & 0x0000FFFF; + ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -2482,21 +1726,22 @@ int media_info_set_author(media_info_h media, const char *author) return ret; } -int media_info_set_provider(media_info_h media, const char *provider) +int media_info_get_modified_month(media_info_h media, char **modified_month) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_provider() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; - if (_media != NULL) { - SAFE_FREE(_media->provider); - - if (STRING_VALID(provider)) { - _media->provider = strdup(provider); - media_content_retvm_if(_media->provider == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); + if (_media && modified_month) { + if (STRING_VALID(_media->modified_month)) { + *modified_month = strdup(_media->modified_month); + if (*modified_month == NULL) { + media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY); + return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY; + } } else { - _media->provider = NULL; + *modified_month = NULL; } + ret = MEDIA_CONTENT_ERROR_NONE; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -2505,113 +1750,64 @@ int media_info_set_provider(media_info_h media, const char *provider) return ret; } -int media_info_set_content_name(media_info_h media, const char *content_name) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_content_name() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; - - if (_media != NULL) { - SAFE_FREE(_media->content_name); - - if (STRING_VALID(content_name)) { - _media->content_name = strdup(content_name); - media_content_retvm_if(_media->content_name == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->content_name = NULL; - } - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} +#endif -int media_info_set_category(media_info_h media, const char *category) +int media_info_get_media_from_db(const char *media_id, media_info_h *media) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_category() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; - - if (_media != NULL) { - SAFE_FREE(_media->category); + char select_query[DEFAULT_QUERY_SIZE] = {0, }; + char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, }; + sqlite3_stmt *stmt = NULL; - if (STRING_VALID(category)) { - _media->category = strdup(category); - media_content_retvm_if(_media->category == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->category = NULL; - } - } else { + if (!STRING_VALID(media_id) || (media == NULL)) { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; + return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; } - return ret; -} - -int media_info_set_location_tag(media_info_h media, const char *location_tag) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_location_tag() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; + memset(select_query, 0x00, sizeof(select_query)); + memset(storage_id, 0x00, sizeof(storage_id)); - if (_media != NULL) { - SAFE_FREE(_media->location_tag); + ret = _media_db_get_storage_id_by_media_id(media_id, storage_id); + media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - if (STRING_VALID(location_tag)) { - _media->location_tag = strdup(location_tag); - media_content_retvm_if(_media->location_tag == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->location_tag = NULL; - } - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } + snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_MEDIA, storage_id, media_id); - return ret; -} + ret = _content_query_prepare(&stmt, select_query, NULL, NULL); + media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); -int media_info_set_age_rating(media_info_h media, const char *age_rating) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_age_rating() is deprecated and will be removed from next release."); - media_info_s *_media = (media_info_s*)media; + media_info_s *_media = NULL; - if (_media != NULL) { - SAFE_FREE(_media->age_rating); + if (sqlite3_step(stmt) == SQLITE_ROW) { + _media = (media_info_s*)calloc(1, sizeof(media_info_s)); - if (STRING_VALID(age_rating)) { - _media->age_rating = strdup(age_rating); - media_content_retvm_if(_media->age_rating == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->age_rating = NULL; + if (_media == NULL) { + media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY); + SQLITE3_FINALIZE(stmt); + return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY; } + + _media_info_item_get_detail(stmt, (media_info_h)_media); + + *media = (media_info_h)_media; } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; } + SQLITE3_FINALIZE(stmt); + return ret; } -int media_info_set_keyword(media_info_h media, const char *keyword) +int media_info_set_favorite(media_info_h media, bool favorite) { int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_set_keyword() is deprecated and will be removed from next release."); media_info_s *_media = (media_info_s*)media; if (_media != NULL) { - SAFE_FREE(_media->keyword); - - if (STRING_VALID(keyword)) { - _media->keyword = strdup(keyword); - media_content_retvm_if(_media->keyword == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->keyword = NULL; - } + if (favorite == TRUE) + time(&_media->favourite); + else + _media->favourite = 0; } else { media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; @@ -2633,88 +1829,20 @@ int media_info_update_to_db(media_info_h media) char *test_sql = sqlite3_mprintf("%f, %f, %f", _media->longitude, _media->latitude, _media->altitude); SQLITE3_SAFE_FREE(test_sql); - /*Update Pinyin If Support Pinyin*/ - char *file_name_pinyin = NULL; - char *description_pinyin = NULL; - char *author_pinyin = NULL; - char *provider_pinyin = NULL; - char *content_name_pinyin = NULL; - char *category_pinyin = NULL; - char *location_tag_pinyin = NULL; - char *age_rating_pinyin = NULL; - char *keyword_pinyin = NULL; - bool pinyin_support = FALSE; - - /*Update Pinyin If Support Pinyin*/ - media_svc_check_pinyin_support(&pinyin_support); - if (pinyin_support) { - if (STRING_VALID(_media->display_name)) - media_svc_get_pinyin(_media->display_name, &file_name_pinyin); - if (STRING_VALID(_media->description)) - media_svc_get_pinyin(_media->description, &description_pinyin); - if (STRING_VALID(_media->author)) - media_svc_get_pinyin(_media->author, &author_pinyin); - if (STRING_VALID(_media->provider)) - media_svc_get_pinyin(_media->provider, &provider_pinyin); - if (STRING_VALID(_media->content_name)) - media_svc_get_pinyin(_media->content_name, &content_name_pinyin); - if (STRING_VALID(_media->category)) - media_svc_get_pinyin(_media->category, &category_pinyin); - if (STRING_VALID(_media->location_tag)) - media_svc_get_pinyin(_media->location_tag, &location_tag_pinyin); - if (STRING_VALID(_media->age_rating)) - media_svc_get_pinyin(_media->age_rating, &age_rating_pinyin); - if (STRING_VALID(_media->keyword)) - media_svc_get_pinyin(_media->keyword, &keyword_pinyin); - } - - char *album = NULL; - char *artist = NULL; - char *genre = NULL; - char *recorded_date = NULL; - - if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) { - if (_media->video_meta->album != NULL) - album = strdup(_media->video_meta->album); - if (_media->video_meta->artist != NULL) - artist = strdup(_media->video_meta->artist); - if (_media->video_meta->genre != NULL) - genre = strdup(_media->video_meta->genre); - if (_media->video_meta->recorded_date != NULL) - recorded_date = strdup(_media->video_meta->recorded_date); - } else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) { - if (_media->audio_meta->album != NULL) - album = strdup(_media->audio_meta->album); - if (_media->audio_meta->artist != NULL) - artist = strdup(_media->audio_meta->artist); - if (_media->audio_meta->genre != NULL) - genre = strdup(_media->audio_meta->genre); - if (_media->audio_meta->recorded_date != NULL) - recorded_date = strdup(_media->audio_meta->recorded_date); - } - +#ifdef _USE_TVPD_MODE #ifdef _USE_SENIOR_MODE if (_media_content_is_support_senior_mode()) { - set_sql = sqlite3_mprintf("file_name=%Q, added_time=%d, description=%Q, longitude=%f, latitude=%f, altitude=%f, \ - played_count=%d, last_played_time=%d, last_played_position=%d, \ - rating=%d, favourite=%d, author=%Q, provider=%Q, content_name=%Q, category=%Q, location_tag=%Q, age_rating=%Q, keyword=%Q, weather=%Q, sync_status=%d, \ - file_name_pinyin=%Q, description_pinyin=%Q, author_pinyin=%Q, provider_pinyin=%Q, content_name_pinyin=%Q, category_pinyin=%Q, location_tag_pinyin=%Q, age_rating_pinyin=%Q, keyword_pinyin=%Q, title=%Q, contact=%Q, app_data=%Q", - _media->display_name, _media->added_time, _media->description, _media->longitude, _media->latitude, _media->altitude, _media->played_count, _media->played_time, _media->played_position, _media->rating, _media->favourite, - _media->author, _media->provider, _media->content_name, _media->category, _media->location_tag, _media->age_rating, _media->keyword, _media->weather, _media->sync_status, - file_name_pinyin, description_pinyin, author_pinyin, provider_pinyin, content_name_pinyin, category_pinyin, location_tag_pinyin, age_rating_pinyin, keyword_pinyin, _media->title, _media->contact, _media->app_data); + set_sql = sqlite3_mprintf("played_count=%d, last_played_time=%d, last_played_position=%d, favourite=%d, contact=%Q, app_data=%Q", + _media->played_count, _media->played_time, _media->played_position, _media->favourite, _media->contact, _media->app_data); } else #endif { - set_sql = sqlite3_mprintf("file_name=%Q, added_time=%d, description=%Q, longitude=%f, latitude=%f, altitude=%f, \ - played_count=%d, last_played_time=%d, last_played_position=%d, \ - rating=%d, favourite=%d, author=%Q, provider=%Q, content_name=%Q, category=%Q, location_tag=%Q, age_rating=%Q, keyword=%Q, weather=%Q, sync_status=%d, \ - file_name_pinyin=%Q, description_pinyin=%Q, author_pinyin=%Q, provider_pinyin=%Q, content_name_pinyin=%Q, category_pinyin=%Q, location_tag_pinyin=%Q, age_rating_pinyin=%Q, keyword_pinyin=%Q, title=%Q, \ - album=%Q, artist=%Q, genre=%Q, recorded_date=%Q", - _media->display_name, _media->added_time, _media->description, _media->longitude, _media->latitude, _media->altitude, _media->played_count, _media->played_time, _media->played_position, _media->rating, _media->favourite, - _media->author, _media->provider, _media->content_name, _media->category, _media->location_tag, _media->age_rating, _media->keyword, _media->weather, _media->sync_status, - file_name_pinyin, description_pinyin, author_pinyin, provider_pinyin, content_name_pinyin, category_pinyin, location_tag_pinyin, age_rating_pinyin, keyword_pinyin, _media->title, - album, artist, genre, recorded_date); + set_sql = sqlite3_mprintf("played_count=%d, last_played_time=%d, last_played_position=%d, favourite=%d", + _media->played_count, _media->played_time, _media->played_position, _media->favourite); } +#else + set_sql = sqlite3_mprintf("favourite=%d", _media->favourite); +#endif sql = sqlite3_mprintf("UPDATE %Q SET %s WHERE media_uuid=%Q", _media->storage_uuid, set_sql, _media->media_id); @@ -2722,21 +1850,6 @@ int media_info_update_to_db(media_info_h media) SQLITE3_SAFE_FREE(set_sql); SQLITE3_SAFE_FREE(sql); - SAFE_FREE(file_name_pinyin); - SAFE_FREE(description_pinyin); - SAFE_FREE(author_pinyin); - SAFE_FREE(provider_pinyin); - SAFE_FREE(content_name_pinyin); - SAFE_FREE(category_pinyin); - SAFE_FREE(location_tag_pinyin); - SAFE_FREE(age_rating_pinyin); - SAFE_FREE(keyword_pinyin); - - SAFE_FREE(album); - SAFE_FREE(artist); - SAFE_FREE(genre); - SAFE_FREE(recorded_date); - if (ret == MEDIA_CONTENT_ERROR_NONE) { /* Send notification for this update */ media_content_debug("Update is successfull. Send notification for this"); @@ -2753,67 +1866,6 @@ int media_info_update_to_db(media_info_h media) return ret; } -int media_info_refresh_metadata_to_db(const char *media_id) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_info_refresh_metadata_to_db() is deprecated and will be removed from next release."); - media_info_h media = NULL; - char *file_path = NULL; - media_content_storage_e storage_type = 0; - char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, }; - char repl_path[MAX_PATH_LEN] = {0, }; - - if (!STRING_VALID(media_id)) { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - ret = media_info_get_media_from_db(media_id, &media); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_info_destroy(media); - return ret; - } - - ret = media_info_get_storage_type(media, &storage_type); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_info_destroy(media); - return ret; - } - - ret = media_info_get_file_path(media, &file_path); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_info_destroy(media); - return ret; - } - memset(repl_path, 0, sizeof(repl_path)); - ret = _media_content_replace_path(file_path, repl_path); - - ret = _media_util_check_file_exist(repl_path); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - SAFE_FREE(file_path); - media_info_destroy(media); - return ret; - } - - memset(storage_id, 0x00, sizeof(storage_id)); - ret = media_svc_get_storage_id(_content_get_db_handle(), repl_path, storage_id, _content_get_uid()); - if (ret != MS_MEDIA_ERR_NONE) { - media_content_error("media_svc_get_storage_id failed : %d", ret); - SAFE_FREE(file_path); - media_info_destroy(media); - return _content_error_capi(MEDIA_CONTENT_TYPE, ret); - } - - ret = media_svc_refresh_item(_content_get_db_handle(), storage_id, storage_type, repl_path, _content_get_uid()); - if (ret != MS_MEDIA_ERR_NONE) - ret = _content_error_capi(MEDIA_CONTENT_TYPE, ret); - - SAFE_FREE(file_path); - media_info_destroy(media); - - return ret; -} - int media_info_move_to_db(media_info_h media, const char* dst_path) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -2989,487 +2041,3 @@ int media_info_cancel_face_detection(media_info_h media) return ret; } - -static int __media_info_map_data_usr_to_svc(media_info_s *media, media_svc_content_info_s **service_content, media_content_storage_e storage_type) -{ - media_content_retvm_if(media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid handle"); - char repl_path[MAX_PATH_LEN] = {0, }; - char *tmp_path = NULL; - - media_svc_content_info_s *svc_content_info = calloc(1, sizeof(media_svc_content_info_s)); - media_content_retvm_if(svc_content_info == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - - memset(repl_path, 0, sizeof(repl_path)); - tmp_path = g_strdup(media->file_path); - _media_content_replace_path(tmp_path, repl_path); - svc_content_info->path = g_strdup(repl_path); - SAFE_FREE(tmp_path); - - svc_content_info->file_name = g_strdup(media->display_name); - svc_content_info->media_type = media->media_type; - svc_content_info->mime_type = g_strdup(media->mime_type); - svc_content_info->size = media->size; - svc_content_info->storage_type = storage_type; - svc_content_info->storage_uuid = g_strdup(media->storage_uuid); - - svc_content_info->added_time = media->added_time; - svc_content_info->modified_time = media->modified_time; - svc_content_info->thumbnail_path = g_strdup(media->thumbnail_path); - svc_content_info->is_drm = media->is_drm; - svc_content_info->last_played_time = media->played_time; - svc_content_info->played_count = media->played_count; - svc_content_info->favourate = media->favourite; - -#ifdef _USE_SENIOR_MODE - if (_media_content_is_support_senior_mode()) { - svc_content_info->contact = g_strdup(media->contact); - svc_content_info->app_data = g_strdup(media->app_data); - } -#endif - - svc_content_info->media_meta.title = g_strdup(media->title); - svc_content_info->media_meta.rating = media->rating; - svc_content_info->media_meta.description = g_strdup(media->description); - svc_content_info->media_meta.longitude = media->longitude; - svc_content_info->media_meta.latitude = media->latitude; - svc_content_info->media_meta.altitude = media->altitude; - svc_content_info->media_meta.weather = g_strdup(media->weather); - svc_content_info->media_meta.category = g_strdup(media->category); - svc_content_info->media_meta.keyword = g_strdup(media->keyword); - svc_content_info->media_meta.location_tag = g_strdup(media->location_tag); - svc_content_info->media_meta.content_name = g_strdup(media->content_name); - svc_content_info->media_meta.age_rating = g_strdup(media->age_rating); - svc_content_info->media_meta.author = g_strdup(media->author); - svc_content_info->media_meta.provider = g_strdup(media->provider); - - svc_content_info->media_meta.album = g_strdup(media->audio_meta->album); - svc_content_info->media_meta.artist = g_strdup(media->audio_meta->artist); - svc_content_info->media_meta.genre = g_strdup(media->audio_meta->genre); - svc_content_info->media_meta.recorded_date = g_strdup(media->audio_meta->recorded_date); - - *service_content = svc_content_info; - - return MEDIA_CONTENT_ERROR_NONE; -} - -static int __media_info_set_str_data(media_info_h media, media_info_item_e data_type, const char *str_data) -{ - media_info_s *_media = (media_info_s*)media; - - media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid media"); - - switch (data_type) { - case MEDIA_INFO_PATH: - SAFE_FREE(_media->file_path); - if (STRING_VALID(str_data)) { - _media->file_path = strdup(str_data); - media_content_retvm_if(_media->file_path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->file_path = NULL; - } - break; - case MEDIA_INFO_MIME_TYPE: - SAFE_FREE(_media->mime_type); - if (STRING_VALID(str_data)) { - _media->mime_type = strdup(str_data); - media_content_retvm_if(_media->mime_type == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->mime_type = NULL; - } - break; - case MEDIA_INFO_THUMBNAIL_PATH: - SAFE_FREE(_media->thumbnail_path); - if (STRING_VALID(str_data)) { - _media->thumbnail_path = strdup(str_data); - media_content_retvm_if(_media->thumbnail_path == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->thumbnail_path = NULL; - } - break; - case MEDIA_INFO_TITLE: - SAFE_FREE(_media->title); - if (STRING_VALID(str_data)) { - _media->title = strdup(str_data); - media_content_retvm_if(_media->title == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->title = NULL; - } - break; - case MEDIA_INFO_STORAGE_UUID: - SAFE_FREE(_media->storage_uuid); - if (STRING_VALID(str_data)) { - _media->storage_uuid = strdup(str_data); - media_content_retvm_if(_media->storage_uuid == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } else { - _media->storage_uuid = NULL; - } - break; - case MEDIA_INFO_ALBUM: - if (STRING_VALID(_media->media_id)) { - if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) { - SAFE_FREE(_media->video_meta->album); - if (str_data != NULL) { - _media->video_meta->album = strdup(str_data); - media_content_retvm_if(_media->video_meta->album == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) { - SAFE_FREE(_media->audio_meta->album); - if (str_data != NULL) { - _media->audio_meta->album = strdup(str_data); - media_content_retvm_if(_media->audio_meta->album == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } - } else { - SAFE_FREE(_media->video_meta->album); - if (str_data != NULL) { - _media->video_meta->album = strdup(str_data); - media_content_retvm_if(_media->video_meta->album == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - - SAFE_FREE(_media->audio_meta->album); - if (str_data != NULL) { - _media->audio_meta->album = strdup(str_data); - media_content_retvm_if(_media->audio_meta->album == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } - break; - case MEDIA_INFO_ARTIST: - if (STRING_VALID(_media->media_id)) { - if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) { - SAFE_FREE(_media->video_meta->artist); - if (str_data != NULL) { - _media->video_meta->artist = strdup(str_data); - media_content_retvm_if(_media->video_meta->artist == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) { - SAFE_FREE(_media->audio_meta->artist); - if (str_data != NULL) { - _media->audio_meta->artist = strdup(str_data); - media_content_retvm_if(_media->audio_meta->artist == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } - } else { - SAFE_FREE(_media->video_meta->artist); - if (str_data != NULL) { - _media->video_meta->artist = strdup(str_data); - media_content_retvm_if(_media->video_meta->artist == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - - SAFE_FREE(_media->audio_meta->artist); - if (str_data != NULL) { - _media->audio_meta->artist = strdup(str_data); - media_content_retvm_if(_media->audio_meta->artist == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } - break; - case MEDIA_INFO_GENRE: - if (STRING_VALID(_media->media_id)) { - if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) { - SAFE_FREE(_media->video_meta->genre); - if (str_data != NULL) { - _media->video_meta->genre = strdup(str_data); - media_content_retvm_if(_media->video_meta->genre == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) { - SAFE_FREE(_media->audio_meta->genre); - if (str_data != NULL) { - _media->audio_meta->genre = strdup(str_data); - media_content_retvm_if(_media->audio_meta->genre == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } - } else { - SAFE_FREE(_media->video_meta->genre); - if (str_data != NULL) { - _media->video_meta->genre = strdup(str_data); - media_content_retvm_if(_media->video_meta->genre == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - - SAFE_FREE(_media->audio_meta->genre); - if (str_data != NULL) { - _media->audio_meta->genre = strdup(str_data); - media_content_retvm_if(_media->audio_meta->genre == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } - break; - case MEDIA_INFO_RECORDED_DATE: - if (STRING_VALID(_media->media_id)) { - if (_media->media_type == MEDIA_CONTENT_TYPE_VIDEO) { - SAFE_FREE(_media->video_meta->recorded_date); - if (str_data != NULL) { - _media->video_meta->recorded_date = strdup(str_data); - media_content_retvm_if(_media->video_meta->recorded_date == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } else if ((_media->media_type == MEDIA_CONTENT_TYPE_MUSIC) || (_media->media_type == MEDIA_CONTENT_TYPE_SOUND)) { - SAFE_FREE(_media->audio_meta->recorded_date); - if (str_data != NULL) { - _media->audio_meta->recorded_date = strdup(str_data); - media_content_retvm_if(_media->audio_meta->recorded_date == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } - } else { - SAFE_FREE(_media->video_meta->recorded_date); - if (str_data != NULL) { - _media->video_meta->recorded_date = strdup(str_data); - media_content_retvm_if(_media->video_meta->recorded_date == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - - SAFE_FREE(_media->audio_meta->recorded_date); - if (str_data != NULL) { - _media->audio_meta->recorded_date = strdup(str_data); - media_content_retvm_if(_media->audio_meta->recorded_date == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - } - } - break; - default: - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return MEDIA_CONTENT_ERROR_NONE; -} - -static int __media_info_destroy(media_info_h media) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_info_s *_media = (media_info_s*)media; - - if (_media) { - SAFE_FREE(_media->media_id); - SAFE_FREE(_media->file_path); - SAFE_FREE(_media->display_name); - SAFE_FREE(_media->mime_type); - SAFE_FREE(_media->thumbnail_path); - SAFE_FREE(_media->description); - SAFE_FREE(_media->author); - SAFE_FREE(_media->provider); - SAFE_FREE(_media->content_name); - SAFE_FREE(_media->category); - SAFE_FREE(_media->location_tag); - SAFE_FREE(_media->age_rating); - SAFE_FREE(_media->keyword); - SAFE_FREE(_media->title); - SAFE_FREE(_media->weather); - SAFE_FREE(_media->storage_uuid); - - if (_media->image_meta) { - SAFE_FREE(_media->image_meta->media_id); - SAFE_FREE(_media->image_meta->date_taken); - SAFE_FREE(_media->image_meta->burst_id); - SAFE_FREE(_media->image_meta->exposure_time); - SAFE_FREE(_media->image_meta->model); - SAFE_FREE(_media->image_meta->title); - - SAFE_FREE(_media->image_meta); - } - - if (_media->video_meta) { - SAFE_FREE(_media->video_meta->media_id); - SAFE_FREE(_media->video_meta->title); - SAFE_FREE(_media->video_meta->album); - SAFE_FREE(_media->video_meta->artist); - SAFE_FREE(_media->video_meta->album_artist); - SAFE_FREE(_media->video_meta->genre); - SAFE_FREE(_media->video_meta->composer); - SAFE_FREE(_media->video_meta->year); - SAFE_FREE(_media->video_meta->recorded_date); - SAFE_FREE(_media->video_meta->copyright); - SAFE_FREE(_media->video_meta->track_num); - - SAFE_FREE(_media->video_meta); - } - - if (_media->audio_meta) { - SAFE_FREE(_media->audio_meta->media_id); - SAFE_FREE(_media->audio_meta->title); - SAFE_FREE(_media->audio_meta->album); - SAFE_FREE(_media->audio_meta->artist); - SAFE_FREE(_media->audio_meta->album_artist); - SAFE_FREE(_media->audio_meta->genre); - SAFE_FREE(_media->audio_meta->composer); - SAFE_FREE(_media->audio_meta->year); - SAFE_FREE(_media->audio_meta->recorded_date); - SAFE_FREE(_media->audio_meta->copyright); - SAFE_FREE(_media->audio_meta->track_num); - - SAFE_FREE(_media->audio_meta); - } - - ret = MEDIA_CONTENT_ERROR_NONE; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - -int media_info_insert_to_db_with_data(media_info_h media) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - int ret_cnt = 0; - char repl_path[MAX_PATH_LEN] = {0, }; - - media_content_warn("DEPRECATION WARNING: media_info_insert_to_db_with_data() is deprecated and will be removed from next release. Use media_info_insert_to_db() instead."); - - media_info_s *_media = (media_info_s*)media; - - media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid media"); - media_content_retvm_if(!STRING_VALID(_media->file_path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid file_path"); - media_content_retvm_if(!STRING_VALID(_media->storage_uuid), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid storage_uuid"); - media_content_retvm_if(_media->storage_type < 0, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid storage_type [%d]", _media->storage_type); - - media_content_sec_debug("storage[%d], path[%s], media_type[%d]", _media->storage_type, _media->file_path, _media->media_type); - - media_svc_content_info_s *svc_content_info = NULL; - - ret = __media_info_map_data_usr_to_svc(_media, &svc_content_info, _media->storage_type); - media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "__media_info_map_data_usr_to_svc fail"); - - ret = media_svc_insert_item_immediately_with_data(_content_get_db_handle(), svc_content_info, _content_get_uid()); - if (ret != MS_MEDIA_ERR_NONE) { - media_content_sec_error("media_svc_insert_item_immediately_with_data failed : %d (%s)", ret, _media->file_path); - media_svc_destroy_content_info(svc_content_info); - SAFE_FREE(svc_content_info); - return _content_error_capi(MEDIA_CONTENT_TYPE, ret); - } - /*free the svc_content_info*/ - media_svc_destroy_content_info(svc_content_info); - SAFE_FREE(svc_content_info); - - /*Fill out the handle*/ - memset(repl_path, 0, sizeof(repl_path)); - ret = _media_content_replace_path(_media->file_path, repl_path); - char *media_file_path = g_strdup(repl_path); - - char *media_string_uuid = g_strdup(_media->storage_uuid); - - __media_info_destroy(media); -RETRY: - ret = _media_info_get_media_info_from_db(media_file_path, media_string_uuid, media); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("_media_info_get_media_info_from_db fail [%d]", ret); - if (ret == MEDIA_CONTENT_ERROR_DB_FAILED && ret_cnt < 5) { - ret_cnt++; - media_content_error("RETRY GETTING DATA"); - goto RETRY; - } - } - - SAFE_FREE(media_file_path); - SAFE_FREE(media_string_uuid); - - return ret; -} - -int media_info_create(const char *path, media_info_h *media) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, }; - media_svc_storage_type_e storage_type = 0; - char repl_path[MAX_PATH_LEN] = {0, }; - media_content_warn("DEPRECATION WARNING: media_info_create() is deprecated and will be removed from next release. Use media_info_insert_to_db() instead."); - - media_content_retvm_if(!STRING_VALID(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid path"); - media_content_retvm_if(media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid media"); - memset(repl_path, 0, sizeof(repl_path)); - ret = _media_content_replace_path(path, repl_path); - media_content_retvm_if(!STRING_VALID(repl_path), MEDIA_CONTENT_ERROR_INVALID_OPERATION, "path replacement failed"); - - memset(storage_id, 0x00, sizeof(storage_id)); - - ret = __media_info_check_file_validity(repl_path); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = media_svc_get_storage_id(_content_get_db_handle(), repl_path, storage_id, _content_get_uid()); - if (ret != MS_MEDIA_ERR_NONE) { - media_content_error("media_svc_get_storage_id failed : %d", ret); - return _content_error_capi(MEDIA_CONTENT_TYPE, ret); - } - - ret = media_svc_get_storage_type(repl_path, &storage_type, _content_get_uid()); - if (ret != MS_MEDIA_ERR_NONE) { - media_content_sec_error("media_svc_get_storage_type failed : %d", ret); - return _content_error_capi(MEDIA_CONTENT_TYPE, ret); - } - - media_info_s *_media = (media_info_s*)calloc(1, sizeof(media_info_s)); - media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY"); - - _media->audio_meta = (audio_meta_s *)calloc(1, sizeof(audio_meta_s)); - if (_media->audio_meta == NULL) { - SAFE_FREE(_media); - media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY); - return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY; - } - - _media->video_meta = (video_meta_s *)calloc(1, sizeof(video_meta_s)); - if (_media->video_meta == NULL) { - SAFE_FREE(_media->audio_meta); - SAFE_FREE(_media); - media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY); - return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY; - } - - _media->image_meta = (image_meta_s *)calloc(1, sizeof(image_meta_s)); - if (_media->image_meta == NULL) { - SAFE_FREE(_media->audio_meta); - SAFE_FREE(_media->video_meta); - SAFE_FREE(_media); - media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY); - return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY; - } - - _media->file_path = g_strdup(path); - _media->storage_type = -1; - _media->media_type = 0; - _media->modified_time = 0; - _media->size = 0; - _media->request_id = 0; - _media->longitude = MEDIA_SVC_DEFAULT_GPS_VALUE; - _media->latitude = MEDIA_SVC_DEFAULT_GPS_VALUE; - _media->altitude = MEDIA_SVC_DEFAULT_GPS_VALUE; - - if (STRING_VALID(storage_id)) { - _media->storage_uuid = g_strdup(storage_id); - _media->storage_type = storage_type; - } - - *media = (media_info_h)_media; - - return ret; -} - -int media_info_set_title(media_info_h media, const char *title) -{ - media_content_warn("DEPRECATION WARNING: media_info_set_title() is deprecated and will be removed from next release."); - - return __media_info_set_str_data(media, MEDIA_INFO_TITLE, title); -} - -int media_info_set_album(media_info_h media, const char *album) -{ - media_content_warn("DEPRECATION WARNING: media_info_set_album() is deprecated and will be removed from next release."); - - return __media_info_set_str_data(media, MEDIA_INFO_ALBUM, album); -} - -int media_info_set_artist(media_info_h media, const char *artist) -{ - media_content_warn("DEPRECATION WARNING: media_info_set_artist() is deprecated and will be removed from next release."); - - return __media_info_set_str_data(media, MEDIA_INFO_ARTIST, artist); -} - -int media_info_set_genre(media_info_h media, const char *genre) -{ - media_content_warn("DEPRECATION WARNING: media_info_set_genre() is deprecated and will be removed from next release."); - - return __media_info_set_str_data(media, MEDIA_INFO_GENRE, genre); -} - -int media_info_set_recorded_date(media_info_h media, const char *recorded_date) -{ - media_content_warn("DEPRECATION WARNING: media_info_set_recorded_date() is deprecated and will be removed from next release."); - - return __media_info_set_str_data(media, MEDIA_INFO_RECORDED_DATE, recorded_date); -} diff --git a/src/media_storage.c b/src/media_storage.c index 0a18606..c569bf3 100755 --- a/src/media_storage.c +++ b/src/media_storage.c @@ -211,22 +211,6 @@ int media_storage_get_id(media_storage_h storage, char **storage_id) return ret; } -int media_storage_get_name(media_storage_h storage, char **storage_name) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_content_warn("DEPRECATION WARNING: media_storage_get_name() is deprecated and will be removed from next release."); - media_storage_s *_storage = (media_storage_s*)storage; - - if (_storage && storage_name) { - *storage_name = NULL; - } else { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return ret; -} - int media_storage_get_path(media_storage_h storage, char **storage_path) { int ret = MEDIA_CONTENT_ERROR_NONE; diff --git a/src/media_video.c b/src/media_video.c index da79e57..3b1ed37 100755 --- a/src/media_video.c +++ b/src/media_video.c @@ -428,16 +428,3 @@ int video_meta_get_rotation(video_meta_h video, int *rotation) return ret; } - -int video_meta_update_to_db(video_meta_h video) -{ - media_content_warn("DEPRECATION WARNING: video_meta_update_to_db() is deprecated and will be removed from next release."); - video_meta_s *_video = (video_meta_s*)video; - - if (_video == NULL) { - media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER); - return MEDIA_CONTENT_ERROR_INVALID_PARAMETER; - } - - return MEDIA_CONTENT_ERROR_NONE; -} diff --git a/test/media-content_test.c b/test/media-content_test.c index 809382f..1da4c36 100755 --- a/test/media-content_test.c +++ b/test/media-content_test.c @@ -321,9 +321,6 @@ bool media_item_cb(media_info_h media, void *user_data) } else if (media_type == MEDIA_CONTENT_TYPE_IMAGE) { image_meta_h image; media_content_orientation_e orientation = 0; - bool is_burst_shot = false; - char *burst_id = NULL; - char *weather = NULL; if (media_info_get_image(media, &image) == MEDIA_CONTENT_ERROR_NONE) { ret = image_meta_get_orientation(image, &orientation); @@ -332,19 +329,6 @@ bool media_item_cb(media_info_h media, void *user_data) else media_content_debug("[image] orientation : %d", orientation); - ret = image_meta_is_burst_shot(image, &is_burst_shot); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error image_meta_is_burst_shot : [%d]", ret); - if (is_burst_shot) { - ret = image_meta_get_burst_id(image, &burst_id); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error image_meta_get_burst_id : [%d]", ret); - else - media_content_debug("[image] burst_id : [%s]", burst_id); - - SAFE_FREE(burst_id); - } - ret = image_meta_destroy(image); if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("error image_meta_destroy : [%d]", ret); @@ -397,48 +381,6 @@ bool media_item_cb(media_info_h media, void *user_data) media_content_debug("description : [%s]", c_value); SAFE_FREE(c_value); - ret = media_info_get_author(media, &c_value); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error when get info : [%d]", ret); - media_content_debug("author : [%s]", c_value); - SAFE_FREE(c_value); - - ret = media_info_get_provider(media, &c_value); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error when get info : [%d]", ret); - media_content_debug("provider : [%s]", c_value); - SAFE_FREE(c_value); - - ret = media_info_get_content_name(media, &c_value); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error when get info : [%d]", ret); - media_content_debug("content_name : [%s]", c_value); - SAFE_FREE(c_value); - - ret = media_info_get_category(media, &c_value); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error when get info : [%d]", ret); - media_content_debug("category : [%s]", c_value); - SAFE_FREE(c_value); - - ret = media_info_get_location_tag(media, &c_value); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error when get info : [%d]", ret); - media_content_debug("location_tag : [%s]", c_value); - SAFE_FREE(c_value); - - ret = media_info_get_age_rating(media, &c_value); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error when get info : [%d]", ret); - media_content_debug("age_rating : [%s]", c_value); - SAFE_FREE(c_value); - - ret = media_info_get_keyword(media, &c_value); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error when get info : [%d]", ret); - media_content_debug("keyword : [%s]", c_value); - SAFE_FREE(c_value); - ret = media_info_get_size(media, &size); if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("error when get info : [%d]", ret); @@ -489,19 +431,6 @@ bool media_item_cb(media_info_h media, void *user_data) media_content_error("error when get info : [%d]", ret); media_content_debug("360 engine : [%d]", i_value); - ret = media_info_set_weather(media, "Sunny"); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("Fail to set weather"); - return ret; - - ret = media_info_get_weather(media, &c_value); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error when get info : [%d]", ret); - media_content_debug("weather : [%s]", c_value); - SAFE_FREE(c_value); - - /* Media server can't update when another db handle holds DB connection by sqlite3_prepare */ - /*ret = media_info_set_location_tag(media, "Test location tag");*/ /*media_info_update_to_db(media);*/ SAFE_FREE(media_id); #endif @@ -514,7 +443,6 @@ bool folder_list_cb(media_folder_h folder, void *user_data) int item_count = 0; char *folder_id = NULL; char *str_val = NULL; - int int_val = -1; media_content_storage_e storage_type; bool ret; media_folder_h *_folder = (media_folder_h*)user_data; @@ -530,14 +458,6 @@ bool folder_list_cb(media_folder_h folder, void *user_data) } media_content_debug("folder_id = [%s]", folder_id); - if (media_folder_get_parent_folder_id(folder, &str_val) != MEDIA_CONTENT_ERROR_NONE) { - SAFE_FREE(folder_id); - media_content_error("[ERROR] media_folder_get_parent_folder_id is failed"); - return false; - } - media_content_debug("parent_folder_id = [%s]", str_val); - SAFE_FREE(str_val); - if (media_folder_get_path(folder, &str_val) != MEDIA_CONTENT_ERROR_NONE) { SAFE_FREE(folder_id); media_content_error("[ERROR] media_folder_get_path is failed"); @@ -569,11 +489,6 @@ bool folder_list_cb(media_folder_h folder, void *user_data) media_content_debug("storage_id = [%s]", str_val); SAFE_FREE(str_val); - if (media_folder_get_order(folder, &int_val) != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("[ERROR] media_folder_get_order is failed"); - return false; - } - media_content_debug("folder_order = [%d]", int_val); #if 1 if (media_folder_get_media_count_from_db(folder_id, g_filter, &item_count) != MEDIA_CONTENT_ERROR_NONE) { SAFE_FREE(folder_id); @@ -1075,7 +990,6 @@ int test_gallery_scenario(void) int width = 0, height = 0; media_content_orientation_e orientation = 0; char *datetaken = NULL; - char *burst_id = NULL; ret = media_info_get_image(media_handle, &image_handle); if (ret != MEDIA_CONTENT_ERROR_NONE) { @@ -1093,16 +1007,12 @@ int test_gallery_scenario(void) ret = image_meta_get_date_taken(image_handle, &datetaken); if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("error image_meta_get_date_taken : [%d]", ret); - ret = image_meta_get_burst_id(image_handle, &burst_id); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("error image_meta_get_burst_id : [%d]", ret); media_content_debug("This is Image"); media_content_debug("Width : %d, Height : %d, Orientation : %d, Date taken : %s", width, height, orientation, datetaken); } SAFE_FREE(datetaken); - SAFE_FREE(burst_id); ret = image_meta_destroy(image_handle); if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("error image_meta_destroy : [%d]", ret); @@ -1617,79 +1527,6 @@ int test_folder_operation(void) return ret; } -bool folder_update_cb(media_folder_h folder, void *user_data) -{ - char *folder_id = NULL; - char *folder_path = NULL; - char *folder_name = NULL; - int folder_order = -1; - bool ret = true; - - if (folder != NULL) { - ret = media_folder_get_folder_id(folder, &folder_id); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - media_content_debug("folder_id = [%s]", folder_id); - SAFE_FREE(folder_id); - - ret = media_folder_get_path(folder, &folder_path); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - media_content_debug("folder_path = [%s]", folder_path); - SAFE_FREE(folder_path); - - ret = media_folder_get_name(folder, &folder_name); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - media_content_debug("folder_name = [%s]", folder_name); - SAFE_FREE(folder_name); - - ret = media_folder_get_order(folder, &folder_order); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - media_content_debug("folder_order = [%d]", folder_order); - - ret = media_folder_clone(&g_folder, folder); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = true; - } else { - ret = false; - } - - return ret; -} - - -int test_folder_update(void) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - filter_h filter; - int folder_count = 0; - - media_content_debug("\n============Folder Update Test============\n\n"); - - ret = media_filter_create(&filter); - media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret); - - ret = media_filter_set_condition(filter, "MEDIA_TYPE=0 and MEDIA_STORAGE_TYPE=0", MEDIA_CONTENT_COLLATE_DEFAULT); /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music, 4-other*/ - ret = media_filter_set_order(filter, MEDIA_CONTENT_ORDER_DESC, FOLDER_ORDER, MEDIA_CONTENT_COLLATE_NOCASE); - - ret = media_folder_get_folder_count_from_db(filter, &folder_count); - - media_content_debug("Folder count : %d", folder_count); - - ret = media_folder_foreach_folder_from_db(filter, folder_update_cb, NULL); - - media_filter_destroy(filter); - - ret = media_folder_set_name(g_folder, "test_folder"); - - ret = media_folder_set_order(g_folder, 200); - - ret = media_folder_update_to_db(g_folder); - - ret = media_folder_destroy(g_folder); - - return ret; -} - int test_playlist_operation(void) { int ret = MEDIA_CONTENT_ERROR_NONE; @@ -2358,9 +2195,6 @@ int test_update_operation() media_content_debug("media_info_get_video success"); /* update video meta */ - video_meta_set_played_count(video_handle, 5); - video_meta_set_played_time(video_handle, 5); - video_meta_set_played_position(video_handle, 5); video_meta_update_to_db(video_handle); ret = video_meta_update_to_db(video_handle); @@ -2377,10 +2211,6 @@ int test_update_operation() } else { media_content_debug("media_info_get_audio success"); - audio_meta_set_played_count(audio_handle, 5); - audio_meta_set_played_time(audio_handle, 1000); - audio_meta_set_played_position(audio_handle, 180); - ret = audio_meta_update_to_db(audio_handle); if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("audio_meta_update_to_db failed: %d", ret); @@ -2855,17 +2685,12 @@ int test_request_update_db(void) { int ret = MEDIA_CONTENT_ERROR_NONE; media_info_h media = NULL; - char *content_name = NULL; bool favorite = FALSE; ret = media_info_get_media_from_db("71b19196-5b38-4ab1-ab34-bfe05c369614", &media); if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("media_info_get_media_from_db failed: %d", ret); - ret = media_info_set_content_name(media, "TEST_content_name"); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("media_info_set_content_name failed: %d", ret); - ret = media_info_set_favorite(media, TRUE); if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("media_info_set_favorite failed: %d", ret); @@ -2884,14 +2709,6 @@ int test_request_update_db(void) if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("media_info_get_media_from_db failed: %d", ret); - ret = media_info_get_content_name(media, &content_name); - if (ret != MEDIA_CONTENT_ERROR_NONE) - media_content_error("media_info_get_content_name failed: %d", ret); - else - media_content_debug("content name [%s]", content_name); - - SAFE_FREE(content_name); - ret = media_info_get_favorite(media, &favorite); if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("media_info_get_favorite failed: %d", ret); @@ -3083,84 +2900,9 @@ int test_batch_operations() if (ret != MEDIA_CONTENT_ERROR_NONE) media_content_error("media_info_insert_batch_to_db failed : %d\n", ret); - filter_h filter; - char condition[2048] = {0, }; - const char *temp = NULL; - memset(condition, 0x00, sizeof(condition)); - - temp = tzplatform_mkpath(TZ_USER_CONTENT, "test/image%%jpg\'"); - snprintf(condition, sizeof(condition), "MEDIA_PATH LIKE \'%s", temp); - - ret = media_filter_create(&filter); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("Fail to create filter"); - return ret; - } - - ret = media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_filter_destroy(filter); - media_content_error("Fail to set condition"); - return ret; - } - - ret = media_info_delete_batch_from_db(filter); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_filter_destroy(filter); - media_content_error("media_info_delete_batch_from_db failed : %d\n", ret); - return ret; - } - - ret = media_filter_destroy(filter); - return ret; } -void insert_burst_shot_cb(media_content_error_e error, void * user_data) -{ - media_content_debug("media_info_insert_burst_shot_to_db completed![%d]\n", error); - g_main_loop_quit(g_loop); -} - -gboolean test_insert_burst_shot_to_db_start(gpointer data) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - int i = 0; - char *file_list[10]; - - for (i = 0; i < 10; i++) { - char filepath[255] = {0,}; - snprintf(filepath, sizeof(filepath), "%s%d.jpg", tzplatform_mkpath(TZ_USER_CONTENT, "test/image"), i+1); - media_content_debug("File : %s\n", filepath); - file_list[i] = strdup(filepath); - } - - ret = media_info_insert_burst_shot_to_db((const char **)file_list, 10, insert_burst_shot_cb, NULL); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("media_info_insert_burst_shot_to_db failed : %d\n", ret); - g_main_loop_quit(g_loop); - } - - return ret; -} - -int test_insert_burst_shot_to_db(void) -{ - GSource *source = NULL; - GMainContext *context = NULL; - - g_loop = g_main_loop_new(NULL, FALSE); - context = g_main_loop_get_context(g_loop); - source = g_idle_source_new(); - g_source_set_callback(source, test_insert_burst_shot_to_db_start, NULL, NULL); - g_source_attach(source, context); - - g_main_loop_run(g_loop); - g_main_loop_unref(g_loop); - - return 0; -} - void _scan_cb(media_content_error_e err, void *user_data) { media_content_debug("scan callback is called : %d\n", err); @@ -3336,39 +3078,6 @@ gboolean _send_noti_operations(gpointer data) media_content_debug("media_info_insert_to_db success"); - /* media_info_delete_batch_from_db */ - filter_h filter; - char condition[2048] = {0,}; - const char *temp = NULL; - memset(condition, 0x00, sizeof(condition)); - - temp = tzplatform_mkpath(TZ_USER_CONTENT, "test/image%%\'"); - snprintf(condition, sizeof(condition), "MEDIA_PATH LIKE \'%s", temp); - - ret = media_filter_create(&filter); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("Fail to create filter"); - media_info_destroy(media_item); - return ret; - } - - ret = media_filter_set_condition(filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_filter_destroy(filter); - media_info_destroy(media_item); - media_content_error("Fail to set condition"); - return ret; - } - ret = media_info_delete_batch_from_db(filter); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_filter_destroy(filter); - media_info_destroy(media_item); - media_content_error("media_info_delete_batch_from_db failed : %d\n", ret); - return ret; - } - - media_filter_destroy(filter); - media_content_remove_db_updated_cb(noti_h); /* media_info_update_to_db */ @@ -3405,146 +3114,6 @@ int test_noti() return ret; } -int test_create_handle(void) -{ - int ret = MEDIA_CONTENT_ERROR_NONE; - media_info_h media = NULL; - const char *path = tzplatform_mkpath(TZ_USER_CONTENT, "test/test.txt"); - char *str_value = NULL; - int int_value = -1; - bool bool_value = FALSE; - unsigned long long content_size = 0; - time_t modified_time = 0; - double double_value = 0.0; - - ret = media_info_create(path, &media); - - ret = media_info_set_title(media, "test_title"); - ret = media_info_set_album(media, "test_album"); - ret = media_info_set_artist(media, "test_artist"); - ret = media_info_set_genre(media, "test_genre"); - ret = media_info_set_recorded_date(media, "test_recorded_date"); - ret = media_info_set_age_rating(media, "test_age_rating"); - ret = media_info_set_author(media, "test_author"); - ret = media_info_set_category(media, "test_category"); - ret = media_info_set_content_name(media, "test_content_name"); - ret = media_info_set_description(media, "test_description"); - ret = media_info_set_display_name(media, "test_display_name"); - ret = media_info_set_keyword(media, "test_keyword"); - ret = media_info_set_location_tag(media, "test_location_tag"); - ret = media_info_set_weather(media, "test_weather"); - ret = media_info_set_provider(media, "test_provider"); - - ret = media_info_set_altitude(media, 100.10); - ret = media_info_set_latitude(media, 200.20); - ret = media_info_set_longitude(media, 300.30); - ret = media_info_set_rating(media, 10); - ret = media_info_set_played_time(media); - ret = media_info_set_favorite(media, TRUE); - ret = media_info_increase_played_count(media); - ret = media_info_set_added_time(media, 12345); - - ret = media_info_insert_to_db_with_data(media); - if (ret != MEDIA_CONTENT_ERROR_NONE) { - media_content_error("media_info_insert_to_db_with_data failed : %d\n", ret); - media_info_destroy(media); - return ret; - } - - ret = media_info_get_media_id(media, &str_value); - media_content_debug("media_id = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_file_path(media, &str_value); - media_content_debug("file_path = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_title(media, &str_value); - media_content_debug("title = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_age_rating(media, &str_value); - media_content_debug("age_rating = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_author(media, &str_value); - media_content_debug("author = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_category(media, &str_value); - media_content_debug("category = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_content_name(media, &str_value); - media_content_debug("content_name = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_description(media, &str_value); - media_content_debug("description = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_display_name(media, &str_value); - media_content_debug("display_name = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_keyword(media, &str_value); - media_content_debug("keyword = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_location_tag(media, &str_value); - media_content_debug("location_tag = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_weather(media, &str_value); - media_content_debug("weather = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_provider(media, &str_value); - media_content_debug("provider = [%s]", str_value); - SAFE_FREE(str_value); - - ret = media_info_get_longitude(media, &double_value); - media_content_debug("longitude = [%lf]", double_value); - - ret = media_info_get_latitude(media, &double_value); - media_content_debug("latitude = [%lf]", double_value); - - ret = media_info_get_altitude(media, &double_value); - media_content_debug("altitud = [%lf]", double_value); - - ret = media_info_get_rating(media, &int_value); - media_content_debug("rating = [%d]", int_value); - - ret = media_info_get_favorite(media, &bool_value); - media_content_debug("favorite = [%d]", bool_value); - - ret = media_info_get_played_time(media, &modified_time); - media_content_debug("played_time = [%ld]", modified_time); - - ret = media_info_get_played_count(media, &int_value); - media_content_debug("played_count = [%d]", int_value); - - ret = media_info_get_added_time(media, &modified_time); - media_content_debug("added_time = [%ld]", modified_time); - - ret = media_info_get_size(media, &content_size); - media_content_debug("size = [%llu]", content_size); - - ret = media_info_get_modified_time(media, &modified_time); - media_content_debug("modified_time = [%ld]", modified_time); - - ret = media_info_get_media_type(media, (media_content_type_e *)&int_value); - media_content_debug("media_type = [%d]", int_value); - - ret = media_info_get_storage_type(media, (media_content_storage_e *)&int_value); - media_content_debug("storage_type = [%d]", int_value); - - media_info_destroy(media); - - return ret; - -} - bool media_face_test_cb(media_face_h face, void *user_data) { char *face_id = NULL; @@ -4071,10 +3640,6 @@ int main(int argc, char *argv[]) if (ret != MEDIA_CONTENT_ERROR_NONE) return ret; - ret = test_folder_update(); - if (ret != MEDIA_CONTENT_ERROR_NONE) - return ret; - ret = test_playlist_operation(); if (ret != MEDIA_CONTENT_ERROR_NONE) return ret; @@ -4127,10 +3692,6 @@ int main(int argc, char *argv[]) if (ret != MEDIA_CONTENT_ERROR_NONE) return MEDIA_CONTENT_ERROR_NONE; - ret = test_insert_burst_shot_to_db(); - if (ret != MEDIA_CONTENT_ERROR_NONE) - return MEDIA_CONTENT_ERROR_NONE; - ret = test_scan_file(); if (ret != MEDIA_CONTENT_ERROR_NONE) return MEDIA_CONTENT_ERROR_NONE; @@ -4143,10 +3704,6 @@ int main(int argc, char *argv[]) if (ret != MEDIA_CONTENT_ERROR_NONE) return MEDIA_CONTENT_ERROR_NONE; - ret = test_create_handle(); - if (ret != MEDIA_CONTENT_ERROR_NONE) - return MEDIA_CONTENT_ERROR_NONE; - ret = test_face(); if (ret != MEDIA_CONTENT_ERROR_NONE) return MEDIA_CONTENT_ERROR_NONE; -- 2.7.4