* operations that involve database requires an active connection with the media content service.\n
* During media scanning, Media Service extract media information automatically. media information include basic file info like
* path, size, modified time etc and some metadata like ID3tag, EXIF, thumbnail, etc. (thumbnail extracted only in Internal and SD card storage.) \n
- * Since 3.0, a thumbnail is not automatically extracted during media scanning. A thumbnail will be created only when media_info_create_thumbnail() is called by any application. \n
+ * Since 3.0, a thumbnail is not automatically extracted during media scanning. A thumbnail will be created only when media_info_generate_thumbnail() is called by any application. \n
* Media content services do not manage hidden files. \n
* The API provides functions for connecting (#media_content_connect()) and disconnecting (#media_content_disconnect()) from the media content service.
*
*
* @section CAPI_CONTENT_MEDIA_FOLDER_MODULE_OVERVIEW Overview
* A Folder is used to organize media content files i.e. image, audio, video, ebook files, in the physical storage of the device.
- * The Media Folder API provides functions to get basic information about existing folders e.g. folder name, path and storage type.
+ * The Media Folder API provides functions to get basic information about existing folders e.g. folder name, path and modified time.
* It also provides functions to get information related to media items present in the folder.
*
* For getting information about folder call the respective get functions e.g. to get path and name of a given folder call #media_folder_get_path() and #media_folder_get_name() function respectively and so on.\n
* </tr>
* <tr>
* <td>copyright</td>
- * <td>#MEDIA_COPYRIGHT</td>
+ * <td></td>
* <td>Get from metadata if exist.</td>
* </tr>
* <tr>
* </tr>
* <tr>
* <td>bit_rate</td>
- * <td>#MEDIA_BITRATE</td>
+ * <td></td>
* <td>Bitrate</td>
* </tr>
* <tr>
* <td>bitpersample</td>
- * <td>#MEDIA_BITPERSAMPLE</td>
+ * <td></td>
* <td>Bit per sample</td>
* </tr>
* <tr>
* <td>sample_rate</td>
- * <td>#MEDIA_SAMPLERATE</td>
+ * <td></td>
* <td>Samplerate</td>
* </tr>
* <tr>
* <td>channel</td>
- * <td>#MEDIA_CHANNEL</td>
+ * <td></td>
* <td>Channel</td>
* </tr>
* <tr>
* </tr>
* <tr>
* <td>rating</td>
- * <td>#MEDIA_RATING</td>
+ * <td></td>
* <td>Get from metadata if exist.</td>
* </tr>
* </table>
* </tr>
* <tr>
* <td>exposure_time</td>
- * <td>#MEDIA_EXPOSURE_TIME</td>
+ * <td></td>
* <td>Get from EXIF if exist.</td>
* </tr>
* <tr>
* <td>fnumber</td>
- * <td>#MEDIA_FNUMBER</td>
+ * <td></td>
* <td>Get from EXIF if exist.</td>
* </tr>
* <tr>
* <td>iso</td>
- * <td>#MEDIA_ISO</td>
+ * <td></td>
* <td>Get from EXIF if exist.</td>
* </tr>
* <tr>
* <td>model</td>
- * <td>#MEDIA_MODEL</td>
+ * <td></td>
* <td>Get from EXIF if exist.</td>
* </tr>
* <tr>
* </tr>
* <tr>
* <td>orientation</td>
- * <td>#MEDIA_ORIENTATION</td>
+ * <td></td>
* <td>Get from EXIF if exist.</td>
* </tr>
* <tr>
* </tr>
* <tr>
* <td>copyright</td>
- * <td>#MEDIA_COPYRIGHT</td>
+ * <td></td>
* <td>Get from metadata if exist.</td>
* </tr>
* <tr>
* </tr>
* <tr>
* <td>bit_rate</td>
- * <td>#MEDIA_BITRATE</td>
+ * <td></td>
* <td>Bitrate</td>
* </tr>
* <tr>
* <td>bitpersample</td>
- * <td>#MEDIA_BITPERSAMPLE</td>
+ * <td></td>
* <td>Bit per sample</td>
* </tr>
* <tr>
* <td>sample_rate</td>
- * <td>#MEDIA_SAMPLERATE</td>
+ * <td></td>
* <td>Samplerate</td>
* </tr>
* <tr>
* <td>channel</td>
- * <td>#MEDIA_CHANNEL</td>
+ * <td></td>
* <td>Channel</td>
* </tr>
* <tr>
* </tr>
* <tr>
* <td>rating</td>
- * <td>#MEDIA_RATING</td>
+ * <td></td>
* <td>Get from metadata if exist.</td>
* </tr>
* <tr>
* <td>rotation</td>
- * <td>#MEDIA_ORIENTATION</td>
+ * <td></td>
* <td>Video rotation</td>
* </tr>
* <tr>
* </tr>
* <tr>
* <td>publisher</td>
- * <td>#MEDIA_COPYRIGHT</td>
+ * <td></td>
* <td>Get from metadata if exist.</td>
* </tr>
* </table>
* <td>Whether DRM content or not</td>
* </tr>
* <tr>
- * <td>storage_id</td>
- * <td>#MEDIA_STORAGE_ID</td>
- * <td>Storage UUID.</td>
- * </tr>
- * <tr>
- * <td>storage_type</td>
- * <td>#MEDIA_STORAGE_TYPE</td>
- * <td>Storage type (media_content_storage_e)</td>
- * </tr>
- * <tr>
* <td>favorite</td>
* <td>#MEDIA_FAVOURITE</td>
* <td>User data. Not guarantee independence between applications.</td>
* </tr>
* <tr>
* <td>description</td>
- * <td>#MEDIA_DESCRIPTION</td>
+ * <td></td>
* <td>Get from metadata if exist.</td>
* </tr>
* </table>
*/
/**
- * @defgroup CAPI_CONTENT_MEDIA_STORAGE_MODULE Media Storage
- * @brief The Media Storage Information API provides functions to manage storage information on the media items.
- *
- * @ingroup CAPI_MEDIA_CONTENT_MODULE
- *
- * @section CAPI_CONTENT_MEDIA_STORAGE_MODULE_HEADER Required Header
- * \#include <media_content.h>
- *
- * @section CAPI_CONTENT_MEDIA_STORAGE_MODULE_OVERVIEW Overview
- * A Storage allows you to manage external storage. \n
- * The system generates the storage id when the external storage is added. And the system manages the media information in each of the storage by using storage id. \n
- * So you can get the information from the storage that you want to view.
- *
- */
-
-/**
* @defgroup CAPI_CONTENT_MEDIA_FACE_MODULE Media Face
* @brief The Media Face Information API provides functions to manage the face information in the image files.
*
#include <media_group.h>
#include <media_playlist.h>
#include <media_bookmark.h>
-#include <media_storage.h>
#include <media_face.h>
#include <media_book.h>
/**
* @ingroup CAPI_MEDIA_CONTENT_MODULE
- * @deprecated Deprecated since 5.0.
- * @brief Enumeration for the storage type.
- * @details This information is used to establish where the folder is.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-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_e;
-
-/**
- * @ingroup CAPI_MEDIA_CONTENT_MODULE
* @brief Enumeration for media content DB update items.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef struct filter_s *filter_h;
/**
- * @ingroup CAPI_CONTENT_MEDIA_STORAGE_MODULE
- * @deprecated Deprecated since 5.0.
- * @brief The structure type for the Media storage handle.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-typedef void *media_storage_h;
-
-/**
* @ingroup CAPI_CONTENT_MEDIA_FACE_MODULE
* @brief The structure type for the Media face handle.
* @since_tizen 3.0
/**
- * @deprecated Deprecated since 5.0.
- * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
- * @brief Called when creating a thumbnail image.
- * @details This callback is called for completion of generating the thumbnail image.
- * The following error codes can be delivered. \n
- * #MEDIA_CONTENT_ERROR_NONE, \n
- * #MEDIA_CONTENT_ERROR_INVALID_PARAMETER, \n
- * #MEDIA_CONTENT_ERROR_INVALID_OPERATION, \n
- * #MEDIA_CONTENT_ERROR_PERMISSION_DENIED, \n
- * #MEDIA_CONTENT_ERROR_DB_FAILED, \n
- * #MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT
- * @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] path The path of the thumbnail which is generated
- * @param[in] user_data The user data passed from the foreach function
- *
- * @pre media_info_create_thumbnail()
- * @see media_info_create_thumbnail()
- */
-typedef void (*media_thumbnail_completed_cb)(media_content_error_e error, const char *path, void *user_data);
-
-/**
* @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
* @brief Called when face detection on the image is completed.
*
typedef bool (*media_group_cb)(const char *group_name, void *user_data);
/**
- * @ingroup CAPI_CONTENT_MEDIA_STORAGE_MODULE
- * @deprecated Deprecated since 5.0.
- * @brief Called for every storage in the obtained list of storages.
- * @details Iterates over a media storage list.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks You should not destroy @a storage returned by this function. \n
- * The callback is called in the main loop.
- *
- * @param[in] storage The handle of the media storage
- * @param[in] user_data The user data passed from the foreach function
- *
- * @return @c true to continue with the next iteration of the loop,
- * otherwise @c false to break out of the loop
- *
- * @pre media_storage_foreach_storage_from_db() will invoke this function.
- * @see media_storage_foreach_storage_from_db()
- */
-typedef bool (*media_storage_cb)(media_storage_h storage, void *user_data);
-
-/**
* @ingroup CAPI_CONTENT_MEDIA_FACE_MODULE
* @brief Called for every face in the obtained list of face.
* @details Iterates over a media face list.
#define MEDIA_RECORDED_DATE "MEDIA_RECORDED_DATE"
/**
- * @deprecated Deprecated since 5.5.
- * @brief Media copyright.
- * @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_COPYRIGHT "MEDIA_COPYRIGHT"
-
-/**
* @brief Media track number.
* @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_TRACK_NUM "MEDIA_TRACK_NUM"
/**
- * @deprecated Deprecated since 5.5.
- * @brief Media description.
- * @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_DESCRIPTION "MEDIA_DESCRIPTION"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media bitrate.
- * @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_BITRATE "MEDIA_BITRATE"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media bit per sample.
- * @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_BITPERSAMPLE "MEDIA_BITPERSAMPLE"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media sample rate.
- * @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_SAMPLERATE "MEDIA_SAMPLERATE"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media channel.
- * @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_CHANNEL "MEDIA_CHANNEL"
-
-/**
* @brief Media duration.
* @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_DATETAKEN "MEDIA_DATETAKEN"
/**
- * @deprecated Deprecated since 5.5.
- * @brief Media orientation.
- * @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_ORIENTATION "MEDIA_ORIENTATION"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @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
- *
- */
-#define MEDIA_RATING "MEDIA_RATING"
-
-/**
* @brief The time to register favourite.
* @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_IS_DRM "MEDIA_IS_DRM"
/**
- * @deprecated Deprecated since 5.0.
- * @brief Media storage.
- * @details There are 3 types:\n
- * 0-internal storage, 1-SD card, 2-USB storage\n
- * 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_STORAGE_TYPE "MEDIA_STORAGE_TYPE"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media exposure time.
- * @details You can use above define to set the condition of media filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- */
-#define MEDIA_EXPOSURE_TIME "MEDIA_EXPOSURE_TIME"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media fnumber.
- * @details You can use above define to set the condition of media filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- */
-#define MEDIA_FNUMBER "MEDIA_FNUMBER"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media ISO.
- * @details You can use above define to set the condition of media filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- */
-#define MEDIA_ISO "MEDIA_ISO"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media model.
- * @details You can use above define to set the condition of media filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- */
-#define MEDIA_MODEL "MEDIA_MODEL"
-
-/**
* @deprecated Deprecated since 7.0.
* @brief Media file name pinyin.
* @details You can use above define to set the condition of media filter and order keyword.
#define MEDIA_COMPOSER_PINYIN "MEDIA_COMPOSER_PINYIN"
/**
- * @deprecated Deprecated since 5.5.
- * @brief Media copyright 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_COPYRIGHT_PINYIN "MEDIA_COPYRIGHT_PINYIN"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media description 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_DESCRIPTION_PINYIN "MEDIA_DESCRIPTION_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
#define FOLDER_NAME "FOLDER_NAME"
/**
- * @deprecated Deprecated since 5.0.
- * @brief Folder storage.
- * @details There are 2 types:\n
- * 0-internal storage, 1-external storage\n
- * 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_STORAGE_TYPE "FOLDER_STORAGE_TYPE"
-
-/**
* @deprecated Deprecated since 7.0.
* @brief Folder base name pinyin.
* @details You can use above define to set the condition of folder filter and order keyword.
#define BOOKMARK_NAME "BOOKMARK_NAME"
/**
- * @deprecated Deprecated since 5.0.
- * @brief Storage ID.
- * @details You can use above define to set the condition of storage filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define MEDIA_STORAGE_ID "STORAGE_ID"
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Storage path.
- * @details You can use above define to set the condition of storage filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define MEDIA_STORAGE_PATH "STORAGE_PATH"
-
-/**
* @brief Face tag.
* @details You can use above define to set the condition of face filter and order keyword.
* @since_tizen 3.0
int media_filter_set_order(filter_h filter, media_content_order_e order_type, const char *order_keyword, media_content_collation_e collate_type);
/**
- * @deprecated Deprecated since 5.0. Use media_filter_set_condition() with MEDIA_PATH keyword instead. \n
- * See @ref CAPI_SYSTEM_STORAGE_MODULE for information about file system paths.
- *
- * @brief Sets the @a storage_id for the given @a filter.
- * @details You can use this function when you want to search items only in the specific storage
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @param[in] filter The handle to the media filter
- * @param[in] storage_id The ID of the media storage
- *
- * @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
- *
- * @see media_filter_create()
- * @see media_filter_destroy()
- */
-int media_filter_set_storage(filter_h filter, const char *storage_id) TIZEN_DEPRECATED_API;
-
-/**
* @brief Gets the @a offset and @a count for the given @a filter used to limit the number of items returned.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
int media_filter_get_order(filter_h filter, media_content_order_e *order_type, char **order_keyword, media_content_collation_e *collate_type);
/**
- * @deprecated Deprecated since 5.0.
- * @brief Gets the @a storage_id for given @a filter.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks The @a storage_id should be released using free().
- *
- * @param[in] filter The handle to the media filter
- * @param[out] storage_id The ID 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
- *
- * @see media_filter_create()
- * @see media_filter_destroy()
- */
-int media_filter_get_storage(filter_h filter, char **storage_id) TIZEN_DEPRECATED_API;
-
-/**
* @}
*/
int media_folder_get_name(media_folder_h folder, char **folder_name);
/**
- * @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
- *
- * @param[in] folder The handle to the media folder
- * @param[out] storage_type The storage type 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_storage_type(media_folder_h folder, media_content_storage_e *storage_type) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Gets the storage id of the folder.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks The @a storage_id should be released using free().
- *
- * @param[in] folder The handle to the media folder
- * @param[out] storage_id The storage id 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_OUT_OF_MEMORY Out of memory
- */
-int media_folder_get_storage_id(media_folder_h folder, char **storage_id) 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.
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 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
- * You can use media_content_scan_file()/media_content_scan_folder() function instead of this function if a file is removed from the file system.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- *
- * @privlevel public
- * @privilege %http://tizen.org/privilege/content.write
- *
- * @param[in] media_id The media ID. It can get from media info handle.
- *
- * @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_content_scan_file()
- * @see media_content_scan_folder()
- */
-int media_info_delete_from_db(const char *media_id) TIZEN_DEPRECATED_API;
-
-
-/**
* @brief Destroys media info.
* @details The function frees all resources related to the media info handle. This handle
* can no longer be used to perform any operations. New media info handle has to
int media_info_get_title(media_info_h media, char **title);
/**
- * @deprecated Deprecated since 5.0.
- * @brief Gets the storage id of content file.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks The @a storage_id should be released using free().
- *
- * @param[in] media The handle to the media info
- * @param[out] storage_id The ID of the media storage
- *
- * @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_storage_id(media_info_h media, char **storage_id) TIZEN_DEPRECATED_API;
-
-/**
* @brief Checks whether the media is protected via DRM.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
int media_info_is_360_content(media_info_h media, bool *is_360);
/**
- * @deprecated Deprecated since 5.0. Use storage_get_type_dev() instead.
- * @brief Gets the storage type of content file.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- *
- * @param[in] media The handle to the media info
- * @param[out] storage_type The storage type of the content file
- *
- * @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_get_storage_type(media_info_h media, media_content_storage_e *storage_type) 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.
int media_info_move_to_db(media_info_h media, const char* dst_path);
/**
- * @deprecated Deprecated since 5.0. Use media_info_generate_thumbnail() instead.
- * @brief Creates a thumbnail file for the given media, asynchronously.
- * @details This function creates an thumbnail file for given media item and calls @a callback for completion of creating the thumbnail.
- * If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function. \n
- * Since 3.0, a thumbnail is not automatically extracted during media scanning. \n
- * Therefore, if there exists no thumbnail for the given media, you MUST call this function to create a thumbnail.
- *
- * @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 If you want to destroy media handle before callback invoked, you must cancel thumbnail request by using media_info_cancel_thumbnail() \n
- * Since 3.0, if creation of a thumbnail is failed, empty string will be passed through media_thumbnail_completed_cb().
- * Items in external storage except MMC not supported.
- *
- * @param[in] media The handle to the media info
- * @param[in] callback The callback function to be invoked
- * @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()
- */
-int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Cancels the creation of thumbnail file for the given media.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- *
- * @privlevel public
- * @privilege %http://tizen.org/privilege/content.write
- *
- * @remarks If you request cancel for the already thumbnail created media, this function returns #MEDIA_CONTENT_ERROR_INVALID_OPERATION
- *
- * @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_PERMISSION_DENIED Permission denied
- * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
- *
- * @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
- */
-int media_info_cancel_thumbnail(media_info_h media) TIZEN_DEPRECATED_API;
-
-/**
* @brief Generates a thumbnail file for the given media, synchronously.
*
* @since_tizen 5.0
MEDIA_GROUP_BOOKMARK,
MEDIA_GROUP_TAG_BY_MEDIA_ID,
MEDIA_GROUP_BOOKMARK_BY_MEDIA_ID,
- MEDIA_GROUP_STORAGE,
MEDIA_GROUP_FACE,
MEDIA_GROUP_FACE_BY_MEDIA_ID,
} group_list_e;
char *folder_id;
char *path;
char *name;
- media_content_storage_e storage_type;
+ ms_user_storage_type_e storage_type;
char *storage_uuid;
} media_folder_s;
} media_playlist_item_s;
typedef struct {
- char *storage_id;
- char *storage_path;
- int storage_type;
-} media_storage_s;
-
-typedef struct {
int face_id; /* face id */
char *media_id; /* media uuid */
unsigned int face_rect_x; /* x position of face */
} media_face_s;
typedef struct {
- media_info_s *handle;
- void *user_data;
- media_thumbnail_completed_cb thumbnail_completed_cb;
-} media_thumbnail_cb_s;
-
-typedef struct {
void *user_data;
media_face_detection_completed_cb face_completed_cb;
} media_face_cb_s;
#define DB_TABLE_PLAYLIST "playlist"
#define DB_TABLE_PLAYLIST_MAP "playlist_map"
#define DB_TABLE_BOOKMARK "bookmark"
-#define DB_TABLE_STORAGE "storage"
#define DB_TABLE_FACE "face"
#define DB_TABLE_FACE_SCAN_LIST "face_scan_list"
#define FACE_MEDIA_JOIN DB_TABLE_FACE" NATURAL JOIN "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
/* Get Group List */
-#define SELECT_ALBUM_LIST "SELECT DISTINCT album_id, name, artist, album_art FROM "ALBUM_MEDIA_JOIN
-#define SELECT_ALBUM_LIST_BY_STORAGE_ID SELECT_ALBUM_LIST"AND storage_uuid='%s' "
+#define SELECT_ALBUM_LIST "SELECT DISTINCT album_id, name, artist, album_art FROM "ALBUM_MEDIA_JOIN
#define SELECT_MEDIA_GROUP_LIST "SELECT DISTINCT %s FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
-#define SELECT_MEDIA_GROUP_LIST_BY_STORAGE_ID SELECT_MEDIA_GROUP_LIST"AND storage_uuid='%s' "
-
-#define SELECT_FOLDER_LIST "SELECT DISTINCT folder_id, folder_path, folder_name, folder_storage_type, storage_uuid FROM "FOLDER_MEDIA_JOIN
-#define SELECT_FOLDER_LIST_BY_STORAGE_ID SELECT_FOLDER_LIST"AND storage_uuid='%s' "
-#define SELECT_TAG_LIST "SELECT DISTINCT tag_id, tag_name FROM "DB_VIEW_TAG" WHERE 1 "
-#define SELECT_PLAYLIST_LIST "SELECT DISTINCT playlist_id, playlist_name, p_thumbnail_path FROM "DB_VIEW_PLAYLIST" WHERE 1 "
+#define SELECT_FOLDER_LIST "SELECT DISTINCT folder_id, folder_path, folder_name, folder_storage_type, storage_uuid FROM "FOLDER_MEDIA_JOIN
+#define SELECT_TAG_LIST "SELECT DISTINCT tag_id, tag_name FROM "DB_VIEW_TAG" WHERE 1 "
+#define SELECT_PLAYLIST_LIST "SELECT DISTINCT playlist_id, playlist_name, p_thumbnail_path FROM "DB_VIEW_PLAYLIST" WHERE 1 "
/* Get Group Count */
-#define SELECT_ALBUM_COUNT "SELECT COUNT(DISTINCT album_id) FROM "ALBUM_MEDIA_JOIN
-#define SELECT_ALBUM_COUNT_BY_STORAGE_ID SELECT_ALBUM_COUNT"AND storage_uuid='%s' "
-#define SELECT_FOLDER_COUNT "SELECT COUNT(DISTINCT folder_id) FROM "FOLDER_MEDIA_JOIN
-#define SELECT_FOLDER_COUNT_BY_STORAGE_ID SELECT_FOLDER_COUNT"AND storage_uuid='%s' "
-#define SELECT_TAG_COUNT "SELECT COUNT(DISTINCT tag_id) FROM "DB_VIEW_TAG" WHERE 1 "
-#define SELECT_PLAYLIST_COUNT "SELECT COUNT(DISTINCT playlist_id) FROM "DB_VIEW_PLAYLIST" WHERE 1 "
+#define SELECT_ALBUM_COUNT "SELECT COUNT(DISTINCT album_id) FROM "ALBUM_MEDIA_JOIN
+#define SELECT_FOLDER_COUNT "SELECT COUNT(DISTINCT folder_id) FROM "FOLDER_MEDIA_JOIN
+#define SELECT_TAG_COUNT "SELECT COUNT(DISTINCT tag_id) FROM "DB_VIEW_TAG" WHERE 1 "
+#define SELECT_PLAYLIST_COUNT "SELECT COUNT(DISTINCT playlist_id) FROM "DB_VIEW_PLAYLIST" WHERE 1 "
#define SELECT_BOOKMARK_COUNT "SELECT COUNT(*) FROM "BOOKMARK_MEDIA_JOIN
-#define SELECT_BOOKMARK_COUNT_BY_STORAGE_ID SELECT_BOOKMARK_COUNT"AND storage_uuid='%s' "
#define SELECT_MEDIA_GROUP_COUNT "SELECT COUNT(DISTINCT %s) + COUNT(DISTINCT CASE WHEN %s IS NULL THEN 1 END) AS COUNT FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
-#define SELECT_MEDIA_GROUP_COUNT_BY_STORAGE_ID SELECT_MEDIA_GROUP_COUNT"AND storage_uuid='%s' "
-/*count(distinct x) count only non-null values, but select distinct X returns include null. so sync the result of count and list, don't use count(distinct x)*/
/* Get Media Count of Group */
-#define SELECT_MEDIA_COUNT_FROM_MEDIA "SELECT COUNT(*) FROM (SELECT media_id FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
-#define SELECT_MEDIA_COUNT_FROM_MEDIA_BY_STORAGE_ID SELECT_MEDIA_COUNT_FROM_MEDIA"AND storage_uuid='%s' "
+#define SELECT_MEDIA_COUNT_FROM_MEDIA "SELECT COUNT(*) FROM (SELECT media_id FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
#define SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
-#define SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE_BY_STORAGE_ID SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE"AND storage_uuid='%s' "
-#define SELECT_MEDIA_COUNT_FROM_ALBUM "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND album_id='%d' "
-#define SELECT_MEDIA_COUNT_FROM_ALBUM_BY_STORAGE_ID SELECT_MEDIA_COUNT_FROM_ALBUM"AND storage_uuid='%s' "
-#define SELECT_MEDIA_COUNT_FROM_GROUP "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP /*to apply limit condition. */
-#define SELECT_MEDIA_COUNT_FROM_GROUP_BY_STORAGE_ID "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_BY_STORAGE_ID /*to apply limit condition. */
-#define SELECT_MEDIA_COUNT_FROM_GROUP_NULL "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_NULL /* to apply limit condition. */
-#define SELECT_MEDIA_COUNT_FROM_GROUP_NULL_BY_STORAGE_ID "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_NULL_BY_STORAGE_ID /* to apply limit condition. */
-#define SELECT_MEDIA_COUNT_FROM_FOLDER "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND folder_id='%s'"
-#define SELECT_MEDIA_COUNT_FROM_FOLDER_BY_STORAGE_ID SELECT_MEDIA_COUNT_FROM_FOLDER" AND storage_uuid='%s' "
-#define SELECT_MEDIA_COUNT_FROM_STORAGE "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND storage_uuid='%s'"
-#define SELECT_MEDIA_COUNT_FROM_TAG "SELECT COUNT(*) FROM "DB_VIEW_TAG" WHERE (tag_id=%d AND tag_media_count>0) "
-#define SELECT_MEDIA_COUNT_FROM_PLAYLIST "SELECT COUNT(*) FROM "DB_VIEW_PLAYLIST" WHERE (playlist_id=%d and playlist_media_count>0) "
+#define SELECT_MEDIA_COUNT_FROM_ALBUM "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND album_id='%d' "
+#define SELECT_MEDIA_COUNT_FROM_GROUP "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP
+#define SELECT_MEDIA_COUNT_FROM_GROUP_NULL "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_NULL
+#define SELECT_MEDIA_COUNT_FROM_FOLDER "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND folder_id='%s'"
+#define SELECT_MEDIA_COUNT_FROM_STORAGE "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND storage_uuid='%s'"
+#define SELECT_MEDIA_COUNT_FROM_TAG "SELECT COUNT(*) FROM "DB_VIEW_TAG" WHERE (tag_id=%d AND tag_media_count>0) "
+#define SELECT_MEDIA_COUNT_FROM_PLAYLIST "SELECT COUNT(*) FROM "DB_VIEW_PLAYLIST" WHERE (playlist_id=%d and playlist_media_count>0) "
/* Get Group Info by Group ID*/
-#define SELECT_ALBUM_FROM_ALBUM "SELECT name, artist, album_art FROM "DB_TABLE_ALBUM" WHERE album_id=%d"
-#define SELECT_FOLDER_FROM_FOLDER "SELECT folder_path, folder_name, folder_storage_type, storage_uuid FROM "DB_TABLE_FOLDER" WHERE folder_id='%s'"
+#define SELECT_ALBUM_FROM_ALBUM "SELECT name, artist, album_art FROM "DB_TABLE_ALBUM" WHERE album_id=%d"
+#define SELECT_FOLDER_FROM_FOLDER "SELECT folder_path, folder_name, folder_storage_type, storage_uuid FROM "DB_TABLE_FOLDER" WHERE folder_id='%s'"
#define SELECT_PLAYLIST_FROM_PLAYLIST "SELECT playlist_name, thumbnail_path FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d"
-#define SELECT_TAG_FROM_TAG "SELECT tag_name FROM "DB_TABLE_TAG" WHERE tag_id=%d"
-#define SELECT_TAG_BY_NAME "SELECT tag_id FROM "DB_TABLE_TAG" WHERE tag_name='%q'"
+#define SELECT_TAG_FROM_TAG "SELECT tag_name FROM "DB_TABLE_TAG" WHERE tag_id=%d"
+#define SELECT_TAG_BY_NAME "SELECT tag_id FROM "DB_TABLE_TAG" WHERE tag_name='%q'"
/* Tag info*/
-#define INSERT_TAG_TO_TAG "INSERT INTO "DB_TABLE_TAG" (tag_name) VALUES (%Q)"
-#define REMOVE_TAG_ITEM_FROM_TAG_MAP "DELETE FROM "DB_TABLE_TAG_MAP" WHERE tag_id=%d AND media_id='%q';"
-#define UPDATE_TAG_NAME_FROM_TAG "UPDATE "DB_TABLE_TAG" SET tag_name='%q' WHERE tag_id=%d;"
-#define SELECT_TAG_COUNT_BY_MEDIA_ID "SELECT COUNT(*) FROM "DB_VIEW_TAG" WHERE media_id = '%s'"
-#define SELECT_TAG_LIST_BY_MEDIA_ID "SELECT tag_id, tag_name FROM "DB_VIEW_TAG" WHERE media_id = '%s' "
+#define INSERT_TAG_TO_TAG "INSERT INTO "DB_TABLE_TAG" (tag_name) VALUES (%Q)"
+#define REMOVE_TAG_ITEM_FROM_TAG_MAP "DELETE FROM "DB_TABLE_TAG_MAP" WHERE tag_id=%d AND media_id='%q';"
+#define UPDATE_TAG_NAME_FROM_TAG "UPDATE "DB_TABLE_TAG" SET tag_name='%q' WHERE tag_id=%d;"
+#define SELECT_TAG_COUNT_BY_MEDIA_ID "SELECT COUNT(*) FROM "DB_VIEW_TAG" WHERE media_id = '%s'"
+#define SELECT_TAG_LIST_BY_MEDIA_ID "SELECT tag_id, tag_name FROM "DB_VIEW_TAG" WHERE media_id = '%s' "
/* Get Media list of Group */
#define MEDIA_INFO_ITEM "media_id, media_path, media_display_name, media_type, media_mime_type, media_size, media_added_time, media_modified_time, media_thumbnail_path, media_description, \
media_timeline, storage_uuid, media_360"
/* Playlist Info */
-#define INSERT_PLAYLIST_TO_PLAYLIST "INSERT INTO "DB_TABLE_PLAYLIST" (playlist_name) VALUES (%Q)"
-#define UPDATE_PLAYLIST_NAME_FROM_PLAYLIST "UPDATE "DB_TABLE_PLAYLIST" SET playlist_name='%q' WHERE playlist_id=%d;"
-#define UPDATE_PLAYLIST_THUMBNAIL_FROM_PLAYLIST "UPDATE "DB_TABLE_PLAYLIST" SET thumbnail_path='%q' WHERE playlist_id=%d;"
-#define SELECT_PLAYLIST_ID_FROM_PLAYLIST "SELECT playlist_id FROM "DB_TABLE_PLAYLIST" WHERE playlist_name='%q'"
+#define INSERT_PLAYLIST_TO_PLAYLIST "INSERT INTO "DB_TABLE_PLAYLIST" (playlist_name) VALUES (%Q)"
+#define UPDATE_PLAYLIST_NAME_FROM_PLAYLIST "UPDATE "DB_TABLE_PLAYLIST" SET playlist_name='%q' WHERE playlist_id=%d;"
+#define UPDATE_PLAYLIST_THUMBNAIL_FROM_PLAYLIST "UPDATE "DB_TABLE_PLAYLIST" SET thumbnail_path='%q' WHERE playlist_id=%d;"
+#define SELECT_PLAYLIST_ID_FROM_PLAYLIST "SELECT playlist_id FROM "DB_TABLE_PLAYLIST" WHERE playlist_name='%q'"
#define SELECT_PLAYLIST_ITEM_ALL_FROM_PLAYLIST_VIEW "SELECT "MEDIA_INFO_ITEM", pm_id FROM "DB_VIEW_PLAYLIST" WHERE (playlist_id=%d and playlist_media_count>0) "
-#define SELECT_PLAY_ORDER_FROM_PLAYLIST_VIEW "SELECT playlist_member_order FROM "DB_VIEW_PLAYLIST" WHERE playlist_id=%d and pm_id=%d"
+#define SELECT_PLAY_ORDER_FROM_PLAYLIST_VIEW "SELECT playlist_member_order FROM "DB_VIEW_PLAYLIST" WHERE playlist_id=%d and pm_id=%d"
#define SELECT_MAX_PLAY_ORDER_FROM_PLAYLIST_VIEW "SELECT MAX(playlist_member_order) FROM "DB_VIEW_PLAYLIST" WHERE playlist_id=%d"
-#define REMOVE_PLAYLIST_ITEM_FROM_PLAYLIST_MAP "DELETE FROM "DB_TABLE_PLAYLIST_MAP" WHERE playlist_id=%d AND _id=%d;"
-#define UPDATE_PLAYLIST_ORDER_FROM_PLAYLIST_MAP "UPDATE "DB_TABLE_PLAYLIST_MAP" SET playlist_member_order=%d WHERE playlist_id=%d AND _id=%d;"
-#define INSERT_PLAYLIST_ITEM_TO_PLAYLIST_MAP "INSERT INTO "DB_TABLE_PLAYLIST_MAP" (playlist_id, media_id, playlist_member_order) VALUES (%d, '%q', %d);"
+#define REMOVE_PLAYLIST_ITEM_FROM_PLAYLIST_MAP "DELETE FROM "DB_TABLE_PLAYLIST_MAP" WHERE playlist_id=%d AND _id=%d;"
+#define UPDATE_PLAYLIST_ORDER_FROM_PLAYLIST_MAP "UPDATE "DB_TABLE_PLAYLIST_MAP" SET playlist_member_order=%d WHERE playlist_id=%d AND _id=%d;"
+#define INSERT_PLAYLIST_ITEM_TO_PLAYLIST_MAP "INSERT INTO "DB_TABLE_PLAYLIST_MAP" (playlist_id, media_id, playlist_member_order) VALUES (%d, '%q', %d);"
/* Bookmark */
-#define INSERT_BOOKMARK_TO_BOOKMARK "INSERT INTO "DB_TABLE_BOOKMARK" (media_id, bookmark_marked_time, bookmark_thumbnail_path, bookmark_name) VALUES ('%q', '%d', %Q, %Q)"
-#define SELECT_BOOKMARK_COUNT_BY_MEDIA_ID "SELECT COUNT(*) FROM "BOOKMARK_MEDIA_JOIN" AND media_id='%s'"
-#define SELECT_BOOKMARK_LIST "SELECT bookmark_id, media_id, bookmark_marked_time, bookmark_thumbnail_path, bookmark_name FROM "BOOKMARK_MEDIA_JOIN
-#define SELECT_BOOKMARK_LIST_BY_STORAGE_ID SELECT_BOOKMARK_LIST"AND storage_uuid='%s' "
-#define SELECT_BOOKMARK_LIST_BY_MEDIA_ID "SELECT bookmark_id, media_id, bookmark_marked_time, bookmark_thumbnail_path, bookmark_name FROM "BOOKMARK_MEDIA_JOIN" AND media_id='%s'"
-#define SELECT_BOOKMARK_ID_FROM_BOOKMARK "SELECT bookmark_id FROM "DB_TABLE_BOOKMARK" WHERE media_id='%s' AND bookmark_marked_time=%d"
-
-#define UPDATE_BOOKMARK_FROM_BOOKMARK "UPDATE "DB_TABLE_BOOKMARK" SET bookmark_name=%Q WHERE bookmark_id=%d;"
-
-#define SELECT_MEDIA_ITEM "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
-#define SELECT_MEDIA_ITEM_BY_STORAGE_ID SELECT_MEDIA_ITEM"AND storage_uuid='%s' "
-#define SELECT_MEDIA_FROM_MEDIA "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND media_id='%s'"
-#define SELECT_MEDIA_BY_PATH "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity=1 AND media_path='%q'"
-#define SELECT_MEDIA_FROM_ALBUM "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND album_id=%d"
-#define SELECT_MEDIA_FROM_ALBUM_BY_STORAGE_ID SELECT_MEDIA_FROM_ALBUM" AND storage_uuid='%s' "
-#define SELECT_MEDIA_FROM_GROUP "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND %s='%q'"
-#define SELECT_MEDIA_FROM_GROUP_BY_STORAGE_ID SELECT_MEDIA_FROM_GROUP" AND storage_uuid='%s' "
+#define INSERT_BOOKMARK_TO_BOOKMARK "INSERT INTO "DB_TABLE_BOOKMARK" (media_id, bookmark_marked_time, bookmark_thumbnail_path, bookmark_name) VALUES ('%q', '%d', %Q, %Q)"
+#define SELECT_BOOKMARK_COUNT_BY_MEDIA_ID "SELECT COUNT(*) FROM "BOOKMARK_MEDIA_JOIN" AND media_id='%s'"
+#define SELECT_BOOKMARK_LIST "SELECT bookmark_id, media_id, bookmark_marked_time, bookmark_thumbnail_path, bookmark_name FROM "BOOKMARK_MEDIA_JOIN
+#define SELECT_BOOKMARK_LIST_BY_MEDIA_ID "SELECT bookmark_id, media_id, bookmark_marked_time, bookmark_thumbnail_path, bookmark_name FROM "BOOKMARK_MEDIA_JOIN" AND media_id='%s'"
+#define SELECT_BOOKMARK_ID_FROM_BOOKMARK "SELECT bookmark_id FROM "DB_TABLE_BOOKMARK" WHERE media_id='%s' AND bookmark_marked_time=%d"
+
+#define UPDATE_BOOKMARK_FROM_BOOKMARK "UPDATE "DB_TABLE_BOOKMARK" SET bookmark_name=%Q WHERE bookmark_id=%d;"
+
+#define SELECT_MEDIA_ITEM "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) "
+#define SELECT_MEDIA_FROM_MEDIA "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND media_id='%s'"
+#define SELECT_MEDIA_BY_PATH "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity=1 AND media_path='%q'"
+#define SELECT_MEDIA_FROM_ALBUM "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND album_id=%d"
+#define SELECT_MEDIA_FROM_GROUP "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND %s='%q'"
#define SELECT_MEDIA_FROM_GROUP_NULL "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND %s IS NULL"
-#define SELECT_MEDIA_FROM_GROUP_NULL_BY_STORAGE_ID SELECT_MEDIA_FROM_GROUP_NULL" AND storage_uuid='%s' "
-#define SELECT_MEDIA_FROM_FOLDER "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND folder_id='%s'"
-#define SELECT_MEDIA_FROM_STORAGE "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND storage_uuid='%s'"
-#define SELECT_MEDIA_FROM_TAG "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE media_id IN (SELECT media_id FROM "DB_TABLE_TAG_MAP" WHERE tag_id=%d) AND validity IN (1, 2)"
-#define SELECT_MEDIA_FROM_PLAYLIST "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE media_id IN (SELECT media_id FROM "DB_TABLE_PLAYLIST_MAP" WHERE playlist_id=%d) AND validity IN (1, 2)"
-#define SELECT_MEDIA_FROM_TAG_BY_STORAGE_ID SELECT_MEDIA_FROM_TAG" AND storage_uuid='%s' "
-#define SELECT_MEDIA_FROM_PLAYLIST_BY_STORAGE_ID SELECT_MEDIA_FROM_PLAYLIST" AND storage_uuid='%s' "
-#define SELECT_MEDIA_PATH_BY_ID "SELECT media_path FROM "DB_TABLE_MEDIA" WHERE media_id='%q'"
-#define SELECT_MEDIA_STORAGE_ID_BY_ID "SELECT storage_uuid FROM "DB_TABLE_MEDIA" WHERE media_id='%q'"
+#define SELECT_MEDIA_FROM_FOLDER "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity IN (1, 2) AND folder_id='%s'"
+#define SELECT_MEDIA_FROM_TAG "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE media_id IN (SELECT media_id FROM "DB_TABLE_TAG_MAP" WHERE tag_id=%d) AND validity IN (1, 2)"
+#define SELECT_MEDIA_FROM_PLAYLIST "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE media_id IN (SELECT media_id FROM "DB_TABLE_PLAYLIST_MAP" WHERE playlist_id=%d) AND validity IN (1, 2)"
/* Delete */
-#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_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"
-/* Storage*/
-#define SELECT_STORAGE_COUNT "SELECT COUNT(*) FROM "DB_TABLE_STORAGE" WHERE validity=1"
-#define SELECT_STORAGE_LIST "SELECT storage_id, storage_path, storage_type FROM "DB_TABLE_STORAGE" WHERE validity=1"
-#define SELECT_STORAGE_INFO_FROM_STORAGE "SELECT storage_path, storage_type FROM "DB_TABLE_STORAGE" WHERE validity=1 AND storage_id='%s'"
-
/* Face */
-#define DELETE_FACE_FROM_FACE "DELETE FROM "DB_TABLE_FACE" WHERE media_face_id=%d"
-#define INSERT_FACE_TO_FACE "INSERT INTO "DB_TABLE_FACE" (media_id, face_rect_x , face_rect_y, face_rect_w, face_rect_h, face_orientation, media_face_tag) VALUES ('%q', %d, %d, %d, %d, %d, %Q);"
-#define UPDATE_FACE_TO_FACE "UPDATE "DB_TABLE_FACE" SET face_rect_x=%d, face_rect_y=%d, face_rect_w=%d, face_rect_h=%d, face_orientation=%d, media_face_tag=%Q WHERE media_face_id=%d"
-#define SELECT_MEDIA_COUNT_FROM_MEDIA_BY_ID "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE media_id='%q' AND validity IN (1, 2)"
-#define SELECT_IMAGE_COUNT_FROM_MEDIA_BY_ID "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE media_id='%q' AND media_type=0 AND validity IN (1, 2)"
-#define SELECT_FACE_COUNT "SELECT COUNT(*) FROM "FACE_MEDIA_JOIN
-#define SELECT_FACE_COUNT_BY_STORAGE_ID SELECT_FACE_COUNT"AND storage_uuid='%s' "
-#define SELECT_FACE_COUNT_BY_MEDIA_ID "SELECT COUNT(*) FROM "FACE_MEDIA_JOIN" AND media_id='%s'"
-#define SELECT_FACE_LIST "SELECT media_face_id, media_id, face_rect_x, face_rect_y, face_rect_w, face_rect_h, face_orientation, media_face_tag FROM "FACE_MEDIA_JOIN
-#define SELECT_FACE_LIST_BY_STORAGE_ID SELECT_FACE_LIST"AND storage_uuid='%s' "
-#define SELECT_FACE_LIST_BY_MEDIA_ID "SELECT media_face_id, media_id, face_rect_x, face_rect_y, face_rect_w, face_rect_h, face_orientation, media_face_tag FROM "FACE_MEDIA_JOIN" AND media_id='%s'"
+#define DELETE_FACE_FROM_FACE "DELETE FROM "DB_TABLE_FACE" WHERE media_face_id=%d"
+#define INSERT_FACE_TO_FACE "INSERT INTO "DB_TABLE_FACE" (media_id, face_rect_x , face_rect_y, face_rect_w, face_rect_h, face_orientation, media_face_tag) VALUES ('%q', %d, %d, %d, %d, %d, %Q);"
+#define UPDATE_FACE_TO_FACE "UPDATE "DB_TABLE_FACE" SET face_rect_x=%d, face_rect_y=%d, face_rect_w=%d, face_rect_h=%d, face_orientation=%d, media_face_tag=%Q WHERE media_face_id=%d"
+#define SELECT_MEDIA_COUNT_FROM_MEDIA_BY_ID "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE media_id='%q' AND validity IN (1, 2)"
+#define SELECT_IMAGE_COUNT_FROM_MEDIA_BY_ID "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE media_id='%q' AND media_type=0 AND validity IN (1, 2)"
+#define SELECT_FACE_COUNT "SELECT COUNT(*) FROM "FACE_MEDIA_JOIN
+#define SELECT_FACE_COUNT_BY_MEDIA_ID "SELECT COUNT(*) FROM "FACE_MEDIA_JOIN" AND media_id='%s'"
+#define SELECT_FACE_LIST "SELECT media_face_id, media_id, face_rect_x, face_rect_y, face_rect_w, face_rect_h, face_orientation, media_face_tag FROM "FACE_MEDIA_JOIN
+#define SELECT_FACE_LIST_BY_MEDIA_ID "SELECT media_face_id, media_id, face_rect_x, face_rect_y, face_rect_w, face_rect_h, face_orientation, media_face_tag FROM "FACE_MEDIA_JOIN" AND media_id='%s'"
#define UPDATE_MEDIA_INFO_IN_FACE_SCAN_LIST "UPDATE "DB_TABLE_FACE_SCAN_LIST" SET modified_time = 0 WHERE media_id IN (SELECT media_id FROM "DB_TABLE_FACE" WHERE media_face_id=%d)"
-#define SELECT_FACE_ID "SELECT media_face_id FROM "DB_TABLE_FACE" WHERE media_id='%q' AND face_rect_x=%d AND face_rect_y=%d AND face_rect_w=%d AND face_rect_h=%d AND face_orientation=%d"
+#define SELECT_FACE_ID "SELECT media_face_id FROM "DB_TABLE_FACE" WHERE media_id='%q' AND face_rect_x=%d AND face_rect_y=%d AND face_rect_w=%d AND face_rect_h=%d AND face_orientation=%d"
int _content_query_prepare(const char *select_query, const char *condition_query, const char *option_query, sqlite3_stmt **stmt);
int _content_get_result(char *query, sqlite3_stmt **stmt);
int _media_db_get_group_item(const char *group_name, filter_h filter, media_info_cb callback, void *user_data, group_list_e group_type);
int _media_db_get_media_group_item_count(const char *group_name, filter_h filter, media_group_e group, int *item_count);
int _media_db_get_media_group_item(const char *group_name, filter_h filter, media_group_e group, media_info_cb callback, void *user_data);
-int _media_db_get_storage(filter_h filter, media_storage_cb callback, void *user_data);
-int _media_db_get_storage_id_by_media_id(const char *media_id, char **storage_id);
int _media_filter_build_condition(bool is_full, const char *condition, media_content_collation_e collate_type, char **result);
int _media_filter_build_option(filter_h filter, char **result);
+++ /dev/null
-/*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-
-#ifndef __TIZEN_CONTENT_MEDIA_STORAGE_H__
-#define __TIZEN_CONTENT_MEDIA_STORAGE_H__
-
-
-#include <media_content_type.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * @file media_storage.h
- * @brief This file contains API on main functional operations with external storage that are related to media resources in the media database. \n
- * Operations include: getting number of storages, cloning and destroying storage, getting storage`s ID, name, path and type.
- */
-
-/**
- * @addtogroup CAPI_CONTENT_MEDIA_STORAGE_MODULE
- * @{
- */
-
-/**
-* @deprecated Deprecated since 5.0.
-* @brief Gets media storage from database.
-* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
-*
-* @remarks The @a storage should be released using media_storage_destroy().
-*
-* @param[in] storage_id The ID of the media storage
-* @param[out] storage The media storage handle
-*
-* @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_DB_FAILED DB Operation failed
-* @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
-*
-* @pre This function requires opened connection to content service by media_content_connect().
-*
-* @see media_content_connect()
-*/
-int media_storage_get_storage_info_from_db(const char *storage_id, media_storage_h *storage) TIZEN_DEPRECATED_API;
-
-/**
-* @deprecated Deprecated since 5.0. Use @ref CAPI_SYSTEM_STORAGE_MODULE instead.
-* @brief Gets the count of media storage for the passed @a filter from the media database.
-* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
-*
-* @param[in] filter The handle to the media filter
-* @param[out] storage_count The count of 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_INVALID_OPERATION Invalid operation
-* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
-* @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
-*
-* @pre This function requires opened connection to content service by media_content_connect().
-*
-* @see media_content_connect()
-*/
-int media_storage_get_storage_count_from_db(filter_h filter, int *storage_count) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0. Use @ref CAPI_SYSTEM_STORAGE_MODULE instead.
- * @brief Iterates through media storage from the media database.
- * @details This function gets all media storage handles meeting the given @a filter.
- * The @a callback function will be invoked for every retrieved media storage.
- * If @c NULL is passed to the @a filter, then no filtering is applied.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @param[in] filter The handle to the media filter
- * @param[in] callback The callback function to be invoked
- * @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_DB_FAILED DB Operation failed
- * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
- *
- * @pre This function requires opened connection to content service by media_content_connect().
- * @post This function invokes media_storage_destroy().
- *
- * @see media_content_connect()
- * @see media_storage_destroy()
- */
-int media_storage_foreach_storage_from_db(filter_h filter, media_storage_cb callback, void *user_data) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0. Use media_info_get_media_count_from_db() instead.
- * @brief Gets the count of media files for the passed @a filter in the given @a storage_id from the media database.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks Use media_info_get_media_count_from_db() if you want to search for internal storage.
- *
- * @param[in] storage_id The ID of the media storage
- * @param[in] filter The handle to the media filter
- * @param[out] media_count The count of media storage items
- *
- * @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_DB_BUSY DB Operation busy
- *
- * @pre This function requires opened connection to content service by media_content_connect().
- *
- * @see media_content_connect()
- */
-int media_storage_get_media_count_from_db(const char *storage_id, filter_h filter, int *media_count) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0. Use media_info_foreach_media_from_db() instead.
- * @brief Iterates through the media files with an optional @a filter in the given @a storage_id from the media database.
- * @details This function gets all media files associated with the given storage and
- * meeting desired filter option and calls @a callback for
- * every retrieved media item. If @c NULL is passed to the @a filter, no filtering is applied.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks Do not call updating DB function like media_info_update_to_db() in your callback function,
- * your callback function is invoked as inline function. \n
- * So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB. \n
- * We do not recommend you call updating DB function in callback of foreach function.\n
- * Use media_info_foreach_media_from_db() if you want to search for internal storage.
- *
- * @param[in] storage_id The ID of the media storage
- * @param[in] filter The handle to the media filter
- * @param[in] callback The callback function to be invoked
- * @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_DB_FAILED DB Operation failed
- * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
- *
- * @pre This function requires opened connection to content service by media_content_connect().
- * @post This function invokes media_info_cb().
- *
- * @see #media_info_cb
- * @see media_content_connect()
- * @see media_filter_create()
- */
-int media_storage_foreach_media_from_db(const char *storage_id, filter_h filter, media_info_cb callback, void *user_data) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Destroys media storage handle.
- * @details The function frees all resources related to the media storage handle. This handle
- * can no longer be used to perform any operations. New media storage handle has to
- * be created before the next usage.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @param[in] storage The media storage handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- *
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @pre Get copy of media_storage_h handle by calling media_storage_clone().
- *
- * @see media_storage_clone()
- */
-int media_storage_destroy(media_storage_h storage) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Clones the media storage handle.
- *
- * @details This function copies the media storage handle from a source to the destination.
- * There is no media_storage_create() function. The media_storage_h is created internally and
- * available through media storage foreach function such as media_storage_foreach_storage_from_db().
- * To use this handle outside of these foreach functions, use this function.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks The @a dst should be released using media_storage_destroy().
- *
- * @param[out] dst The destination handle to the media storage
- * @param[in] src The source handle to the media storage
- *
- * @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
- *
- * @see media_storage_destroy()
- * @see media_storage_foreach_storage_from_db()
- * @see media_storage_get_storage_info_from_db()
- */
-int media_storage_clone(media_storage_h *dst, media_storage_h src) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Gets the storage id of media storage.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks The @a storage_id should be released using free().
- *
- * @param[in] storage The media storage handle
- * @param[out] storage_id The ID 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_id(media_storage_h storage, char **storage_id) 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
- *
- * @remarks The @a storage_path should be released using free().
- *
- * @param[in] storage The media storage handle
- * @param[out] storage_path The storage path 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_path(media_storage_h storage, char **storage_path) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0. Use storage_get_type_dev() instead.
- * @brief Gets the storage type of media storage.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @param[in] storage The media storage handle
- * @param[out] storage_type The storage type 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
- */
-int media_storage_get_type(media_storage_h storage, media_content_storage_e *storage_type) TIZEN_DEPRECATED_API;
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __TIZEN_CONTENT_MEDIA_STORAGE_H__ */
#include <media_group.h>
#include <media_playlist.h>
#include <media_bookmark.h>
-#include <media_storage.h>
#include <media_face.h>
#include <media_book.h>
#include <media_content_product.h>
/**
* @ingroup CAPI_MEDIA_CONTENT_MODULE
- * @deprecated Deprecated since 5.0.
- * @brief Enumeration for the storage type.
- * @details This information is used to establish where the folder is.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- */
-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_e;
-
-/**
- * @ingroup CAPI_MEDIA_CONTENT_MODULE
* @brief Enumeration for media content DB update items.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*/
typedef struct filter_s *filter_h;
/**
- * @ingroup CAPI_CONTENT_MEDIA_STORAGE_MODULE
- * @deprecated Deprecated since 5.0.
- * @brief The structure type for the Media storage handle.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-typedef void *media_storage_h;
-
-/**
* @ingroup CAPI_CONTENT_MEDIA_FACE_MODULE
* @brief The structure type for the Media face handle.
* @since_tizen 3.0
*/
typedef void (*media_insert_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.
- * @details This callback is called for completion of generating the thumbnail image.
- * The following error codes can be delivered. \n
- * #MEDIA_CONTENT_ERROR_NONE, \n
- * #MEDIA_CONTENT_ERROR_INVALID_PARAMETER, \n
- * #MEDIA_CONTENT_ERROR_INVALID_OPERATION, \n
- * #MEDIA_CONTENT_ERROR_PERMISSION_DENIED, \n
- * #MEDIA_CONTENT_ERROR_DB_FAILED, \n
- * #MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT
- * @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] path The path of the thumbnail which is generated
- * @param[in] user_data The user data passed from the foreach function
- *
- * @pre media_info_create_thumbnail()
- * @see media_info_create_thumbnail()
- */
-typedef void (*media_thumbnail_completed_cb)(media_content_error_e error, const char *path, void *user_data);
-
/**
* @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
* @brief Called when face detection on the image is completed.
typedef bool (*media_group_cb)(const char *group_name, void *user_data);
/**
- * @ingroup CAPI_CONTENT_MEDIA_STORAGE_MODULE
- * @deprecated Deprecated since 5.0.
- * @brief Called for every storage in the obtained list of storages.
- * @details Iterates over a media storage list.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks You should not destroy @a storage returned by this function. \n
- * The callback is called in the main loop.
- *
- * @param[in] storage The handle of the media storage
- * @param[in] user_data The user data passed from the foreach function
- *
- * @return @c true to continue with the next iteration of the loop,
- * otherwise @c false to break out of the loop
- *
- * @pre media_storage_foreach_storage_from_db() will invoke this function.
- * @see media_storage_foreach_storage_from_db()
- */
-typedef bool (*media_storage_cb)(media_storage_h storage, void *user_data);
-
-/**
* @ingroup CAPI_CONTENT_MEDIA_FACE_MODULE
* @brief Called for every face in the obtained list of face.
* @details Iterates over a media face list.
#define MEDIA_RECORDED_DATE "MEDIA_RECORDED_DATE"
/**
- * @deprecated Deprecated since 5.5.
- * @brief Media copyright.
- * @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_COPYRIGHT "MEDIA_COPYRIGHT"
-
-/**
* @brief Media track number.
* @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_TRACK_NUM "MEDIA_TRACK_NUM"
/**
- * @deprecated Deprecated since 5.5.
- * @brief Media description.
- * @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_DESCRIPTION "MEDIA_DESCRIPTION"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media bitrate.
- * @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_BITRATE "MEDIA_BITRATE"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media bit per sample.
- * @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_BITPERSAMPLE "MEDIA_BITPERSAMPLE"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media sample rate.
- * @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_SAMPLERATE "MEDIA_SAMPLERATE"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media channel.
- * @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_CHANNEL "MEDIA_CHANNEL"
-
-/**
* @brief Media duration.
* @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_DATETAKEN "MEDIA_DATETAKEN"
/**
- * @deprecated Deprecated since 5.5.
- * @brief Media orientation.
- * @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_ORIENTATION "MEDIA_ORIENTATION"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @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
- *
- */
-#define MEDIA_RATING "MEDIA_RATING"
-
-/**
* @brief The time to register favourite.
* @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_IS_DRM "MEDIA_IS_DRM"
/**
- * @deprecated Deprecated since 5.0.
- * @brief Media storage.
- * @details There are 3 types:\n
- * 0-internal storage, 1-SD card, 2-USB storage\n
- * 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_STORAGE_TYPE "MEDIA_STORAGE_TYPE"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media exposure time.
- * @details You can use above define to set the condition of media filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- */
-#define MEDIA_EXPOSURE_TIME "MEDIA_EXPOSURE_TIME"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media fnumber.
- * @details You can use above define to set the condition of media filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- */
-#define MEDIA_FNUMBER "MEDIA_FNUMBER"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media ISO.
- * @details You can use above define to set the condition of media filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- */
-#define MEDIA_ISO "MEDIA_ISO"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media model.
- * @details You can use above define to set the condition of media filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- */
-#define MEDIA_MODEL "MEDIA_MODEL"
-
-/**
* @deprecated Deprecated since 7.0.
* @brief Media file name pinyin.
* @details You can use above define to set the condition of media filter and order keyword.
#define MEDIA_COMPOSER_PINYIN "MEDIA_COMPOSER_PINYIN"
/**
- * @deprecated Deprecated since 5.5.
- * @brief Media copyright 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_COPYRIGHT_PINYIN "MEDIA_COPYRIGHT_PINYIN"
-
-/**
- * @deprecated Deprecated since 5.5.
- * @brief Media description 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_DESCRIPTION_PINYIN "MEDIA_DESCRIPTION_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
#define FOLDER_NAME "FOLDER_NAME"
/**
- * @deprecated Deprecated since 5.0.
- * @brief Folder storage.
- * @details There are 2 types:\n
- * 0-internal storage, 1-external storage\n
- * 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_STORAGE_TYPE "FOLDER_STORAGE_TYPE"
-
-/**
* @deprecated Deprecated since 7.0.
* @brief Folder base name pinyin.
* @details You can use above define to set the condition of folder filter and order keyword.
#define BOOKMARK_NAME "BOOKMARK_NAME"
/**
- * @deprecated Deprecated since 5.0.
- * @brief Storage ID.
- * @details You can use above define to set the condition of storage filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define MEDIA_STORAGE_ID "STORAGE_ID"
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Storage path.
- * @details You can use above define to set the condition of storage filter and order keyword.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- */
-#define MEDIA_STORAGE_PATH "STORAGE_PATH"
-
-/**
* @brief Face tag.
* @details You can use above define to set the condition of face filter and order keyword.
* @since_tizen 3.0
int media_filter_set_order(filter_h filter, media_content_order_e order_type, const char *order_keyword, media_content_collation_e collate_type);
/**
- * @deprecated Deprecated since 5.0. Use media_filter_set_condition() with MEDIA_PATH keyword instead. \n
- * See @ref CAPI_SYSTEM_STORAGE_MODULE for information about file system paths.
- *
* @brief Sets the @a storage_id for the given @a filter.
* @details You can use this function when you want to search items only in the specific storage
*
* @see media_filter_create()
* @see media_filter_destroy()
*/
-int media_filter_set_storage(filter_h filter, const char *storage_id) TIZEN_DEPRECATED_API;
+int media_filter_set_storage(filter_h filter, const char *storage_id);
/**
* @brief Gets the @a offset and @a count for the given @a filter used to limit the number of items returned.
int media_filter_get_order(filter_h filter, media_content_order_e *order_type, char **order_keyword, media_content_collation_e *collate_type);
/**
- * @deprecated Deprecated since 5.0.
- * @brief Gets the @a storage_id for given @a filter.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks The @a storage_id should be released using free().
- *
- * @param[in] filter The handle to the media filter
- * @param[out] storage_id The ID 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
- *
- * @see media_filter_create()
- * @see media_filter_destroy()
- */
-int media_filter_get_storage(filter_h filter, char **storage_id) TIZEN_DEPRECATED_API;
-
-/**
* @}
*/
int media_folder_get_name(media_folder_h folder, char **folder_name);
/**
- * @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
- *
- * @param[in] folder The handle to the media folder
- * @param[out] storage_type The storage type 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_storage_type(media_folder_h folder, media_content_storage_e *storage_type) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Gets the storage id of the folder.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks The @a storage_id should be released using free().
- *
- * @param[in] folder The handle to the media folder
- * @param[out] storage_id The storage id 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_OUT_OF_MEMORY Out of memory
- */
-int media_folder_get_storage_id(media_folder_h folder, char **storage_id) 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.
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 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
- * You can use media_content_scan_file()/media_content_scan_folder() function instead of this function if a file is removed from the file system.
- *
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- *
- * @privlevel public
- * @privilege %http://tizen.org/privilege/content.write
- *
- * @param[in] media_id The media ID. It can get from media info handle.
- *
- * @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_content_scan_file()
- * @see media_content_scan_folder()
- */
-int media_info_delete_from_db(const char *media_id) TIZEN_DEPRECATED_API;
-
-
-/**
* @brief Destroys media info.
* @details The function frees all resources related to the media info handle. This handle
* can no longer be used to perform any operations. New media info handle has to
int media_info_get_title(media_info_h media, char **title);
/**
- * @deprecated Deprecated since 5.0.
- * @brief Gets the storage id of content file.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks The @a storage_id should be released using free().
- *
- * @param[in] media The handle to the media info
- * @param[out] storage_id The ID of the media storage
- *
- * @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_storage_id(media_info_h media, char **storage_id) TIZEN_DEPRECATED_API;
-
-/**
* @brief Checks whether the media is protected via DRM.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
int media_info_is_360_content(media_info_h media, bool *is_360);
/**
- * @deprecated Deprecated since 5.0. Use storage_get_type_dev() instead.
- * @brief Gets the storage type of content file.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- *
- * @param[in] media The handle to the media info
- * @param[out] storage_type The storage type of the content file
- *
- * @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_get_storage_type(media_info_h media, media_content_storage_e *storage_type) 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.
int media_info_move_to_db(media_info_h media, const char* dst_path);
/**
- * @deprecated Deprecated since 5.0. Use media_info_generate_thumbnail() instead.
- * @brief Creates a thumbnail file for the given media, asynchronously.
- * @details This function creates an thumbnail file for given media item and calls @a callback for completion of creating the thumbnail.
- * If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function. \n
- * Since 3.0, a thumbnail is not automatically extracted during media scanning. \n
- * Therefore, if there exists no thumbnail for the given media, you MUST call this function to create a thumbnail.
- *
- * @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 If you want to destroy media handle before callback invoked, you must cancel thumbnail request by using media_info_cancel_thumbnail() \n
- * Since 3.0, if creation of a thumbnail is failed, empty string will be passed through media_thumbnail_completed_cb().
- * Items in external storage except MMC not supported.
- *
- * @param[in] media The handle to the media info
- * @param[in] callback The callback function to be invoked
- * @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()
- */
-int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Cancels the creation of thumbnail file for the given media.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- *
- * @privlevel public
- * @privilege %http://tizen.org/privilege/content.write
- *
- * @remarks If you request cancel for the already thumbnail created media, this function returns #MEDIA_CONTENT_ERROR_INVALID_OPERATION
- *
- * @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_PERMISSION_DENIED Permission denied
- * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
- *
- * @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
- */
-int media_info_cancel_thumbnail(media_info_h media) TIZEN_DEPRECATED_API;
-
-/**
* @brief Generates a thumbnail file for the given media, synchronously.
*
* @since_tizen 5.0
MEDIA_GROUP_BOOKMARK,
MEDIA_GROUP_TAG_BY_MEDIA_ID,
MEDIA_GROUP_BOOKMARK_BY_MEDIA_ID,
- MEDIA_GROUP_STORAGE,
MEDIA_GROUP_FACE,
MEDIA_GROUP_FACE_BY_MEDIA_ID,
MEDIA_GROUP_PVR,
char *folder_id;
char *path;
char *name;
- media_content_storage_e storage_type;
+ ms_user_storage_type_e storage_type;
char *storage_uuid;
} media_folder_s;
} media_playlist_item_s;
typedef struct {
- char *storage_id;
- char *storage_path;
- int storage_type;
-} media_storage_s;
-
-typedef struct {
int face_id; /* face id */
char *media_id; /* media uuid */
unsigned int face_rect_x; /* x position of face */
} media_uhd_s;
typedef struct {
- media_info_s *handle;
- void *user_data;
- media_thumbnail_completed_cb thumbnail_completed_cb;
-} media_thumbnail_cb_s;
-
-typedef struct {
void *user_data;
media_face_detection_completed_cb face_completed_cb;
} media_face_cb_s;
int _media_db_get_group_item(const char *group_name, filter_h filter, media_info_cb callback, void *user_data, group_list_e group_type);
int _media_db_get_media_group_item_count(const char *group_name, filter_h filter, media_group_e group, int *item_count);
int _media_db_get_media_group_item(const char *group_name, filter_h filter, media_group_e group, media_info_cb callback, void *user_data);
-int _media_db_get_storage(filter_h filter, media_storage_cb callback, void *user_data);
int _media_db_get_storage_id_by_media_id(const char *media_id, char **storage_id);
int _media_db_get_pvr(filter_h filter, media_pvr_cb callback, void *user_data);
void _media_pvr_item_get_detail(sqlite3_stmt* stmt, media_pvr_h pvr);
+++ /dev/null
-/*
-* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
-
-#ifndef __TIZEN_CONTENT_MEDIA_STORAGE_H__
-#define __TIZEN_CONTENT_MEDIA_STORAGE_H__
-
-
-#include <media_content_type.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/**
- * @file media_storage.h
- * @brief This file contains API on main functional operations with external storage that are related to media resources in the media database. \n
- * Operations include: getting number of storages, cloning and destroying storage, getting storage`s ID, name, path and type.
- */
-
-/**
- * @addtogroup CAPI_CONTENT_MEDIA_STORAGE_MODULE
- * @{
- */
-
-/**
-* @deprecated Deprecated since 5.0.
-* @brief Gets media storage from database.
-* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
-*
-* @remarks The @a storage should be released using media_storage_destroy().
-*
-* @param[in] storage_id The ID of the media storage
-* @param[out] storage The media storage handle
-*
-* @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_DB_FAILED DB Operation failed
-* @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
-*
-* @pre This function requires opened connection to content service by media_content_connect().
-*
-* @see media_content_connect()
-*/
-int media_storage_get_storage_info_from_db(const char *storage_id, media_storage_h *storage) TIZEN_DEPRECATED_API;
-
-/**
-* @deprecated Deprecated since 5.0. Use @ref CAPI_SYSTEM_STORAGE_MODULE instead.
-* @brief Gets the count of media storage for the passed @a filter from the media database.
-* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
-*
-* @param[in] filter The handle to the media filter
-* @param[out] storage_count The count of 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_INVALID_OPERATION Invalid operation
-* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
-* @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
-*
-* @pre This function requires opened connection to content service by media_content_connect().
-*
-* @see media_content_connect()
-*/
-int media_storage_get_storage_count_from_db(filter_h filter, int *storage_count) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0. Use @ref CAPI_SYSTEM_STORAGE_MODULE instead.
- * @brief Iterates through media storage from the media database.
- * @details This function gets all media storage handles meeting the given @a filter.
- * The @a callback function will be invoked for every retrieved media storage.
- * If @c NULL is passed to the @a filter, then no filtering is applied.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @param[in] filter The handle to the media filter
- * @param[in] callback The callback function to be invoked
- * @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_DB_FAILED DB Operation failed
- * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
- *
- * @pre This function requires opened connection to content service by media_content_connect().
- * @post This function invokes media_storage_destroy().
- *
- * @see media_content_connect()
- * @see media_storage_destroy()
- */
-int media_storage_foreach_storage_from_db(filter_h filter, media_storage_cb callback, void *user_data) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0. Use media_info_get_media_count_from_db() instead.
- * @brief Gets the count of media files for the passed @a filter in the given @a storage_id from the media database.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks Use media_info_get_media_count_from_db() if you want to search for internal storage.
- *
- * @param[in] storage_id The ID of the media storage
- * @param[in] filter The handle to the media filter
- * @param[out] media_count The count of media storage items
- *
- * @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_DB_BUSY DB Operation busy
- *
- * @pre This function requires opened connection to content service by media_content_connect().
- *
- * @see media_content_connect()
- */
-int media_storage_get_media_count_from_db(const char *storage_id, filter_h filter, int *media_count) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0. Use media_info_foreach_media_from_db() instead.
- * @brief Iterates through the media files with an optional @a filter in the given @a storage_id from the media database.
- * @details This function gets all media files associated with the given storage and
- * meeting desired filter option and calls @a callback for
- * every retrieved media item. If @c NULL is passed to the @a filter, no filtering is applied.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks Do not call updating DB function like media_info_update_to_db() in your callback function,
- * your callback function is invoked as inline function. \n
- * So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB. \n
- * We do not recommend you call updating DB function in callback of foreach function.\n
- * Use media_info_foreach_media_from_db() if you want to search for internal storage.
- *
- * @param[in] storage_id The ID of the media storage
- * @param[in] filter The handle to the media filter
- * @param[in] callback The callback function to be invoked
- * @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_DB_FAILED DB Operation failed
- * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
- *
- * @pre This function requires opened connection to content service by media_content_connect().
- * @post This function invokes media_info_cb().
- *
- * @see #media_info_cb
- * @see media_content_connect()
- * @see media_filter_create()
- */
-int media_storage_foreach_media_from_db(const char *storage_id, filter_h filter, media_info_cb callback, void *user_data) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Destroys media storage handle.
- * @details The function frees all resources related to the media storage handle. This handle
- * can no longer be used to perform any operations. New media storage handle has to
- * be created before the next usage.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @param[in] storage The media storage handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- *
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @pre Get copy of media_storage_h handle by calling media_storage_clone().
- *
- * @see media_storage_clone()
- */
-int media_storage_destroy(media_storage_h storage) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Clones the media storage handle.
- *
- * @details This function copies the media storage handle from a source to the destination.
- * There is no media_storage_create() function. The media_storage_h is created internally and
- * available through media storage foreach function such as media_storage_foreach_storage_from_db().
- * To use this handle outside of these foreach functions, use this function.
- *
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks The @a dst should be released using media_storage_destroy().
- *
- * @param[out] dst The destination handle to the media storage
- * @param[in] src The source handle to the media storage
- *
- * @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
- *
- * @see media_storage_destroy()
- * @see media_storage_foreach_storage_from_db()
- * @see media_storage_get_storage_info_from_db()
- */
-int media_storage_clone(media_storage_h *dst, media_storage_h src) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0.
- * @brief Gets the storage id of media storage.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @remarks The @a storage_id should be released using free().
- *
- * @param[in] storage The media storage handle
- * @param[out] storage_id The ID 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_id(media_storage_h storage, char **storage_id) 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
- *
- * @remarks The @a storage_path should be released using free().
- *
- * @param[in] storage The media storage handle
- * @param[out] storage_path The storage path 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_path(media_storage_h storage, char **storage_path) TIZEN_DEPRECATED_API;
-
-/**
- * @deprecated Deprecated since 5.0. Use storage_get_type_dev() instead.
- * @brief Gets the storage type of media storage.
- * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
- * @param[in] storage The media storage handle
- * @param[out] storage_type The storage type 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
- */
-int media_storage_get_type(media_storage_h storage, media_content_storage_e *storage_type) TIZEN_DEPRECATED_API;
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __TIZEN_CONTENT_MEDIA_STORAGE_H__ */
Name: capi-content-media-content
Summary: A Media content library in Tizen Native API
-Version: 0.4.19
+Version: 0.4.20
Release: 0
Group: Multimedia/API
License: Apache-2.0
break;
- case MEDIA_GROUP_STORAGE:
- select_query = g_strdup(SELECT_STORAGE_COUNT);
- break;
-
case MEDIA_GROUP_FACE:
if (_filter && STRING_VALID(_filter->storage_id))
select_query = g_strdup_printf(SELECT_FACE_COUNT, _filter->storage_id);
char *select_query = NULL;
char *condition_query = NULL;
char *option_query = NULL;
- filter_s *_filter = (filter_s *)filter;
switch (group_type) {
case MEDIA_GROUP_ALBUM:
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_ALBUM_COUNT_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_ALBUM_COUNT);
+ select_query = g_strdup(SELECT_ALBUM_COUNT);
break;
case MEDIA_GROUP_FOLDER:
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_FOLDER_COUNT_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_FOLDER_COUNT);
+ select_query = g_strdup(SELECT_FOLDER_COUNT);
break;
case MEDIA_GROUP_PLAYLIST:
break;
case MEDIA_GROUP_BOOKMARK:
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_BOOKMARK_COUNT_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_BOOKMARK_COUNT);
-
- break;
-
- case MEDIA_GROUP_STORAGE:
- select_query = g_strdup(SELECT_STORAGE_COUNT);
+ select_query = g_strdup(SELECT_BOOKMARK_COUNT);
break;
case MEDIA_GROUP_FACE:
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_FACE_COUNT_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_FACE_COUNT);
+ select_query = g_strdup(SELECT_FACE_COUNT);
break;
default:
char *select_query = NULL;
char *condition_query = NULL;
char *option_query = NULL;
- filter_s *_filter = (filter_s *)filter;
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_MEDIA_GROUP_COUNT_BY_STORAGE_ID, __media_db_get_group_name(group), __media_db_get_group_name(group), _filter->storage_id);
- else
- select_query = g_strdup_printf(SELECT_MEDIA_GROUP_COUNT, __media_db_get_group_name(group), __media_db_get_group_name(group));
+ select_query = g_strdup_printf(SELECT_MEDIA_GROUP_COUNT, __media_db_get_group_name(group), __media_db_get_group_name(group));
ret = __media_db_make_query(filter, &condition_query, &option_query);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
char *option_query = NULL;
char *name = NULL;
sqlite3_stmt *stmt = NULL;
- filter_s *_filter = (filter_s *)filter;
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_MEDIA_GROUP_LIST_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
- else
- select_query = g_strdup_printf(SELECT_MEDIA_GROUP_LIST, __media_db_get_group_name(group));
+ select_query = g_strdup_printf(SELECT_MEDIA_GROUP_LIST, __media_db_get_group_name(group));
ret = __media_db_make_query(filter, &condition_query, &option_query);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
char *condition_query = NULL;
char *option_query = NULL;
sqlite3_stmt *stmt = NULL;
- filter_s *_filter = (filter_s *)filter;
-
#ifdef _USE_TVPD_MODE
+ filter_s *_filter = (filter_s *)filter;
if (_filter && STRING_VALID(_filter->storage_id))
select_query = g_strdup_printf(SELECT_ALBUM_LIST, _filter->storage_id);
else
select_query = g_strdup_printf(SELECT_ALBUM_LIST, DB_VIEW_MEDIA);
#else
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_ALBUM_LIST_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_ALBUM_LIST);
+ select_query = g_strdup(SELECT_ALBUM_LIST);
#endif
ret = __media_db_make_query(filter, &condition_query, &option_query);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
char *condition_query = NULL;
char *option_query = NULL;
sqlite3_stmt *stmt = NULL;
- filter_s *_filter = (filter_s *)filter;
-
#ifdef _USE_TVPD_MODE
+ filter_s *_filter = (filter_s *)filter;
if (_filter && STRING_VALID(_filter->storage_id))
select_query = g_strdup_printf(SELECT_FOLDER_LIST_BY_STORAGE_ID, _filter->storage_id, _filter->storage_id);
else
select_query = g_strdup_printf(SELECT_FOLDER_LIST, DB_VIEW_MEDIA);
#else
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_FOLDER_LIST_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_FOLDER_LIST);
+ select_query = g_strdup(SELECT_FOLDER_LIST);
#endif
ret = __media_db_make_query(filter, &condition_query, &option_query);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
char *condition_query = NULL;
char *option_query = NULL;
sqlite3_stmt *stmt = NULL;
- filter_s *_filter = (filter_s *)filter;
-
#ifdef _USE_TVPD_MODE
+ filter_s *_filter = (filter_s *)filter;
if (STRING_VALID(media_id)) { //get bookmark by media_id
if (_filter && STRING_VALID(_filter->storage_id))
select_query = g_strdup_printf(SELECT_BOOKMARK_LIST_BY_MEDIA_ID, _filter->storage_id, media_id);
select_query = g_strdup_printf(SELECT_BOOKMARK_LIST, DB_VIEW_MEDIA);
}
#else
- if (STRING_VALID(media_id)) { //get bookmark by media_id
+ if (STRING_VALID(media_id))
select_query = g_strdup_printf(SELECT_BOOKMARK_LIST_BY_MEDIA_ID, media_id);
- } else {
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_BOOKMARK_LIST_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_BOOKMARK_LIST);
- }
+ else
+ select_query = g_strdup(SELECT_BOOKMARK_LIST);
#endif
ret = __media_db_make_query(filter, &condition_query, &option_query);
char *condition_query = NULL;
char *option_query = NULL;
sqlite3_stmt *stmt = NULL;
- filter_s *_filter = (filter_s *)filter;
-
#ifdef _USE_TVPD_MODE
+ filter_s *_filter = (filter_s *)filter;
if (STRING_VALID(media_id)) { //get face by media_id
if (_filter && STRING_VALID(_filter->storage_id))
select_query = g_strdup_printf(SELECT_FACE_LIST_BY_MEDIA_ID, _filter->storage_id, media_id);
select_query = g_strdup_printf(SELECT_FACE_LIST, DB_VIEW_MEDIA);
}
#else
- if (STRING_VALID(media_id)) { //get face by media_id
+ if (STRING_VALID(media_id))
select_query = g_strdup_printf(SELECT_FACE_LIST_BY_MEDIA_ID, media_id);
- } else {
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_FACE_LIST_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_FACE_LIST);
- }
+ else
+ select_query = g_strdup(SELECT_FACE_LIST);
#endif
ret = __media_db_make_query(filter, &condition_query, &option_query);
if (ret != MEDIA_CONTENT_ERROR_NONE) {
char *select_query = NULL;
char *condition_query = NULL;
char *option_query = NULL;
+#ifdef _USE_TVPD_MODE
filter_s *_filter = (filter_s *)filter;
-
+#endif
switch (group_type) {
case MEDIA_GROUP_ALBUM:
#ifdef _USE_TVPD_MODE
else
select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_ALBUM, DB_VIEW_MEDIA, group_id);
#else
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_ALBUM_BY_STORAGE_ID, group_id, _filter->storage_id);
- else
- select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_ALBUM, group_id);
+ select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_ALBUM, group_id);
#endif
break;
else
select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE, DB_VIEW_MEDIA);
#else
- if (STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE);
+ select_query = g_strdup(SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE);
#endif
} else {
#ifdef _USE_TVPD_MODE
else
select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_MEDIA, DB_VIEW_MEDIA);
#else
- if (STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_MEDIA_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_MEDIA_COUNT_FROM_MEDIA);
+ select_query = g_strdup(SELECT_MEDIA_COUNT_FROM_MEDIA);
#endif
need_bracket = true;
}
else
select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_FOLDER, DB_VIEW_MEDIA, group_name);
#else
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_FOLDER_BY_STORAGE_ID, group_name, _filter->storage_id);
- else
- select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_FOLDER, group_name);
+ select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_FOLDER, group_name);
#endif
break;
#endif
break;
- case MEDIA_GROUP_STORAGE:
-#ifdef _USE_TVPD_MODE
- select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_STORAGE, group_name, group_name);
-#else
- select_query = g_strdup_printf(SELECT_MEDIA_COUNT_FROM_STORAGE, group_name);
-#endif
- break;
-
case MEDIA_GROUP_FACE_BY_MEDIA_ID:
#ifdef _USE_TVPD_MODE
if (_filter && STRING_VALID(_filter->storage_id))
char *condition_query = NULL;
char *option_query = NULL;
sqlite3_stmt *stmt = NULL;
+#ifdef _USE_TVPD_MODE
filter_s *_filter = (filter_s *)filter;
+#endif
switch (group_type) {
case MEDIA_GROUP_ALBUM:
else
select_query = g_strdup_printf(SELECT_MEDIA_FROM_ALBUM, DB_VIEW_MEDIA, group_id);
#else
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_MEDIA_FROM_ALBUM_BY_STORAGE_ID, group_id, _filter->storage_id);
- else
- select_query = g_strdup_printf(SELECT_MEDIA_FROM_ALBUM, group_id);
+ select_query = g_strdup_printf(SELECT_MEDIA_FROM_ALBUM, group_id);
#endif
break;
else
select_query = g_strdup_printf(SELECT_MEDIA_FROM_PLAYLIST, DB_VIEW_MEDIA, group_id);
#else
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_MEDIA_FROM_PLAYLIST_BY_STORAGE_ID, group_id, _filter->storage_id);
- else
- select_query = g_strdup_printf(SELECT_MEDIA_FROM_PLAYLIST, group_id);
+ select_query = g_strdup_printf(SELECT_MEDIA_FROM_PLAYLIST, group_id);
#endif
break;
else
select_query = g_strdup_printf(SELECT_MEDIA_FROM_TAG, DB_VIEW_MEDIA, group_id);
#else
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_MEDIA_FROM_TAG_BY_STORAGE_ID, group_id, _filter->storage_id);
- else
- select_query = g_strdup_printf(SELECT_MEDIA_FROM_TAG, group_id);
+ select_query = g_strdup_printf(SELECT_MEDIA_FROM_TAG, group_id);
#endif
break;
char *condition_query = NULL;
char *option_query = NULL;
sqlite3_stmt *stmt = NULL;
+#ifdef _USE_TVPD_MODE
filter_s *_filter = (filter_s *)filter;
+#endif
switch (group_type) {
case MEDIA_GROUP_NONE:
else
select_query = g_strdup_printf(SELECT_MEDIA_ITEM, DB_VIEW_MEDIA);
#else
- if (_filter && STRING_VALID(_filter->storage_id))
- select_query = g_strdup_printf(SELECT_MEDIA_ITEM_BY_STORAGE_ID, _filter->storage_id);
- else
- select_query = g_strdup(SELECT_MEDIA_ITEM);
+ select_query = g_strdup(SELECT_MEDIA_ITEM);
#endif
break;
#endif
break;
- case MEDIA_GROUP_STORAGE:
-#ifdef _USE_TVPD_MODE
- select_query = g_strdup_printf(SELECT_MEDIA_FROM_STORAGE, group_name, group_name);
-#else
- select_query = g_strdup_printf(SELECT_MEDIA_FROM_STORAGE, group_name);
-#endif
- break;
-
default:
content_error("INVALID_PARAMETER");
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
char *tmp_option = NULL;
char *condition_query = NULL;
char *option_query = NULL;
- filter_s *_filter = (filter_s *)filter;
-
#ifdef _USE_TVPD_MODE
+ filter_s *_filter = (filter_s *)filter;
if (group < MEDIA_PVR_GROUP_DURATION) { /*media content */
if (group_name) {
if (_filter && STRING_VALID(_filter->storage_id))
}
}
#else
- if (group_name) {
- if (_filter && STRING_VALID(_filter->storage_id))
- sqlite3_snprintf(sizeof(select_query), select_query, SELECT_MEDIA_COUNT_FROM_GROUP_BY_STORAGE_ID, __media_db_get_group_name(group), group_name, _filter->storage_id);
- else
- sqlite3_snprintf(sizeof(select_query), select_query, SELECT_MEDIA_COUNT_FROM_GROUP, __media_db_get_group_name(group), group_name);
- } else {
- if (_filter && STRING_VALID(_filter->storage_id))
- snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_GROUP_NULL_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
- else
- snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_GROUP_NULL, __media_db_get_group_name(group));
- }
+ if (group_name)
+ sqlite3_snprintf(MAX_QUERY_SIZE, select_query, SELECT_MEDIA_COUNT_FROM_GROUP, __media_db_get_group_name(group), group_name);
+ else
+ snprintf(select_query, MAX_QUERY_SIZE, SELECT_MEDIA_COUNT_FROM_GROUP_NULL, __media_db_get_group_name(group));
#endif
ret = __media_db_make_query(filter, &condition_query, &option_query);
content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
char *condition_query = NULL;
char *option_query = NULL;
sqlite3_stmt *stmt = NULL;
- filter_s *_filter = (filter_s *)filter;
-
#ifdef _USE_TVPD_MODE
+ filter_s *_filter = (filter_s *)filter;
if (group_name) {
if (_filter && STRING_VALID(_filter->storage_id))
sqlite3_snprintf(sizeof(select_query), select_query, SELECT_MEDIA_FROM_GROUP, _filter->storage_id, __media_db_get_group_name(group), group_name);
snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_GROUP_NULL, DB_VIEW_MEDIA, __media_db_get_group_name(group));
}
#else
- if (group_name) {
- if (_filter && STRING_VALID(_filter->storage_id))
- sqlite3_snprintf(sizeof(select_query), select_query, SELECT_MEDIA_FROM_GROUP_BY_STORAGE_ID, __media_db_get_group_name(group), group_name, _filter->storage_id);
- else
- sqlite3_snprintf(sizeof(select_query), select_query, SELECT_MEDIA_FROM_GROUP, __media_db_get_group_name(group), group_name);
- } else {
- if (_filter && STRING_VALID(_filter->storage_id))
- snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_GROUP_NULL_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
- else
- snprintf(select_query, sizeof(select_query), SELECT_MEDIA_FROM_GROUP_NULL, __media_db_get_group_name(group));
- }
+ if (group_name)
+ sqlite3_snprintf(MAX_QUERY_SIZE, select_query, SELECT_MEDIA_FROM_GROUP, __media_db_get_group_name(group), group_name);
+ else
+ snprintf(select_query, MAX_QUERY_SIZE, SELECT_MEDIA_FROM_GROUP_NULL, __media_db_get_group_name(group));
#endif
ret = __media_db_make_query(filter, &condition_query, &option_query);
content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
return ret;
}
-int _media_db_get_storage(filter_h filter, media_storage_cb callback, void *user_data)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- char *condition_query = NULL;
- char *option_query = NULL;
- sqlite3_stmt *stmt = NULL;
-
- ret = __media_db_make_query(filter, &condition_query, &option_query);
- content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
- ret = _content_query_prepare(SELECT_STORAGE_LIST, condition_query, option_query, &stmt);
- g_free(condition_query);
- g_free(option_query);
- content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
- while (sqlite3_step(stmt) == SQLITE_ROW) {
- media_storage_s *_storage = g_new0(media_storage_s, 1);
-
- _storage->storage_id = g_strdup((const char *)sqlite3_column_text(stmt, 0));
- _storage->storage_path = g_strdup((const char *)sqlite3_column_text(stmt, 1));
- _storage->storage_type = sqlite3_column_int(stmt, 2);
-
- if (callback((media_storage_h)_storage, user_data) == false) {
- media_storage_destroy((media_storage_h) _storage);
- break;
- }
-
- media_storage_destroy((media_storage_h) _storage);
- }
-
- SQLITE3_FINALIZE(stmt);
-
- return ret;
-}
-
+#ifdef _USE_TVPD_MODE
int _media_db_get_storage_id_by_media_id(const char *media_id, char **storage_id)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
return ret;
}
-#ifdef _USE_TVPD_MODE
int _media_db_get_pvr_group_item(const char *group_name, filter_h filter, media_group_e group, media_pvr_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
return MEDIA_CONTENT_ERROR_NONE;
}
-
+#ifdef _USE_TVPD_MODE
int media_filter_set_storage(filter_h filter, const char *storage_id)
{
- content_warn("DEPRECATION WARNING: media_filter_set_storage() is deprecated and will be removed from next release. Use media_filter_set_condition() with MEDIA_PATH keyword instead.");
filter_s *_filter = (filter_s *)filter;
content_retip_if_fail(filter);
return MEDIA_CONTENT_ERROR_NONE;
}
-
+#endif
int media_filter_get_offset(filter_h filter, int *offset, int *count)
{
filter_s *_filter = (filter_s *)filter;
return MEDIA_CONTENT_ERROR_NONE;
}
-int media_filter_get_storage(filter_h filter, char **storage_id)
-{
- content_warn("DEPRECATION WARNING: media_filter_get_storage() is deprecated and will be removed from next release.");
- filter_s *_filter = (filter_s *)filter;
-
- content_retip_if_fail(filter);
- content_retip_if_fail(storage_id);
-
- *storage_id = g_strdup(_filter->storage_id);
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
int media_filter_set_condition_v2(filter_h filter, const char *condition)
{
filter_s *_filter = (filter_s *)filter;
return MEDIA_CONTENT_ERROR_NONE;
}
-
return MEDIA_CONTENT_ERROR_NONE;
}
-int media_folder_get_storage_type(media_folder_h folder, media_content_storage_e* storage_type)
-{
- content_warn("DEPRECATION WARNING: media_folder_get_storage_type() is deprecated and will be removed from next release. Use storage_get_type_dev() instead.");
- media_folder_s *_folder = (media_folder_s*)folder;
-
- content_retip_if_fail(folder);
- content_retip_if_fail(storage_type);
-
- *storage_type = _folder->storage_type;
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_folder_get_storage_id(media_folder_h folder, char **storage_id)
-{
- content_warn("DEPRECATION WARNING: media_folder_get_storage_id() is deprecated and will be removed from next release.");
- media_folder_s *_folder = (media_folder_s*)folder;
-
- content_retip_if_fail(folder);
- content_retip_if_fail(storage_id);
-
- *storage_id = g_strdup(_folder->storage_uuid);
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
int media_folder_get_folder_from_db(const char *folder_id, media_folder_h *folder)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
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)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- sqlite3_stmt *stmt = NULL;
- char *select_query = NULL;
-
- content_retip_if_fail(STRING_VALID(media_id));
-
- select_query = sqlite3_mprintf(SELECT_MEDIA_PATH_BY_ID, media_id);
-
- ret = _content_get_result(select_query, &stmt);
- SQLITE3_SAFE_FREE(select_query);
- content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
- if (sqlite3_step(stmt) == SQLITE_ROW) {
- *path = g_strdup((const char *)sqlite3_column_text(stmt, 0));
- } else {
- content_error("There's no media with this ID : %s", media_id);
- *path = NULL;
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
- SQLITE3_FINALIZE(stmt);
-
- return ret;
-}
-
static void __media_info_insert_completed_cb(media_request_result_s *result, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
}
#endif
-int media_info_delete_from_db(const char *media_id)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- char *path = NULL;
- char *storage_id = NULL;
- content_warn("DEPRECATION WARNING: media_info_delete_from_db() is deprecated and will be removed from next release. Use media_content_scan_file() instead.");
-
- content_retip_if_fail(STRING_VALID(media_id));
-
- ret = __media_info_get_media_path_by_id_from_db(media_id, &path);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- content_error("__media_info_get_media_path_by_id_from_db failed : %d", ret);
- g_free(path);
- return ret;
- }
-
- ret = _media_db_get_storage_id_by_media_id(media_id, &storage_id);
- if (ret != MEDIA_CONTENT_ERROR_NONE) {
- content_error("_media_db_get_storage_id_by_media_id failed : %d", ret);
- g_free(path);
- return ret;
- }
-
- ret = media_svc_delete_item_by_path(_content_get_db_handle(), storage_id, path, _content_get_uid());
- g_free(path);
- g_free(storage_id);
-
- return _content_error_capi(ret);
-}
-
int media_info_destroy(media_info_h media)
{
media_info_s *_media = (media_info_s*)media;
return MEDIA_CONTENT_ERROR_NONE;
}
-int media_info_get_storage_id(media_info_h media, char **storage_id)
-{
- 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;
-
- content_retip_if_fail(media);
- content_retip_if_fail(storage_id);
-
- *storage_id = g_strdup(_media->storage_uuid);
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
int media_info_is_drm(media_info_h media, bool *is_drm)
{
media_info_s *_media = (media_info_s*)media;
return MEDIA_CONTENT_ERROR_NONE;
}
-int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type)
-{
- 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;
-
- content_retip_if_fail(media);
- content_retip_if_fail(storage_type);
-
- *storage_type = _media->storage_type;
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
#ifdef _USE_TVPD_MODE
int media_info_get_played_count(media_info_h media, int *played_count)
{
return ret;
}
-int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data)
-{
- content_warn("DEPRECATION WARNING: media_info_create_thumbnail() is deprecated and will be removed from next release. Use media_info_generate_thumbnail() instead.");
- int ret = MEDIA_CONTENT_ERROR_NONE;
- media_info_s *_media = (media_info_s*)media;
-
- content_retip_if_fail(media);
- content_retip_if_fail(callback);
-
- ret = media_info_generate_thumbnail(media);
- content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE && ret != MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT, ret);
-
- callback(ret, _media->thumbnail_path, user_data);
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
int media_info_generate_thumbnail(media_info_h media)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
return ret;
}
-int media_info_cancel_thumbnail(media_info_h media)
-{
- content_warn("DEPRECATION WARNING: media_info_cancel_thumbnail() is deprecated and will be removed from next release.");
- content_retip_if_fail(media);
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
ret = dcm_request_cancel_face(_media->face_request_id);
return _content_error_capi(ret);
-}
\ No newline at end of file
+}
*/
-#include <media_info_private.h>
-
-int media_storage_get_storage_info_from_db(const char *storage_id, media_storage_h *storage)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- content_warn("DEPRECATION WARNING: media_storage_get_storage_info_from_db() is deprecated and will be removed from next release.");
- char select_query[DEFAULT_QUERY_SIZE] = {0, };
- sqlite3_stmt *stmt = NULL;
- media_storage_s *_storage = NULL;
-
- content_retip_if_fail(STRING_VALID(storage_id));
- content_retip_if_fail(storage);
-
- snprintf(select_query, sizeof(select_query), SELECT_STORAGE_INFO_FROM_STORAGE, storage_id);
-
- ret = _content_get_result(select_query, &stmt);
- content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
- if (sqlite3_step(stmt) == SQLITE_ROW) {
- _storage = g_new0(media_storage_s, 1);
-
- _storage->storage_id = g_strdup(storage_id);
- _storage->storage_path = g_strdup((const char *)sqlite3_column_text(stmt, 0));
- _storage->storage_type = (int)sqlite3_column_int(stmt, 1);
-
- *storage = (media_storage_h)_storage;
- } else {
- content_error("Nonexistent storage id[%s]", storage_id);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
- SQLITE3_FINALIZE(stmt);
-
- return ret;
-}
-
-int media_storage_get_storage_count_from_db(filter_h filter, int *storage_count)
-{
- content_warn("DEPRECATION WARNING: media_storage_get_storage_count_from_db() is deprecated and will be removed from next release.");
-
- content_retip_if_fail(storage_count);
-
- return _media_db_get_group_count(filter, MEDIA_GROUP_STORAGE, storage_count);
-}
-
-int media_storage_foreach_storage_from_db(filter_h filter, media_storage_cb callback, void *user_data)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- content_warn("DEPRECATION WARNING: media_storage_foreach_storage_from_db() is deprecated and will be removed from next release.");
-
- content_retip_if_fail(callback);
-
#ifdef _USE_TVPD_MODE
- g_mutex_lock(_content_get_db_mutex());
-#endif
- ret = _media_db_get_storage(filter, callback, user_data);
-
-#ifdef _USE_TVPD_MODE
- g_mutex_unlock(_content_get_db_mutex());
-#endif
-
- return ret;
-}
-
-int media_storage_get_media_count_from_db(const char *storage_id, filter_h filter, int *media_count)
-{
- content_warn("DEPRECATION WARNING: media_storage_get_media_count_from_db() is deprecated and will be removed from next release.");
-
- content_retip_if_fail(STRING_VALID(storage_id));
- content_retip_if_fail(media_count);
-
- return _media_db_get_group_item_count(storage_id, filter, MEDIA_GROUP_STORAGE, media_count);
-}
-
-int media_storage_foreach_media_from_db(const char *storage_id, filter_h filter, media_info_cb callback, void *user_data)
-{
- content_warn("DEPRECATION WARNING: media_storage_foreach_media_from_db() is deprecated and will be removed from next release.");
-
- content_retip_if_fail(STRING_VALID(storage_id));
- content_retip_if_fail(callback);
-
- return _media_db_get_group_item(storage_id, filter, callback, user_data, MEDIA_GROUP_STORAGE);
-}
-
-int media_storage_destroy(media_storage_h storage)
-{
- content_warn("DEPRECATION WARNING: media_storage_destroy() is deprecated and will be removed from next release.");
- media_storage_s *_storage = (media_storage_s*)storage;
-
- content_retip_if_fail(storage);
-
- g_free(_storage->storage_id);
- g_free(_storage->storage_path);
- g_free(_storage);
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_storage_clone(media_storage_h *dst, media_storage_h src)
-{
- content_warn("DEPRECATION WARNING: media_storage_clone() is deprecated and will be removed from next release.");
- media_storage_s *_src = (media_storage_s*)src;
-
- content_retip_if_fail(dst);
- content_retip_if_fail(src);
-
- media_storage_s *_dst = g_new0(media_storage_s, 1);
-
- _dst->storage_id = g_strdup(_src->storage_id);
- _dst->storage_path = g_strdup(_src->storage_path);
- _dst->storage_type = _src->storage_type;
-
- *dst = (media_storage_h)_dst;
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_storage_get_id(media_storage_h storage, char **storage_id)
-{
- content_warn("DEPRECATION WARNING: media_storage_get_id() is deprecated and will be removed from next release.");
- media_storage_s *_storage = (media_storage_s*)storage;
-
- content_retip_if_fail(storage);
- content_retip_if_fail(storage_id);
-
- *storage_id = g_strdup(_storage->storage_id);
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_storage_get_path(media_storage_h storage, char **storage_path)
-{
- content_warn("DEPRECATION WARNING: media_storage_get_path() is deprecated and will be removed from next release.");
- media_storage_s *_storage = (media_storage_s*)storage;
-
- content_retip_if_fail(storage);
- content_retip_if_fail(storage_path);
-
- *storage_path = g_strdup(_storage->storage_path);
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
-
-int media_storage_get_type(media_storage_h storage, media_content_storage_e *storage_type)
-{
- content_warn("DEPRECATION WARNING: media_storage_get_type() is deprecated and will be removed from next release. Use storage_get_type_dev() instead.");
- media_storage_s *_storage = (media_storage_s*)storage;
-
- content_retip_if_fail(storage);
- content_retip_if_fail(storage_type);
-
- *storage_type = _storage->storage_type;
-
- return MEDIA_CONTENT_ERROR_NONE;
-}
+#include <media_info_private.h>
-#ifdef _USE_TVPD_MODE
int media_storage_get_scan_status(const char *storage_uuid, media_storage_scan_status_e *scan_status)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
static void get_folder_meta(media_folder_h folder, char **folder_id)
{
char *c_value = NULL;
- media_content_storage_e storage_type;
content_debug("=== folder meta ===");
if (media_folder_get_folder_id(folder, &c_value) != MEDIA_CONTENT_ERROR_NONE) {
content_debug("folder_name : %s", c_value);
SAFE_FREE(c_value);
}
-
- if (media_folder_get_storage_type(folder, &storage_type) == MEDIA_CONTENT_ERROR_NONE)
- content_debug("storage_type : [%d]", storage_type);
-
- if (media_folder_get_storage_id(folder, &c_value) == MEDIA_CONTENT_ERROR_NONE) {
- content_debug("storage_id : %s", c_value);
- SAFE_FREE(c_value);
- }
}
static void get_media_meta(media_info_h media)
media_filter_set_condition(filter, "(MEDIA_TYPE = 0 or MEDIA_TYPE = 1) and MEDIA_STORAGE_TYPE=0", MEDIA_CONTENT_COLLATE_DEFAULT); /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music, 4-other*/
media_filter_set_offset(filter, 0, 5);
media_filter_set_order(filter, MEDIA_CONTENT_ORDER_DESC, MEDIA_PATH, MEDIA_CONTENT_COLLATE_NOCASE);
- media_filter_set_storage(filter, "cfbf3d2c-71c5-4611-bccc-7cbac890146e");
ret = media_folder_get_folder_count_from_db(filter, &count);
content_debug("Folder count : [%d]", count);
return ret;
}
-void thumbnail_completed_cb(media_content_error_e error, const char *path, void *user_data)
-{
- char *thumbnail_path = NULL;
- int ret = MEDIA_CONTENT_ERROR_NONE;
- g_cnt++;
-
- content_debug("=================[%d][%d]", g_media_cnt, g_cnt);
- content_debug("error_code [%d]", error);
- content_debug("thumbnail_path [%s]", path);
- if (user_data != NULL) {
- media_info_h media = (media_info_h)user_data;
- ret = media_info_get_thumbnail_path(media, &thumbnail_path);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- content_error("media_info_get_thumbnail_path failed: %d", ret);
- else
- content_debug("thumbnail_path get from media[%s]", thumbnail_path);
- SAFE_FREE(thumbnail_path);
- ret = media_info_destroy(media);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- content_error("media_info_destroy failed: %d", ret);
- }
-
- if (g_cnt == g_media_cnt)
- g_main_loop_quit(g_loop);
-
- return;
-}
-
-bool thumbnail_create_cb(media_info_h media, void *user_data)
-{
- char *media_id = NULL;
- media_info_h dst = NULL;
- int ret = MEDIA_CONTENT_ERROR_NONE;
-
- if (media == NULL) {
- content_debug("NO Item");
- return true;
- }
-
- ret = media_info_get_media_id(media, &media_id);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- content_error("media_info_get_media_id failed: %d", ret);
- else
- content_debug("media_id : [%s]", media_id);
-
- ret = media_info_clone(&dst, media);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- content_error("media_info_clone failed: %d", ret);
- else {
- ret = media_info_create_thumbnail(dst, thumbnail_completed_cb, dst);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- content_error("media_info_create_thumbnail failed: %d", ret);
- }
-
- /* fix prevent: Resource leak */
- SAFE_FREE(media_id);
-
- return true;
-}
-
-bool thumbnail_cancel_cb(media_info_h media, void *user_data)
+int test_create_thumbnail(const char *path)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
+ media_info_h media;
+ char *thumb_path = NULL;
- char *media_id = NULL;
- media_info_h dst = NULL;
-
- g_cnt++;
+ ret = media_info_insert_to_db(path, &media);
+ content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_insert_to_db failed [%d]", ret);
- if (media == NULL) {
- content_debug("NO Item");
- return true;
+ ret = media_info_generate_thumbnail(media);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ content_error("media_info_generate_thumbnail failed [%d]", ret);
+ goto FINALIZE;
}
- ret = media_info_get_media_id(media, &media_id);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- content_error("media_info_get_media_id failed: %d", ret);
- else
- content_debug("media_id : [%s]", media_id);
-
- ret = media_info_clone(&dst, media);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- content_error("media_info_clone failed: %d", ret);
-
- ret = media_info_cancel_thumbnail(dst);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- content_error("media_info_cancel_thumbnail failed: %d", ret);
-
- ret = media_info_destroy(dst);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- content_error("media_info_destroy failed: %d", ret);
-
- if (g_cnt == g_media_cnt)
- g_main_loop_quit(g_loop);
-
- /* fix prevent: Resource leak */
- SAFE_FREE(media_id);
-
- return true;
-}
-
-gboolean create_thumbnail_start(gpointer data)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
-
- ret = media_info_foreach_media_from_db(g_filter, thumbnail_create_cb, NULL);
-
- if (ret == MEDIA_CONTENT_ERROR_NONE)
- content_debug("media_info_foreach_media_from_db is success");
- else
- content_error("media_info_foreach_media_from_db is failed");
-
- return false;
-}
-
-gboolean cancel_thumbnail_start(gpointer data)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
-
- ret = media_info_foreach_media_from_db(g_filter, thumbnail_cancel_cb, NULL);
-
- if (ret == MEDIA_CONTENT_ERROR_NONE)
- content_debug("media_info_foreach_media_from_db is success");
- else
- content_error("media_info_foreach_media_from_db is failed");
-
- return false;
-}
-
-int test_create_thumbnail(int cancel)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- GSource *source = NULL;
- GMainContext *context = NULL;
-
- test_filter_create();
-
- ret = media_info_get_media_count_from_db(g_filter, &g_media_cnt);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- content_error("media_info_get_media_count_from_db failed: %d", ret);
- else
- content_debug("media_count : [%d]", g_media_cnt);
-
- 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, create_thumbnail_start, NULL, NULL);
- g_source_attach(source, context);
-
- /* Logic to cancel */
- if (cancel) {
- GSource *cancel_src = NULL;
- cancel_src = g_idle_source_new();
- g_source_set_callback(cancel_src, cancel_thumbnail_start, NULL, NULL);
- g_source_attach(cancel_src, context);
+ ret = media_info_get_thumbnail_path(media, &thumb_path);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ content_error("media_info_get_thumbnail_path failed [%d]", ret);
+ goto FINALIZE;
}
- g_main_loop_run(g_loop);
- g_main_loop_unref(g_loop);
-
- test_filter_destroy();
+ content_debug("Thumbnail Path [%s]", thumb_path);
+ if (thumb_path)
+ free(thumb_path);
+FINALIZE:
+ media_info_destroy(media);
return ret;
}
if (ret != MEDIA_CONTENT_ERROR_NONE)
return ret;
- ret = test_create_thumbnail(TRUE);
- if (ret != MEDIA_CONTENT_ERROR_NONE)
- return ret;
+ if (argc == 2) {
+ ret = test_create_thumbnail(argv[1]);
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
+ return ret;
+ }
ret = test_extrace_face(TRUE);
if (ret != MEDIA_CONTENT_ERROR_NONE)