From: Minje Ahn Date: Fri, 12 Jun 2015 06:06:25 +0000 (+0900) Subject: Update header files. X-Git-Tag: accepted/tizen/mobile/20150617.044509~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd63d040a821b31ea7cb0966e405abe4e8bbbc27;p=platform%2Fcore%2Fapi%2Fmedia-content.git Update header files. Change-Id: I1310de63c8ae440949a36037bf005b295a312a74 Signed-off-by: Minje Ahn --- diff --git a/include/media_audio.h b/include/media_audio.h index 72af7db..16164c4 100755 --- a/include/media_audio.h +++ b/include/media_audio.h @@ -44,7 +44,7 @@ extern "C" { * * @param[in] audio The audio metadata handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -68,7 +68,7 @@ int audio_meta_destroy(audio_meta_h audio); * @param[out] dst The destination handle to audio metadata * @param[in] src The source handle to the audio metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -89,7 +89,7 @@ int audio_meta_clone(audio_meta_h *dst, audio_meta_h src); * @param[in] audio The audio metadata handle * @param[out] media_id The ID of the audio * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -110,7 +110,7 @@ int audio_meta_get_media_id(audio_meta_h audio, char **media_id); * @param[in] audio The audio metadata handle * @param[out] album_name The name of the album * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -131,7 +131,7 @@ int audio_meta_get_album(audio_meta_h audio, char **album_name); * @param[in] audio The audio metadata handle * @param[out] artist_name The name of the artist * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -155,9 +155,9 @@ int audio_meta_get_artist(audio_meta_h audio, char **artist_name); * @return @c 0 on success, * otherwise a negative error value * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_NONE Successful * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied */ int audio_meta_get_album_artist(audio_meta_h audio, char **album_artist_name); @@ -173,7 +173,7 @@ int audio_meta_get_album_artist(audio_meta_h audio, char **album_artist_name); * @param[in] audio The audio metadata handle * @param[out] genre_name The name of the genre * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -194,7 +194,7 @@ int audio_meta_get_genre(audio_meta_h audio, char **genre_name); * @param[in] audio The audio metadata handle * @param[out] composer_name The name of the author of the audio * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -215,7 +215,7 @@ int audio_meta_get_composer(audio_meta_h audio, char **composer_name); * @param[in] audio The audio metadata handle * @param[out] year The year of the audio file * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -234,7 +234,7 @@ int audio_meta_get_year(audio_meta_h audio, char **year); * @param[in] audio The audio metadata handle * @param[out] recorded_date The recorded date of the audio file * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -253,7 +253,7 @@ int audio_meta_get_recorded_date(audio_meta_h audio, char **recorded_date); * @param[in] audio The audio metadata handle * @param[out] copyright The audio copyright notice * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -272,7 +272,7 @@ int audio_meta_get_copyright(audio_meta_h audio, char **copyright); * @param[in] audio The audio metadata handle * @param[out] track_num The audio track number * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -288,7 +288,7 @@ int audio_meta_get_track_num(audio_meta_h audio, char **track_num); * @param[in] audio The audio metadata handle * @param[out] bit_rate The audio bitrate in bit per second [bps] * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -321,7 +321,7 @@ int audio_meta_get_bitpersample(audio_meta_h audio, int *bitpersample); * @param[in] audio The audio metadata handle * @param[out] sample_rate The audio sample rate[hz] * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -337,7 +337,7 @@ int audio_meta_get_sample_rate(audio_meta_h audio, int *sample_rate); * @param[in] audio The audio metadata handle * @param[out] channel The channel of the audio * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -353,7 +353,7 @@ int audio_meta_get_channel(audio_meta_h audio, int *channel); * @param[in] audio The audio metadata handle * @param[out] duration The audio file duration * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -363,13 +363,14 @@ int audio_meta_get_channel(audio_meta_h audio, int *channel); int audio_meta_get_duration(audio_meta_h audio, int *duration); /** + * @deprecated Deprecated since 2.4. [Use media_info_get_played_count() instead] * @brief Gets the number of times the given audio has been played. * @since_tizen 2.3 * * @param[in] audio The audio metadata handle * @param[out] played_count The counter of the audio played * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -379,6 +380,7 @@ int audio_meta_get_duration(audio_meta_h audio, int *duration); int audio_meta_get_played_count(audio_meta_h audio, int *played_count); /** + * @deprecated Deprecated since 2.4. [Use media_info_get_played_time() instead] * @brief Gets the played time parameter of an audio. * @details This function returns audio's elapsed playback time parameter as a period * starting from the beginning of the track. @@ -388,7 +390,7 @@ int audio_meta_get_played_count(audio_meta_h audio, int *played_count); * @param[in] audio The audio metadata handle * @param[out] played_time The elapsed time of the audio * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -398,6 +400,7 @@ int audio_meta_get_played_count(audio_meta_h audio, int *played_count); int audio_meta_get_played_time(audio_meta_h audio, time_t *played_time); /** + * @deprecated Deprecated since 2.4. * @brief Gets the played position parameter of an audio. * @details This function returns audio's elapsed playback position parameter as a period * starting from the beginning of the track. @@ -407,7 +410,7 @@ int audio_meta_get_played_time(audio_meta_h audio, time_t *played_time); * @param[in] audio The audio metadata handle * @param[out] played_position The elapsed time of the audio * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -417,13 +420,14 @@ int audio_meta_get_played_time(audio_meta_h audio, time_t *played_time); int audio_meta_get_played_position(audio_meta_h audio, int *played_position); /** + * @deprecated Deprecated since 2.4. [Use media_info_increase_played_count() instead] * @brief Sets the played count to an audio meta handle. * @since_tizen 2.3 * * @param[in] audio The audio metadata handle * @param[in] played_count The played count of the audio * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -435,13 +439,14 @@ int audio_meta_get_played_position(audio_meta_h audio, int *played_position); int audio_meta_set_played_count(audio_meta_h audio, int played_count); /** + * @deprecated Deprecated since 2.4. [Use media_info_set_played_time() instead] * @brief Sets the played time to an audio meta handle. * @since_tizen 2.3 * * @param[in] audio The audio metadata handle * @param[in] played_time The played time of the audio * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -453,13 +458,16 @@ int audio_meta_set_played_count(audio_meta_h audio, int played_count); int audio_meta_set_played_time(audio_meta_h audio, time_t played_time); /** + * @deprecated Deprecated since 2.4. * @brief Sets the played position to an audio meta handle. * @since_tizen 2.3 * + * @remarks It is NOT recommended to use this attribute for your application-specific purpose because this attribute can be overwritten by other applications (even 0). + * * @param[in] audio The audio metadata handle * @param[in] played_position The played position of the audio * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -485,7 +493,7 @@ int audio_meta_set_played_position(audio_meta_h audio, int played_position); * * @param[in] audio The audio metadata handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful diff --git a/include/media_bookmark.h b/include/media_bookmark.h index af5abb8..d83092b 100755 --- a/include/media_bookmark.h +++ b/include/media_bookmark.h @@ -49,7 +49,7 @@ extern "C" { * @param[in] thumbnail_path The thumbnail path of video bookmark\ n * If the media type is audio, then thumbnail is null. * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -76,7 +76,7 @@ int media_bookmark_insert_to_db(const char *media_id, time_t time, const char *t * * @param[in] bookmark_id The ID of media bookmark * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -101,7 +101,7 @@ int media_bookmark_delete_from_db(int bookmark_id); * @param[in] filter The handle to the media filter * @param[out] bookmark_count The count of the media bookmark * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -129,7 +129,7 @@ int media_bookmark_get_bookmark_count_from_db(filter_h filter, int *bookmark_cou * @param[out] dst The destination handle to media bookmark * @param[in] src The source handle to media bookmark * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -152,7 +152,7 @@ int media_bookmark_clone(media_bookmark_h *dst, media_bookmark_h src); * * @param[in] bookmark The handle to media bookmark * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -172,7 +172,7 @@ int media_bookmark_destroy(media_bookmark_h bookmark); * @param[in] bookmark The handle to media bookmark * @param[out] bookmark_id The media bookmark ID * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -191,7 +191,7 @@ int media_bookmark_get_bookmark_id(media_bookmark_h bookmark, int *bookmark_id); * @param[in] bookmark The handle to media bookmark * @param[out] marked_time The bookmark time offset (in milliseconds) * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -209,7 +209,7 @@ int media_bookmark_get_marked_time(media_bookmark_h bookmark, time_t *marked_tim * @param[in] bookmark The handle to media bookmark * @param[out] path The thumbnail path of media bookmark * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful diff --git a/include/media_content.h b/include/media_content.h index 5f3fb63..6423e5f 100755 --- a/include/media_content.h +++ b/include/media_content.h @@ -28,6 +28,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -51,7 +52,7 @@ extern "C" { * * @since_tizen 2.3 * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -71,7 +72,7 @@ int media_content_connect(void); * * @since_tizen 2.3 * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -105,7 +106,7 @@ int media_content_disconnect(void); * * @param[in] path The file path * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -141,7 +142,7 @@ int media_content_scan_file(const char *path); * @param[in] callback The callback to be invoked when the scanning is finished * @param[in] user_data The user data to be passed to the callback function * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -152,6 +153,22 @@ int media_content_scan_file(const char *path); int media_content_scan_folder(const char *path, bool is_recursive, media_scan_completed_cb callback, void *user_data); /** + * @brief Requests to cancel the media folder scanning. + * @since_tizen 2.4 + * + * @param[in] path The folder path + * + * @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 media_content_scan_folder() + */ +int media_content_cancel_scan_folder(const char *path); + +/** * @brief Subscribes notifications of the media DB change. * @details This function subscribes notifications of the media DB change which are published by the media server or other apps. * media_content_db_update_cb() function will be called when notification of the media DB change is subscribed. @@ -161,7 +178,7 @@ int media_content_scan_folder(const char *path, bool is_recursive, media_scan_co * @param[in] callback The callback to be invoked when the scanning is finished * @param[in] user_data The user data to be passed to the callback function * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -181,7 +198,7 @@ int media_content_set_db_updated_cb(media_content_db_update_cb callback, void *u * * @since_tizen 2.3 * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful diff --git a/include/media_content_internal.h b/include/media_content_internal.h new file mode 100755 index 0000000..6e0accf --- /dev/null +++ b/include/media_content_internal.h @@ -0,0 +1,470 @@ +/* +* 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_MEDIA_CONTENT_INTERNAL_H__ +#define __TIZEN_MEDIA_CONTENT_INTERNAL_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @internal + * @file media_content_internal.h + * @brief This file contains API on main functional operations with storage that are related to media resources in the media database. \n + * Operations include: inserting a new storage in media to the media database, removing storage from database, \n + */ + +/** +* @internal +* @brief Insert media storage to database. +* @since_tizen 2.4 +* +* @remarks You must release @a storage using media_storage_destroy(). +* +* @privlevel platform +* @privilege %http://tizen.org/privilege/content.write +* +* @param[in] storage_name The storage name to insert to database +* @param[in] storage_path The storage path to insert to database +* @param[in] storage_account The storage account to insert to database +* @param[in] storage_type The storage type to insert to database +* @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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @see media_storage_delete_from_db() +*/ +int media_storage_insert_to_db(const char *storage_name, const char *storage_path, const char *storage_account, media_content_storage_e storage_type, media_storage_h *storage); + +/** +* @internal +* @brief Deletes the database for media storage. +* @since_tizen 2.4 +* +* @privlevel platform +* @privilege %http://tizen.org/privilege/content.write +* +* @param[in] storage_id The storage ID to delete from database +* +* @return @c 0 on success, +* otherwise a negative error value +* +* @retval #MEDIA_CONTENT_ERROR_NONE Successful +* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter +* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @see media_storage_insert_to_db() +*/ +int media_storage_delete_from_db(const char *storage_id); + +/** + * @brief Gets the storage account of media storage. + * @since_tizen 2.4 + * + * @remarks You must release @a storage_account using free(). + * + * @param[in] storage The media storage handle + * @param[out] storage_account The storage account 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_storage_account(media_storage_h storage, char **storage_account); + +/** +* @internal +* @brief Creates the media info handle. +* @since_tizen 2.4 +* +* @remarks You must release @a media using media_info_destroy(). +* +* @param[out] media The 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @see media_info_destroy() +*/ +int media_info_create_handle(media_info_h *media); + +/** +* @internal +* @brief Inserts media info to database with media info data. +* @since_tizen 2.4 +* +* @remarks You must release @a info using media_info_destroy(). +* +* @privlevel platform +* @privilege %http://tizen.org/privilege/content.write +* +* @param[in] media The media info handle +* @param[out] info The media info handle to get data from database +* +* @return @c 0 on success, +* otherwise a negative error value +* +* @retval #MEDIA_CONTENT_ERROR_NONE Successful +* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter +* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +*/ +int media_info_insert_to_db_with_data(media_info_h media, media_info_h *info); + +/** +* @internal +* @brief Sets the path of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] path The path of the media info +* +* @return @c 0 on success, +* otherwise a negative error value +* +* @retval #MEDIA_CONTENT_ERROR_NONE Successful +* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter +* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_path(media_info_h media, const char *path); + +/** +* @internal +* @brief Sets the MIME type of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] mime_type The MIME type of the media info +* +* @return @c 0 on success, +* otherwise a negative error value +* +* @retval #MEDIA_CONTENT_ERROR_NONE Successful +* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter +* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_mime_type(media_info_h media, const char *mime_type); + +/** +* @internal +* @brief Sets the title of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] title The title of media info handle +* +* @return @c 0 on success, +* otherwise a negative error value +* +* @retval #MEDIA_CONTENT_ERROR_NONE Successful +* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter +* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_title(media_info_h media, const char *title); + +/** +* @internal +* @brief Sets the album of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] album The album of 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_album(media_info_h media, const char *album); + +/** +* @internal +* @brief Sets the artist of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] artist The artist of media info handle +* +* @return @c 0 on success, +* otherwise a negative error value +* +* @retval #MEDIA_CONTENT_ERROR_NONE Successful +* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter +* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_artist(media_info_h media, const char *artist); + +/** +* @internal +* @brief Sets the genre of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] genre The genre of media info handle +* +* @return @c 0 on success, +* otherwise a negative error value +* +* @retval #MEDIA_CONTENT_ERROR_NONE Successful +* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter +* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_genre(media_info_h media, const char *genre); + +/** +* @internal +* @brief Sets the recorded date of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] recorded_date The recorded date of media info handle +* +* @return @c 0 on success, +* otherwise a negative error value +* +* @retval #MEDIA_CONTENT_ERROR_NONE Successful +* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter +* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_recorded_date(media_info_h media, const char *recorded_date); + +/** +* @internal +* @brief Sets the thumbnail path of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] thumbnail_path The thumbnail path of 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_thumbnail_path(media_info_h media, const char *thumbnail_path); + +/** +* @internal +* @brief Sets the size of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] size The size of 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_size(media_info_h media, unsigned long long size); + +/** +* @internal +* @brief Sets the modified time of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] modified_time The modified time of 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_modified_time(media_info_h media, time_t modified_time); + +/** +* @internal +* @brief Sets the media type of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] type The media type of 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_media_type(media_info_h media, media_content_type_e type); + +/** +* @internal +* @brief Sets the duration of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] duration The duration of 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_duration(media_info_h media, int duration); + +/** +* @internal +* @brief Sets the width of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] width The width of 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_width(media_info_h media, int width); + +/** +* @internal +* @brief Sets the height of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] height The height of 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_height(media_info_h media, int height); + +/** +* @internal +* @brief Sets the storage type of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] storage_type The storage type of 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_storage_type(media_info_h media, media_content_storage_e storage_type); + +/** +* @internal +* @brief Sets the storage type of media info handle. +* @since_tizen 2.4 +* +* @param[in] media The media info handle +* @param[in] storage_id The storage id of 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_DB_FAILED DB operation failed +* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied +* +* @post media_info_insert_to_db_with_data() +*/ +int media_info_set_storage_id(media_info_h media, const char *storage_id); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /*__TIZEN_MEDIA_CONTENT_INTERNAL_H__*/ diff --git a/include/media_content_type.h b/include/media_content_type.h index e4a4aab..9746991 100755 --- a/include/media_content_type.h +++ b/include/media_content_type.h @@ -63,8 +63,9 @@ typedef enum */ typedef enum { - MEDIA_CONTENT_STORAGE_INTERNAL = 0, /**< The device's internal storage */ - MEDIA_CONTENT_STORAGE_EXTERNAL = 1, /**< The device's external storage */ + MEDIA_CONTENT_STORAGE_INTERNAL = 0, /**< The device's internal storage */ + MEDIA_CONTENT_STORAGE_EXTERNAL = 1, /**< The device's external storage */ + MEDIA_CONTENT_STORAGE_CLOUD = 100, /**< The Cloud storage */ } media_content_storage_e; /** @@ -242,6 +243,13 @@ typedef struct audio_meta_s *audio_meta_h; typedef struct filter_s *filter_h; /** + * @ingroup CAPI_CONTENT_MEDIA_STORAGE_MODULE + * @brief The structure type for the Media storage handle. + * @since_tizen 2.4 + */ +typedef void *media_storage_h; + +/** * @ingroup CAPI_MEDIA_CONTENT_MODULE * @brief Called when the media scanning is finished. * @@ -504,6 +512,27 @@ typedef bool (*media_album_cb)(media_album_h album, void *user_data); typedef bool (*media_group_cb)(const char *group_name, void *user_data); /** + * @ingroup CAPI_CONTENT_MEDIA_STORAGE_MODULE + * @brief Called for every storage in the obtained list of storages. + * @since_tizen 2.4 + * + * @details Iterates over a media storage list. + * + * @remarks You should not destroy @a storage returned by this function. + * + * @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); + +/** * @} */ @@ -559,26 +588,31 @@ typedef bool (*media_group_cb)(const char *group_name, void *user_data); #define MEDIA_LOCATION_TAG "MEDIA_LOCATION_TAG" /**< Media location tag*/ #define MEDIA_AGE_RATING "MEDIA_AGE_RATING" /**< Media age rating*/ #define MEDIA_KEYWORD "MEDIA_KEYWORD" /**< Media keyword*/ -#define MEDIA_WEATHER "MEDIA_WEATHER" /**< Media weather*/ +#define MEDIA_WEATHER "MEDIA_WEATHER" /**< Media weather*/ #define MEDIA_IS_DRM "MEDIA_IS_DRM" /**< Is DRM. 0-not drm, 1-drm*/ #define MEDIA_STORAGE_TYPE "MEDIA_STORAGE_TYPE" /**< Media storage. 0-internal storage, 1-external storage*/ +#define MEDIA_EXPOSURE_TIME "MEDIA_EXPOSURE_TIME" /**< media exposure_time*/ +#define MEDIA_FNUMBER "MEDIA_FNUMBER" /**< media fnumber*/ +#define MEDIA_ISO "MEDIA_ISO" /**< media iso*/ +#define MEDIA_MODEL "MEDIA_MODEL" /**< media model*/ + +#define MEDIA_FILE_NAME_PINYIN "MEDIA_FILE_NAME_PINYIN" /**< Media file name pinyin */ +#define MEDIA_TITLE_PINYIN "MEDIA_TITLE_PINYIN" /**< Media title pinyin */ +#define MEDIA_ALBUM_PINYIN "MEDIA_ALBUM_PINYIN" /**< Media album pinyin*/ +#define MEDIA_ARTIST_PINYIN "MEDIA_ARTIST_PINYIN" /**< Media artist pinyin*/ +#define MEDIA_ALBUM_ARTIST_PINYIN "MEDIA_ALBUM_ARTIST_PINYIN" /**< Media album_artist pinyin*/ +#define MEDIA_GENRE_PINYIN "MEDIA_GENRE_PINYIN" /**< Media genre pinyin*/ +#define MEDIA_COMPOSER_PINYIN "MEDIA_COMPOSER_PINYIN" /**< Media composer pinyin*/ +#define MEDIA_COPYRIGHT_PINYIN "MEDIA_COPYRIGHT_PINYIN" /**< Media copyright pinyin*/ +#define MEDIA_DESCRIPTION_PINYIN "MEDIA_DESCRIPTION_PINYIN" /**< Media description pinyin*/ +#define MEDIA_AUTHOR_PINYIN "MEDIA_AUTHOR_PINYIN" /**< Media authore pinyin*/ +#define MEDIA_PROVIDER_PINYIN "MEDIA_PROVIDER_PINYIN" /**< Media provider pinyin*/ +#define MEDIA_CONTENT_NAME_PINYIN "MEDIA_CONTENT_NAME_PINYIN" /**< Media content name pinyin*/ +#define MEDIA_CATEGORY_PINYIN "MEDIA_CATEGORY_PINYIN" /**< Media category pinyin*/ +#define MEDIA_LOCATION_TAG_PINYIN "MEDIA_LOCATION_TAG_PINYIN" /**< Media location tag pinyin*/ +#define MEDIA_AGE_RATING_PINYIN "MEDIA_AGE_RATING_PINYIN" /**< Media age rating pinyin*/ +#define MEDIA_KEYWORD_PINYIN "MEDIA_KEYWORD_PINYIN" /**< Media keyword pinyin*/ -#define MEDIA_FILE_NAME_PINYIN "MEDIA_FILE_NAME_PINYIN" /**< media file name pinyin */ -#define MEDIA_TITLE_PINYIN "MEDIA_TITLE_PINYIN" /**< media title pinyin */ -#define MEDIA_ALBUM_PINYIN "MEDIA_ALBUM_PINYIN" /**< media album pinyin*/ -#define MEDIA_ARTIST_PINYIN "MEDIA_ARTIST_PINYIN" /**< media artist pinyin*/ -#define MEDIA_ALBUM_ARTIST_PINYIN "MEDIA_ALBUM_ARTIST_PINYIN" /**< media album_artist pinyin*/ -#define MEDIA_GENRE_PINYIN "MEDIA_GENRE_PINYIN" /**< media genre pinyin*/ -#define MEDIA_COMPOSER_PINYIN "MEDIA_COMPOSER_PINYIN" /**< media composer pinyin*/ -#define MEDIA_COPYRIGHT_PINYIN "MEDIA_COPYRIGHT_PINYIN" /**< media copyright pinyin*/ -#define MEDIA_DESCRIPTION_PINYIN "MEDIA_DESCRIPTION_PINYIN" /**< media description pinyin*/ -#define MEDIA_AUTHOR_PINYIN "MEDIA_AUTHOR_PINYIN" /**< media authore pinyin*/ -#define MEDIA_PROVIDER_PINYIN "MEDIA_PROVIDER_PINYIN" /**< media provider pinyin*/ -#define MEDIA_CONTENT_NAME_PINYIN "MEDIA_CONTENT_NAME_PINYIN" /**< media content name pinyin*/ -#define MEDIA_CATEGORY_PINYIN "MEDIA_CATEGORY_PINYIN" /**< media category pinyin*/ -#define MEDIA_LOCATION_TAG_PINYIN "MEDIA_LOCATION_TAG_PINYIN" /**< media location tag pinyin*/ -#define MEDIA_AGE_RATING_PINYIN "MEDIA_AGE_RATING_PINYIN" /**< media age rating pinyin*/ -#define MEDIA_KEYWORD_PINYIN "MEDIA_KEYWORD_PINYIN" /**< media keyword pinyin*/ /** * @} */ @@ -594,7 +628,8 @@ typedef bool (*media_group_cb)(const char *group_name, void *user_data); #define FOLDER_NAME "FOLDER_NAME" /**< Folder base name */ #define FOLDER_MODIFIED_TIME "FOLDER_MODIFIED_TIME" /**< Folder modified time */ #define FOLDER_STORAGE_TYPE "FOLDER_STORAGE_TYPE" /**< Folder storage. 0-internal storage, 1-external storage*/ -#define FOLDER_NAME_PINYIN "FOLDER_NAME_PINYIN" /**< folder base name pinyin*/ +#define FOLDER_NAME_PINYIN "FOLDER_NAME_PINYIN" /**< Folder base name pinyin*/ +#define FOLDER_ORDER "FOLDER_ORDER" /**< Folder order info */ /** * @} diff --git a/include/media_filter.h b/include/media_filter.h index 651e890..41777dd 100755 --- a/include/media_filter.h +++ b/include/media_filter.h @@ -50,7 +50,7 @@ extern "C" { * * @param[out] filter A handle to the media filter * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -72,7 +72,7 @@ int media_filter_create(filter_h *filter); * * @param[in] filter The handle to the media filter * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -94,7 +94,7 @@ int media_filter_destroy(filter_h filter); * @param[in] offset The start position of the given filter (Starting from zero) * @param[in] count The number of items to be searched with respect to the offset * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -114,7 +114,7 @@ int media_filter_set_offset(filter_h filter, int offset, int count); * @param[in] condition The condition which is used WHERE clause on a query * @param[in] collate_type The collate type for comparing two strings * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -136,7 +136,7 @@ int media_filter_set_condition(filter_h filter, const char *condition, media_con * @param[in] order_keyword The search order keyword * @param[in] collate_type The collate type for comparing two strings * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -149,6 +149,26 @@ int media_filter_set_condition(filter_h filter, const char *condition, media_con int media_filter_set_order(filter_h filter, media_content_order_e order_type, const char *order_keyword, media_content_collation_e collate_type); /** + * @brief Sets the @a storage id for the given @a filter. + * @since_tizen 2.4 + * + * @param[in] filter The handle to the media filter + * @param[in] storage_id The storage_id for browsing or searching + * + * @return @c 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied + * + * @see media_filter_create() + * @see media_filter_destroy() + */ +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. * @since_tizen 2.3 * @@ -178,7 +198,7 @@ int media_filter_get_offset(filter_h filter, int *offset, int *count); * @param[out] condition The condition which is used WHERE clause on a query * @param[out] collate_type The collate type for comparing two strings * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -202,7 +222,7 @@ int media_filter_get_condition(filter_h filter, char **condition, media_content_ * @param[out] order_keyword The search order keyword * @param[out] collate_type The collate type for comparing two strings * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -215,6 +235,27 @@ int media_filter_get_condition(filter_h filter, char **condition, media_content_ int media_filter_get_order(filter_h filter, media_content_order_e* order_type, char **order_keyword, media_content_collation_e *collate_type); /** + * @brief Get the @a storage id for given @a filter. + * @since_tizen 2.4 + * + * @remarks You must release @a storage_id using free(). + * + * @param[in] filter The handle to media info filter + * @param[out] storage_id The storage_id which is used in filter + * + * @return @c 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied + * + * @see media_filter_create() + * @see media_filter_destroy() + */ +int media_filter_get_storage(filter_h filter, char **storage_id); + +/** * @} */ diff --git a/include/media_folder.h b/include/media_folder.h index c87fe0f..33ea5a3 100755 --- a/include/media_folder.h +++ b/include/media_folder.h @@ -298,6 +298,44 @@ int media_folder_get_modified_time(media_folder_h folder, time_t *date); int media_folder_get_storage_type(media_folder_h folder, media_content_storage_e *storage_type); /** + * @brief Gets the storage id of the folder. + * @since_tizen 2.4 + * + * @remarks You must release @a storage_id 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 + * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied + */ +int media_folder_get_storage_id(media_folder_h folder, char **storage_id); + +/** + * @brief Gets the folder viewing order. + * @since_tizen 2.4 + * + * @param[in] folder The handle to the media folder + * @param[out] order The viewing order of the media folder + * + * @return @c 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied + * + * @post media_folder_update_to_db() + */ +int media_folder_get_order(media_folder_h folder, int *order); + +/** * @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. @@ -325,41 +363,61 @@ int media_folder_get_storage_type(media_folder_h folder, media_content_storage_e int media_folder_get_folder_from_db(const char *folder_id, media_folder_h *folder); /** - * @brief Updates the media folder to the media database. + * @brief Sets the folder name. + * @since_tizen 2.3 * - * @details The function updates the given media folder in the media database. The function should be called after any change in folder attributes, to be updated to the media - * database. For example, after using media_folder_set_name() for setting the name of the folder, the media_folder_update_to_db() function should be called so as to update - * the given folder attributes in the media database. + * @param[in] folder The handle to the media folder + * @param[in] name The name of the media folder * - * @since_tizen 2.3 + * @return @c 0 on success, + * otherwise a negative error value * - * @privlevel public - * @privilege %http://tizen.org/privilege/content.write + * @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_PERMISSION_DENIED Permission denied + * + * @post media_folder_update_to_db() + */ +int media_folder_set_name(media_folder_h folder, const char *name); + +/** + * @brief Sets the folder viewing order. + * @details If you set the order value for each folder, you can sort in ascending or descending order as the set order values using the filter. \n + * Moreover, more detailed settings are possible when used with the filter. \n + * + * @since_tizen 2.4 + * @remarks If you don't set the order value, the order value will be set default value. Default is 0. \n + * If you don't use the filter, the set order value does not effect the folder viewing order. * * @param[in] folder The handle to the media folder + * @param[in] order The viewing order of the media folder * * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied * - * @pre This function requires opened connection to content service by media_content_connect(). - * @pre If you do not set new name of folder by using media_folder_set_name(), your updating function is failed. - * - * @see media_content_connect() - * @see media_folder_destroy() - * @see media_folder_set_name() + * @post media_folder_update_to_db() */ -int media_folder_update_to_db(media_folder_h folder); +int media_folder_set_order(media_folder_h folder, int order); /** - * @brief Sets the folder name. + * @brief Updates the media folder to the media database. + * + * @details The function updates the given media folder in the media database. The function should be called after any change in folder attributes, to be updated to the media + * database. For example, after using media_folder_set_name() for setting the name of the folder, the media_folder_update_to_db() function should be called so as to update + * the given folder attributes in the media database. + * * @since_tizen 2.3 * + * @privlevel public + * @privilege %http://tizen.org/privilege/content.write + * * @param[in] folder The handle to the media folder - * @param[in] name The name of the media folder * * @return @c 0 on success, * otherwise a negative error value @@ -367,11 +425,20 @@ int media_folder_update_to_db(media_folder_h folder); * @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 * - * @post media_folder_update_to_db() + * @pre This function requires opened connection to content service by media_content_connect(). + * @pre If you do not set new name of folder by using media_folder_set_name(), your updating function is failed. + * + * @see media_content_connect() + * @see media_folder_destroy() + * @see media_folder_set_name() */ -int media_folder_set_name(media_folder_h folder, const char *name); +int media_folder_update_to_db(media_folder_h folder); /** * @} diff --git a/include/media_group.h b/include/media_group.h index d073f98..83882c2 100755 --- a/include/media_group.h +++ b/include/media_group.h @@ -46,7 +46,7 @@ extern "C" { * @param[in] filter The media filter handle * @param[out] album_count The count of the media album * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -73,7 +73,7 @@ int media_album_get_album_count_from_db(filter_h filter, int *album_count); * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -100,7 +100,7 @@ int media_album_foreach_album_from_db(filter_h filter, media_album_cb callback, * @param[in] filter The media filter handle * @param[out] media_count The count of the album * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -129,7 +129,7 @@ int media_album_get_media_count_from_db (int album_id, filter_h filter, int *med * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -158,7 +158,7 @@ int media_album_foreach_media_from_db(int album_id, filter_h filter, media_info_ * * @param[in] album The media album handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -185,7 +185,7 @@ int media_album_destroy(media_album_h album); * @param[in] src The source handle to the media album * @param[out] dst The destination handle to the media album * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -205,7 +205,7 @@ int media_album_clone(media_album_h *dst, media_album_h src); * @param[in] album The media album handle * @param[out] album_id The media album ID * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -226,7 +226,7 @@ int media_album_get_album_id(media_album_h album, int *album_id); * @param[in] album The media album handle * @param[out] album_name The name of the media album handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -245,7 +245,7 @@ int media_album_get_name(media_album_h album, char **album_name); * @param[in] album The media album handle * @param[out] artist The name of the media artist * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -264,7 +264,7 @@ int media_album_get_artist(media_album_h album, char **artist); * @param[in] album The media album handle * @param[out] album_art The path of the media album_art * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -287,7 +287,7 @@ int media_album_get_album_art(media_album_h album, char **album_art); * @param[in] album_id The ID of the media album * @param[out] album The album handle associated with the album ID * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -323,7 +323,7 @@ int media_album_get_album_from_db(int album_id, media_album_h *album); * @param[in] group The type of the media group * @param[out] group_count The count of the media group * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -351,7 +351,7 @@ int media_group_get_group_count_from_db(filter_h filter, media_group_e group, in * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -379,7 +379,7 @@ int media_group_foreach_group_from_db(filter_h filter, media_group_e group, medi * @param[in] filter The media filter handle * @param[out] media_count The count of the media * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -409,7 +409,7 @@ int media_group_get_media_count_from_db(const char *group_name, media_group_e gr * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful diff --git a/include/media_image.h b/include/media_image.h index 52bde06..450ade4 100755 --- a/include/media_image.h +++ b/include/media_image.h @@ -48,7 +48,7 @@ extern "C" { * @param[out] dst The destination handle to the image metadata * @param[in] src The source handle to the image metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -70,7 +70,7 @@ int image_meta_clone(image_meta_h *dst, image_meta_h src); * * @param[in] image The image metadata handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -89,7 +89,7 @@ int image_meta_destroy(image_meta_h image); * @param[in] image The image metadata handle * @param[out] media_id The ID of an image * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -105,7 +105,7 @@ int image_meta_get_media_id(image_meta_h image, char **media_id); * @param[in] image The image metadata handle * @param[out] width The image width in pixels * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -121,7 +121,7 @@ int image_meta_get_width(image_meta_h image, int *width); * @param[in] image The image metadata handle * @param[out] height The image height in pixels * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -137,7 +137,7 @@ int image_meta_get_height(image_meta_h image, int *height); * @param[in] image The image metadata handle * @param[out] orientation The image orientation * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -153,7 +153,7 @@ int image_meta_get_orientation(image_meta_h image, media_content_orientation_e * * @param[in] image The image metadata handle * @param[out] date_taken The time, when image was taken (in seconds, since the Epoch) * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -172,7 +172,7 @@ int image_meta_get_date_taken(image_meta_h image, char **date_taken); * @param[out] burst_id The ID of burst shot\ n * If @a burst_id is @c NULL, this is not burst shot * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -182,6 +182,78 @@ int image_meta_get_date_taken(image_meta_h image, char **date_taken); int image_meta_get_burst_id(image_meta_h image, char **burst_id); /** + * @brief Gets the exposure time from exif. + * @since_tizen 2.4 + * + * @remarks @a exposure time must be released with free() by you. + * + * @param[in] media The handle to image metadata + * @param[out] exposure_time The value of exposure_time, getting from exif + * + * @return 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * + */ +int image_meta_get_exposure_time(image_meta_h image, char **exposure_time); + +/** + * @brief Gets the fnumber from exif. + * @since_tizen 2.4 + * + * @param[in] media The handle toimage metadata + * @param[out] fnumber The value of fnumber, getting from exif + * + * @return 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * + */ +int image_meta_get_fnumber(image_meta_h image, double *fnumber); + +/** + * @brief Gets the iso from exif. + * @since_tizen 2.4 + * + * @param[in] media The handle toimage metadata + * @param[out] iso The value of iso, getting from exif + * + * @return 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * + */ +int image_meta_get_iso(image_meta_h image, int *iso); + +/** + * @brief Gets the model from exif. + * @since_tizen 2.4 + * + * @remarks @a model must be released with free() by you. + * + * @param[in] media The handle toimage metadata + * @param[out] model The value of model, getting from exif + * + * @return 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * + */ +int image_meta_get_model(image_meta_h image, char **model); + +/** * @brief Checks whether the media is a burst shot image. * @since_tizen 2.3 * @@ -189,7 +261,7 @@ int image_meta_get_burst_id(image_meta_h image, char **burst_id); * @param[out] is_burst_shot @c true if the media is a burst shot image, * otherwise @c false if the media is not a burst shot image * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -205,7 +277,7 @@ int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot); * @param[in] image The image metadata handle * @param[in] orientation The image orientation * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -232,7 +304,7 @@ int image_meta_set_orientation(image_meta_h image, media_content_orientation_e o * * @param[in] image The handle to the image * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful diff --git a/include/media_info.h b/include/media_info.h index 029787f..a86bbe6 100755 --- a/include/media_info.h +++ b/include/media_info.h @@ -63,10 +63,10 @@ extern "C" { * @param[in] path The path to the media file * @param[out] info The handle to the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_NONE Successful * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation @@ -104,7 +104,7 @@ int media_info_insert_to_db (const char *path, media_info_h *info); * @param[in] callback The callback to be invoked when media items inserted completely * @param[in] user_data The user data to be passed to the callback function * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -145,7 +145,7 @@ int media_info_insert_batch_to_db(const char **path_array,unsigned int array_len * @param[in] callback The callback to be invoked when the images are inserted completely * @param[in] user_data The user data to be passed to the callback function * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -177,10 +177,10 @@ int media_info_insert_burst_shot_to_db(const char **path_array,unsigned int arra * * @param[in] media_id The ID to the media file * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_NONE Successful * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed @@ -208,10 +208,10 @@ int media_info_delete_from_db(const char *media_id); * * @param[in] filter The handle to filter * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_NONE Successful * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed @@ -236,7 +236,7 @@ int media_info_delete_batch_from_db(filter_h filter); * * @param[in] media The media info handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -264,7 +264,7 @@ int media_info_destroy(media_info_h media); * @param[out] dst The destination handle to the media info * @param[in] src The source handle to media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -289,7 +289,7 @@ int media_info_clone(media_info_h *dst, media_info_h src); * @param[in] filter The handle to filter * @param[out] media_count The count of media * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -321,7 +321,7 @@ int media_info_get_media_count_from_db(filter_h filter, int *media_count); * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -348,7 +348,7 @@ int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, vo * @param[in] filter The handle to the media filter * @param[out] tag_count The count of the media tag * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -374,7 +374,7 @@ int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -400,7 +400,7 @@ int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_ * @param[in] filter The handle to the media filter * @param[out] bookmark_count The count of the media tag * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -426,7 +426,7 @@ int media_info_get_bookmark_count_from_db(const char *media_id, filter_h 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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -455,7 +455,7 @@ int media_info_foreach_bookmark_from_db (const char *media_id, filter_h filter, * @param[in] media The media info handle * @param[out] image A handle to image metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -477,7 +477,7 @@ int media_info_get_image(media_info_h media, image_meta_h *image); * @param[in] media The media info handle * @param[out] video A handle to the video meta * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -500,7 +500,7 @@ int media_info_get_video(media_info_h media, video_meta_h *video); * @param[in] media The media info handle * @param[out] audio A handle to the audio meta * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -519,7 +519,7 @@ int media_info_get_audio(media_info_h media, audio_meta_h *audio); * @param[in] media The media info handle * @param[out] media_id The ID of the media tag * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -537,7 +537,7 @@ int media_info_get_media_id(media_info_h media, char **media_id); * @param[in] media The media info handle * @param[out] path The path of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -557,7 +557,7 @@ int media_info_get_file_path(media_info_h media, char **path); * @param[in] media The media info handle * @param[out] name The name of media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -574,7 +574,7 @@ int media_info_get_display_name(media_info_h media, char **name); * @param[in] media The media info handle * @param[out] type The type of the media content (#media_content_type_e) * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -592,7 +592,7 @@ int media_info_get_media_type(media_info_h media, media_content_type_e *type); * @param[in] media The media info handle * @param[out] mime_type The MIME type of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -609,7 +609,7 @@ int media_info_get_mime_type(media_info_h media, char **mime_type); * @param[in] media The media info handle * @param[out] size The type of the media content * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -625,7 +625,7 @@ int media_info_get_size(media_info_h media, unsigned long long *size); * @param[in] media The media info handle * @param[out] added_time The added time to the DB * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -642,7 +642,7 @@ int media_info_get_added_time(media_info_h media, time_t *added_time); * @param[out] time The date of modification of the file \n * Get from the file. * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -663,7 +663,7 @@ int media_info_get_modified_time(media_info_h media, time_t *time); * @return @c 0 on success, * otherwise a negative error value * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_NONE Successful * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied */ @@ -678,7 +678,7 @@ int media_info_get_timeline(media_info_h media, time_t* time); * @param[in] media The media info handle * @param[out] path The path to the thumbnail of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -697,7 +697,7 @@ int media_info_get_thumbnail_path(media_info_h media, char **path); * @param[in] media The media info handle * @param[out] description The description of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -714,7 +714,7 @@ int media_info_get_description(media_info_h media, char **description); * @param[in] media The media info handle * @param[out] longitude The longitude of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -730,7 +730,7 @@ int media_info_get_longitude(media_info_h media, double* longitude); * @param[in] media The media info handle * @param[out] latitude The latitude of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -747,7 +747,7 @@ int media_info_get_latitude(media_info_h media, double* latitude); * @param[in] media The media info handle * @param[out] altitude The altitude of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -766,7 +766,7 @@ int media_info_get_altitude(media_info_h media, double* altitude); * @return @c 0 on success, * otherwise a negative error value * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_NONE Successful * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied */ @@ -779,7 +779,7 @@ int media_info_get_weather(media_info_h media, char **weather); * @param[in] media The media info handle * @param[out] rating The rating of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -796,7 +796,7 @@ int media_info_get_rating(media_info_h media, int *rating); * @param[out] favorite @c true if media info is set as favorite, * otherwise @c false if media info is not set as favorite * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -814,7 +814,7 @@ int media_info_get_favorite(media_info_h media, bool* favorite); * @param[in] media The media info handle * @param[out] author The author of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -833,7 +833,7 @@ int media_info_get_author(media_info_h media, char **author); * @param[in] media The media info handle * @param[out] provider The provider of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -852,7 +852,7 @@ int media_info_get_provider(media_info_h media, char **provider); * @param[in] media The media info handle * @param[out] content_name The content name of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -871,7 +871,7 @@ int media_info_get_content_name(media_info_h media, char **content_name); * @param[in] media The media info handle * @param[out] title The title of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -890,7 +890,7 @@ int media_info_get_title(media_info_h media, char **title); * @param[in] media The media info handle * @param[out] category The category of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -909,7 +909,7 @@ int media_info_get_category(media_info_h media, char **category); * @param[in] media The media info handle * @param[out] location_tag The location of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -928,7 +928,7 @@ int media_info_get_location_tag(media_info_h media, char **location_tag); * @param[in] media The media info handle * @param[out] age_rating The age rating of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -947,7 +947,7 @@ int media_info_get_age_rating(media_info_h media, char **age_rating); * @param[in] media The media info handle * @param[out] keyword The keyword of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -958,6 +958,25 @@ int media_info_get_age_rating(media_info_h media, char **age_rating); int media_info_get_keyword(media_info_h media, char **keyword); /** + * @brief Gets the storage id of media info. + * @since_tizen 2.4 + * + * @remarks You must release @a storage_id using free(). + * + * @param[in] media The media info handle + * @param[out] storage_id The storage id of the media info + * + * @return @c 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied + */ +int media_info_get_storage_id(media_info_h media, char **storage_id); + +/** * @brief Checks whether the media is protected via DRM. * @since_tizen 2.3 * @@ -965,7 +984,7 @@ int media_info_get_keyword(media_info_h media, char **keyword); * @param[out] is_drm @c true if media is DRM media, * otherwise @c false if media is not DRM media * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -981,7 +1000,7 @@ int media_info_is_drm(media_info_h media, bool *is_drm); * @param[in] media The media info handle * @param[out] storage_type The storage type of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1090,7 +1109,7 @@ int media_info_set_played_time(media_info_h media); * @param[in] media The media info handle * @param[in] display_name The display name of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1110,7 +1129,7 @@ int media_info_set_display_name(media_info_h media, const char *display_name); * @param[in] media The media info handle * @param[in] description The description of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1130,7 +1149,7 @@ int media_info_set_description(media_info_h media, const char *description); * @param[in] media The media info handle * @param[in] longitude The longitude of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1149,7 +1168,7 @@ int media_info_set_longitude(media_info_h media, double longitude); * @param[in] media The media info handle * @param[in] latitude The latitude of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1168,7 +1187,7 @@ int media_info_set_latitude(media_info_h media, double latitude); * @param[in] media The media info handle * @param[in] altitude The altitude of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1190,8 +1209,8 @@ int media_info_set_altitude(media_info_h media, double altitude); * @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_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied * @@ -1207,7 +1226,7 @@ int media_info_set_weather(media_info_h media, const char *weather); * @param[in] media The media info handle * @param[in] rating The rating of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1227,7 +1246,7 @@ int media_info_set_rating(media_info_h media, int rating); * @param[in] favorite Set @c true to set the media info as favorite, * otherwise set @c false to not set the media info as favorite * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1244,7 +1263,7 @@ int media_info_set_favorite(media_info_h media, bool favorite); * @param[in] media The media info handle * @param[in] author The author of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1261,7 +1280,7 @@ int media_info_set_author(media_info_h media, const char *author); * @param[in] media The media info handle * @param[in] provider The provider of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1278,7 +1297,7 @@ int media_info_set_provider(media_info_h media, const char *provider); * @param[in] media The media info handle * @param[in] content_name The content name of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1297,7 +1316,7 @@ int media_info_set_content_name(media_info_h media, const char *content_name); * @param[in] media The media info handle * @param[in] category The category of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1316,7 +1335,7 @@ int media_info_set_category(media_info_h media, const char *category); * @param[in] media The media info handle * @param[in] location_tag The location of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1335,7 +1354,7 @@ int media_info_set_location_tag(media_info_h media, const char *location_tag); * @param[in] media The media info handle * @param[in] age_rating The age rating of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1354,7 +1373,7 @@ int media_info_set_age_rating(media_info_h media, const char *age_rating); * @param[in] media The media info handle * @param[in] keyword The keyword of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1382,7 +1401,7 @@ int media_info_set_keyword(media_info_h media, const char *keyword); * * @param[in] media The media info handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1429,7 +1448,7 @@ int media_info_update_to_db(media_info_h media); * * @param[in] media_id The ID of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1454,7 +1473,7 @@ int media_info_refresh_metadata_to_db(const char *media_id); * @param[in] media The media info handle * @param[in] added_time The added time of the media info * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1483,7 +1502,7 @@ int media_info_set_added_time(media_info_h media, time_t added_time); * @param[in] media The media info handle * @param[in] dst_path The path of destination * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1515,7 +1534,7 @@ int media_info_move_to_db(media_info_h media, const char* dst_path); * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -1544,7 +1563,7 @@ int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb * * @param[in] media The media info handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful diff --git a/include/media_playlist.h b/include/media_playlist.h index 0125416..bc3bb73 100755 --- a/include/media_playlist.h +++ b/include/media_playlist.h @@ -44,7 +44,7 @@ extern "C" { * @param[in] filter The handle to the filter * @param[out] playlist_count The count of the media playlist * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -71,7 +71,7 @@ int media_playlist_get_playlist_count_from_db(filter_h filter, int *playlist_cou * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -98,7 +98,7 @@ int media_playlist_foreach_playlist_from_db(filter_h filter, media_playlist_cb c * @param[in] filter The media filter handle * @param[out] media_count The number of media items * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -126,7 +126,7 @@ int media_playlist_get_media_count_from_db(int playlist_id, filter_h filter, int * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -157,7 +157,7 @@ int media_playlist_foreach_media_from_db(int playlist_id, filter_h filter, playl * @param[in] name The name of the inserted playlist * @param[out] playlist A created handle to media playlist * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -185,7 +185,7 @@ int media_playlist_insert_to_db(const char *name, media_playlist_h *playlist); * * @param[in] playlist_id The ID of media playlist * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -216,7 +216,7 @@ int media_playlist_delete_from_db(int playlist_id); * @param[in] playlist_id The ID of the media playlist * @param[out] playlist The media playlist handle associated with the playlist ID * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -243,7 +243,7 @@ int media_playlist_get_playlist_from_db(int playlist_id, media_playlist_h *playl * * @param[in] playlist The media playlist handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -270,7 +270,7 @@ int media_playlist_destroy(media_playlist_h playlist); * @param[in] src The source handle of a media playlist * @param[out] dst The destination handle to a media playlist * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -290,7 +290,7 @@ int media_playlist_clone(media_playlist_h *dst, media_playlist_h src); * @param[in] playlist The media playlist handle * @param[out] playlist_id The ID of the media playlist * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -308,7 +308,7 @@ int media_playlist_get_playlist_id(media_playlist_h playlist, int *playlist_id); * @param[in] playlist The media playlist handle * @param[out] playlist_name The playlist name * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -325,7 +325,7 @@ int media_playlist_get_name(media_playlist_h playlist, char **playlist_name); * @param[in] playlist The media playlist handle * @param[in] playlist_name The name of the media playlist * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -347,7 +347,7 @@ int media_playlist_set_name(media_playlist_h playlist, const char *playlist_name * @param[in] playlist The media playlist handle * @param[out] path The path of the thumbnail * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -364,7 +364,7 @@ int media_playlist_get_thumbnail_path(media_playlist_h playlist, char **path); * @param[in] playlist The media playlist handle * @param[in] path The path of the thumbnail * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -385,7 +385,7 @@ int media_playlist_set_thumbnail_path(media_playlist_h playlist, const char *pat * @param[in] playlist_member_id The playlist member ID * @param[in] play_order The playing order * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -404,7 +404,7 @@ int media_playlist_set_play_order(media_playlist_h playlist, int playlist_member * @param[in] playlist The media playlist handle * @param[in] media_id The ID to the media info which is added * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -427,7 +427,7 @@ int media_playlist_add_media(media_playlist_h playlist, const char *media_id); * @param[in] playlist The media playlist handle * @param[in] playlist_member_id The playlist member ID * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -451,7 +451,7 @@ int media_playlist_remove_media(media_playlist_h playlist, int playlist_member_i * @param[in] playlist_member_id The playlist member ID * @param[out] play_order The played order * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -476,7 +476,7 @@ int media_playlist_get_play_order(media_playlist_h playlist, int playlist_member * * @param[in] playlist The media playlist handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -500,6 +500,60 @@ int media_playlist_get_play_order(media_playlist_h playlist, int playlist_member int media_playlist_update_to_db(media_playlist_h playlist); /** + * @brief Imports the playlist from m3u playlist file. + * @details This api reads a playlist from the m3u playlist file and insert into the db. + * @since_tizen 2.4 + * + * @privlevel public + * @privilege %http://tizen.org/privilege/content.write + * + * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n + * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n + * This api does not support the file of extended m3u playlist. + * + * @param[in] playlist_name The name of the playlist to save + * @param[in] path The path to import the playlist file + * @param[out] playlist The media playlist 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_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 + */ +int media_playlist_import_from_file(const char *playlist_name, const char *path, media_playlist_h *playlist); + +/** + * @brief Exports the playlist to m3u playlist file. + * @since_tizen 2.4 + * + * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n + * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n + * + * @param[in] playlist The media playlist handle + * @param[in] path path The path to export the playlist + * + * @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 + */ +int media_playlist_export_to_file(media_playlist_h playlist, const char* path); + +/** * @} */ diff --git a/include/media_storage.h b/include/media_storage.h new file mode 100755 index 0000000..ee7876f --- /dev/null +++ b/include/media_storage.h @@ -0,0 +1,295 @@ +/* +* 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_MEDIA_STORAGE_H__ +#define __TIZEN_MEDIA_STORAGE_H__ + + +#include + + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @file media_storage.h + * @brief This file contains API on main functional operations with 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. + */ + +/** +* @brief Gets media storage from database. +* @since_tizen 2.4 +* +* @param[in] storage_id The storage id to get media storage info +* @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 +* @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_storage_get_storage_info_from_db(const char *storage_id, media_storage_h *storage); + +/** +* @brief Gets the count of media storage for the passed @a filter from the media database. +* @since_tizen 2.4 +* +* @param[in] filter The handle to 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 +* @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_storage_get_storage_count_from_db(filter_h filter, int *storage_count); + +/** + * @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 2.4 + * + * @param[in] filter The media storage handle 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 + * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied + * + * @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); + +/** + * @brief Gets the count of media files for the passed @a filter in the given @a storage from the media database. + * @since_tizen 2.4 + * + * @param[in] storage_id The ID of the media storage + * @param[in] filter The filter of the media content + * @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 + * @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_storage_get_media_count_from_db(const char *storage_id, filter_h filter, int *media_count); + +/** + * @brief Iterates through the media files with an optional @a filter in the given @a storage from the media database. + * @details This function gets all media files associated with the given storage and + * meeting desired filter option and calls registered callback function for + * every retrieved media item. If @c NULL is passed to the @a filter, no filtering is applied. + * + * @since_tizen 2.4 + * + * @remarks Do not call updating DB function like media_info_update_to_db(), media_info_refresh_metadata_to_db(), audio_meta_update_to_db(), image_meta_update_to_db() and video_meta_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. + * + * @param[in] storage_id The ID of the media storage + * @param[in] filter The handle to the media info 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 + * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied + * + * @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); + +/** + * @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 operation. New media storage handle has to + * be created before the next usage. + * + * @since_tizen 2.4 + * + * @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); + +/** + * @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 2.4 + * + * @remarks You must release the destination handle using media_storage_destroy(). + * + * @param[out] dst The destination handle to the media storage + * @param[in] src The source handle to 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); + +/** + * @brief Gets the storage id of media storage. + * @since_tizen 2.4 + * + * @remarks You must release @a storage_id using free(). + * + * @param[in] storage The media storage handle + * @param[out] storage_id The storage 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); + +/** + * @brief Gets the storage name of media storage. + * @since_tizen 2.4 + * + * @remarks You must release @a storage_name using free(). + * + * @param[in] storage The media storage handle + * @param[out] storage_name The storage name of the media storage + * + * @return @c 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + */ +int media_storage_get_name(media_storage_h storage, char **storage_name); + +/** + * @brief Gets the storage path of media storage. + * @since_tizen 2.4 + * + * @remarks You must release @a storage_path 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); + +/** + * @brief Gets the storage type of media storage. + * @since_tizen 2.4 + * + * @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); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __TIZEN_MEDIA_STORAGE_H__ */ diff --git a/include/media_tag.h b/include/media_tag.h index ed39f1a..a5d51c1 100755 --- a/include/media_tag.h +++ b/include/media_tag.h @@ -51,7 +51,7 @@ extern "C" { * @param[in] tag_name The tag name to be inserted * @param[out] tag The created handle to the media tag * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -80,7 +80,7 @@ int media_tag_insert_to_db(const char *tag_name, media_tag_h *tag); * * @param[in] tag_id The ID of media tag * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -105,7 +105,7 @@ int media_tag_delete_from_db(int tag_id); * @param[in] filter The handle to the filter * @param[out] tag_count The count of the media tag * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -132,7 +132,7 @@ int media_tag_get_tag_count_from_db(filter_h filter, int *tag_count); * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -159,7 +159,7 @@ int media_tag_foreach_tag_from_db (filter_h filter, media_tag_cb callback, void * @param[in] filter The handle to the media filter * @param[out] media_count The count of media items * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -187,7 +187,7 @@ int media_tag_get_media_count_from_db (int tag_id, filter_h filter, int *media_c * @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, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -220,7 +220,7 @@ int media_tag_foreach_media_from_db(int tag_id, filter_h filter, media_info_cb c * @param[out] dst The destination handle to the media tag * @param[in] src The source handle to the media tag * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -241,7 +241,7 @@ int media_tag_clone(media_tag_h *dst, media_tag_h src); * * @param[in] tag The media tag handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -262,7 +262,7 @@ int media_tag_destroy(media_tag_h tag); * @param[in] tag The media tag handle * @param[out] tag_id The ID of the media tag * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -280,7 +280,7 @@ int media_tag_get_tag_id(media_tag_h tag, int *tag_id); * @param[in] tag The media tag handle * @param[out] tag_name The name of the tag * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -303,7 +303,7 @@ int media_tag_get_name(media_tag_h tag, char **tag_name); * @param[in] tag_id The ID of the media tag * @param[out] tag The media tag handle associated with the tag ID * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -327,7 +327,7 @@ int media_tag_get_tag_from_db(int tag_id, media_tag_h *tag); * @param[in] tag The media tag handle * @param[in] media_id The ID to the media info which is added * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -350,7 +350,7 @@ int media_tag_add_media(media_tag_h tag, const char *media_id); * @param[in] tag The media tag handle * @param[in] media_id The ID to the media info which is removed * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -373,7 +373,7 @@ int media_tag_remove_media(media_tag_h tag, const char *media_id); * @param[in] tag The media tag handle * @param[in] tag_name The name of the media tag * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -399,7 +399,7 @@ int media_tag_set_name(media_tag_h tag, char *tag_name); * * @param[in] tag The media tag handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful diff --git a/include/media_video.h b/include/media_video.h index 65c573c..560bb9a 100755 --- a/include/media_video.h +++ b/include/media_video.h @@ -39,7 +39,7 @@ extern "C" { /** * @brief Clones the video metadata. - * @details This function copies the video metadata handle from a source to + * @details This function copies the video metadata handle from a source to * destination. * * @since_tizen 2.3 @@ -49,7 +49,7 @@ extern "C" { * @param[out] dst The destination handle to the video metadata * @param[in] src The source handle to the video metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -71,7 +71,7 @@ int video_meta_clone(video_meta_h *dst, video_meta_h src); * * @param[in] video The video metadata handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -93,7 +93,7 @@ int video_meta_destroy(video_meta_h video); * @param[in] video The video metadata handle * @param[out] media_id The ID of the video * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -114,7 +114,7 @@ int video_meta_get_media_id(video_meta_h video, char **media_id); * @param[in] video The video metadata handle * @param[out] album The video album or @c NULL * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -135,7 +135,7 @@ int video_meta_get_album(video_meta_h video, char **album); * @param[in] video The video metadata handle * @param[out] artist The artist of the video metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -159,9 +159,9 @@ int video_meta_get_artist(video_meta_h video, char **artist); * @return @c 0 on success, * otherwise a negative error value * - * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_NONE Successful * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied */ int video_meta_get_album_artist(video_meta_h video, char **album_artist); @@ -177,7 +177,7 @@ int video_meta_get_album_artist(video_meta_h video, char **album_artist); * @param[in] video The video metadata handle * @param[out] genre The genre of the video metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -198,7 +198,7 @@ int video_meta_get_genre(video_meta_h video, char **genre); * @param[in] video The video metadata handle * @param[out] composer The composer of the video metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -219,7 +219,7 @@ int video_meta_get_composer(video_meta_h video, char **composer); * @param[in] video The video metadata handle * @param[out] year The year of the video metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -238,7 +238,7 @@ int video_meta_get_year(video_meta_h video, char **year); * @param[in] video The video metadata handle * @param[out] recorded_date The recorded date of the video metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -257,7 +257,7 @@ int video_meta_get_recorded_date(video_meta_h video, char **recorded_date); * @param[in] video The video metadata handle * @param[out] copyright The copyright of the video metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -278,7 +278,7 @@ int video_meta_get_copyright(video_meta_h video, char **copyright); * @param[in] video The video metadata handle * @param[out] track_num The track number of the video metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -297,7 +297,7 @@ int video_meta_get_track_num(video_meta_h video, char **track_num); * @param[in] video The video metadata handle * @param[out] bit_rate The bit rate of the video metadata * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -314,7 +314,7 @@ int video_meta_get_bit_rate(video_meta_h video, int *bit_rate); * @param[in] video The video metadata handle * @param[out] duration The video duration in milliseconds * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -330,7 +330,7 @@ int video_meta_get_duration(video_meta_h video, int *duration); * @param[in] video The video metadata handle * @param[out] width The video width in pixels * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -346,7 +346,7 @@ int video_meta_get_width(video_meta_h video, int *width); * @param[in] video The video metadata handle * @param[out] height The video height in pixels * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -356,13 +356,14 @@ int video_meta_get_width(video_meta_h video, int *width); int video_meta_get_height(video_meta_h video, int *height); /** + * @deprecated Deprecated since 2.4. [Use media_info_get_played_count() instead] * @brief Gets the played count of the video. * @since_tizen 2.3 * * @param[in] video The video metadata handle * @param[out] played_count The number of played * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -372,13 +373,14 @@ int video_meta_get_height(video_meta_h video, int *height); int video_meta_get_played_count(video_meta_h video, int *played_count); /** + * @deprecated Deprecated since 2.4. [Use media_info_get_played_time() instead] * @brief Gets the last played time parameter of the video. * @since_tizen 2.3 * * @param[in] video The video metadata handle * @param[out] played_time The time last played in the video * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -388,6 +390,7 @@ int video_meta_get_played_count(video_meta_h video, int *played_count); int video_meta_get_played_time(video_meta_h video, time_t *played_time); /** + * @deprecated Deprecated since 2.4. * @brief Gets the position played parameter of the video. * @details This function returns the elapsed playback time parameter of the video as period * starting from the beginning of the movie. @@ -397,7 +400,7 @@ int video_meta_get_played_time(video_meta_h video, time_t *played_time); * @param[in] video The video metadata handle * @param[out] played_position The position from the beginning of the video (in milliseconds) * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -407,13 +410,14 @@ int video_meta_get_played_time(video_meta_h video, time_t *played_time); int video_meta_get_played_position(video_meta_h video, int *played_position); /** + * @deprecated Deprecated since 2.4. [Use media_info_increase_played_count() instead] * @brief Sets the played count of the video. * @since_tizen 2.3 * * @param[in] video The video metadata handle * @param[in] played_count The number of played * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -425,13 +429,14 @@ int video_meta_get_played_position(video_meta_h video, int *played_position); int video_meta_set_played_count(video_meta_h video, int played_count); /** + * @deprecated Deprecated since 2.4. [Use media_info_set_played_time() instead] * @brief Sets the time last played parameter of the video. * @since_tizen 2.3 * * @param[in] video The video metadata handle * @param[in] played_time The time last played in the video * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -443,16 +448,19 @@ int video_meta_set_played_count(video_meta_h video, int played_count); int video_meta_set_played_time(video_meta_h video, time_t played_time); /** + * @deprecated Deprecated since 2.4. * @brief Sets the position played parameter of the video. * @details This function returns video's elapsed playback time parameter as period * starting from the beginning of the movie. * * @since_tizen 2.3 * + * @remarks It is NOT recommended to use this attribute for your application-specific purpose because this attribute can be overwritten by other applications (even 0). + * * @param[in] video The video metadata handle * @param[in] played_position The position from the beginning of the video (in milliseconds) * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful @@ -479,7 +487,7 @@ int video_meta_set_played_position(video_meta_h video, int played_position); * * @param[in] video The video metadata handle * - * @return @c 0 on success, + * @return @c 0 on success, * otherwise a negative error value * * @retval #MEDIA_CONTENT_ERROR_NONE Successful