summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjk7744.park <jk7744.park@samsung.com>2015-02-01 13:30:28 +0900
committerjk7744.park <jk7744.park@samsung.com>2015-02-01 13:30:28 +0900
commite0657bdb40f86dca11d8cd2ff9aec8c6e7c875ae (patch)
tree86a6b0b0accf9153bc004f438a49d93c6e5e6a41
parent1b40680a5f7fb8e4cfd31b1330301f97fbe21319 (diff)
downloadmedia-content-tizen_2.3.tar.gz
media-content-tizen_2.3.tar.bz2
media-content-tizen_2.3.zip
-rwxr-xr-xdoc/media_content_doc.h580
-rwxr-xr-xinclude/media_audio.h487
-rwxr-xr-xinclude/media_bookmark.h179
-rwxr-xr-xinclude/media_content.h140
-rwxr-xr-xinclude/media_content_type.h554
-rwxr-xr-xinclude/media_filter.h177
-rwxr-xr-xinclude/media_folder.h318
-rwxr-xr-xinclude/media_group.h379
-rwxr-xr-xinclude/media_image.h244
-rwxr-xr-xinclude/media_info.h1373
-rwxr-xr-xinclude/media_info_private.h149
-rwxr-xr-xinclude/media_playlist.h440
-rwxr-xr-xinclude/media_tag.h323
-rwxr-xr-xinclude/media_util_private.h3
-rwxr-xr-xinclude/media_video.h478
-rwxr-xr-xpackaging/capi-content-media-content.spec2
-rwxr-xr-xsrc/media_audio.c51
-rwxr-xr-xsrc/media_content.c254
-rwxr-xr-xsrc/media_db.c33
-rwxr-xr-xsrc/media_filter.c4
-rwxr-xr-xsrc/media_folder.c6
-rwxr-xr-xsrc/media_image.c94
-rwxr-xr-xsrc/media_info.c115
-rwxr-xr-xsrc/media_playlist.c4
-rwxr-xr-xsrc/media_util_private.c21
-rwxr-xr-xsrc/media_video.c32
-rwxr-xr-xtest/media-content_test.c45
27 files changed, 4348 insertions, 2137 deletions
diff --git a/doc/media_content_doc.h b/doc/media_content_doc.h
new file mode 100755
index 0000000..d62a266
--- /dev/null
+++ b/doc/media_content_doc.h
@@ -0,0 +1,580 @@
+/*
+ * 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_DOC_H__
+#define __TIZEN_MEDIA_CONTENT_DOC_H__
+
+/**
+ * @defgroup CAPI_MEDIA_CONTENT_MODULE Media Content
+ * @brief The Media Content API provides functions, enumerations used in the entire Content Service.
+ *
+ * @ingroup CAPI_CONTENT_FRAMEWORK
+ *
+ * @section CAPI_MEDIA_CONTENT_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_MEDIA_CONTENT_MODULE_OVERVIEW Overview
+ * The Media Content API provides functions and enumerations used in the entire Content Service.\n
+ * The information about media items i.e. image, audio and video, are managed in the content database and
+ * operations that involve database requires an active connection with the media content service.\n
+ * The API provides functions for connecting (#media_content_connect()) and disconnecting (#media_content_disconnect()) from the media content service.
+ *
+ * The API consists of @ref CAPI_CONTENT_MEDIA_FOLDER_MODULE,@ref CAPI_CONTENT_MEDIA_TAG_MODULE,@ref CAPI_CONTENT_MEDIA_FILTER_MODULE, @ref CAPI_CONTENT_MEDIA_INFO_MODULE API and others.
+ *
+ * <table>
+ * <tr>
+ * <th>API</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_FOLDER_MODULE </td>
+ * <td> Provide information about folders (e.g. path, name, modification date) stored on the device.\n
+ * Provide information about the media items present in the folders.</td>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_TAG_MODULE </td>
+ * <td> Provide information about media tags.\n
+ * Provide functions to insert or delete tag from database.\n
+ * Provide functions to add and remove media item from tags in the database. </td>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_FILTER_MODULE </td>
+ * <td> Provide functions for creating and destroying media filters.\n
+ * Provide functions to get filter properties</td>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_INFO_MODULE </td>
+ * <td> Provide generic information about media content items (i.e. image, audio, video and others).\n
+ * Provide details about audio files (e.g. name, author, genre etc) present in the device.\n
+ * Provide details about image files (e.g. width, height, orientation etc) present in the device.\n
+ * Provide details about video files (e.g. width, height, duration etc) present in the device .</td>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_PLAYLIST_MODULE </td>
+ * <td> Provide information about the media playlist. </td>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_ALBUM_MODULE </td>
+ * <td> Provide information about the media album. </td>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_GROUP_MODULE </td>
+ * <td> Provide information about the media group(e.g. media artist, composer, genre, year). </td>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_BOOKMARK_MODULE </td>
+ * <td> Provide information about the media bookmark. </td>
+ * </tr>
+ *
+ * </table>
+ *
+ */
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_FOLDER_MODULE Media Folder
+ * @brief The Media folder API provides functions to get information about folders.
+ *
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_FOLDER_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_FOLDER_MODULE_OVERVIEW Overview
+ * A Folder is used to organize media content files i.e. image, audio, video files, in the physical storage of the device.
+ * The Media Folder API provides functions to get basic information about existing folders e.g. folder name, path and storage type.
+ * It also provides functions to get information related to media items present in the folder.
+ *
+ * For getting information about folder call the respective get functions e.g. to get path and name of a given folder call #media_folder_get_path() and #media_folder_get_name() function respectively and so on.\n
+ * Similarly call media_folder_get_media_count_from_db() to get count of media items present in a given folder.
+ * @subsection CAPI_CONTENT_MEDIA_FOLDER_FOREACH_OPERATIONS Foreach Operations
+ * <div><table class="doxtable">
+ * <tr>
+ * <th><b>FOREACH</b></th>
+ * <th><b>CALLBACK</b></th>
+ * <th><b>DESCRIPTION</b></th>
+ * </tr>
+ * <tr>
+ * <td>media_folder_foreach_folder_from_db()</td>
+ * <td>media_folder_cb()</td>
+ * <td>Iterates over a folder information list</td>
+ * </tr>
+ * <tr>
+ * <td>media_folder_foreach_media_from_db()</td>
+ * <td>media_info_cb()</td>
+ * <td>Iterates media information trough the folder</td>
+ * </tr>
+ * </table></div>
+ *
+ *
+ */
+
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_TAG_MODULE Media Tag
+ * @brief The Media Tag API provides functions to manage media content tags.
+ *
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_TAG_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_TAG_MODULE_OVERVIEW Overview
+ * A Tag is a special piece of information that may be associated with media content items.
+ * Tagging allows a user to organize large number of items into logical groups providing a simplified
+ * and faster way of accessing media content items.\n\n
+ * Media Tag API provides functions to get basic information about existing tags and manage tags
+ * associated with Media Information (#media_info_h).
+ * For inserting a new tag to the database call #media_tag_insert_to_db() function and for deleting existing tag from database
+ * call media_tag_delete_from_db() function.\n
+ * A Media item can be associated and dissociated from tags by calling #media_tag_add_media() and #media_tag_remove_media() function respectively.
+ * Finally, #media_tag_update_to_db function should be called so as to update the given item in the media database.
+ *
+ * @subsection CAPI_CONTENT_MEDIA_TAG_FOREACH_OPERATIONS Foreach Operations
+ * <div><table class="doxtable">
+ * <tr>
+ * <th><b>FOREACH</b></th>
+ * <th><b>CALLBACK</b></th>
+ * <th><b>DESCRIPTION</b></th>
+ * </tr>
+ * <tr>
+ * <td>media_tag_foreach_tag_from_db()</td>
+ * <td> media_tag_cb()</td>
+ * <td>Iterates through tags</td>
+ * </tr>
+ * <tr>
+ * <td>media_tag_foreach_media_from_db()</td>
+ * <td>media_info_cb()</td>
+ * <td> Iterates through the media items for a given tag
+ </td>
+ * </tr>
+ * </table></div>
+ *
+ *
+ *
+ */
+
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_FILTER_MODULE Media Filter
+ * @brief The Media Filter API provides functions to manage media filters.
+ *
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_FILTER_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_FILTER_MODULE_OVERVIEW Overview
+ * A Media filter is required for filtering information associated with media Folder, Tag, Audio, Bookmark and Media Information on basis of details like offset, count, order and condition for searching.\n
+ * @ref CAPI_CONTENT_MEDIA_FILTER_MODULE API provides functions for creating and destroying media filters. \n
+ * It provide functions to set properties and also provide functions for getting filter properties associated with a given media filter.
+ *
+ *\n
+ * Setting media filter properties helps to limit the number of filtered items as following:
+ * - Offset - Used to set starting position of the filter's search
+ * - Count - Used to set number of items to be searched from offset
+ * - Condition - Used to set keyword which user want to search
+ * - Order - Used to set type of media to be ordered by the filter
+ *
+ *\n
+ * The Media Filter API provides functions for creating and destroying media filters.\n
+ * It provide functions to set and get properties of the filter associated with a given media filter. \n
+ * For creating a media filter (@ref filter_h), call #media_filter_create() function and call #media_filter_destroy() function for destroying an existing filter. \n
+ * For setting filter properties call the respective set functions e.g. to set offset position, call #media_filter_set_offset() function and
+ * call #media_filter_set_condition() function to set the condition like an sql "where" clause. \n
+ * Searchable expression can use one of the following forms:
+ *
+ *
+ * - column = value
+ * - column > value
+ * - column >= value
+ * - column < value
+ * - column <= value
+ * - value = column
+ * - * - value > column
+ * - value >= column
+ * - value < column
+ * - value <= column
+ * - column IN (value)
+ * - column IN (value-list)
+ * - column NOT IN (value)
+ * - column NOT IN (value-list)
+ * - column LIKE value
+ * - expression1 AND expression2 OR expression3
+ *
+ *\n
+ *
+ * Note that if you want to set qoutation(" ' " or " " ") as value of LIKE operator, you should use two times.(" '' " or " "" ") \n
+ * And the optional ESCAPE clause is supported. Both percent symbol("%") and underscore symbol("_") are used in the LIKE pattern.\n
+ * If these characters are used as value of LIKE operation, then the expression following the ESCAPE caluse of sqlite. \n
+ *
+ * For example,
+ * - column LIKE ('#%') ESCAPE('#') - "#" is escape character, it will be ignored.
+ *\n
+ *
+ *
+ * Similarly, call respective get function to get filter properties e.g. call #media_filter_get_condition() function
+ * to get condition of the media filter and call #media_filter_get_order() function to get order (#media_content_order_e) of the filtered items and so on.
+ *
+**/
+
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_AUDIO_META_MODULE Audio Metadata
+ * @brief The Audio Metadata API provides functions to get information about audio items.
+ *
+ * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_AUDIO_META_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_AUDIO_META_MODULE_OVERVIEW Overview
+ * The Audio Metadata API provides functions to get information about stored audio files.
+ * Its purpose is threefold:
+ * - to provide information about audio content
+ * - to organize audio content logically (grouping)
+ *
+ * API provides functions that allow to check attributes of audio files. Following information about audio content is provided:
+ * - album
+ * - artist
+ * - genre
+ * - composer
+ * - year
+ * - recorded_date
+ * - copyright
+ * - track number
+ * - sample rate
+ * - played count
+ * - played time
+ * - played position
+ * - bitrate
+ *
+ * <p>
+ * For getting the audio handle (#audio_meta_h) from the media information (#media_info_h), call #media_info_get_audio() function.\n
+ * For getting the information related to audio files stored in the device, call the respective get functions e.g. to get the artist of a audio, call #audio_meta_get_artist() function and
+ * to get bitrate of a audio, call #audio_meta_get_bit_rate() function and so on.\n
+ * When the audio handle is no longer needed, it should be destroyed by calling #audio_meta_destroy() function.\n
+ *
+ *
+ *
+ */
+
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE Media Playlist
+ * @brief The Media Playlist API provides functions to manage media playlists.
+ *
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_PLAYLIST_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_PLAYLIST_MODULE_OVERVIEW Overview
+ * A Playlist is a list of songs which can be played in some sequence i.e. sequential or shuffled order.
+ * The Media Playlist API provides functions to insert, delete or updates a media playlist in the database.
+ *
+ * For inserting new playlist (#media_playlist_h) in the database, call #media_playlist_insert_to_db() function and call #media_playlist_delete_from_db() function
+ * to delete a playlist from the database.\n
+ * For adding a media item to the playlist, call #media_playlist_add_media() function, for removing a media item from the playlist, call
+ * #media_playlist_remove_media() function.\n
+ * Finally, #media_playlist_update_to_db() function should be called so as to update the given item in the media database.
+ *
+ * @subsection CAPI_CONTENT_MEDIA_PLAYLIST_FOREACH_OPERATIONS Foreach Operations
+ * <div><table class="doxtable">
+ * <tr>
+ * <th><b>FOREACH</b></th>
+ * <th><b>CALLBACK</b></th>
+ * <th><b>DESCRIPTION</b></th>
+ * </tr>
+ * <tr>
+ * <td>media_playlist_foreach_playlist_from_db()</td>
+ * <td>media_playlist_cb()</td>
+ * <td>Iterates through playlist</td>
+ * </tr>
+ * <tr>
+ * <td>media_playlist_foreach_media_from_db()</td>
+ * <td>media_info_cb()</td>
+ * <td>Iterates through playlist's items</td>
+ * </tr>
+ * </table></div>
+ *
+ *
+ */
+
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_ALBUM_MODULE Media Album
+ * @brief The Media Album API provides information related to album of media items.
+ *
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_ALBUM_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_ALBUM_MODULE_OVERVIEW Overview
+ * An album is a logical collection or grouping of related audio files. It is also used for filtering media items.\n
+ * The Media Album API allows to manage media albums which contains all video and audio items from
+ * the same album.
+ *
+ * The API provides functions to get and search media items in album group.
+ * For getting the count of media items associated with a given album, call #media_album_get_media_count_from_db() function.
+ *
+ * @subsection CAPI_CONTENT_MEDIA_ALBUM_FOREACH_OPERATIONS Foreach Operations
+ * <div><table class="doxtable">
+ * <tr>
+ * <th><b>FOREACH</b></th>
+ * <th><b>CALLBACK</b></th>
+ * <th><b>DESCRIPTION</b></th>
+ * </tr>
+ * <tr>
+ * <td>media_album_foreach_album_from_db()</td>
+ * <td>media_album_cb()</td>
+ * <td>Iterates through albums</td>
+ * </tr>
+ * <tr>
+ * <td>media_album_foreach_media_from_db()</td>
+ * <td>media_info_cb()</td>
+ * <td>Iterates through album's items</td>
+ * </tr>
+ * </table></div>
+ *
+ *
+ */
+
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_GROUP_MODULE Media Group
+ * @brief The Media Group API provides information related to artist of media group.
+ *
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_GROUP_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_GROUP_MODULE_OVERVIEW Overview
+ * A Media Group represents logical grouping of media files with respect to their group name. It is also used for filtering media items.\n
+ *
+ * The API provides functions to get and search image, video and audio items in media group.
+ * For getting the count of media items associated with a given group, call #media_group_get_media_count_from_db() function.
+ *
+ *
+ * @subsection CAPI_CONTENT_MEDIA_GROUP_FOREACH_OPERATIONS Foreach Operations
+ * <div><table class="doxtable">
+ * <tr>
+ * <th><b>FOREACH</b></th>
+ * <th><b>CALLBACK</b></th>
+ * <th><b>DESCRIPTION</b></th>
+ * </tr>
+ * <tr>
+ * <td>media_group_foreach_group_from_db()</td>
+ * <td> media_group_cb()</td>
+ * <td>Iterates through group</td>
+ * </tr>
+ * <tr>
+ * <td>media_group_foreach_media_from_db()</td>
+ * <td>media_info_cb()</td>
+ * <td>Iterates through group's items</td>
+ * </tr>
+ * </table></div>
+ *
+ *
+ */
+
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_IMAGE_MODULE Image Metadata
+ * @brief The Image Metadata API provides functions that allow to get information about
+ * stored image files.
+ *
+ * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_IMAGE_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_IMAGE_MODULE_OVERVIEW Overview
+ * The Image Metadata API provides functions to get basic information associated with image files:
+ * - width
+ * - height
+ * - date taken (when image was created)
+ * - image orientation\n
+ *
+ *<p>
+ * For getting the image handle (#image_meta_h) from the media information (#media_info_h), call #media_info_get_image() function.\n
+ * For getting the information related to image files stored in the device call the respective get functions e.g. to get the width of a image, call #image_meta_get_width() function and
+ * to get orientation (#media_content_orientation_e) of a image, call #image_meta_get_orientation() function and so on.\n
+ * When the image handle is no longer needed, it should be destroyed by calling #image_meta_destroy() function.\n
+ *
+ */
+
+
+
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_VIDEO_META_MODULE Video Metadata
+ * @brief The Video Metadata API provides functions to get information about video files present in the device.
+ *
+ * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_VIDEO_META_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_VIDEO_META_MODULE_OVERVIEW Overview
+ * The Video Metadata API provides functions to get information about video files present in the device.
+ * Following information about video content (#video_meta_h )is provided:
+ * - artist
+ * - album
+ * - genre
+ * - composer
+ * - year
+ * - recorded date
+ * - copyright
+ * - track number
+ * - bit rate
+ * - width
+ * - height
+ * - played count
+ * - played time
+ * - played position
+ * \n
+ * and others.\n
+ *<p>
+ * For getting the video handle (#video_meta_h) from the media information (#media_info_h), call the media_info_get_video() function.\n
+ * For getting the information related to video files stored in the device call the respective get functions e.g. to get duration of the video file
+ * call #video_meta_get_duration() function and so on.\n
+ * When the video handle is no longer needed, it should be destroyed by calling #video_meta_destroy() function.
+ *
+ *
+ *
+ */
+
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_BOOKMARK_MODULE Media Bookmark
+ * @brief The Media Bookmark Information API provides functions to manage bookmark information on the media items.
+ *
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_BOOKMARKINFO_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_BOOKMARKINFO_MODULE_OVERVIEW Overview
+ * A Bookmark allows you to mark interesting moment in a media(video and audio) to enable fast searching.
+ * The Bookmark Information API provides functions to get information about bookmarks associated with video and audio items.
+ *
+ * API allows to:
+ * - get and filter existing bookmarks
+ * - insert new bookmarks
+ * - delete bookmarks
+ *
+ * For inserting a bookmark to media item, call media_bookmark_insert_to_db() function and for deleting already set bookmark from a media, call
+ * #media_bookmark_delete_from_db() function.
+ * For retrieving time where the bookmark is placed on the media, call #media_bookmark_get_marked_time() function.
+ *
+ * @subsection CAPI_CONTENT_MEDIA_BOOKMARKINFO_FOREACH_OPERATIONS Foreach Operations
+ * <div><table class="doxtable" >
+ * <tr>
+ * <th><b>FOREACH</b></th>
+ * <th><b>CALLBACK</b></th>
+ * <th><b>DESCRIPTION</b></th>
+ * </tr>
+ * <tr>
+ * <td>media_info_foreach_bookmark_from_db()</td>
+ * <td>media_bookmark_cb()</td>
+ * <td>Iterates through bookmarks</td>
+ * </tr>
+ *</table></div>
+ *
+ *
+ */
+
+/**
+ * @defgroup CAPI_CONTENT_MEDIA_INFO_MODULE Media Information
+ * @brief The Media Information API provides functions to get information about media items
+ * stored on an internal and external storage.
+ *
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ *
+ * @section CAPI_CONTENT_MEDIA_INFO_MODULE_HEADER Required Header
+ * \#include <media_content.h>
+ *
+ * @section CAPI_CONTENT_MEDIA_INFO_MODULE_OVERVIEW Overview
+ *
+ * The Media Information API provides functions to get basic information e.g. path, date, type etc about media items (#media_info_h) present in the device.
+ * Media Information (#media_info_h) is a generalization of media content of any type (audio, image, video and others).
+ *
+ * Received information about media items can be the processed using dedicated APIs:
+ * <table>
+ * <tr>
+ * <th>API</th>
+ * <th>Description</th>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_INFO_MODULE </td>
+ * <td> Provides details about all items present in the device.\n
+ * Provide functions to get information (e.g. title, size, mime type etc) about the files.</td>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_AUDIO_META_MODULE </td>
+ * <td> Provides details about audio items present in the device.\n
+ * Provide functions to get information (e.g. genre, album, year, bitrate etc) about the audio files.</td>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_IMAGE_MODULE </td>
+ * <td> Provides details about image items present in the device.\n
+ * Provide functions to get information (e.g. longitude, description, date etc) about the image files.</td>
+ * </tr>
+ * <tr>
+ * <td>@ref CAPI_CONTENT_MEDIA_VIDEO_META_MODULE </td>
+ * <td> Provides details about video items present in the device.\n
+ * Provide functions to get information (e.g. title, duration, date etc) about the video files.</td>
+ * </tr>
+ * </table>
+ *
+ * Video and Audio information can be further processed with respect to its properties i.e. playlist, album, using their respective APIs.
+ * - @ref CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
+ * - @ref CAPI_CONTENT_MEDIA_ALBUM_MODULE
+ * - @ref CAPI_CONTENT_MEDIA_BOOKMARK_MODULE
+ *
+ *
+ * @subsection CAPI_CONTENT_MEDIA_INFO_FOREACH_OPERATIONS Foreach Operations
+ * <div><table class="doxtable">
+ * <tr>
+ * <th><b>FOREACH</b></th>
+ * <th><b>CALLBACK</b></th>
+ * <th><b>DESCRIPTION</b></th>
+ * </tr>
+ * <tr>
+ * <td>media_info_foreach_media_from_db()</td>
+ * <td>media_info_cb()</td>
+ * <td>Iterates through items</td>
+ * </tr>
+ * <tr>
+ * <td>media_info_foreach_tag_from_db()</td>
+ * <td>media_tag_cb()</td>
+ * <td>Iterate through tags</td>
+ * </tr>
+ * <tr>
+ * <td>media_info_foreach_bookmark_from_db()</td>
+ * <td>media_bookmark_cb()</td>
+ * <td>Iterate through bookmark</td>
+ * </tr>
+ * </table></div>
+ *
+ *
+ *
+ */
+
+#endif /* __TIZEN_MEDIA_CONTENT_DOC_H__ */
diff --git a/include/media_audio.h b/include/media_audio.h
index f1f345e..274fd38 100755
--- a/include/media_audio.h
+++ b/include/media_audio.h
@@ -26,333 +26,474 @@ extern "C" {
#endif
/**
- * @addtogroup CAPI_CONTENT_MEDIA_AUDIO_META_MODULE
- * @{
- *
- * @file audio_meta.h
+ * @file media_audio.h
* @brief This file contains the audio metadata API and related structure and enumeration. \n
* Description of the audio content involves: album, artist, album_artist, author, genre and description tags. \n
- * Parameters of the recording are also supported, as: format, bitrate, duration, size etc.
+ * Parameters of the recording are also supported such as format, bitrate, duration, size etc.
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_AUDIO_META_MODULE
+ * @{
*/
/**
- * @brief Destroys audio metadata.
+ * @brief Destroys the audio metadata.
+ * @since_tizen 2.3
+ *
+ * @param[in] audio The audio metadata handle
*
- * @param [in] audio The handle to audio metadata.
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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 audio metadata handle handle by calling audio_meta_clone()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre Get a copy of audio metadata handle handle by calling audio_meta_clone().
+ *
* @see audio_meta_clone()
*/
int audio_meta_destroy(audio_meta_h audio);
/**
- * @brief Clones audio metadata.
- * @details Function copies the audio metadata handle handle from source to destination.
+ * @brief Clones the audio metadata.
+ * @details This function copies the audio metadata handle from source to destination.
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks The destination handle must be released using audio_meta_destroy().
*
- * @remark The destination handle must be released with audio_meta_destroy() by you.
+ * @param[out] dst The destination handle to audio metadata
+ * @param[in] src The source handle to the audio metadata
*
- * @param [out] dst A destination handle to audio metadata
- * @param [in] src The source handle to audio metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @see audio_meta_destroy()
*/
int audio_meta_clone(audio_meta_h *dst, audio_meta_h src);
/**
- * @brief Gets id of audio of given audio metadata.
+ * @brief Gets the audio ID of the given audio metadata.
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a media_id using free().
*
- * @remarks @a audio id must be released with free() by you.
+ * @param[in] audio The audio metadata handle
+ * @param[out] media_id The ID of the audio
*
- * @param [in] audio The handle to audio metadata
- * @param [out] media_id The id of the audio
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int audio_meta_get_media_id(audio_meta_h audio, char **media_id);
/**
- * @brief Gets title of audio of given audio metadata.
+ * @brief Gets the album name of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown".
*
- * @remarks @a audio title must be released with free() by you.
+ * @since_tizen 2.3
*
- * @param [in] audio The handle to audio metadata
- * @param [out] title The title of the audio
- * @return 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 audio_meta_get_title(audio_meta_h audio, char **title);
-
-/**
- * @brief Gets name of album of given audio metadata.\n
- * If the value is an empty string, the method returns "Unknown".
+ * @remarks You must release @a album_name using free().
*
- * @remarks @a album_name must be released with free() by you.
+ * @param[in] audio The audio metadata handle
+ * @param[out] album_name The name of the album
*
- * @param [in] audio The handle to audio metadata
- * @param [out] album_name The name of the album
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int audio_meta_get_album(audio_meta_h audio, char **album_name);
/**
- * @brief Gets name of artist of given audio metadata.\n
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the artist name of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown".
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a artist_name using free().
*
- * @remarks @a artist_name must be released with free() by you.
+ * @param[in] audio The audio metadata handle
+ * @param[out] artist_name The name of the artist
*
- * @param [in] audio The handle to audio metadata
- * @param [out] artist_name The name of the artist
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int audio_meta_get_artist(audio_meta_h audio, char **artist_name);
/**
- * @brief Gets name of album_artist of given audio metadata.\n
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the album artist name of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown".
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a album_artist_name using free().
*
- * @remarks @a album_artist_name must be released with free() by you.
+ * @param[in] audio The audio metadata handle
+ * @param[out] album_artist_name The name of the album artist
*
- * @param [in] audio The handle to audio metadata
- * @param [out] album_artist_name The name of the album_artist
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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_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);
/**
-
- * @brief Gets name of genre of given audio metadata.\n
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the genre name of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown".
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a genre_name using free().
+ *
+ * @param[in] audio The audio metadata handle
+ * @param[out] genre_name The name of the genre
*
- * @remarks @a genre_name must be released with free() by you.
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] audio The handle to audio metadata
- * @param [out] genre_name The name of the genre
- * @return 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_genre(audio_meta_h audio, char **genre_name);
/**
- * @brief Gets name of composer of given audio metadata.\n
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the composer name of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown".
*
- * @remarks @a author_name must be released with free() by you.
+ * @since_tizen 2.3
*
- * @param [in] audio The handle to audio metadata
- * @param [out] author_name The name of the author of audio
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a author_name using free().
+ *
+ * @param[in] audio The audio metadata handle
+ * @param[out] composer_name The name of the author of the audio
+ *
+ * @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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int audio_meta_get_composer(audio_meta_h audio, char **composer_name);
/**
- * @brief Gets year of given audio metadata.\n
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the year of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown".
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a year using free().
*
- * @remarks @a year must be released with free() by you.
+ * @param[in] audio The audio metadata handle
+ * @param[out] year The year of the audio file
*
- * @param [in] audio The handle to audio metadata
- * @param [out] year The year of the audio file
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int audio_meta_get_year(audio_meta_h audio, char **year);
/**
- * @brief Gets recorded date of given audio metadata.
+ * @brief Gets the recorded date of the given audio metadata.
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a recorded_date using free().
+ *
+ * @param[in] audio The audio metadata handle
+ * @param[out] recorded_date The recorded date of the audio file
*
- * @remarks @a recorded date must be released with free() by you.
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] audio The handle to audio metadata
- * @param [out] recorded_date The recorded date of the audio file
- * @return 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_recorded_date(audio_meta_h audio, char **recorded_date);
/**
- * @brief Gets copyright notice of given audio metadata.
+ * @brief Gets the copyright notice of the given audio metadata.
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a copyright using free().
+ *
+ * @param[in] audio The audio metadata handle
+ * @param[out] copyright The audio copyright notice
*
- * @remarks @a copyright must be released with free() by you.
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] audio The handle to audio metadata
- * @param [out] copyright The audio copyright notice
- * @return 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_copyright(audio_meta_h audio, char **copyright);
/**
- * @brief Gets track number of given audio metadata. \n
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the track number of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown".
*
- * @param [in] audio The handle to audio metadata
- * @param [out] track_num The audio track number
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @param[in] audio The audio metadata handle
+ * @param[out] track_num The audio track number
+ *
+ * @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
*/
int audio_meta_get_track_num(audio_meta_h audio, char **track_num);
/**
- * @brief Gets bitrate of given audio metadata in bitrate per second.
+ * @brief Gets the bitrate of the given audio metadata in bitrate per second.
+ * @since_tizen 2.3
*
- * @param [in] audio The handle to audio metadata
- * @param [out] bit_rate The audio bitrate in bit per second [bps]
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] audio The audio metadata handle
+ * @param[out] bit_rate The audio bitrate in bit per second [bps]
+ *
+ * @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
*/
int audio_meta_get_bit_rate(audio_meta_h audio, int *bit_rate);
/**
- * @brief Gets sample rate of given audio metadata.
+ * @brief Gets bit per sample of the given audio metadata.
+ * @since_tizen 2.3
+ *
+ * @param [in] audio The handle to the audio metadata
+ * @param [out] bitpersample The audio bit per sample
+ *
+ * @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
+ */
+
+int audio_meta_get_bitpersample(audio_meta_h audio, int *bitpersample);
+
+/**
+ * @brief Gets the sample rate of the given audio metadata.
+ * @since_tizen 2.3
+ *
+ * @param[in] audio The audio metadata handle
+ * @param[out] sample_rate The audio sample rate[hz]
*
- * @param [in] audio The handle to audio metadata
- * @param [out] sample_rate The audio sample rate[hz]
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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
*/
int audio_meta_get_sample_rate(audio_meta_h audio, int *sample_rate);
/**
- * @brief Gets channel of given audio metadata.
+ * @brief Gets the channel of the given audio metadata.
+ * @since_tizen 2.3
+ *
+ * @param[in] audio The audio metadata handle
+ * @param[out] channel The channel of the audio
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] audio The handle to audio metadata
- * @param [out] channel The channel of audio
- * @return 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
*/
int audio_meta_get_channel(audio_meta_h audio, int *channel);
/**
- * @brief Gets track duration of given audio metadata.
+ * @brief Gets the track duration of the given audio metadata.
+ * @since_tizen 2.3
*
- * @param [in] audio The handle to audio metadata
- * @param [out] duration The audio file duration
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] audio The audio metadata handle
+ * @param[out] duration The audio file duration
+ *
+ * @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
*/
int audio_meta_get_duration(audio_meta_h audio, int *duration);
/**
- * @brief Gets number which represents how many times given audio has been played.
+ * @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
*
- * @param [in] audio The handle to audio metadata
- * @param [out] count_played The counter of audio played
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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
*/
int audio_meta_get_played_count(audio_meta_h audio, int *played_count);
/**
- * @brief Gets the audio's played time parameter.
- * @details Function returns audio's elapsed playback time parameter as period
- * starting from the beginning of the track.
- *
- * @param [in] audio The handle to audio metadata
- * @param [out] played_time The elapsed time of the audio
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] audio The audio metadata handle
+ * @param[out] played_time The elapsed time of the audio
+ *
+ * @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
*/
int audio_meta_get_played_time(audio_meta_h audio, time_t *played_time);
/**
- * @brief Gets the audio's played position parameter.
- * @details Function returns audio's elapsed playback position parameter as period
- * starting from the beginning of the track.
- *
- * @param [in] audio The handle to audio metadata
- * @param [out] played_position The elapsed time of the audio
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] audio The audio metadata handle
+ * @param[out] played_position The elapsed time of the audio
+ *
+ * @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
*/
int audio_meta_get_played_position(audio_meta_h audio, int *played_position);
/**
- * @brief Sets the played count to audio meta handle.
+ * @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,
+ * otherwise a negative error value
*
- * @param [in] audio The handle to audio metadata
- * @param [in] played_count The played count of audio
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post audio_meta_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post audio_meta_update_to_db().
*/
int audio_meta_set_played_count(audio_meta_h audio, int played_count);
/**
- * @brief Sets the played time to audio meta handle.
+ * @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
*
- * @param [in] audio The handle to audio metadata
- * @param [in] played_time The played time of audio
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post audio_meta_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post audio_meta_update_to_db().
*/
int audio_meta_set_played_time(audio_meta_h audio, time_t played_time);
/**
- * @brief Sets the played position to audio meta handle.
+ * @brief Sets the played position to an audio meta handle.
+ * @since_tizen 2.3
+ *
+ * @param[in] audio The audio metadata handle
+ * @param[in] played_position The played position of the audio
*
- * @param [in] audio The handle to audio metadata
- * @param [in] played_position The played position of audio
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post audio_meta_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post audio_meta_update_to_db().
*/
int audio_meta_set_played_position(audio_meta_h audio, int played_position);
/**
- * @brief Updates audio metadata which is modified attributes to the media database.
+ * @brief Updates an audio metadata with modified attributes in the media database.
+ * @details The function updates the given audio meta in the media database.
*
- * @details The function updates the given audio meta in the media database.\n
- * The function should be called after any change in the attributes, to be updated to the media database.\n
- * For example, after using audio_meta_set_played_count() for changing the count of the played,
- * audio_meta_update_to_db() function should be called so as to update the given the attibutes in the media database.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
*
- * @param [in] audio The handle to audio metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks The function should be called after any change in the attributes, to update the media database.
+ * For example, after using audio_meta_set_played_count() for changing the count of the played, the
+ * audio_meta_update_to_db() function should be called to update the given attributes in the media database. \n
+ * Do not call this function in callback function of foreach function like media_info_foreach_media_from_db().
+ *
+ * @param[in] audio The audio metadata 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_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see audio_meta_set_played_count()
* @see audio_meta_set_played_time()
diff --git a/include/media_bookmark.h b/include/media_bookmark.h
index 3f73766..3d80ff7 100755
--- a/include/media_bookmark.h
+++ b/include/media_bookmark.h
@@ -25,130 +25,187 @@
extern "C" {
#endif /* __cplusplus */
+/**
+ * @file media_bookmark.h
+ * @brief This file contains API on main functional operations with bookmarks that are related to media resources in the media database. \n
+ * Operations include: inserting a new bookmark in media to the media database, removing bookmark from database, \n
+ * getting number of bookmarks, cloning and destroying bookmark, getting bookmark`s ID, time marked parameter and thumbnail.
+ */
/**
* @addtogroup CAPI_CONTENT_MEDIA_BOOKMARK_MODULE
* @{
- *
- * @file media_bookmark.h
- * @brief This file contains API on main functional operations with bookmarks that are related to media resources in the media database. \n
- * Operations include: inserting a new bookmark in media to the media database, removing bookmark from database, \n
- * getting number of bookmarks, cloning and destroying bookmark, getting bookmark`s id, time marked parameter and thumbnail.
*/
/**
- * @brief Inserts a new bookmark in media on specified time offset to the media database.
+ * @brief Inserts a new bookmark in media on the specified time offset to the media database.
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] media_id The media ID
+ * @param[in] time The bookmark time offset (in seconds)
+ * @param[in] thumbnail_path The thumbnail path of video bookmark\ n
+ * If the media type is audio, then thumbnail is null.
*
- * @param [in] media_id The id of media
- * @param [in] time The bookmark time offset(in seconds)
- * @param [in] thumbnail_path The thumbnail path of video bookmark. If the media type is audio, then thumbnail is null.
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_bookmark_delete_from_db()
- *
*/
int media_bookmark_insert_to_db(const char *media_id, time_t time, const char *thumbnail_path);
/**
- * @brief Removes media bookmark from the media database.
+ * @brief Removes a media bookmark from the media database.
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] bookmark_id The ID of media bookmark
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] bookmark The handle to media bookmark
- * @return 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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_bookmark_insert_to_db()
- *
*/
int media_bookmark_delete_from_db(int bookmark_id);
/**
- * @brief Gets number of bookmark with optional filter from media database.
+ * @brief Gets the number of bookmarks with an optional filter from the media database.
+ * @since_tizen 2.3
+ *
+ * @param[in] filter The handle to the media filter
+ * @param[out] bookmark_count The count of the media bookmark
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] filter The handle to media filter
- * @param [out] bookmark_count The count of media bookmark
- * @return 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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
*/
int media_bookmark_get_bookmark_count_from_db(filter_h filter, int *bookmark_count);
/**
- * @brief Clones media bookmark.
+ * @brief Clones a media bookmark.
* @details This function copies the media bookmark handle from a source to destination. There is no media_bookmark_create() function.
- * The media_bookmark_h is created internally and available through media bookmark foreach function such as media_info_foreach_bookmark_from_db().
- * To use this handle outside of these foreach functions, use this function.
+ * The media_bookmark_h is created internally and available through media bookmark foreach function such as media_info_foreach_bookmark_from_db().
+ * To use this handle outside of these foreach functions, use this function.
+ *
+ * @since_tizen 2.3
*
- * @remark The destination handle must be released with media_bookmark_destroy() by you.
+ * @remarks The destination handle must be released using media_bookmark_destroy().
*
- * @param [out] dst A destination handle to media bookmark
- * @param [in] src The source handle to media bookmark
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[out] dst The destination handle to media bookmark
+ * @param[in] src The source handle to media bookmark
+ *
+ * @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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @see media_bookmark_destroy()
* @see media_info_foreach_bookmark_from_db()
- *
*/
int media_bookmark_clone(media_bookmark_h *dst, media_bookmark_h src);
/**
- * @brief Destroys media bookmark.
- * @details Function frees all resources related to bookmark handle. This handle
- * no longer can be used to perform any operation. A new handle has to
- * be created before the next use.
- *
- * @param [in] bookmark The handle to media bookmark
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @brief Destroys a media bookmark.
+ * @details This function frees all the resources related to the bookmark handle. This handle
+ * no longer can be used to perform any operation. A new handle has to
+ * be created before the next use.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] bookmark The handle to media bookmark
+ *
+ * @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 bookmark handle by calling media_bookmark_clone()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre Get copy of bookmark handle by calling media_bookmark_clone().
+ *
* @see media_bookmark_clone()
*/
int media_bookmark_destroy(media_bookmark_h bookmark);
/**
- * @brief Gets bookmark's id.
+ * @brief Gets the bookmark ID.
+ * @since_tizen 2.3
+ *
+ * @param[in] bookmark The handle to media bookmark
+ * @param[out] bookmark_id The media bookmark ID
*
- * @param [in] bookmark The handle to media bookmark
- * @param [out] bookmark_id The id of media bookmark
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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
*/
int media_bookmark_get_bookmark_id(media_bookmark_h bookmark, int *bookmark_id);
/**
- * @brief Gets bookmark's time marked parameter.
- * @details Function returns time offset in milliseconds from beginning of the movie on which bookmark
- * was placed.
- *
- * @param [in] bookmark The handle to media bookmark
- * @param [out] marked_time The bookmark time offset(in milliseconds)
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @brief Gets the bookmark time marked parameter.
+ * @details This function returns time offset in milliseconds from beginning of the movie on which bookmark
+ * was placed.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] bookmark The handle to media bookmark
+ * @param[out] marked_time The bookmark time offset (in milliseconds)
+ *
+ * @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
*/
int media_bookmark_get_marked_time(media_bookmark_h bookmark, time_t *marked_time);
/**
- * @brief Gets the media bookmark's thumbnail.
+ * @brief Gets the media bookmark thumbnail.
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a path using free().
+ *
+ * @param[in] bookmark The handle to media bookmark
+ * @param[out] path The thumbnail path of media bookmark
*
- * @remarks @a path must be released with free() by you.
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] bookmark The handle to media bookmark
- * @param [out] path The thumbnail path of media bookmark
- * @return 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 media_bookmark_get_thumbnail_path(media_bookmark_h bookmark, char **path);
diff --git a/include/media_content.h b/include/media_content.h
index 141e4fd..665d414 100755
--- a/include/media_content.h
+++ b/include/media_content.h
@@ -29,42 +29,57 @@
#include <media_playlist.h>
#include <media_bookmark.h>
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/**
+ * @file media_content.h
+ * @brief This file contains API providing functions for media content in DB. \n
+ * Operations include connect and disconnect the media content service, scanning media file and folder with subfolders, \n
+ * subscribing and unsubscribing notifications of media DB change.
+ */
+
+/**
* @addtogroup CAPI_MEDIA_CONTENT_MODULE
* @{
- * @file media-content.h
- * @brief This file contains API on functions proceeding with media content in db. \n
- * Operations include connect and disconnect the media content service,scanning media file and folder with subfolders, \n
- * subscribing and unsubscribing notifications of media db change.
*/
/**
* @brief Connects to the media content service.
* @details Any media content related function call should be invoked after this function call.
*
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @post media_content_disconnect()
- * @see media_content_disconnect()
*
+ * @see media_content_disconnect()
*/
int media_content_connect(void);
/**
* @brief Disconnects from the media content service.
* @details This function closes connection to the media content service. Any further media content related operation
- * cannot be performed after this function is called.
+ * cannot be performed after this function is called.
*
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre media_content_connect()
+ *
* @see media_content_connect()
*
*/
@@ -72,59 +87,106 @@ int media_content_disconnect(void);
/**
* @brief Requests to scan a media file.
- * @details This function requests to scan a media file to media server.
- * if media file was not registered to db yet, that media file information will be added to media db. And if already registered to db, then try to refresh information.
- * if requested file is not exist on file system, information of the media file will be removed from media db.
+ * @details This function requests to scan a media file to the media server.
+ * If media file is not registered to DB yet, that media file information will be added to the media DB. If it is already registered to the DB, then this tries to refresh information.
+ * If requested file does not exist on file system, information of the media file will be removed from the media DB.
+ *
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ * %http://tizen.org/privilege/mediastorage \n
+ * %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
+ * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
+ * If you can access both storage, you must add all privilege.
+ *
* @param[in] path The file path
- * @return 0 on success, otherwise a negative error value.
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @pre This function requires opened connection to content service by media_content_connect().
*/
int media_content_scan_file(const char *path);
-
/**
* @brief Requests to scan a media folder, asynchronously.
- * @details This function requests to scan a media folder to media server with given completed callback fucntion.
- * #media_scan_completed_cb() function will be called when the scanning is finished.
- * The sub folders are also scanned, if there are sub folder in that folder. \n
- * If you want that the any folders are not scanned, you have to create a blank file ".scan_ignore" in that folder.
- * @param[in] path The folder path
- * @param[in] is_recursive /@a true if scan recursively subdirectories,
- * /@a false if scan only current directory,
- * @param[in] callback The callback to invoke when the scanning is finished
- * @param[in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
+ * @details This function requests to scan a media folder to the media server with given completed callback function.
+ * media_scan_completed_cb() function will be called when the scanning is finished.
+ * The sub folders are also scanned, if there are sub folders in that folder. \n
+ * If any folder must not be scanned, a blank file ".scan_ignore" has to be created in that folder.
+ *
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ * %http://tizen.org/privilege/mediastorage \n
+ * %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
+ * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
+ * If you can access both storage, you must add all privilege.
+ *
+ * @param[in] path The folder path
+ * @param[in] is_recursive Set @c true to scan recursively subdirectories,
+ * otherwise @c false to scan only the current directory
+ * @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,
+ * otherwise a negative error value
+ *
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @see media_scan_completed_cb()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @see media_scan_completed_cb()
*/
int media_content_scan_folder(const char *path, bool is_recursive, media_scan_completed_cb callback, void *user_data);
/**
- * @brief Subscribe notifications of media db change.
- * @details This function subscribes notifications of media db change, which are published by media server or other apps.
- * #media_content_db_update_cb() function will be called when notification of media db change is subscribed.
- * @param[in] callback The callback to invoke when the scanning is finished
+ * @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.
+ *
+ * @since_tizen 2.3
+ *
+ * @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 0 on success, otherwise a negative error value.
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @see media_content_db_update_cb()
* @see media_content_unset_db_updated_cb()
- *
*/
int media_content_set_db_updated_cb(media_content_db_update_cb callback, void *user_data);
/**
-
- * @brief Unsubscribe notifications of media db change.
- * @details This function unsubscribes notifications of media db change, which are published by media server or other apps.
- * @return 0 on success, otherwise a negative error value.
+ * @brief Unsubscribes notifications of the media DB change.
+ * @details This function unsubscribes notifications of the media DB change which are published by the media server or other apps.
+ *
+ * @since_tizen 2.3
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre media_content_set_db_updated_cb()
- * @see media_content_set_db_updated_cb()
*
+ * @see media_content_set_db_updated_cb()
*/
int media_content_unset_db_updated_cb(void);
diff --git a/include/media_content_type.h b/include/media_content_type.h
index 5c613d6..a3f9a6d 100755
--- a/include/media_content_type.h
+++ b/include/media_content_type.h
@@ -31,207 +31,213 @@ extern "C" {
#endif
/**
+ * @file media_content_type.h
+ * @brief This file contains API related to media-content enumerations for media data types, groups, orientations, \n
+ * classes of errors and definitions of media-data. \n
+ * Listed APIs are called when iterating over lists of album, group, bookmark and other media, \n
+ * when media items and burst shot are inserted completely and when notification of media DB change is subscribed.
+ */
+
+/**
* @addtogroup CAPI_MEDIA_CONTENT_MODULE
* @{
- * @file media-content.h
- * @brief This file contains API related to media-content enumerations for media data types, groups, orientations, \n
- * classes of errors and definitions of media-data. \n
- * Listed APIs are called when iterating over lists of album, group, bookmark and other media, \n
- * when media items and burst shot are inserted completely and when notification of media db change is subscribed.
*/
/**
* @ingroup CAPI_MEDIA_CONTENT_MODULE
- * @brief The enumerations of the media file format.
+ * @brief Enumeration for the media file format.
*/
typedef enum
{
- MEDIA_CONTENT_TYPE_IMAGE = 0, /**<The type of image */
- MEDIA_CONTENT_TYPE_VIDEO = 1, /**<The type of video */
- MEDIA_CONTENT_TYPE_SOUND = 2, /**<The type of sound */
- MEDIA_CONTENT_TYPE_MUSIC = 3, /**<The type of music */
- MEDIA_CONTENT_TYPE_OTHERS = 4, /**<The type of other */
+ MEDIA_CONTENT_TYPE_IMAGE = 0, /**<The type of an image */
+ MEDIA_CONTENT_TYPE_VIDEO = 1, /**<The type of a video */
+ MEDIA_CONTENT_TYPE_SOUND = 2, /**<The type of sound */
+ MEDIA_CONTENT_TYPE_MUSIC = 3, /**<The type of music */
+ MEDIA_CONTENT_TYPE_OTHERS = 4, /**<The type of other */
} media_content_type_e;
/**
* @ingroup CAPI_CONTENT_MEDIA_FOLDER_MODULE
- * @brief The enumerations of the storage type.
- * @detail This information is used to establish where the folder is.
+ * @brief Enumeration for the storage type.
+ * @details This information is used to establish where the folder is.
*/
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_e;
/**
* @ingroup CAPI_MEDIA_CONTENT_MODULE
- * @brief The enumerations of media content db update item
+ * @brief Enumeration for media content DB update items.
*/
typedef enum {
- MEDIA_ITEM_FILE = 0, /**< File type ,an item updated to db */
- MEDIA_ITEM_DIRECTORY = 1, /**< Directory type, an item updated to db */
+ MEDIA_ITEM_FILE = 0, /**< File type, an item updated to DB */
+ MEDIA_ITEM_DIRECTORY = 1, /**< Directory type, an item updated to DB */
} media_content_db_update_item_type_e;
/**
* @ingroup CAPI_MEDIA_CONTENT_MODULE
- * @brief The enumerations of media content db update type
+ * @brief Enumeration for media content DB update types.
*/
typedef enum {
- MEDIA_CONTENT_INSERT = 0, /**< Insert, the type of DB update */
- MEDIA_CONTENT_DELETE = 1, /**< Delete, The type of DB update */
- MEDIA_CONTENT_UPDATE = 2, /**< Update, The type of DB update */
+ MEDIA_CONTENT_INSERT = 0, /**< Insert, the type of DB update */
+ MEDIA_CONTENT_DELETE = 1, /**< Delete, The type of DB update */
+ MEDIA_CONTENT_UPDATE = 2, /**< Update, The type of DB update */
} media_content_db_update_type_e;
/**
* @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
- * @brief The type of orientation.
+ * @brief Enumeration for orientation types.
*/
typedef enum {
- MEDIA_CONTENT_ORIENTATION_NOT_AVAILABLE = 0, /**< Not available*/
- MEDIA_CONTENT_ORIENTATION_NORMAL = 1, /**< Normal*/
- MEDIA_CONTENT_ORIENTATION_HFLIP = 2, /**< Flip horizontal*/
- MEDIA_CONTENT_ORIENTATION_ROT_180 = 3, /**< Rotate 180 degrees*/
- MEDIA_CONTENT_ORIENTATION_VFLIP = 4, /**< Flip vertical*/
- MEDIA_CONTENT_ORIENTATION_TRANSPOSE = 5, /**< Transpose*/
- MEDIA_CONTENT_ORIENTATION_ROT_90 = 6, /**< Rotate 90 degrees*/
- MEDIA_CONTENT_ORIENTATION_TRANSVERSE = 7, /**< Transverse*/
- MEDIA_CONTENT_ORIENTATION_ROT_270 = 8, /**< Rotate 270 degrees*/
+ MEDIA_CONTENT_ORIENTATION_NOT_AVAILABLE = 0, /**< Not available*/
+ MEDIA_CONTENT_ORIENTATION_NORMAL = 1, /**< Normal*/
+ MEDIA_CONTENT_ORIENTATION_HFLIP = 2, /**< Flip horizontal*/
+ MEDIA_CONTENT_ORIENTATION_ROT_180 = 3, /**< Rotate 180 degrees*/
+ MEDIA_CONTENT_ORIENTATION_VFLIP = 4, /**< Flip vertical*/
+ MEDIA_CONTENT_ORIENTATION_TRANSPOSE = 5, /**< Transpose*/
+ MEDIA_CONTENT_ORIENTATION_ROT_90 = 6, /**< Rotate 90 degrees*/
+ MEDIA_CONTENT_ORIENTATION_TRANSVERSE = 7, /**< Transverse*/
+ MEDIA_CONTENT_ORIENTATION_ROT_270 = 8, /**< Rotate 270 degrees*/
} media_content_orientation_e;
/**
* @ingroup CAPI_MEDIA_CONTENT_MODULE
- * @brief The enumerations of ordering.
+ * @brief Enumeration for ordering.
*/
typedef enum
{
- MEDIA_CONTENT_ORDER_ASC = 0, /**< ascending order*/
- MEDIA_CONTENT_ORDER_DESC = 1, /**< descending order*/
+ MEDIA_CONTENT_ORDER_ASC = 0, /**< Ascending order*/
+ MEDIA_CONTENT_ORDER_DESC = 1, /**< Descending order*/
} media_content_order_e;
/**
* @ingroup CAPI_MEDIA_CONTENT_MODULE
- * @brief The enumerations of collations.
+ * @brief Enumeration for collations.
*/
typedef enum
{
- MEDIA_CONTENT_COLLATE_DEFAULT = 0, /**< default collation BINARY */
- MEDIA_CONTENT_COLLATE_NOCASE = 1, /**< collation NOCASE, not case sensitive */
- MEDIA_CONTENT_COLLATE_RTRIM = 2, /**< collation RTRIM, trailing space characters are ignored */
- MEDIA_CONTENT_COLLATE_LOCALIZED = 3, /**< collation LOCALIZATION, NOCASE also applied */
+ MEDIA_CONTENT_COLLATE_DEFAULT = 0, /**< Default collation BINARY */
+ MEDIA_CONTENT_COLLATE_NOCASE = 1, /**< Collation NOCASE, not case sensitive */
+ MEDIA_CONTENT_COLLATE_RTRIM = 2, /**< Collation RTRIM, trailing space characters are ignored */
+ MEDIA_CONTENT_COLLATE_LOCALIZED = 3, /**< Collation LOCALIZATION, NOCASE also applied */
} media_content_collation_e;
+#define MEDIA_CONTENT_ERROR_CLASS TIZEN_ERROR_MEDIA_CONTENT
+
/**
* @ingroup CAPI_MEDIA_CONTENT_MODULE
- * @brief The enumerations of media content error
+ * @brief Enumeration for a media content error.
*/
-typedef enum
+ typedef enum
{
- MEDIA_CONTENT_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- MEDIA_CONTENT_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- MEDIA_CONTENT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- MEDIA_CONTENT_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid Operation */
- MEDIA_CONTENT_FILE_NO_SPACE_ON_DEVICE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on device */
- MEDIA_CONTENT_ERROR_DB_FAILED = TIZEN_ERROR_CONTENT_CLASS | 0x01, /**< DB operation failed */
- MEDIA_CONTENT_ERROR_DB_BUSY = TIZEN_ERROR_CONTENT_CLASS | 0x02, /**< DB operation BUSY */
- MEDIA_CONTENT_ERROR_NETWORK = TIZEN_ERROR_CONTENT_CLASS | 0x03, /**< Network Fail */
- MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT = TIZEN_ERROR_CONTENT_CLASS | 0x04, /**< Unsupported Content */
+ MEDIA_CONTENT_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ MEDIA_CONTENT_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ MEDIA_CONTENT_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ MEDIA_CONTENT_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid Operation */
+ MEDIA_CONTENT_FILE_NO_SPACE_ON_DEVICE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on device */
+ MEDIA_CONTENT_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+ MEDIA_CONTENT_ERROR_DB_FAILED = MEDIA_CONTENT_ERROR_CLASS | 0x01, /**< DB operation failed */
+ MEDIA_CONTENT_ERROR_DB_BUSY = MEDIA_CONTENT_ERROR_CLASS | 0x02, /**< DB operation BUSY */
+ MEDIA_CONTENT_ERROR_NETWORK = MEDIA_CONTENT_ERROR_CLASS | 0x03, /**< Network Fail */
+ MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT = MEDIA_CONTENT_ERROR_CLASS | 0x04, /**< Unsupported Content */
} media_content_error_e;
/**
* @ingroup CAPI_MEDIA_CONTENT_MODULE
- * @brief The enumerations of media group
+ * @brief Enumeration for a media group.
*/
typedef enum {
- MEDIA_CONTENT_GROUP_DISPLAY_NAME = 0,
- MEDIA_CONTENT_GROUP_TYPE,
- MEDIA_CONTENT_GROUP_MIME_TYPE,
- MEDIA_CONTENT_GROUP_SIZE,
- MEDIA_CONTENT_GROUP_ADDED_TIME,
- MEDIA_CONTENT_GROUP_MODIFIED_TIME,
- MEDIA_CONTENT_GROUP_TITLE,
- MEDIA_CONTENT_GROUP_ARTIST,
- MEDIA_CONTENT_GROUP_ALBUM_ARTIST,
- MEDIA_CONTENT_GROUP_GENRE,
- MEDIA_CONTENT_GROUP_COMPOSER,
- MEDIA_CONTENT_GROUP_YEAR,
- MEDIA_CONTENT_GROUP_RECORDED_DATE,
- MEDIA_CONTENT_GROUP_COPYRIGHT,
- MEDIA_CONTENT_GROUP_TRACK_NUM,
- MEDIA_CONTENT_GROUP_DESCRIPTION,
- MEDIA_CONTENT_GROUP_LONGITUDE,
- MEDIA_CONTENT_GROUP_LATITUDE,
- MEDIA_CONTENT_GROUP_ALTITUDE,
- MEDIA_CONTENT_GROUP_BURST_IMAGE,
- MEDIA_CONTENT_GROUP_RATING,
- MEDIA_CONTENT_GROUP_AUTHOR,
- MEDIA_CONTENT_GROUP_PROVIDER,
- MEDIA_CONTENT_GROUP_CONTENT_NAME,
- MEDIA_CONTENT_GROUP_CATEGORY,
- MEDIA_CONTENT_GROUP_LOCATION_TAG,
- MEDIA_CONTENT_GROUP_AGE_RATING,
- MEDIA_CONTENT_GROUP_KEYWORD,
- MEDIA_CONTENT_GROUP_WEATHER,
- MEDIA_CONTENT_GROUP_MAX
+ MEDIA_CONTENT_GROUP_DISPLAY_NAME = 0, /**< Media group ID for display name */
+ MEDIA_CONTENT_GROUP_TYPE, /**< Media group ID for a media type */
+ MEDIA_CONTENT_GROUP_MIME_TYPE, /**< Media group ID for a mime type */
+ MEDIA_CONTENT_GROUP_SIZE, /**< Media group ID for content size */
+ MEDIA_CONTENT_GROUP_ADDED_TIME, /**< Media group ID for the added time */
+ MEDIA_CONTENT_GROUP_MODIFIED_TIME, /**< Media group ID for the modified time */
+ MEDIA_CONTENT_GROUP_TITLE, /**< Media group ID for a content title */
+ MEDIA_CONTENT_GROUP_ARTIST, /**< Media group ID for an artist*/
+ MEDIA_CONTENT_GROUP_ALBUM_ARTIST, /**< Media group ID for an album artist */
+ MEDIA_CONTENT_GROUP_GENRE, /**< Media group ID for a genre*/
+ MEDIA_CONTENT_GROUP_COMPOSER, /**< Media group ID for a composer*/
+ MEDIA_CONTENT_GROUP_YEAR, /**< Media group ID for a year*/
+ MEDIA_CONTENT_GROUP_RECORDED_DATE, /**< Media group ID for the recorded date*/
+ MEDIA_CONTENT_GROUP_COPYRIGHT, /**< Media group ID for the copyright*/
+ MEDIA_CONTENT_GROUP_TRACK_NUM, /**< Media group ID for a track number*/
+ MEDIA_CONTENT_GROUP_DESCRIPTION, /**< Media group ID for a description */
+ MEDIA_CONTENT_GROUP_LONGITUDE, /**< Media group ID for the longitude*/
+ MEDIA_CONTENT_GROUP_LATITUDE, /**< Media group ID for the latitude*/
+ MEDIA_CONTENT_GROUP_ALTITUDE, /**< Media group ID for the altitude*/
+ MEDIA_CONTENT_GROUP_BURST_IMAGE, /**< Media group ID for the burst shot*/
+ MEDIA_CONTENT_GROUP_RATING, /**< Media group ID for a rating*/
+ MEDIA_CONTENT_GROUP_AUTHOR, /**< Media group ID for an author*/
+ MEDIA_CONTENT_GROUP_PROVIDER, /**< Media group ID for a provider*/
+ MEDIA_CONTENT_GROUP_CONTENT_NAME, /**< Media group ID for the content name*/
+ MEDIA_CONTENT_GROUP_CATEGORY, /**< Media group ID for a category*/
+ MEDIA_CONTENT_GROUP_LOCATION_TAG, /**< Media group ID for a location tag*/
+ MEDIA_CONTENT_GROUP_AGE_RATING, /**< Media group ID for an age rating*/
+ MEDIA_CONTENT_GROUP_KEYWORD, /**< Media group ID for a keyword*/
+ MEDIA_CONTENT_GROUP_WEATHER, /**< Media group ID for the weather*/
+ MEDIA_CONTENT_GROUP_MAX /**< Max count of the media group ID */
} media_group_e;
/**
* @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
- * @brief The handle to media info.
+ * @brief The structure type for the Media info handle.
*/
typedef struct media_info_s *media_info_h;
/**
* @ingroup CAPI_CONTENT_MEDIA_FOLDER_MODULE
- * @brief The handle to media folder.
+ * @brief The structure type for the Media folder handle.
*/
typedef struct media_folder_s *media_folder_h;
/**
* @ingroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
- * @brief The handle to media playlist.
+ * @brief The structure type for the Media playlist handle.
*/
typedef struct media_playlist_s *media_playlist_h;
/**
* @ingroup CAPI_CONTENT_MEDIA_TAG_MODULE
- * @brief The handle to media tag.
+ * @brief The structure type for the Media tag handle.
*/
typedef struct media_tag_s *media_tag_h;
/**
* @ingroup CAPI_CONTENT_MEDIA_BOOKMARK_MODULE
- * @brief The handle to media bookmark.
+ * @brief The structure type for the Media bookmark handle.
*/
typedef struct media_bookmark_s *media_bookmark_h;
/**
* @ingroup CAPI_CONTENT_MEDIA_ALBUM_MODULE
- * @brief The handle to media album.
+ * @brief The structure type for the Media album handle.
*/
typedef struct media_album_s *media_album_h;
/**
* @ingroup CAPI_CONTENT_MEDIA_IMAGE_MODULE
- * @brief The handle to image metadata.
+ * @brief The structure type for the Image metadata handle.
*/
typedef struct image_meta_s *image_meta_h;
/**
* @ingroup CAPI_CONTENT_MEDIA_VIDEO_META_MODULE
- * @brief The handle to video metadata.
+ * @brief The structure type for the Video metadata handle.
*/
typedef struct video_meta_s *video_meta_h;
/**
* @ingroup CAPI_CONTENT_MEDIA_AUDIO_META_MODULE
- * @brief The handle to audio metadata.
+ * @brief The structure type for the Audio metadata handle.
*/
typedef struct audio_meta_s *audio_meta_h;
/**
* @ingroup CAPI_CONTENT_MEDIA_FILTER_MODULE
- * @brief The handle to media filter.
+ * @brief The structure type for the Media filter handle.
*/
typedef struct filter_s *filter_h;
@@ -239,9 +245,11 @@ typedef struct filter_s *filter_h;
* @ingroup CAPI_MEDIA_CONTENT_MODULE
* @brief Called when the media scanning is finished.
*
- * @param[in] error The error code
+ * @param[in] error The error code
* @param[in] user_data The user data passed from the foreach function
- * @pre media_content_scan()
+ *
+ * @pre media_content_scan().
+ *
* @see media_content_scan()
*
*/
@@ -249,47 +257,50 @@ typedef void (*media_scan_completed_cb)(media_content_error_e error, void * user
/**
* @ingroup CAPI_MEDIA_CONTENT_MODULE
- * @brief Called when notification of media db change is subscribed.
- *
- * @param[in] error The error code
- * @param[in] pid pid which publish notification
- * @param[in] update_item Update item of notification
- * @param[in] update_type Update type of notification
- * @param[in] media_type The type of media content(#media_content_type_e)
- * @param[in] uuid UUID of media or directory, which is updated
- * @param[in] path The path of media or directory
- * @param[in] mime_type The mime type of media info
- * @param[in] user_data The user data passed from the foreach function
- * @pre media_content_db_update_subscribe()
+ * @brief Called when the notification of the media DB change is subscribed.
+ *
+ * @param[in] error The error code
+ * @param[in] pid The PID which publishes notification
+ * @param[in] update_item The update item of notification
+ * @param[in] update_type The update type of notification
+ * @param[in] media_type The type of the media content (#media_content_type_e)
+ * @param[in] uuid The UUID of media or directory, which is updated
+ * @param[in] path The path of the media or directory
+ * @param[in] mime_type The mime type of the media info
+ * @param[in] user_data The user data passed from the foreach function
+ *
+ * @pre media_content_db_update_subscribe().
* @see media_content_db_update_subscribe()
- *
*/
typedef void (*media_content_db_update_cb)(
- media_content_error_e error,
- int pid,
- media_content_db_update_item_type_e update_item,
- media_content_db_update_type_e update_type,
- media_content_type_e media_type,
- char *uuid,
- char *path,
- char *mime_type,
- void *user_data);
+ media_content_error_e error,
+ int pid,
+ media_content_db_update_item_type_e update_item,
+ media_content_db_update_type_e update_type,
+ media_content_type_e media_type,
+ char *uuid,
+ char *path,
+ char *mime_type,
+ void *user_data);
/**
* @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
- * @brief Iterates over a list of media info.
+ * @brief Called for every available media info.
*
- * @details This callback is called for every available media info.\n
+ * @details Iterates over a list of media info.
*
- * @remarks To use the @a media outside this function, copy the handle with #media_info_clone() function.
+ * @remarks To use the @a media outside this function, copy the handle with media_info_clone() function.
*
- * @param[in] media The handle to media info
+ * @param[in] media The handle to the media info
* @param[in] user_data The user data passed from the foreach function
- * @return true to continue with the next iteration of the loop,
- * @return false to break out of the loop.
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ * otherwise @c false to break out of the loop
+ *
* @pre media_tag_foreach_media_from_db(), media_playlist_foreach_media_from_db(), media_genre_foreach_media_from_db(),
- * media_info_foreach_media_from_db(), media_folder_foreach_media_from_db() will invoke this function.
+ * media_info_foreach_media_from_db(), media_folder_foreach_media_from_db() will invoke this function.
+ *
* @see media_info_clone()
* @see media_album_foreach_media_from_db()
* @see media_playlist_foreach_media_from_db()
@@ -302,25 +313,27 @@ typedef bool (*media_info_cb)(media_info_h media, void *user_data);
/**
* @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
- * @brief Called when media items is inserted completely.
+ * @brief Called when media items are inserted completely.
*
- *
- * @param[in] media The handle to media info
+ * @param[in] media The handle to the media info
* @param[in] user_data The user data passed from the foreach function
+ *
* @pre media_info_insert_batch_to_db()
- * @see media_info_insert_batch_to_db()
*
+ * @see media_info_insert_batch_to_db()
*/
typedef void (*media_insert_completed_cb)(media_content_error_e error, void * user_data);
/**
* @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
- * @brief Called when burst shot is inserted completely.
+ * @brief Called when the burst shot is inserted completely.
*
- * @param[in] media The handle to media info
+ * @param[in] media The handle to the media info
* @param[in] user_data The user data passed from the foreach function
+ *
* @pre media_info_insert_burst_shot_to_db()
+ *
* @see media_info_insert_burst_shot_to_db()
*
*/
@@ -329,14 +342,16 @@ typedef void (*media_insert_burst_shot_completed_cb)(media_content_error_e error
/**
* @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
- * @brief Creates a thumbnail image.
+ * @brief Called when creating a thumbnail image.
*
- * @details This callback is called for completion of generating the thumbnail image.\n
+ * @details This callback is called for completion of generating the thumbnail image.
*
- * @param[in] error The Error code
- * @param[in] path The Path of thumbnail which is generated
+ * @param[in] error The error code
+ * @param[in] path The path of the thumbnail which is generated
* @param[in] user_data The user data passed from the foreach function
+ *
* @pre media_info_create_thumbnail()
+ *
* @see media_info_create_thumbnail()
*/
typedef void (*media_thumbnail_completed_cb)(media_content_error_e error, const char *path, void *user_data);
@@ -344,16 +359,18 @@ typedef void (*media_thumbnail_completed_cb)(media_content_error_e error, const
/**
* @ingroup CAPI_CONTENT_MEDIA_FOLDER_MODULE
- * @brief Iterates over a list of folders.
+ * @brief Called for every available media folder.
*
- * @details This callback is called for every available media folder.\n
+ * @details Iterates over a list of folders.
*
- * @remarks To use the @a folder outside this function, copy the handle with #media_folder_clone() function.
+ * @remarks To use the @a folder outside this function, copy the handle with the media_folder_clone() function.
*
- * @param[in] folder The handle to media folder
+ * @param[in] folder The handle to the media folder
* @param[in] user_data The user data passed from the foreach function
- * @return true to continue with the next iteration of the loop,
- * @return false to break out of the loop.
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ * otherwise @c false to break out of the loop
+ *
* @pre media_folder_foreach_folder_from_db() will invoke this function.
* @see media_folder_clone()
* @see media_folder_foreach_folder_from_db()
@@ -362,17 +379,20 @@ typedef bool (*media_folder_cb)(media_folder_h folder, void *user_data);
/**
* @ingroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
- * @brief Iterates over playlist list.
+ * @brief Called for every playlist in the obtained list of playlists.
*
- * @details This callback is called for every playlist in obtained list of playlists.\n
+ * @details Iterates over a playlist list.
*
- * @remarks To use the @a playlist outside this function, copy the handle with #media_playlist_clone() function.
+ * @remarks To use the @a playlist outside this function, copy the handle with the media_playlist_clone() function.
*
- * @param[in] playlist The handle to media playlist
+ * @param[in] playlist The handle to the media playlist
* @param[in] user_data The user data passed from the foreach function
- * @return true to continue with the next iteration of the loop,
- * @return false to break out of the loop.
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ * otherwise @c false to break out of the loop
+ *
* @pre media_playlist_foreach_playlist_from_db() will invoke this function.
+ *
* @see media_playlist_clone()
* @see media_playlist_foreach_playlist_from_db()
*/
@@ -380,18 +400,21 @@ typedef bool (*media_playlist_cb)(media_playlist_h playlist, void *user_data);
/**
* @ingroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
- * @brief Iterates over playlist member.
+ * @brief Called for every media info with playlist member ID in the obtained list of media info.
*
- * @details This callback is called for every media info with playlist member ID in obtained list of media info.\n
+ * @details Iterates over playlist members.
*
- * @remarks To use the @a media outside this function, copy the handle with #media_info_clone() function.
+ * @remarks To use the @a media outside this function, copy the handle with the media_info_clone() function.
+ *
+ * @param[in] playlist_member_id The ID to member of the playlist
+ * @param[in] media The handle to the media info
+ * @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
*
- * @param[in] playlist_member_id The ID to member of playlist
- * @param[in] media The handle to media info
- * @param[in] user_data The user data passed from the foreach function
- * @return true to continue with the next iteration of the loop,
- * @return false to break out of the loop.
* @pre media_playlist_foreach_media_from_db() will invoke this function.
+ *
* @see media_info_clone()
* @see media_playlist_foreach_media_from_db()
*/
@@ -399,17 +422,20 @@ typedef bool(* playlist_member_cb)(int playlist_member_id, media_info_h media, v
/**
* @ingroup CAPI_CONTENT_MEDIA_TAG_MODULE
- * @brief Iterates over a list of tags
+ * @brief Called for every tag in the obtained list of tags.
*
- * @details This callback is called for every tag in the obtained list of tags.\n
+ * @details Iterates over a list of tags.
*
- * @remarks To use the @a tag outside this function, copy the handle with #media_tag_clone() function.
+ * @remarks To use the @a tag outside this function, copy the handle with the media_tag_clone() function.
*
- * @param[in] tag The handle to media tag
+ * @param[in] tag The handle to the media tag
* @param[in] user_data The user data passed from the foreach function
- * @return true to continue with the next iteration of the loop,
- * @return false to break out of the loop.
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ * otherwise @c false to break out of the loop
+ *
* @pre media_tag_foreach_tag_from_db(), media_info_foreach_tag_from_db() will invoke this function.
+ *
* @see media_tag_clone()
* @see media_tag_foreach_tag_from_db()
* @see media_info_foreach_tag_from_db()
@@ -418,34 +444,40 @@ typedef bool (*media_tag_cb)(media_tag_h tag, void *user_data);
/**
* @ingroup CAPI_CONTENT_MEDIA_BOOKMARK_MODULE
- * @brief Iterates over bookmark list
+ * @brief Called for every bookmark in the obtained list of bookmarks.
*
- * @details This callback is called for every bookmark in obtained list of bookmarks.\n
+ * @details Iterates over a bookmark list.
*
- * @remarks To use the @a bookmark outside this function, copy the handle with #media_bookmark_clone() function.
+ * @remarks To use the @a bookmark outside this function, copy the handle with the media_bookmark_clone() function.
*
- * @param[in] bookmark The handle to video bookmark
+ * @param[in] bookmark The handle to the video bookmark
* @param[in] user_data The user data passed from the foreach function
- * @return true to continue with the next iteration of the loop,
- * @return false to break out of the loop.
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ * otherwise @c false to break out of the loop
+ *
* @pre media_info_foreach_bookmark_from_db() will invoke this function.
+ *
* @see media_info_foreach_bookmark_from_db()
*/
typedef bool (*media_bookmark_cb)(media_bookmark_h bookmark, void *user_data);
/**
* @ingroup CAPI_CONTENT_MEDIA_ALBUM_MODULE
- * @brief Iterates over album list
+ * @brief Called for every album in the obtained list of groups.
*
- * @details This callback is called for every album in obtained list of groups.\n
+ * @details Iterates over an album list.
*
- * @remarks To use the @a album outside this function, copy the handle with #media_album_clone() function.
+ * @remarks To use the @a album outside this function, copy the handle with the media_album_clone() function.
*
- * @param[in] album The handle to media album
+ * @param[in] album The handle to the media album
* @param[in] user_data The user data passed from the foreach function
- * @return true to continue with the next iteration of the loop,
- * @return false to break out of the loop.
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ * otherwise @c false to break out of the loop
+ *
* @pre media_album_foreach_album_from_db() will invoke this function.
+ *
* @see media_album_clone()
* @see media_album_foreach_album_from_db()
*/
@@ -453,17 +485,20 @@ typedef bool (*media_album_cb)(media_album_h album, void *user_data);
/**
* @ingroup CAPI_CONTENT_MEDIA_GROUP_MODULE
- * @brief Iterates over media group list
+ * @brief Called for every group in the obtained list of groups.
*
- * @details This callback is called for every group in obtained list of groups.\n
+ * @details Iterates over a media group list.
*
- * @remarks You should not free group_name returned by this function.
+ * @remarks You should not free @a group_name returned by this function.
+ *
+ * @param[in] group_name The name of the media group
+ * @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
*
- * @param[in] group_name The name of media group
- * @param[in] user_data The user data passed from the foreach function
- * @return true to continue with the next iteration of the loop,
- * @return false to break out of the loop.
* @pre media_group_foreach_group_from_db() will invoke this function.
+ *
* @see media_group_foreach_group_from_db()
*/
typedef bool (*media_group_cb)(const char *group_name, void *user_data);
@@ -473,75 +508,78 @@ typedef bool (*media_group_cb)(const char *group_name, void *user_data);
*/
/**
- * @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ * @addtogroup CAPI_CONTENT_MEDIA_FILTER_MODULE
* @{
- *
- */
-#define MEDIA_ID "MEDIA_ID" /**< media id */
-#define MEDIA_PATH "MEDIA_PATH" /**< media full path */
-#define MEDIA_DISPLAY_NAME "MEDIA_DISPLAY_NAME" /**< media base name */
-#define MEDIA_TYPE "MEDIA_TYPE" /**< media type. 0-image, 1-video, 2-sound, 3-music, 4-other*/
-#define MEDIA_MIME_TYPE "MEDIA_MIME_TYPE" /**< media mime type */
-#define MEDIA_SIZE "MEDIA_SIZE" /**< media mime size */
-#define MEDIA_ADDED_TIME "MEDIA_ADDED_TIME" /**< media added time */
-#define MEDIA_MODIFIED_TIME "MEDIA_MODIFIED_TIME" /**< media modified time */
-#define MEDIA_TIMELINE "MEDIA_TIMELINE" /**< media modified time */
-#define MEDIA_THUMBNAIL_PATH "MEDIA_THUMBNAIL_PATH" /**< media thumbnail path */
-#define MEDIA_TITLE "MEDIA_TITLE" /**< media title get from tag or file name */
-#define MEDIA_ALBUM "MEDIA_ALBUM" /**< media album name*/
-#define MEDIA_ARTIST "MEDIA_ARTIST" /**< media artist*/
-#define MEDIA_ALBUM_ARTIST "MEDIA_ALBUM_ARTIST" /**< media album_artist*/
-#define MEDIA_GENRE "MEDIA_GENRE" /**< media genre*/
-#define MEDIA_COMPOSER "MEDIA_COMPOSER" /**< media composer*/
-#define MEDIA_YEAR "MEDIA_YEAR" /**< media year*/
-#define MEDIA_RECORDED_DATE "MEDIA_RECORDED_DATE" /**< media recorded date*/
-#define MEDIA_COPYRIGHT "MEDIA_COPYRIGHT" /**< media copyright*/
-#define MEDIA_TRACK_NUM "MEDIA_TRACK_NUM" /**< media track number*/
-#define MEDIA_DESCRIPTION "MEDIA_DESCRIPTION" /**< media description*/
-#define MEDIA_BITRATE "MEDIA_BITRATE" /**< media bitrate*/
-#define MEDIA_SAMPLERATE "MEDIA_SAMPLERATE" /**< media sample rate*/
-#define MEDIA_CHANNEL "MEDIA_CHANNEL" /**< media channel*/
-#define MEDIA_DURATION "MEDIA_DURATION" /**< media duration */
-#define MEDIA_LONGITUDE "MEDIA_LONGITUDE" /**< media longitude */
-#define MEDIA_LATITUDE "MEDIA_LATITUDE" /**< media latitude */
-#define MEDIA_ALTITUDE "MEDIA_ALTITUDE" /**< media altitude */
-#define MEDIA_WIDTH "MEDIA_WIDTH" /**< media width*/
-#define MEDIA_HEIGHT "MEDIA_HEIGHT" /**< media height*/
-#define MEDIA_DATETAKEN "MEDIA_DATETAKEN" /**< media datetaken*/
-#define MEDIA_ORIENTATION "MEDIA_ORIENTATION" /**< media orientation*/
-#define MEDIA_BURST_ID "BURST_ID" /**< media burst id*/
-#define MEDIA_PLAYED_COUNT "MEDIA_PLAYED_COUNT" /**< media playedcount*/
-#define MEDIA_LAST_PLAYED_TIME "MEDIA_LAST_PLAYED_TIME" /**< media last played time*/
-#define MEDIA_LAST_PLAYED_POSITION "MEDIA_LAST_PLAYED_POSITION" /**< media last played position of file*/
-#define MEDIA_RATING "MEDIA_RATING" /**< media rating*/
-#define MEDIA_FAVOURITE "MEDIA_FAVORITE" /**< 0-not favourite, 1-favourite*/
-#define MEDIA_AUTHOR "MEDIA_AUTHOR" /**< media authore*/
-#define MEDIA_PROVIDER "MEDIA_PROVIDER" /**< media provider*/
-#define MEDIA_CONTENT_NAME "MEDIA_CONTENT_NAME" /**< media content name*/
-#define MEDIA_CATEGORY "MEDIA_CATEGORY" /**< media category*/
-#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_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_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*/
+ * @brief You can use above defines to set the condition of media filter and order keyword.
+ *
+ */
+#define MEDIA_ID "MEDIA_ID" /**< Media ID */
+#define MEDIA_PATH "MEDIA_PATH" /**< Media full path */
+#define MEDIA_DISPLAY_NAME "MEDIA_DISPLAY_NAME" /**< Media base name */
+#define MEDIA_TYPE "MEDIA_TYPE" /**< Media type: 0-image, 1-video, 2-sound, 3-music, 4-other*/
+#define MEDIA_MIME_TYPE "MEDIA_MIME_TYPE" /**< Media MIME type */
+#define MEDIA_SIZE "MEDIA_SIZE" /**< Media MIME size */
+#define MEDIA_ADDED_TIME "MEDIA_ADDED_TIME" /**< Media added time */
+#define MEDIA_MODIFIED_TIME "MEDIA_MODIFIED_TIME" /**< Media modified time */
+#define MEDIA_TIMELINE "MEDIA_TIMELINE" /**< Media modified time */
+#define MEDIA_THUMBNAIL_PATH "MEDIA_THUMBNAIL_PATH" /**< Media thumbnail path */
+#define MEDIA_TITLE "MEDIA_TITLE" /**< Media title get from tag or file name */
+#define MEDIA_ALBUM "MEDIA_ALBUM" /**< Media album name*/
+#define MEDIA_ARTIST "MEDIA_ARTIST" /**< Media artist*/
+#define MEDIA_ALBUM_ARTIST "MEDIA_ALBUM_ARTIST" /**< Media album_artist*/
+#define MEDIA_GENRE "MEDIA_GENRE" /**< Media genre*/
+#define MEDIA_COMPOSER "MEDIA_COMPOSER" /**< Media composer*/
+#define MEDIA_YEAR "MEDIA_YEAR" /**< Media year*/
+#define MEDIA_RECORDED_DATE "MEDIA_RECORDED_DATE" /**< Media recorded date*/
+#define MEDIA_COPYRIGHT "MEDIA_COPYRIGHT" /**< Media copyright*/
+#define MEDIA_TRACK_NUM "MEDIA_TRACK_NUM" /**< Media track number*/
+#define MEDIA_DESCRIPTION "MEDIA_DESCRIPTION" /**< Media description*/
+#define MEDIA_BITRATE "MEDIA_BITRATE" /**< Media bitrate*/
+#define MEDIA_BITPERSAMPLE "MEDIA_BITPERSAMPLE" /**< Media bit per sample*/
+#define MEDIA_SAMPLERATE "MEDIA_SAMPLERATE" /**< Media sample rate*/
+#define MEDIA_CHANNEL "MEDIA_CHANNEL" /**< Media channel*/
+#define MEDIA_DURATION "MEDIA_DURATION" /**< Media duration */
+#define MEDIA_LONGITUDE "MEDIA_LONGITUDE" /**< Media longitude */
+#define MEDIA_LATITUDE "MEDIA_LATITUDE" /**< Media latitude */
+#define MEDIA_ALTITUDE "MEDIA_ALTITUDE" /**< Media altitude */
+#define MEDIA_WIDTH "MEDIA_WIDTH" /**< Media width*/
+#define MEDIA_HEIGHT "MEDIA_HEIGHT" /**< Media height*/
+#define MEDIA_DATETAKEN "MEDIA_DATETAKEN" /**< Media datetaken*/
+#define MEDIA_ORIENTATION "MEDIA_ORIENTATION" /**< Media orientation*/
+#define MEDIA_BURST_ID "BURST_ID" /**< Media burst ID*/
+#define MEDIA_PLAYED_COUNT "MEDIA_PLAYED_COUNT" /**< Media playedcount*/
+#define MEDIA_LAST_PLAYED_TIME "MEDIA_LAST_PLAYED_TIME" /**< Media last played time*/
+#define MEDIA_LAST_PLAYED_POSITION "MEDIA_LAST_PLAYED_POSITION" /**< Media last played position of file*/
+#define MEDIA_RATING "MEDIA_RATING" /**< Media rating*/
+#define MEDIA_FAVOURITE "MEDIA_FAVOURITE" /**< 0-not favourite, 1-favourite*/
+#define MEDIA_AUTHOR "MEDIA_AUTHOR" /**< Media authore*/
+#define MEDIA_PROVIDER "MEDIA_PROVIDER" /**< Media provider*/
+#define MEDIA_CONTENT_NAME "MEDIA_CONTENT_NAME" /**< Media content name*/
+#define MEDIA_CATEGORY "MEDIA_CATEGORY" /**< Media category*/
+#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_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_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*/
+
/**
* @}
*/
@@ -552,12 +590,12 @@ typedef bool (*media_group_cb)(const char *group_name, void *user_data);
* @addtogroup CAPI_CONTENT_MEDIA_FOLDER_MODULE
* @{
*/
-#define FOLDER_ID "FOLDER_ID" /**< folder id */
-#define FOLDER_PATH "FOLDER_PATH" /**< folder full path */
-#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_ID "FOLDER_ID" /**< Folder ID */
+#define FOLDER_PATH "FOLDER_PATH" /**< Folder full path */
+#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*/
/**
* @}
@@ -567,9 +605,9 @@ typedef bool (*media_group_cb)(const char *group_name, void *user_data);
* @addtogroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
* @{
*/
-#define PLAYLIST_NAME "PLAYLIST_NAME" /**< playlist name */
-#define PLAYLIST_MEMBER_ORDER "PLAYLIST_MEMBER_ORDER" /**< playlist name */
-#define PLAYLIST_MEDIA_COUNT "PLAYLIST_MEDIA_COUNT" /**< media count in playlist view */
+#define PLAYLIST_NAME "PLAYLIST_NAME" /**< Playlist name */
+#define PLAYLIST_MEMBER_ORDER "PLAYLIST_MEMBER_ORDER" /**< Playlist name */
+#define PLAYLIST_MEDIA_COUNT "PLAYLIST_MEDIA_COUNT" /**< Media count in playlist view */
/**
* @}
@@ -579,8 +617,8 @@ typedef bool (*media_group_cb)(const char *group_name, void *user_data);
* @addtogroup CAPI_CONTENT_MEDIA_TAG_MODULE
* @{
*/
-#define TAG_NAME "TAG_NAME" /**< tag name */
-#define TAG_MEDIA_COUNT "TAG_MEDIA_COUNT" /**< media count in tag view */
+#define TAG_NAME "TAG_NAME" /**< Tag name */
+#define TAG_MEDIA_COUNT "TAG_MEDIA_COUNT" /**< Media count in tag view */
/**
* @}
@@ -590,7 +628,7 @@ typedef bool (*media_group_cb)(const char *group_name, void *user_data);
* @addtogroup CAPI_CONTENT_MEDIA_BOOKMARK_MODULE
* @{
*/
-#define BOOKMARK_MARKED_TIME "BOOKMARK_MARKED_TIME" /**< bookmark marked time */
+#define BOOKMARK_MARKED_TIME "BOOKMARK_MARKED_TIME" /**< Bookmark marked time */
/**
* @}
diff --git a/include/media_filter.h b/include/media_filter.h
index 6ce89f8..985b453 100755
--- a/include/media_filter.h
+++ b/include/media_filter.h
@@ -27,144 +27,197 @@ extern "C" {
#endif /* __cplusplus */
/**
+ * @file media_filter.h
+ * @brief This file contains the media filter API and related operation with filters. \n
+ * The functions include: creating and destroying media filter handles that are used to get the filtered information, \n
+ * making free all resources related to the filter handle, limiting number of items returned, setting conditions for the filter, \n
+ * setting and getting media filter's content order and ordering keyword either descending or ascending.
+ */
+
+/**
* @addtogroup CAPI_CONTENT_MEDIA_FILTER_MODULE
* @{
- *
- * @file media-filter.h
- * @brief This file contains the media filter API and related operatioins with filters \n
- * The following functions include: creating and destroying media filter handles that are used to get filtered information, \n
- * making free all resources related to filter handle, limiting number of items returned, setting conditions for filter, \n
- * setting and getting media filter's content order and ordering keyword either descending or ascending.
*/
/**
* @brief Creates a media filter handle.
* @details This function creates a media filter handle. The handle can be
- * used to get filtered information based on filter properties i.e. offset, count, condition for searching and order.
- * @remarks The @a filter handle must be released with media_info_filter_destroy() by you.
- * @param[out] filter A handle to media filter
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * used to get the filtered information based on filter properties i.e. offset, count, condition for searching and order.
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks You must release the @a filter handle using media_info_filter_destroy().
+ *
+ * @param[out] filter A handle to the media filter
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
- * @see media_filter_destroy()
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @see media_filter_destroy()
*/
int media_filter_create(filter_h *filter);
/**
* @brief Destroys a media filter handle.
* @details The function frees all resources related to the media filter handle. The filter
- * handle no longer can be used to perform any operation. A new filter handle
- * has to be created before the next usage.
+ * handle no longer can be used to perform any operation. A new filter handle
+ * has to be created before the next usage.
+ *
+ * @since_tizen 2.3
*
- * @param[in] filter The handle to media filter
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] filter The handle to the media filter
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @see media_filter_create()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @see media_filter_create()
*/
int media_filter_destroy(filter_h filter);
/**
- * @brief Set the media filter's offset and count.
- * @details This function set the @a offset and @a count for the given filter used to limit number of items returned.
- * For example, if you set the @a offset as 10 and @a count as 5, then only searched data from 10 to 14 will be returned when the filter is used with foreach functions.
- *
- * @param[in] filter The handle to media 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 offset
- * @return return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @brief Sets the media filter offset and count.
+ * @details This function sets the @a offset and @a count for the given filter used to limit number of items returned.
+ * For example, if you set the @a offset as @c 10 and @a count as @c 5, then only searched data from @c 10 to @c 14 will be returned when the filter is used with foreach functions.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] filter The handle to the media 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,
+ * 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_set_offset(filter_h filter, int offset, int count);
/**
- * @brief Set the @a condition for given @a filter.
+ * @brief Sets the @a condition for the given @a filter.
+ * @since_tizen 2.3
*
- * @param[in] filter The handle to media filter
- * @param[in] condition The condition which is used WHERE clause on a query
+ * @param[in] filter The handle to the media filter
+ * @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 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
+ *
+ * @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_condition(filter_h filter, const char *condition, media_content_collation_e collate_type);
/**
- * @brief Set the media filter's content @a order and @a order @a keyword either descending or ascending.
+ * @brief Sets the media filter content @a order and order keyword i.e. either descending or ascending.
+ * @since_tizen 2.3
*
- * @param[in] filter The handle to media filter
- * @param[in] order_type The search order type
+ * @param[in] filter The handle to the media filter
+ * @param[in] order_type The search order type
* @param[in] order_keyword The search order keyword
- * @param[in] collate_type The collate type for comparing two strings
- * @return return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] collate_type The collate type for comparing two strings
+ *
+ * @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_set_order(filter_h filter, media_content_order_e order_type, const char *order_keyword, media_content_collation_e collate_type);
/**
- * @brief Gets the @a offset and @a count for the given @a filter used to limit number of items returned.
+ * @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
+ *
+ * @param[in] filter The handle to the media filter
+ * @param[out] offset The start position of the given filter (Starting from zero)
+ * @param[out] count The number of items to be searched with respect to the offset
*
- * @param[in] filter The handle to Media filter
- * @param[out] offset The start position of the given filter(Starting from zero)
- * @param[out] count The number of items to be searched with respect to offset
- * @return return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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_offset(filter_h filter, int *offset, int *count);
/**
- * @brief Get the @a condition for given @a filter.
+ * @brief Gets the @a condition for the given @a filter.
+ * @since_tizen 2.3
*
- * @remarks @a condition must be released with free() by you.
- * @param[in] filter The handle to media info filter
- * @param[out] condition The condition which is used WHERE clause on a query
+ * @remarks You must release @a condition using free().
+ *
+ * @param[in] filter The handle to the media info filter
+ * @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 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
+ *
+ * @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_get_condition(filter_h filter, char **condition, media_content_collation_e *collate_type);
/**
- * @brief Get the media filter's content @a order and @a order @a keyword either descending or ascending.
+ * @brief Gets the media filter's content @a order and order keyword i.e. either descending or ascending.
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a order_keyword using free().
*
- * @remarks @a order_keyword must be released with free() by you.
- * @param[in] filter The handle to media filter
- * @param[out] order_type The search order type
+ * @param[in] filter The handle to the media filter
+ * @param[out] order_type The search order type
* @param[out] order_keyword The search order keyword
- * @param[out] collate_type The collate type for comparing two strings
- * @return return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[out] collate_type The collate type for comparing two strings
+ *
+ * @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_order(filter_h filter, media_content_order_e* order_type, char **order_keyword, media_content_collation_e *collate_type);
-
/**
* @}
*/
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/include/media_folder.h b/include/media_folder.h
index e926791..8179aa3 100755
--- a/include/media_folder.h
+++ b/include/media_folder.h
@@ -27,104 +27,154 @@ extern "C" {
#endif /* __cplusplus */
/**
+ * @file media_folder.h
+ * @brief This file contains API related to all operations with media folder in DB. \n
+ * These functions include getting the number of folders and media files filtered from DB, \n
+ * iterating through media files and folders filtered in the given folder from DB; \n
+ * cloning and destroying the media folder, getting its name, ID, absolute path and date \n
+ * and updating the media folder to the media database.
+ */
+
+/**
* @addtogroup CAPI_CONTENT_MEDIA_FOLDER_MODULE
* @{
- *
- * @file media-folder.h
- * @brief This file contains API realted to all operations with media folder in db. \n
- * These functions include getting number of folder and media files filtered from db, \n
- * iterating through media files and folders filtered in the given folder from db; \n
- * clonning and destroying media folder, getting its name, ID, absolute path and date \n
- * and updating the media folder to the media database.
*/
+
/**
- * @brief Gets the number of folder for the passed @a filter from the media database.
+ * @brief Gets the count of folder for the passed @a filter from the media database.
+ * @since_tizen 2.3
+ *
+ * @param[in] filter The handle to filter \n
+ * To allow searching over different content types, you should use #filter_h.
+ * @param[out] folder_count The count of the media folder
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param[in] filter The handle to filter. \n To allow searching over different content types, you should use @a filter_h.
- * @param[out] folder_count The count of media folder
- * @return 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_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_folder_get_folder_count_from_db(filter_h filter, int *folder_count);
/**
* @brief Iterates through available media folders with optional @a filter from the media database.
- * @details This function gets media folder handles meeting the given
- * @a filter. The @a callback function will be invoked for every retrieved
- * folder. If NULL is passed to the @a filter, no filtering is applied.
+ * @details This function gets the media folder meeting the given @a filter.
+ * The @a callback function will be invoked for every retrieved
+ * folder. If @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks Do not call updating DB fuction like media_folder_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] filter The handle to media folder filter
- * @param[in] callback The callback function to invoke
+ * @param[in] filter The handle to the media folder 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 return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
- * @pre A filter handle has to be created by calling media_folder_filter_create()
- * @post This function invokes media_folder_cb()
+ * @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 A filter handle has to be created by calling media_filter_create().
+ * @post This function invokes media_folder_cb().
+ *
* @see media_content_connect()
- * @see #media_folder_cb
+ * @see media_folder_cb()
* @see media_filter_create()
*/
int media_folder_foreach_folder_from_db(filter_h filter, media_folder_cb callback, void *user_data);
/**
- * @brief Gets the number of media files for the passed @a filter in the given @a folder from the media database.
+ * @brief Gets the count of media files for the passed @a filter in the given @a folder from the media database.
+ * @since_tizen 2.3
*
- * @param[in] folder_id The ID of media folder
- * @param[in] filter The filter of media content
+ * @param[in] folder_id The ID of the media folder
+ * @param[in] filter The filter of the media content
* @param[out] media_count The count of media folder items
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @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_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_folder_get_media_count_from_db(const char *folder_id, filter_h filter, int *media_count);
/**
- * @brief Iterates through the media files with optional @a filter in the given @a folder from the media database.
+ * @brief Iterates through the media files with an optional @a filter in the given @a folder from the media database.
* @details This function gets all media files associated with the given folder and
- * meeting desired filter option and calls registered callback function for
- * every retrieved media item. If NULL is passed to the @a filter, no filtering is applied.
+ * 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.3
*
- * @param[in] folder_id The ID of media folder
- * @param[in] filter The handle to media info filter
- * @param[in] callback The callback function to invoke
+ * @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] folder_id The ID of the media folder
+ * @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 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
- * @post This function invokes media_info_cb()
+ * @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().
+ * @post This function invokes media_info_cb().
+ *
* @see #media_info_cb
* @see media_content_connect()
- * @see media_folder_filter_create()
+ * @see media_filter_create()
*/
int media_folder_foreach_media_from_db(const char *folder_id, filter_h filter, media_info_cb callback, void *user_data);
/**
* @brief Clones the media folder.
* @details This function copies the media folder handle from a source to
- * destination. There is no media_folder_create() function. The media_folder_h is created internally and available through
- * media folder foreach function such as media_folder_foreach_folder_from_db(). To use this handle outside of these foreach functions,
- * use this function.
- * @remark The destination handle must be released with media_folder_destroy() by you.
- * @param[out] dst A destination handle to media folder
- * @param[in] src The source handle to media folder
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * destination. There is no media_folder_create() function. The media_folder_h is created internally and available through
+ * media folder foreach function such as media_folder_foreach_folder_from_db(). To use this handle outside of these foreach functions,
+ * use this function.
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks The destination handle must be released with media_folder_destroy().
+ *
+ * @param[out] dst The destination handle to the media folder
+ * @param[in] src The source handle to the media folder
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @see media_folder_destroy()
* @see media_folder_foreach_folder_from_db()
*/
@@ -133,99 +183,135 @@ int media_folder_clone(media_folder_h *dst, media_folder_h src);
/**
* @brief Destroys the media folder.
* @details The function frees all resources related to the folder handle. This handle
- * no longer can be used to perform any operation. A new handle has to
- * be created before the next use.
+ * no longer can be used to perform any operation. A new handle has to
+ * be created before the next use.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] folder The handle to the media folder
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param[in] folder The handle to media folder
- * @return 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
- * @pre A copy of the media folder handle created by calling media_folder_clone()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre A copy of the media folder handle created by calling media_folder_clone().
+ *
* @see media_folder_clone()
*/
int media_folder_destroy(media_folder_h folder);
/**
- * @brief Gets media folder's ID.
+ * @brief Gets the media folder ID.
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a folder_id using free().
+ *
+ * @param[in] folder The handle to the media folder
+ * @param[out] folder_id The ID of the media folder
*
- * @remarks @a folder_id must be released with free() by you.
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] folder The handle to media folder
- * @param [out] folder_id The ID of media folder
- * @return 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
*/
int media_folder_get_folder_id(media_folder_h folder, char **folder_id);
/**
- * @brief Gets the absolute path to the folder.
+ * @brief Gets the absolute path to the media folder.
+ * @since_tizen 2.3
*
- * @remarks @a path must be released with free() by you.
+ * @remarks You must release @a path using free().
*
- * @param[in] folder The handle to media folder
- * @param[out] path The path of the media folder
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] folder The handle to the media folder
+ * @param[out] path The path 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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
*/
int media_folder_get_path(media_folder_h folder, char **path);
/**
- * @brief Gets the folder name.
+ * @brief Gets the media folder name.
+ * @since_tizen 2.3
*
- * @remarks @a folder_name must be released with free() by you.
+ * @remarks You must release @a folder_name using free().
*
- * @param[in] folder The handle to media folder
+ * @param[in] folder The handle to the media folder
* @param[out] folder_name The name of the media folder
- * @return 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
*
+ * @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_name(media_folder_h folder, char **folder_name);
/**
* @brief Gets the modified date of the folder.
+ * @since_tizen 2.3
*
- * @param[in] folder The handle to media folder
- * @param[out] date The modified date of folder
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] folder The handle to the media folder
+ * @param[out] date The modified date of the folder
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
*/
int media_folder_get_modified_time(media_folder_h folder, time_t *date);
/**
* @brief Gets the folder storage type.
+ * @since_tizen 2.3
*
- * @param[in] folder The handle to media folder
+ * @param[in] folder The handle to the media folder
* @param[out] storage_type The storage type of the media folder
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
*
+ * @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
*/
int media_folder_get_storage_type(media_folder_h folder, media_content_storage_e *storage_type);
/**
* @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 folder_id.
- * media folder will be created, which is filled with folder information.
+ * @details This function creates a new media folder handle from the media database by the given @a folder_id.
+ * Media folder will be created, which is filled with folder information.
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a folder using media_folder_destroy().
*
- * @remarks @a folder must be released with media_folder_destroy() by you.
+ * @param[in] folder_id The ID of the media folder
+ * @param[out] folder The media folder handle associated with the folder ID
*
- * @param[in] folder_id The ID of media folder
- * @param[out] folder The media folder handle associated with the folder ID
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_folder_destroy()
*
@@ -235,33 +321,49 @@ int media_folder_get_folder_from_db(const char *folder_id, media_folder_h *folde
/**
* @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, media_folder_update_to_db() function should be called so as to update
- * the given folder attibutes in 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] folder The handle to media folder
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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
+ *
* @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_update_to_db(media_folder_h folder);
/**
* @brief Sets the folder name.
+ * @since_tizen 2.3
*
- * @param[in] folder The handle to media folder
- * @param[in] name The name of the media folder
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] folder The handle to the media folder
+ * @param[in] name The name of the media folder
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
- * @post media_folder_update_to_db()
+ * @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);
diff --git a/include/media_group.h b/include/media_group.h
index fe62070..98e7d0f 100755
--- a/include/media_group.h
+++ b/include/media_group.h
@@ -26,83 +26,113 @@ extern "C" {
#endif /* __cplusplus */
/**
+ * @file media_group.h
+ * @brief This file contains API related to handling different operations with album and other media data groups in DB.
+ * The following APIs are capable to get number of albums, media info in the given album from DB, \n
+ * to clone, destroy and get all albums and media files associated with the given media album from DB, \n
+ * to get name, ID, artist, album art path from album; to get number of groups and their names, \n
+ * to get the number of media files and their content associated with the given group from DB.
+ */
+
+/**
* @addtogroup CAPI_CONTENT_MEDIA_ALBUM_MODULE
* @{
- *
- * @file media_group.h
- * @brief This file contains API related to handling different operations with album and other media data groups in db. \n
- * The following APIs are capable to get number of albums, media info in the given album from db, \n
- * to clone, destroy and get all albums and media files associated with the given media album from db, \n
- * to get name, ID, artist, album art path from album; to get number of groups and their names, \n
- * to get the number of media files and their content associated with the given group from db.
*/
/**
- * @brief Gets the number of album for the passed @a filter from the media database.
+ * @brief Gets the number of the album for the passed @a filter from the media database.
+ * @since_tizen 2.3
*
- * @param[in] filter The handle to media filter.
- * @param[out] album_count The count of media album
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] filter The media filter handle
+ * @param[out] album_count The count of the media album
+ *
+ * @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_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_album_get_album_count_from_db(filter_h filter, int *album_count);
/**
* @brief Iterates through the media album with optional @a filter from the media database.
* @details This function gets all media album handles meeting the given filter.
- * The callback function will be invoked for every retrieved media album.
- * If NULL is passed to the filter, no filtering is applied.
- *
- * @param [in] filter The handle to media filter
- * @param [in] callback The callback function to invoke
- * @param [in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * The callback function will be invoked for every retrieved media album.
+ * If @c NULL is passed to the filter, no filtering is applied.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] filter The media filter handle
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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().
* @post This function invokes media_album_cb().
+ *
* @see #media_album_cb
* @see media_content_connect()
* @see media_filter_create()
- *
*/
int media_album_foreach_album_from_db(filter_h filter, media_album_cb callback, void *user_data);
/**
- * @brief Gets number of media info for the given album present in the media database.
+ * @brief Gets the number of media info for the given album present in the media database.
+ * @since_tizen 2.3
+ *
+ * @param[in] album_id The ID of the media album
+ * @param[in] filter The media filter handle
+ * @param[out] media_count The count of the album
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] album_id The ID of media album
- * @param [in] filter The handle to media filter
- * @param [out] media_count A count of album
- * @return 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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
*/
int media_album_get_media_count_from_db (int album_id, filter_h filter, int *media_count);
/**
- * @brief Iterates through the media files with optional @a filter in the given @a media @a album from the media database.
+ * @brief Iterates through the media files with an optional @a filter in the given media album from the media database.
* @details This function gets all media files associated with the given media album and
- * meeting desired filter option and calls registered callback function for
- * every retrieved media info. If NULL is passed to the @a filter, no filtering is applied.
- *
- * @param [in] album_id The ID of media album
- * @param [in] filter The handle to media filter
- * @param [in] callback The callback function to invoke
- * @param [in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * meeting desired filter option and calls registered callback function for
+ * every retrieved media info. If @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] album_id The ID of the media album
+ * @param[in] filter The media filter handle
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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()
@@ -110,116 +140,155 @@ int media_album_get_media_count_from_db (int album_id, filter_h filter, int *med
int media_album_foreach_media_from_db(int album_id, filter_h filter, media_info_cb callback, void *user_data);
/**
- * @brief Destroys album handle.
- * @details Function frees all resources related to album handle. This handle
- * no longer can be used to perform any operation. A new handle has to
- * be created before the next use.
- *
- * @param [in] album The handle to media album
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @brief Destroys the album handle.
+ * @details This function frees all resources related to the album handle. This handle
+ * can no longer be used to perform any operation. A new handle has to
+ * be created before the next use.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] album The media album 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 album handle by calling media_album_clone()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre Get copy of album handle by calling media_album_clone().
+ *
* @see media_album_clone()
*/
int media_album_destroy(media_album_h album);
/**
- * @brief Clones media album.
+ * @brief Clones a media album.
* @details This function copies the media album handle from a source to
- * destination. There is no media_album_create() function. The media_album_h is created internally and available through
- * media album foreach function such as media_album_foreach_album_from_db(). To use this handle outside of these foreach functions,
- * use this function.
+ * destination. There is no media_album_create() function. The media_album_h is created internally and available through
+ * media album foreach function such as media_album_foreach_album_from_db(). To use this handle outside of these foreach functions,
+ * use this function.
+ *
+ * @since_tizen 2.3
*
- * @remark The destination handle must be released with media_album_destroy() by you.
+ * @remarks You must release the destination handle using media_album_destroy().
*
- * @param [in] src The source handle to media album
- * @param [out] dst A destination handle to media album
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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,
+ * 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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @see media_album_destroy()
* @see media_album_foreach_album_from_db()
*/
int media_album_clone(media_album_h *dst, media_album_h src);
/**
- * @brief Gets a ID of the album.
+ * @brief Gets the ID of the album.
+ * @since_tizen 2.3
+ *
+ * @param[in] album The media album handle
+ * @param[out] album_id The media album ID
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] album The handle to media album
- * @param [out] album_id A ID of media album
- * @return 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
- * @see media_album_foreach_album_from_db()
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @see media_album_foreach_album_from_db()
*/
int media_album_get_album_id(media_album_h album, int *album_id);
/**
- * @brief Gets a name of the album.
+ * @brief Gets the name of the album.
+ * @since_tizen 2.3
*
- * @remarks @a album_name must be released with free() by you.
+ * @remarks You must release @a album_name using free().
*
- * @param [in] album The handle to media album
- * @param [out] album_name A name of media album handle
- * @return 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
+ * @param[in] album The media album handle
+ * @param[out] album_name The name of the media album 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_PERMISSION_DENIED Permission denied
*/
int media_album_get_name(media_album_h album, char **album_name);
/**
- * @brief Gets a name of the artist from album.
+ * @brief Gets the name of the artist from the given album.
+ * @since_tizen 2.3
*
- * @remarks @a artist must be released with free() by you.
+ * @remarks You must release @a artist using free().
*
- * @param [in] album The handle to media album
- * @param [out] artist A name of media artist
- * @return 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
+ * @param[in] album The media album handle
+ * @param[out] artist The name of the media artist
*
+ * @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_album_get_artist(media_album_h album, char **artist);
/**
- * @brief Gets a album art path from album.
+ * @brief Gets the album art path from the album.
+ * @since_tizen 2.3
*
- * @remarks @a album_art must be released with free() by you.
+ * @remarks You must release @a album_art using free().
*
- * @param [in] album The handle to media album
- * @param [out] album_art A path of media album_art
- * @return 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
+ * @param[in] album The media album handle
+ * @param[out] album_art The path of the media album_art
*
+ * @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_album_get_album_art(media_album_h album, char **album_art);
/**
* @brief Gets the media album from the media database.
*
- * @details This function creates a new media album handle from the media database by the given album_id.
- * media album will be created, which is filled with album information.
+ * @details This function creates a new media album handle from the media database by the given @a album_id.
+ * Media album will be created and will be filled with the album information.
*
- * @remarks @a folder must be released with media_album_destroy() by you.
+ * @since_tizen 2.3
*
- * @param[in] album_id The ID of media album
- * @param[out] album The album handle associated with the album ID
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a folder using media_album_destroy().
+ *
+ * @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,
+ * 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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_album_destroy()
- *
*/
int media_album_get_album_from_db(int album_id, media_album_h *album);
@@ -235,36 +304,49 @@ int media_album_get_album_from_db(int album_id, media_album_h *album);
*/
/**
- * @brief Gets the number of group for the passed @a filter from the media database.
+ * @brief Gets the number of the group for the passed @a filter from the media database.
+ * @since_tizen 2.3
+ *
+ * @param[in] filter The media filter handle
+ * @param[in] group The type of the media group
+ * @param[out] group_count The count of the media group
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param[in] filter The handle to media filter
- * @param [in] group The type of media group
- * @param[out] group_count The count of media group
- * @return 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_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_group_get_group_count_from_db(filter_h filter, media_group_e group, int *group_count);
/**
- * @brief Iterates through the media group with optional @a filter from the media database.
- * @details This function gets the names of media group meeting the given filter.
- * The callback function will be invoked for every retrieved media group.
- * If NULL is passed to the filter, no filtering is applied.
- *
- * @param [in] filter The handle to media filter
- * @param [in] group The type of media group
- * @param [in] callback The callback function to invoke
- * @param [in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @brief Iterates through the media group with an optional @a filter from the media database.
+ * @details This function gets names of media group meeting the given filter.
+ * The callback function will be invoked for every retrieved media group.
+ * If @c NULL is passed to the filter, no filtering is applied.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] filter The media filter handle
+ * @param[in] group The type of the media group
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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_group_cb().
+ *
* @see #media_group_cb
* @see media_content_connect()
* @see media_filter_create()
@@ -272,37 +354,52 @@ int media_group_get_group_count_from_db(filter_h filter, media_group_e group, in
int media_group_foreach_group_from_db(filter_h filter, media_group_e group, media_group_cb callback, void *user_data);
/**
- * @brief Gets number of media info for the given media group present in the media database.
- *
- * @param [in] group_name The name of media group
- * @param [in] group The type of media group
- * @param [in] filter The handle to media filter
- * @param [out] media_count The count of media
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @brief Gets the count of the media info for the given media group present in the media database.
+ * @since_tizen 2.3
+ *
+ * @param[in] group_name The name of the media group
+ * @param[in] group The type of the media group
+ * @param[in] filter The media filter handle
+ * @param[out] media_count The count of the media
+ *
+ * @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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
*/
int media_group_get_media_count_from_db(const char *group_name, media_group_e group, filter_h filter, int *media_count);
/**
- * @brief Iterates through the media files with optional @a filter in the given @a group from the media database.
+ * @brief Iterates through the media files with an optional @a filter in the given @a group from the media database.
* @details This function gets all media files associated with the given group and
- * meeting desired filter option and calls registered callback function for
- * every retrieved media info. If NULL is passed to the @a filter, no filtering is applied.
- *
- * @param [in] group_name The name of media group
- * @param [in] group The type of media group
- * @param [in] filter The handle to media filter
- * @param [in] callback The callback function to invoke
- * @param [in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * meeting desired filter option and calls registered callback function for
+ * every retrieved media info. If @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] group_name The name of the media group
+ * @param[in] group The type of the media group
+ * @param[in] filter The media filter handle
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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_info_cb()
* @see media_content_connect()
* @see media_filter_create()
*/
diff --git a/include/media_image.h b/include/media_image.h
index e005f1b..1e4a81c 100755
--- a/include/media_image.h
+++ b/include/media_image.h
@@ -25,181 +25,193 @@
extern "C" {
#endif /* __cplusplus */
+/**
+ * @brief This file contains the image metadata API and related functions to proceed with them.
+ * Functions include cloning and destroying the image metadata, getting image metadata such as width, height, \n
+ * orientation, date taken, title, burst shot id and updating image to DB.
+ */
/**
* @addtogroup CAPI_CONTENT_MEDIA_IMAGE_MODULE
* @{
- *
- * @file media_image.h
- * @brief This file contains the image metadata API and related functions to proceed with them. \n
- * Functions include clonning and destroying image metadata, getting image metadata as width, height, \n
- * orientation, date taken, title, weather, burst shot id and updating image to db.
*/
+
/**
- * @brief Clones image metadata.
- * @details Function copies the image metadata handle from source to destination.
+ * @brief Clones the image metadata.
+ * @details The function copies the image metadata handle from a source to destination.
*
- * @remark The destination handle must be released with image_meta_destroy() by you.
+ * @since_tizen 2.3
*
- * @param [out] dst A destination handle to image metadata
- * @param [in] src The source handle to image metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks The destination handle must be released with image_meta_destroy().
+ *
+ * @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,
+ * 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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @see image_meta_destroy()
*/
int image_meta_clone(image_meta_h *dst, image_meta_h src);
/**
- * @brief Destroys image metadata.
+ * @brief Destroys the image metadata.
* @details The function frees all resources related to the image metadata handle. This handle
- * no longer can be used to perform any operation. A new handle has to
- * be created before next usage.
+ * no longer can be used to perform any operation. A new handle has to
+ * be created before next usage.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] image The image metadata handle
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] image The handle to image metadata
- * @return 0 on success, otherwise a negative error value.
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @pre Get copy of image_meta handle by calling image_meta_clone()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre Get a copy of image_meta handle by calling image_meta_clone().
+ *
* @see image_meta_clone()
*/
int image_meta_destroy(image_meta_h image);
/**
- * @brief Gets the ID of image.
+ * @brief Gets the ID of an image.
+ * @since_tizen 2.3
*
- * @param [in] image The handle to image metadata
- * @param [out] media_id The ID of image
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] image The image metadata handle
+ * @param[out] media_id The ID of an image
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int image_meta_get_media_id(image_meta_h image, char **media_id);
/**
- * @brief Gets image's width in pixels.
+ * @brief Gets the image width in pixels.
+ * @since_tizen 2.3
*
- * @param [in] image The handle to image metadata
- * @param [out] width The image width in pixels
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] image The image metadata handle
+ * @param[out] width The image width in pixels
+ *
+ * @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
*/
int image_meta_get_width(image_meta_h image, int *width);
/**
- * @brief Gets image's height in pixels.
+ * @brief Gets the image height in pixels.
+ * @since_tizen 2.3
*
- * @param [in] image The handle to image metadata
- * @param [out] height The image height in pixels
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] image The image metadata handle
+ * @param[out] height The image height in pixels
+ *
+ * @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
*/
int image_meta_get_height(image_meta_h image, int *height);
/**
* @brief Gets the image orientation.
+ * @since_tizen 2.3
*
- * @param [in] image The handle to image metadata
- * @param [out] orientation The image orientation
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] image The image metadata handle
+ * @param[out] orientation The image orientation
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int image_meta_get_orientation(image_meta_h image, media_content_orientation_e *orientation);
/**
- * @brief Gets the date, when image was created as time_t structure.
+ * @brief Gets the image creation time as time_t structure.
+ * @since_tizen 2.3
*
- * @param [in] image The handle to image metadata
- * @param [out] date_taken The time, when image was taken (in seconds, since the Epoch)
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int image_meta_get_date_taken(image_meta_h image, char **date_taken);
-
-/**
- * @brief Gets the title.
+ * @param[in] image The image metadata handle
+ * @param[out] date_taken The time, when image was taken (in seconds, since the Epoch)
*
- * @remarks @a title must be released with free() by you.
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param[in] media The handle to image metadata
- * @param[out] title title of image
- * @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_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- *
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
-int image_meta_get_title(image_meta_h image, char **title);
+int image_meta_get_date_taken(image_meta_h image, char **date_taken);
/**
- * @brief Gets the weather in maker note in exif.
- * Example) WeatherInfo: Weather Condition=Sunny, Low Temp=22, High Temp=31
+ * @brief Gets the burst shot ID.
+ * @since_tizen 2.3
*
- * @remarks @a weather must be released with free() by you.
+ * @remarks You must release @a burst_id using free().
*
- * @param[in] image The handle to image metadata
- * @param[out] weather weather of image
- * @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
+ * @param[in] image The image metadata handle
+ * @param[out] burst_id The ID of burst shot\ n
+ * If @a burst_id is @c NULL, this is not burst shot.
*
- */
-int image_meta_get_weather(image_meta_h image, char **weather);
-
-/**
- * @brief Gets the burst shot id.
- *
- * @remarks @a burst id must be released with free() by you.
- *
- * @param[in] media The handle toimage metadata
- * @param[out] burst_id The id of burst shot. if burst_id is NULL, this is not burst shot.
- * @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
+ * @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_PERMISSION_DENIED Permission denied
*/
int image_meta_get_burst_id(image_meta_h image, char **burst_id);
/**
- * @brief Checks whether the media is burst shot image.
+ * @brief Checks whether the media is a burst shot image.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to image metadata
- * @param[out] is_burst_shot /@a true if the burst shot image,
- * /@a false if not burst shot image.
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] image The image metadata handle
+ * @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
*
- */
-int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot);
-
-/**
- * @brief Sets the weather information.
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] image The handle to image metadata
- * @param [in] weather The image weather information
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post image_meta_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
-int image_meta_set_weather(image_meta_h image, const char *weather);
+int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot);
/**
- * @brief Sets the image orientation.
+ * @brief Sets an orientation of the image.
+ * @since_tizen 2.3
*
- * @param [in] image The handle to image metadata
- * @param [in] orientation The image orientation
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] image The image metadata handle
+ * @param[in] orientation The image orientation
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @post image_meta_update_to_db()
*/
int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation);
@@ -207,18 +219,30 @@ int image_meta_set_orientation(image_meta_h image, media_content_orientation_e o
/**
* @brief Updates the image to the media database.
*
- * @details The function updates the given image meta in the media database. The function should be called after any change in image attributes, to be updated to the media
- * database. For example, after using image_meta_set_orientation() for setting the orientation of the image, image_meta_update_to_db() function should be called so as to update
- * the given image attibutes in the media database.
+ * @details The function updates the given image meta in the media database. The function should be called after any change in image attributes, to be updated to the media
+ * database. For example, after using image_meta_set_orientation() for setting the orientation of the image, the image_meta_update_to_db() function should be called so as to update
+ * the given image attributes in the media database.
*
- * @param[in] image The handle to image
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db().
+ *
+ * @param[in] image The handle to the image
+ *
+ * @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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see image_meta_set_orientation()
- *
*/
int image_meta_update_to_db(image_meta_h image);
diff --git a/include/media_info.h b/include/media_info.h
index e61da76..8837a16 100755
--- a/include/media_info.h
+++ b/include/media_info.h
@@ -26,114 +26,204 @@
extern "C" {
#endif /* __cplusplus */
+/**
+ * @file media_info.h
+ * @brief This file contains the media info API and related functions to proceed with it. \n
+ * You can use the functions to insert, clone, delete, get the number and content of files from DB. \n
+ * You can get and set properties and parameters such as storage type, provider, and category of media info, \n
+ * handling with thumbnail and updating media info to DB.
+ */
+
/**
* @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
* @{
- * @file media_info.h
- * @brief This file contains the media info API and related functions to proceed with it. \n
- * Functions are capabale to insert, clone, delete, get number, content of files from db. \n
- * Get and set properties and parameters such as storage type, provider, category etc. of media info, \n
- * handling with thumbnail and updaing media info to db.
*/
/**
- * @brief Inserts media file into the media database.
- * @details This function inserts an media item into the content storage.
- * Normally, inserting a media file in database is done automatically by media server, without calling this function.
- * This function is only called when media server is busy and user needs to get quick result of inserting
- * e.g. Taking a photo while media server is busy and user want to see the quick snapshot of the photo taken.
- * @remark The handle must be released with media_info_destroy() by you.
+ * @brief Inserts a media file into the media database.
+ * @details This function inserts a media item into the content storage.
+ * Normally, inserting a media file in database is done automatically by the media server, without calling this function.
+ * This function is only called when the media server is busy and the user needs to get quick result of inserting
+ * e.g. Taking a photo while media server is busy and the user wants to see the quick snapshot of the photo taken.
+ *
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ * %http://tizen.org/privilege/mediastorage \n
+ * %http://tizen.org/privilege/externalstorage
*
- * @param[in] path The path to the media file
+ * @remarks You must release the handle using media_info_destroy(). \n
+ * You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
+ * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
+ * If you can access both storage, you must add all privilege.
+ *
+ * @param[in] path The path to the media file
* @param[out] info The handle to the media info
- * @return 0 on success, otherwise a negative error value.
+ *
+ * @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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
*/
int media_info_insert_to_db (const char *path, media_info_h *info);
/**
- * @brief Insert media files into the media database, asynchronously.
- * @details This function insert an media items into the content storage.
- * Normally, inserting a media file in database is done automatically by media server, without calling this function.
- * This function invokes media_insert_completed_cb callback function.
- * #media_insert_completed_cb will be called when insertion to media database is finished.
+ * @brief Inserts media files into the media database, asynchronously.
+ * @details This function inserts media items into the content storage.
+ * Normally, inserting a media file in database is done automatically by the media server, without calling this function.
+ * This function invokes media_insert_completed_cb() callback function when insertion to the media database is finished.
*
- * @param[in] path_array The path array to the media files
- * @param[in] array_length The length of array
- * @param[in] callback The callback to invoke when media items inserted completely
- * @param[in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ * %http://tizen.org/privilege/mediastorage \n
+ * %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
+ * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
+ * If you can access both storage, you must add all privilege.
+ *
+ * @param[in] path_array The path array to the media files
+ * @param[in] array_length The length of the array
+ * @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,
+ * 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_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_insert_completed_cb()
*/
int media_info_insert_batch_to_db(const char **path_array,unsigned int array_length, media_insert_completed_cb callback, void *user_data);
/**
- * @brief Insert the burst shot images into the media database, asynchronously.
- * @details This function insert the busrt images into the content storage.
- * #media_insert_burst_shot_completed_cb will be called when insertion to media database is finished.
+ * @brief Inserts the burst shot images into the media database, asynchronously.
+ * @details This function inserts burst images into the content storage.
+ * media_insert_burst_shot_completed_cb() will be called when insertion to media database is finished.
*
- * @param[in] path_array The path array to the burst shot images
- * @param[in] array_length The length of array
- * @param[in] callback The callback to invoke when the images inserted completely
- * @param[in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ * %http://tizen.org/privilege/mediastorage \n
+ * %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ * If you want to access only internal storage with this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
+ * Or if you want to access only external storage with this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
+ * If you can access both storage, you must add all privilege.
+ *
+ * @param[in] path_array The path array to the burst shot images
+ * @param[in] array_length The length of the array
+ * @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,
+ * 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_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_insert_burst_shot_completed_cb()
*/
int media_info_insert_burst_shot_to_db(const char **path_array,unsigned int array_length, media_insert_burst_shot_completed_cb callback, void *user_data);
/**
- * @brief Deletes media file from the media database.
- * @details This function deletes an media item from the content storage.
- * Normally, deleting a media file in database is done automatically by media server, without calling this function.
- * This function is only called when media server is busy and user needs to get quick result of deleting
+ * @brief Deletes a media file from the media database.
+ * @details This function deletes a media item from the content storage.
+ * Normally, deleting a media file in the database is done automatically by the media server, without calling this function.
+ * This function is only called when the media server is busy and user needs to get quick result of deleting.
+ *
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] media_id The ID to the media file
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param[in] media_id The ID to the media file
- * @return 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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
*/
int media_info_delete_from_db(const char *media_id);
/**
- * @brief Deletes media files from the media database. The media files to delete can be specified as a condition in a filter.
+ * @brief Deletes media files from the media database.
+ * The media files for deletion can be specified as a condition in a filter.
* @details This function deletes the media items from the content storage.
- * Normally, deleting media files in database are done automatically by media server, without calling this function.
- * This function is only called when media server is busy and user needs to get quick result of deleting
+ * Normally, deleting media files in the database are done automatically by the media server, without calling this function.
+ * This function is only called when the media server is busy and user needs to get quick result of deleting.
+ *
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] filter The handle to filter
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param[in] filter The handle to filter
- * @return 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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
*/
int media_info_delete_batch_from_db(filter_h filter);
/**
- * @brief Destroys the media info.
+ * @brief Destroys media info.
* @details The function frees all resources related to the media info handle. This handle
- * no longer can be used to perform any operation. New media info handle has to
- * be created before next usage.
+ * can no longer be used to perform any operation. New media info handle has to
+ * be created before the next usage.
*
- * @param[in] media The handle to media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @param[in] 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
- * @pre Get copy of media_info handle by calling media_info_clone()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre Get copy of media_info handle by calling media_info_clone().
+ *
* @see media_info_clone()
*/
int media_info_destroy(media_info_h media);
@@ -141,18 +231,26 @@ int media_info_destroy(media_info_h media);
/**
* @brief Clones the media info handle.
*
- * @details This function copies the media info handle from a source to destination.
- * There is no media_info_create() function. The media_info_h is created internally and
- * available through media info foreach function such as media_info_foreach_media_from_db().
- * To use this handle outside of these foreach functions, use this function.
- * @remark The destination handle must be released with media_info_destroy() by you.
+ * @details This function copies the media info handle from a source to the destination.
+ * There is no media_info_create() function. The media_info_h is created internally and
+ * available through media info foreach function such as media_info_foreach_media_from_db().
+ * To use this handle outside of these foreach functions, use this function.
*
- * @param[out] dst A destination handle to media info
- * @param[in] src The source handle to media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @remarks You must release the destination handle using media_info_destroy().
+ *
+ * @param[out] dst The destination handle to the media info
+ * @param[in] src The source handle to 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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @see media_info_destroy()
* @see media_album_foreach_media_from_db()
* @see media_playlist_foreach_media_from_db()
@@ -160,763 +258,1041 @@ int media_info_destroy(media_info_h media);
* @see media_tag_foreach_media_from_db()
* @see media_info_foreach_media_from_db()
* @see media_folder_foreach_media_from_db()
- *
*/
int media_info_clone(media_info_h *dst, media_info_h src);
/**
- * @brief Gets the number of media info for the passed @a filter from the media database.
+ * @brief Gets the count of media info for the passed @a filter from the media database.
+ * @since_tizen 2.3
*
- * @param[in] filter The handle to filter.
+ * @param[in] filter The handle to filter
* @param[out] media_count The count of media
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @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_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_info_get_media_count_from_db(filter_h filter, int *media_count);
/**
* @brief Iterates through media info from the media database.
- * @details This function gets all media info handles meeting the given @a filter. The @a callback function will be invoked for every retrieved media info.
- * If NULL is passed to the @a filter, no filtering is applied.
- * @param[in] filter The handle to media info filter
- * @param[in] callback The callback function to invoke
+ * @details This function gets all media info handles meeting the given @a filter.
+ * The @a callback function will be invoked for every retrieved media info.
+ * If @c NULL is passed to the @a filter, then no filtering is applied.
+ *
+ * @since_tizen 2.3
+ *
+ * @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.
+ * So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB.
+ * We do not recommend you call updating DB function in callback of foreach function.
+ *
+ * @param[in] filter The media info 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 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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_content_connect()
* @see #media_info_cb
* @see media_info_filter_create()
- *
*/
int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, void *user_data);
/**
- * @brief Gets the number of media tag for the passed @a filter in the given @a media ID from the media database.
+ * @brief Gets the count of media tags for the passed @a filter in the given @a media_id from the media database.
+ * @since_tizen 2.3
*
- * @param[in] media_id The ID of media info
- * @param[in] filter The handle to media filter
- * @param[out] tag_count The count of media tag
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] media_id The ID of the media info
+ * @param[in] filter The handle to the media filter
+ * @param[out] tag_count The count of the media tag
+ *
+ * @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_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count);
/**
- * @brief Iterates through the media tag in the given @a media @a info from the media database.
- * @details This function gets all media tag associated with the given @a media and calls registered callback function for every retrieved media tag.
- * @param[in] media_id The ID of media info
- * @param[in] filter The handle to media filter
- * @param[in] callback The callback function to invoke
+ * @brief Iterates through the media tag in the given media info from the media database.
+ * @details This function gets all the media tags associated with the given @a media_id and calls registered callback function for every retrieved media tag.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] media_id The ID of the media info
+ * @param[in] filter The handle to the media filter
+ * @param[in] callback The callback function to be invoked
* @param[in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ *
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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_tag_cb().
+ *
* @see media_content_connect()
* @see #media_tag_cb
*/
int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data);
/**
- * @brief Gets the number of bookmark for the passed @a filter in the given @a media ID from the media database.
+ * @brief Gets the number of bookmarks for the passed @a filter in the given media ID from the media database.
+ * @since_tizen 2.3
*
- * @param[in] media_id The ID of media info
- * @param[in] filter The handle to media filter
- * @param[out] bookmark_count The count of media tag
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] media_id The ID of the media info
+ * @param[in] filter The handle to the media filter
+ * @param[out] bookmark_count The count of the media tag
+ *
+ * @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_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_info_get_bookmark_count_from_db(const char *media_id, filter_h filter, int *bookmark_count);
/**
- * @brief Iterates through the media bookmark in the given @a media @a info from the media database.
- * @details This function gets all media bookmark associated with the given @a media and calls registered callback function for every retrieved media bookmark.
- * @param[in] media_id The ID of media info
- * @param[in] filter The handle to media filter
- * @param[in] callback The callback function to invoke
+ * @brief Iterates through the media bookmark in the given media info from the media database.
+ * @details This function gets all media bookmarks associated with the given media and calls registered callback function for every retrieved media bookmark.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] media_id The ID of the media info
+ * @param[in] filter The handle to the media filter
+ * @param[in] callback The callback function to be invoked
* @param[in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ *
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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_bookmark_cb().
+ *
* @see media_content_connect()
- * @see #media_bookmark_cb
+ * @see media_bookmark_cb()
*/
int media_info_foreach_bookmark_from_db (const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
/**
- * @brief Gets image metadata for a given media info.
+ * @brief Gets the image metadata for a given media info.
* @details This function returns an image metadata handle retrieved from the media info.
*
- * @remark The @a image handle must be released with image_meta_destroy() by you.
+ * @since_tizen 2.3
*
- * @param [in] media The handle to media info
- * @param[out] image A handle to image meta
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release the @a image handle using image_meta_destroy().
+ *
+ * @param[in] media The media info handle
+ * @param[out] image A handle to image metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @see image_meta_destroy()
*/
int media_info_get_image(media_info_h media, image_meta_h *image);
/**
- * @brief Gets video metadata for a given media info.
+ * @brief Gets a video metadata for a given media info.
* @details This function returns a video metadata handle retrieved from the media info handle.
*
- * @remark The @a video handle must be released with video_meta_destroy() by you.
+ * @since_tizen 2.3
+ *
+ * @remarks You must release the @a video handle using video_meta_destroy().
*
- * @param [in] media The handle to media info
+ * @param[in] media The media info handle
* @param[out] video A handle to the video meta
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
- * @see video_meta_destroy()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @see video_meta_destroy()
*/
int media_info_get_video(media_info_h media, video_meta_h *video);
/**
- * @brief Gets audio metadata for a given media info.
+ * @brief Gets an audio metadata for a given media info.
* @details This function returns an audio metadata handle retrieved from the media info handle.
*
- * @remark The @a audio handle must be released with audio_meta_destroy() by you.
+ * @since_tizen 2.3
+ *
+ * @remarks You must release the @a audio handle using audio_meta_destroy().
*
- * @param [in] media The handle to media info
+ * @param[in] media The media info handle
* @param[out] audio A handle to the audio meta
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @see audio_meta_destroy()
*/
int media_info_get_audio(media_info_h media, audio_meta_h *audio);
/**
- * @brief Gets ID to media info.
+ * @brief Gets the tag ID for the media info.
+ * @since_tizen 2.3
*
- * @param [in] media_id The ID if media info
- * @param [out] media_id The ID of media tag
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] media The media info handle
+ * @param[out] media_id The ID of the media tag
+ *
+ * @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
*/
int media_info_get_media_id(media_info_h media, char **media_id);
/**
- * @brief Gets path to media info.
+ * @brief Gets the path to the media info.
+ * @since_tizen 2.3
*
- * @remarks @a path must be released with free() by you.
+ * @remarks You must release @a path using free().
*
- * @param[in] media The handle to media info
- * @param[out] path The path of media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] media The media info handle
+ * @param[out] 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_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
*/
int media_info_get_file_path(media_info_h media, char **path);
/**
- * @brief Gets name to media info.
+ * @brief Gets the name of the media info.
+ * @since_tizen 2.3
*
- * @remarks @a name must be released with free() by you.
+ * @remarks You must release @a name using free().
*
- * @param[in] media The handle to media info
- * @param[out] name The name of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] name The name of 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_display_name(media_info_h media, char **name);
/**
- * @brief Gets media info's content type.
+ * @brief Gets the content type of the media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] type The type of media content(#media_content_type_e)
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @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,
+ * 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
*/
int media_info_get_media_type(media_info_h media, media_content_type_e *type);
/**
- * @brief Gets name to media info.
+ * @brief Gets the MIME type from the media info.
+ * @since_tizen 2.3
*
- * @remarks @a mime_type must be released with free() by you.
+ * @remarks You must release @a mime_type using free().
*
- * @param[in] media The handle to media info
- * @param[out] mime_type The mime type of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] 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_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_mime_type(media_info_h media, char **mime_type);
/**
- * @brief Gets media file's size.
+ * @brief Gets the media file size.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] size The type of media content
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @param[out] size The type of the media content
*
+ * @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
*/
int media_info_get_size(media_info_h media, unsigned long long *size);
/**
- * @brief Gets added time.
+ * @brief Gets the addition time of the media.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] added_time The added time to DB
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @param[out] added_time The added time to the DB
+ *
+ * @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
*/
int media_info_get_added_time(media_info_h media, time_t *added_time);
/**
- * @brief Gets media info's date of modification.
+ * @brief Gets the date of modification of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] time The date of modification of File. Get from File
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @param[out] time The date of modification of the file \n
+ * Get from the file.
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_modified_time(media_info_h media, time_t *time);
/**
- * @brief Gets media info's timeline.
+ * @brief Gets the timeline of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] time The date of timeline.
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @param[out] time The date of the timeline
+ *
+ * @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
*/
int media_info_get_timeline(media_info_h media, time_t* time);
/**
- * @brief Gets the thumbnail to media info.
+ * @brief Gets the thumbnail of media info.
+ * @since_tizen 2.3
*
- * @remarks @a path must be released with free() by you.
+ * @remarks You must release @a path using free().
*
- * @param[in] media The handle to media info
- * @param[out] path The path to thumbnail of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] path The path to the thumbnail 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_thumbnail_path(media_info_h media, char **path);
/**
- * @brief Gets the description to media info.
+ * @brief Gets the description of media info.
+ * @since_tizen 2.3
*
- * @remarks @a description must be released with free() by you.
+ * @remarks You must release @a description using free().
*
- * @param[in] media The handle to media info
- * @param[out] description The description of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] description The description 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_description(media_info_h media, char **description);
/**
- * @brief Gets media info's longitude.
+ * @brief Gets the longitude of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] longitude The longitude of media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @param[out] longitude The longitude of the media info
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_longitude(media_info_h media, double* longitude);
/**
- * @brief Gets media info's latitude.
+ * @brief Gets the latitude of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] latitude The latitude of media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] media The media info handle
+ * @param[out] latitude The latitude of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
*/
int media_info_get_latitude(media_info_h media, double* latitude);
/**
- * @brief Gets media info's altitude of modification.
+ * @brief Gets the altitude of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] altitude The altitude of media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @param[out] altitude The altitude of the media info
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_altitude(media_info_h media, double* altitude);
/**
- * @brief Gets media info's weather.
+ * @brief Gets the weather of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] weater The weather of media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @param[out] weather The weather of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_weather(media_info_h media, char **weather);
/**
- * @brief Gets media info's rating.
+ * @brief Gets the rating of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] rating The rating of media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @param[out] rating The rating of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_rating(media_info_h media, int *rating);
/**
- * @brief Gets the given media info's favorite status.
+ * @brief Gets the favorite status of media info.
+ * @since_tizen 2.3
*
- * @param [in] media The handle to media info
- * @param [out] favorite The media favorite status(non zero if favorite, 0 if not favorite)
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @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,
+ * 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
*/
int media_info_get_favorite(media_info_h media, bool* favorite);
/**
- * @brief Gets the author to media info.
+ * @brief Gets the author of media info.
+ * @since_tizen 2.3
*
- * @remarks @a author must be released with free() by you.
+ * @remarks You must release @a author using free().
*
- * @param[in] media The handle to media info
- * @param[out] author The author of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] author The author of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_author(media_info_h media, char **author);
/**
- * @brief Gets the provider to media info.
+ * @brief Gets the provider of media info.
+ * @since_tizen 2.3
*
- * @remarks @a provider must be released with free() by you.
+ * @remarks You must release @a provider using free().
*
- * @param[in] media The handle to media info
- * @param[out] provider The provider of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] provider The provider of the media info
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_provider(media_info_h media, char **provider);
/**
- * @brief Gets the content name to media info.
+ * @brief Gets the content name of media info.
+ * @since_tizen 2.3
*
- * @remarks @a content_name must be released with free() by you.
+ * @remarks You must release @a content_name using free().
*
- * @param[in] media The handle to media info
- * @param[out] content_name The content name of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] content_name The content name of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_content_name(media_info_h media, char **content_name);
/**
- * @brief Gets the title to media info.
+ * @brief Gets the title of media info.
+ * @since_tizen 2.3
*
- * @remarks @a title must be released with free() by you.
+ * @remarks You must release @a title using free().
*
- * @param[in] media The handle to media info
- * @param[out] title The title of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] title The title 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_title(media_info_h media, char **title);
/**
- * @brief Gets the provider to media info.
+ * @brief Gets the category of media info.
+ * @since_tizen 2.3
*
- * @remarks @a category must be released with free() by you.
+ * @remarks You must release @a category using free().
*
- * @param[in] media The handle to media info
- * @param[out] category The category of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] category The category of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_category(media_info_h media, char **category);
/**
- * @brief Gets the location_tag to media info.
+ * @brief Gets the location tag of media info.
+ * @since_tizen 2.3
*
- * @remarks @a location_tag must be released with free() by you.
+ * @remarks You must release @a location_tag using free().
*
- * @param[in] media The handle to media info
- * @param[out] location_tag The location of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] location_tag The location of the media info
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_location_tag(media_info_h media, char **location_tag);
/**
- * @brief Gets the age_rating to media info.
+ * @brief Gets the age_rating of media info.
+ * @since_tizen 2.3
*
- * @remarks @a age_rating must be released with free() by you.
+ * @remarks You must release @a age_rating using free().
*
- * @param[in] media The handle to media info
- * @param[out] age_rating The age rating of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] age_rating The age rating of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_age_rating(media_info_h media, char **age_rating);
/**
- * @brief Gets the keyword to media info.
+ * @brief Gets the keyword of media info.
+ * @since_tizen 2.3
*
- * @remarks @a keyword must be released with free() by you.
+ * @remarks You must release @a keyword using free().
*
- * @param[in] media The handle to media info
- * @param[out] keyword The keyword of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[out] keyword The keyword of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_get_keyword(media_info_h media, char **keyword);
/**
- * @brief Checks whether the media is protected via drm.
+ * @brief Checks whether the media is protected via DRM.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] is_drm /@a true if the drm media,
- * /@a false if not drm.
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @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,
+ * 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
*/
int media_info_is_drm(media_info_h media, bool *is_drm);
/**
- * @brief Gets media info's storage_type.
+ * @brief Gets the storage type of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[out] storage_type The storage type of media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @param[in] media The media info handle
+ * @param[out] storage_type The storage 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_PERMISSION_DENIED Permission denied
*/
int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type);
/**
* @brief Gets the media info from the media database.
*
- * @details This function creates a new media handle from the media database by the given media_id.
- * media info will be created, which is filled with info information.
+ * @details This function creates a new media handle from the media database by the given @a media_id.
+ * Media info will be created and filled with information.
*
- * @remarks @a media must be released with media_tag_destroy() by you.
+ * @since_tizen 2.3
*
- * @param[in] media_id The ID of media info
- * @param[out] media The media handle associated with the media ID
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a media using media_tag_destroy().
+ *
+ * @param[in] media_id The ID of media info
+ * @param[out] media The media handle associated with the media ID
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_info_destroy()
- *
*/
int media_info_get_media_from_db(const char *media_id, media_info_h *media);
/**
- * @brief Sets display name to media info.
+ * @brief Sets the display name of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] display_name The display name of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] display_name The display name of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post media_info_update_to_db().
*
*/
int media_info_set_display_name(media_info_h media, const char *display_name);
/**
- * @brief Sets description to media info.
+ * @brief Sets the description of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] description The description of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] description The description of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post media_info_update_to_db().
*
*/
int media_info_set_description(media_info_h media, const char *description);
/**
- * @brief Sets longitude to media info.
+ * @brief Sets the longitude of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] longitude The longitude of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] longitude The longitude of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_info_update_to_db().
*/
int media_info_set_longitude(media_info_h media, double longitude);
/**
- * @brief Sets latitude to media info.
+ * @brief Sets the latitude of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] latitude The latitude of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] latitude The latitude of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_info_update_to_db().
*/
int media_info_set_latitude(media_info_h media, double latitude);
/**
- * @brief Sets altitude to media info.
+ * @brief Sets the altitude of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] altitude The altitude of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] altitude The altitude of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_info_update_to_db().
*/
int media_info_set_altitude(media_info_h media, double altitude);
/**
- * @brief Sets weather to media info.
+ * @brief Sets the weather of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] weather The weather of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] weather The weather of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post media_info_update_to_db().
*
*/
int media_info_set_weather(media_info_h media, const char *weather);
/**
- * @brief Sets rating to media info.
+ * @brief Sets the rating of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] rating The rating of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] rating The rating of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_info_update_to_db().
*/
int media_info_set_rating(media_info_h media, int rating);
/**
- * @brief Sets favorite to media info.
+ * @brief Sets the favorite of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] favorite The favorite of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] favorite Set @c true to set the media info as favorite,
+ * otherwise set @c false to not set the media info as favorite
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_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_set_favorite(media_info_h media, bool favorite);
/**
- * @brief Sets author to media info.
+ * @brief Sets the author of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] author The author of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] author The author of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_set_author(media_info_h media, const char *author);
/**
- * @brief Sets provider to media info.
+ * @brief Sets the provider of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] provider The provider of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] provider The provider of the media info
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int media_info_set_provider(media_info_h media, const char *provider);
/**
- * @brief Sets content name to media info.
+ * @brief Sets the content name of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] content_name The content name of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] content_name The content name of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_info_update_to_db()
*/
int media_info_set_content_name(media_info_h media, const char *content_name);
/**
- * @brief Sets category to media info.
+ * @brief Sets the category of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] category The category of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] category The category of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_info_update_to_db()
*/
int media_info_set_category(media_info_h media, const char *category);
/**
- * @brief Sets location tag to media info.
+ * @brief Sets the location tag of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] location_tag The location of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] location_tag The location of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_info_update_to_db()
*/
int media_info_set_location_tag(media_info_h media, const char *location_tag);
/**
- * @brief Sets age rating to media info.
+ * @brief Sets the age rating of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] age_rating The age rating of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] age_rating The age rating of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_info_update_to_db()
*/
int media_info_set_age_rating(media_info_h media, const char *age_rating);
/**
- * @brief Sets keyword to media info.
+ * @brief Sets the keyword of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] keyword The keyword of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] keyword The keyword of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_info_update_to_db()
*/
int media_info_set_keyword(media_info_h media, const char *keyword);
/**
* @brief Updates the media info to the media database.
+ *
+ * @details The function updates the given media info in the media database.
*
- * @details The function updates the given media info in the media database. The function should be called after any change in media, to be updated to the media
- * database. For example, after using media_info_set_display_name() for setting the name of the media, media_info_update_to_db() function should be called so as to update
- * the given media info attibutes in the media database.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
*
- * @param[in] media The handle to media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks The function should be called after any change in media, to be updated to the media
+ * database. For example, after using media_info_set_display_name()
+ * for setting the name of the media, the media_info_update_to_db() function should be called so as to update
+ * the given media info attributes in the media database.
+ *
+ * @param[in] media The 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_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_info_set_display_name()
* @see media_info_set_description()
@@ -931,78 +1307,133 @@ int media_info_set_keyword(media_info_h media, const char *keyword);
* @see media_info_set_category()
* @see media_info_set_location_tag()
* @see media_info_set_age_rating()
- *
*/
int media_info_update_to_db(media_info_h media);
/**
- * @brief Refresh the metadata of media to media database.
+ * @brief Refreshes the media metadata to the media database.
+ * @since_tizen 2.3
*
- * @param[in] media_id The ID of media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ * %http://tizen.org/privilege/mediastorage \n
+ * %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
+ * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
+ * If you can access both storage, you should add all privilege.
+ *
+ * @param[in] media_id The 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_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_info_refresh_metadata_to_db(const char *media_id);
/**
- * @brief Sets added_time to media info.
+ * @brief Sets the added time of media info.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] added_time The added time of media info
- * @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
+ * @param[in] media The media info handle
+ * @param[in] added_time The added time of the media info
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post media_info_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_info_update_to_db()
*/
int media_info_set_added_time(media_info_h media, time_t added_time);
/**
* @brief Moves the media info to the given destination path in the media database.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ * %http://tizen.org/privilege/mediastorage \n
+ * %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
+ * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
+ * If you can access both storage, you should add all privilege.
+ *
+ * @param[in] media The media info handle
* @param[in] dst_path The path of destination
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @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_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_info_move_to_db(media_info_h media, const char* dst_path);
/**
- * @brief Creates a thumbnail image for given the media, asynchronously.
- * @details This function creates an thumbnail image for given media item and and calls registered callback function for completion of creating the thumbnail.
- * If there already exist a thumbnail for given media, then the path of thumbnail will be return in callback function.
+ * @brief Creates a thumbnail image for the given media, asynchronously.
+ * @details This function creates an thumbnail image for given media item and calls registered callback function for completion of creating the thumbnail.
+ * If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function.
+ *
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @param[in] callback The callback function to invoke
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] media The media info handle
+ * @param[in] callback The callback function to be invoked
* @param[in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
- * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter ( Especially, if the request is duplicated, this error returns. )
- * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
*/
int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
-
/**
- * @brief Cancel to creates a thumbnail image for given the media.
+ * @brief Cancels the creation of image's thumbnail for the given media.
+ * @since_tizen 2.3
*
- * @param[in] media The handle to media info
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] 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_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
* @see media_content_connect()
*/
diff --git a/include/media_info_private.h b/include/media_info_private.h
index 1b1109c..3b9045c 100755
--- a/include/media_info_private.h
+++ b/include/media_info_private.h
@@ -40,6 +40,7 @@ extern "C" {
#undef LOG_TAG
#endif
+
/**
* @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
* @{
@@ -51,6 +52,7 @@ extern "C" {
* Defenitions of media DB fields and tables, operations with media data relating to DB and handling with media filter attributes.
*/
+
#define LOG_TAG "CAPI_CONTENT_MEDIA_CONTENT"
#define SAFE_STRLCPY(dst, src, n) ((g_strlcpy(dst, src, n) < n) ? TRUE : FALSE)
@@ -59,7 +61,7 @@ extern "C" {
#define STRING_VALID(str) ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
#define SQLITE3_FINALIZE(x) {if(x != NULL) {sqlite3_finalize(x);}}
-#define MEDIA_CONTENT_THUMB_DEFAULT_PATH MEDIA_DATA_PATH"/.thumb/thumb_default.png"
+#define MEDIA_CONTENT_THUMB_DEFAULT_PATH MEDIA_THUMB_ROOT_PATH"/.thumb/thumb_default.png"
#define MEDIA_CONTENT_INSERT_FILES_PATH MEDIA_DATA_PATH"/"
#define MAX_QUERY_SIZE 4096
@@ -97,6 +99,16 @@ typedef enum {
MEDIA_GROUP_BOOKMARK,
MEDIA_GROUP_TAG_BY_MEDIA_ID,
MEDIA_GROUP_BOOKMARK_BY_MEDIA_ID,
+
+#ifdef COMMERCIAL_FEATURE
+ MEDIA_GROUP_MEDIA_WITH_MODE,
+ MEDIA_GROUP_FOLDER_WITH_MODE,
+ MEDIA_GROUP_CATEGORY_MAIN_CATEGORY,
+ MEDIA_GROUP_CATEGORY_SUB_CATEGORY,
+ MEDIA_GROUP_EVENT,
+ MEDIA_GROUP_GALLERY_SEARCH,
+#endif
+
} group_list_e;
typedef enum {
@@ -121,7 +133,7 @@ typedef struct
char *path;
char *name;
time_t modified_time;
- media_content_storage_e storage_type;
+ int storage_type;
}media_folder_s;
typedef struct
@@ -201,6 +213,7 @@ typedef struct
char *copyright;
char *track_num;
int bitrate;
+ int bitpersample;
int samplerate;
int channel;
int duration;
@@ -239,6 +252,9 @@ typedef struct
int is_drm;
int storage_type;
int sync_status;
+#ifdef COMMERCIAL_FEATURE
+ int mode;
+#endif
image_meta_s *image_meta;
video_meta_s *video_meta;
audio_meta_s *audio_meta;
@@ -341,6 +357,7 @@ typedef struct _media_content_cb_data {
#define DB_FIELD_MEDIA_TRACK_NUM "track_num"
#define DB_FIELD_MEDIA_DESCRIPTION "description"
#define DB_FIELD_MEDIA_BITRATE "bitrate"
+#define DB_FIELD_MEDIA_BITPERSAMPLE "bitpersample"
#define DB_FIELD_MEDIA_SAMPLERATE "samplerate"
#define DB_FIELD_MEDIA_CHANNEL "channel"
#define DB_FIELD_MEDIA_DURATION "duration"
@@ -385,6 +402,10 @@ typedef struct _media_content_cb_data {
#define DB_FIELD_MEDIA_AGE_RATING_PINYIN "age_rating_pinyin"
#define DB_FIELD_MEDIA_KEYWORD_PINYIN "keyword_pinyin"
+#ifdef COMMERCIAL_FEATURE
+#define DB_FIELD_MEDIA_TRACK_NUM_INT "CAST (track_num AS INTEGER)"
+#endif
+
/* DB field for folder */
#define DB_FIELD_FOLDER_ID "folder_uuid"
#define DB_FIELD_FOLDER_PATH "path"
@@ -393,6 +414,7 @@ typedef struct _media_content_cb_data {
#define DB_FIELD_FOLDER_STORAGE_TYPE "storage_type"
#define DB_FIELD_FOLDER_NAME_PINYIN "name_pinyin"
+
/* DB field for playlist */
#define DB_FIELD_PLAYLIST_ID "playlist_id"
#define DB_FIELD_PLAYLIST_NAME "name"
@@ -436,7 +458,7 @@ typedef struct _media_content_cb_data {
#define SELECT_FOLDER_LIST "SELECT DISTINCT f.folder_uuid, f.path, f.name, f.storage_type, f.modified_time FROM "FOLDER_MEDIA_JOIN
#define SELECT_TAG_LIST "SELECT DISTINCT tag_id, name FROM "DB_VIEW_TAG" WHERE 1 "
-#define SELECT_PLAYLIST_LIST "SELECT DISTINCT playlist_id, name, thumbnail_path FROM "DB_VIEW_PLAYLIST" WHERE 1 "
+#define SELECT_PLAYLIST_LIST "SELECT DISTINCT playlist_id, name, p_thumbnail_path FROM "DB_VIEW_PLAYLIST" WHERE 1 "
/* Get Group Count */
#define SELECT_ALBUM_COUNT "SELECT COUNT(DISTINCT a.album_id) FROM "ALBUM_MEDIA_JOIN
@@ -472,12 +494,17 @@ typedef struct _media_content_cb_data {
#define SELECT_TAG_COUNT_BY_MEDIA_ID "SELECT COUNT(*) FROM "DB_VIEW_TAG" WHERE media_uuid = '%s'"
#define SELECT_TAG_LIST_BY_MEDIA_ID "SELECT tag_id, name FROM "DB_VIEW_TAG" WHERE media_uuid = '%s'"
+/* Get Media list of Group */
+#define MEDIA_INFO_ITEM "media_uuid, path, file_name, media_type, mime_type, size, added_time, modified_time, thumbnail_path, description, \
+ rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status"
+
/* Playlist Info */
#define INSERT_PLAYLIST_TO_PLAYLIST "INSERT INTO "DB_TABLE_PLAYLIST" (name) VALUES (%Q)"
#define UPDATE_PLAYLIST_NAME_FROM_PLAYLIST "UPDATE "DB_TABLE_PLAYLIST" SET name='%q' WHERE playlist_id=%d"
#define UPDATE_PLAYLIST_THUMBNAIL_FROM_PLAYLIST "UPDATE "DB_TABLE_PLAYLIST" SET thumbnail_path='%q' WHERE playlist_id=%d"
#define SELECT_PLAYLIST_ID_FROM_PLAYLIST "SELECT playlist_id FROM "DB_TABLE_PLAYLIST" WHERE name='%q'"
#define SELECT_PLAYLIST_ITEM_ID_FROM_PLAYLIST_VIEW "SELECT pm_id, media_uuid FROM "DB_VIEW_PLAYLIST" WHERE (playlist_id=%d and media_count>0) "
+#define SELECT_PLAYLIST_ITEM_ALL_FROM_PLAYLIST_VIEW "SELECT "MEDIA_INFO_ITEM" , pm_id FROM "DB_VIEW_PLAYLIST" WHERE (playlist_id=%d and media_count>0) "
#define SELECT_PLAY_ORDER_FROM_PLAYLIST_VIEW "SELECT play_order FROM "DB_VIEW_PLAYLIST" WHERE playlist_id=%d and pm_id=%d"
#define SELECT_MAX_PLAY_ORDER_FROM_PLAYLIST_VIEW "SELECT MAX(play_order) FROM "DB_VIEW_PLAYLIST" WHERE playlist_id=%d"
#define REMOVE_PLAYLIST_ITEM_FROM_PLAYLIST_MAP "DELETE FROM "DB_TABLE_PLAYLIST_MAP" WHERE playlist_id=%d AND _id=%d"
@@ -492,10 +519,6 @@ typedef struct _media_content_cb_data {
#define UPDATE_AV_META_FROM_MEDIA "UPDATE "DB_TABLE_MEDIA" SET played_count=%d, last_played_time=%d, last_played_position=%d WHERE media_uuid='%q'"
#define UPDATE_IMAGE_META_FROM_MEDIA "UPDATE "DB_TABLE_MEDIA" SET orientation=%d, weather=%Q WHERE media_uuid='%q'"
-/* Get Media list of Group */
-#define MEDIA_INFO_ITEM "media_uuid, path, file_name, media_type, mime_type, size, added_time, modified_time, thumbnail_path, description, \
- rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status"
-
#define SELECT_MEDIA_ITEM "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity=1"
#define SELECT_MEDIA_FROM_MEDIA "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity=1 AND media_uuid='%s'"
#define SELECT_MEDIA_BY_PATH "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE validity=1 AND path='%q'"
@@ -513,6 +536,97 @@ typedef struct _media_content_cb_data {
#define DELETE_TAG_FROM_TAG "DELETE FROM "DB_TABLE_TAG" WHERE tag_id=%d"
#define DELETE_BOOKMARK_FROM_BOOKMARK "DELETE FROM "DB_TABLE_BOOKMARK" WHERE bookmark_id=%d"
+#ifdef COMMERCIAL_FEATURE
+#define MEDIA_MODE_JOIN "media as m LEFT OUTER JOIN media_mode as mm ON m.media_uuid=mm.media_uuid WHERE validity=1 "
+#define MEDIA_INFO_ITEM_WITH_MODE "m."MEDIA_INFO_ITEM
+#define SELECT_MEDIA_ITEM_WITH_MODE "SELECT "MEDIA_INFO_ITEM_WITH_MODE", mm.mode FROM "MEDIA_MODE_JOIN
+#define SELECT_MEDIA_FROM_FOLDER_WITH_MODE "SELECT "MEDIA_INFO_ITEM_WITH_MODE", mm.mode FROM "MEDIA_MODE_JOIN"AND folder_uuid='%s'"
+#define SELECT_MEDIA_COUNT_FROM_MODE "SELECT COUNT(*) FROM "MEDIA_MODE_JOIN
+#define SELECT_MEDIA_COUNT_FROM_MODE_BY_ID "SELECT COUNT(*) FROM media_mode WHERE media_uuid=(SELECT media_uuid FROM "DB_TABLE_MEDIA" WHERE path='%q')"
+#define INSERT_MEDIA_MODE "INSERT INTO media_mode (media_uuid, mode) SELECT media_uuid, %d FROM media WHERE path='%q'"
+#define UPDATE_MEDIA_MODE "UPDATE media_mode SET mode=%d WHERE media_uuid=(SELECT media_uuid FROM "DB_TABLE_MEDIA" WHERE path='%q')"
+
+
+int _media_info_get_origin_folder_path(const char *folder_id, char **path);
+int _media_info_get_origin_item_path(const char *media_id, char **path);
+
+/* Definitions for category */
+typedef struct
+{
+ char *category_name; /* category_name can be either main_category or sub_category, depends on API */
+}media_category_s;
+
+typedef enum
+{
+ MEDIA_CATEGORY_TYPE_MAIN_CATEGORY,
+ MEDIA_CATEGORY_TYPE_SUB_CATEGORY,
+} media_category_type_e;
+
+#define DB_TABLE_CATEGORY "category"
+#define DB_VIEW_CATEGORY "category_view"
+#define DB_VIEW_SUB_CATEGORY "sub_category_view"
+#define DB_FIELD_MAIN_CATEGORY "main_category"
+#define DB_FIELD_SUB_CATEGORY "sub_category"
+
+#define SELECT_MAIN_CATEGORY_LIST "SELECT DISTINCT main_category FROM "DB_VIEW_CATEGORY" WHERE 1 "
+#define SELECT_MAIN_CATEGORY_LIST_BY_MEDIA_ID "SELECT main_category FROM "DB_VIEW_CATEGORY" WHERE media_uuid = '%s'"
+#define SELECT_MEDIA_COUNT_FROM_MAIN_CATEGORY "SELECT count(*) FROM "DB_VIEW_CATEGORY" WHERE main_category = '%s'"
+#define SELECT_MEDIA_ITEM_FROM_MAIN_CATEGORY "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE media_uuid IN (SELECT media_uuid FROM "DB_VIEW_CATEGORY" WHERE main_category='%s') AND validity=1"
+#define SELECT_SUB_CATEGORY_LIST "SELECT DISTINCT sub_category FROM "DB_VIEW_SUB_CATEGORY" WHERE 1 "
+#define SELECT_MEDIA_COUNT_FROM_SUB_CATEGORY "SELECT count(*) FROM "DB_VIEW_SUB_CATEGORY" WHERE sub_category = '%s'"
+#define SELECT_MEDIA_ITEM_FROM_SUB_CATEGORY "SELECT "MEDIA_INFO_ITEM" FROM "DB_TABLE_MEDIA" WHERE media_uuid IN (SELECT media_uuid FROM "DB_VIEW_SUB_CATEGORY" WHERE sub_category='%s') AND validity=1"
+#define DELETE_MAIN_CATEGORY_FROM_CATEGORY "DELETE FROM "DB_TABLE_CATEGORY" WHERE media_uuid='%q' AND main_category='%q'"
+#define INSERT_CATEGORY_TO_CATEGORY "INSERT INTO "DB_TABLE_CATEGORY" (media_uuid, main_category, main_score, sub_category, sub_score) VALUES ('%q', '%q', %f, '%q', %f)"
+
+/* Definitions for event */
+typedef struct
+{
+ int event_id; // event id
+ char *name; // event name
+}media_event_s;
+
+typedef struct
+{
+ char *media_id; // media_uuid
+ int function; // Add, remove, modify
+ char *event_name; // event_name
+ int event_member_id; // event unique id of media. Same content which has same media_id can be added to event
+}media_event_item_s;
+
+typedef enum {
+ MEDIA_EVENT_ADD,
+ MEDIA_EVENT_REMOVE,
+ MEDIA_EVENT_UPDATE_EVENT_NAME,
+} event_function_e;
+
+#define DB_TABLE_EVENT "event"
+#define DB_TABLE_EVENT_MAP "event_map"
+#define DB_VIEW_EVENT "event_view"
+
+#define DB_FIELD_EVENT_NAME "name"
+#define DB_FIELD_EVENT_MEDIA_COUNT "media_count"
+
+#define SELECT_EVENT_COUNT "SELECT COUNT(DISTINCT event_id) FROM "DB_VIEW_EVENT" WHERE 1 "
+#define SELECT_EVENT_LIST "SELECT DISTINCT event_id, name FROM "DB_VIEW_EVENT" WHERE 1 "
+#define SELECT_MEDIA_COUNT_FROM_EVENT "SELECT COUNT(*) FROM "DB_VIEW_EVENT" WHERE (event_id=%d and media_count>0) "
+#define SELECT_EVENT_FROM_EVENT "SELECT * FROM "DB_TABLE_EVENT" WHERE event_id=%d"
+#define REMOVE_EVENT_ITEM_FROM_EVENT_MAP "DELETE FROM "DB_TABLE_EVENT_MAP" WHERE event_id=%d AND _id=%d"
+#define UPDATE_EVENT_NAME_FROM_EVENT "UPDATE "DB_TABLE_EVENT" SET name='%q' WHERE event_id=%d"
+#define INSERT_EVENT_TO_EVENT "INSERT INTO "DB_TABLE_EVENT" (name) VALUES (%Q)"
+#define SELECT_EVENT_ID_FROM_EVENT "SELECT event_id FROM "DB_TABLE_EVENT" WHERE name='%q'"
+#define DELETE_EVENT_FROM_EVENT "DELETE FROM "DB_TABLE_EVENT" WHERE event_id=%d"
+#define SELECT_EVENT_ITEM_ID_FROM_EVENT_VIEW "SELECT em_id, media_uuid FROM "DB_VIEW_EVENT" WHERE (event_id=%d and media_count>0) "
+
+/* Definitions for gallery_search_view */
+#define DB_VIEW_GALLERY_SEARCH "gallery_search_view"
+#define DB_FIELD_FACE_UUID "uuid"
+#define DB_FIELD_FACE_CONTACT_ID "contact_id"
+#define DB_FIELD_FACE_CONTACT_NAME "contact_name"
+
+#define SELECT_MEDIA_ITEM_FROM_GALLERY_SEARCH_VIEW "SELECT DISTINCT "MEDIA_INFO_ITEM" FROM "DB_VIEW_GALLERY_SEARCH" WHERE 1 "
+
+#endif
+
/**
*@internal
*/
@@ -628,7 +742,19 @@ int _media_db_get_media_group_item_count(const char *group_name, filter_h filter
*/
int _media_db_get_media_group_item(const char *group_name, filter_h filter, media_group_e group, media_info_cb callback, void *user_data);
+#ifdef COMMERCIAL_FEATURE
+/**
+ *@internal
+ */
+int _media_db_get_category(const char *media_id, media_category_type_e type, filter_h filter, void *callback, void *user_data);
+
+int _media_db_get_event(filter_h filter, void *callback, void *user_data);
+
+int _media_db_get_event_item(int event_id, filter_h filter, void *callback, void *user_data);
+#endif
+
/**
+ * @internal
* @brief Creates a media filter attribute handle.
* @details This function creates a media filter attribute handle. The handle can be
* used to convert to attributes of database from attributes of user.
@@ -638,12 +764,14 @@ int _media_db_get_media_group_item(const char *group_name, filter_h filter, medi
* @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
* @see media_filter_attribute_destory()
*
*/
int _media_filter_attribute_create(attribute_h *attr);
/**
+ * @internal
* @brief Add the attributes to the handle.
* @details This function add the attribute to handle.
* @param[in] filter The handle to media filter attribute
@@ -653,12 +781,14 @@ int _media_filter_attribute_create(attribute_h *attr);
* @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
* @see media_filter_attribute_remove()
*
*/
int _media_filter_attribute_add(attribute_h atrr, char *user_attr, char *platform_attr);
/**
+ * @internal
* @brief Destroys a media filter attribute handle.
* @details The function frees all resources related to the media filter attribute handle. The filter attribute
* handle no longer can be used to perform any operation. A new handle
@@ -668,12 +798,14 @@ int _media_filter_attribute_add(attribute_h atrr, char *user_attr, char *platfor
* @return 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()
*
*/
int _media_filter_attribute_destory(attribute_h attr);
/**
+ * @internal
* @brief Replace to platform attributes from user attributes.
* @details This function replace to platform attributes from user attributes to generate the WHERE clause
* @param[in] filter The handle to media filter attribute
@@ -683,6 +815,7 @@ int _media_filter_attribute_destory(attribute_h attr);
* @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
* @see media_filter_attribute_create()
* @see media_filter_attribute_destory()
*
@@ -691,6 +824,7 @@ int _media_filter_attribute_generate(attribute_h attr, char *condition, media_co
/**
+ * @internal
* @brief Replace to platform attributes from user attributes.
* @details This function replace to platform attributes from user attributes to generate the WHERE clause
* @param[in] filter The handle to media filter attribute
@@ -700,6 +834,7 @@ int _media_filter_attribute_generate(attribute_h attr, char *condition, media_co
* @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #MEDIA_CONTENT_ERROR_DB_FAILED Filed DB
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
* @see media_filter_attribute_create()
* @see media_filter_attribute_destory()
*
diff --git a/include/media_playlist.h b/include/media_playlist.h
index 588b848..2f51d01 100755
--- a/include/media_playlist.h
+++ b/include/media_playlist.h
@@ -23,221 +23,302 @@
extern "C" {
#endif /* __cplusplus */
-
+/**
+ * @file
+ * @brief This file contains the playlist API and functions related with handling playlists. \n
+ * Functions include operations to get the number of playlists, the number of media-info for the playlist \n
+ * and all media files in the playlist, to clone, destroy, insert and delete playlist from DB, \n
+ * to handle with name, ID, thumbnail, played order and media info of the playlist.
+ */
/**
* @addtogroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
* @{
- *
- * @file media_playlist.h
- * @brief This file contains the playlist API and related functions handling with playlist. \n
- * Functions include operations to get the number of playlist,the number of media-info for the playlist \n
- * and all media files in the playlist, to clone,destroy, insert and delete playlist from db, \n
- * to handle with name, ID, thumbnail, played order and media info of playlist.
*/
+
/**
- * @brief Gets the number of playlist for the passed @a filter from the media database.
+ * @brief Gets the number of playlists for the passed @a filter from the media database.
+ * @since_tizen 2.3
+ *
+ * @param[in] filter The handle to the filter
+ * @param[out] playlist_count The count of the media playlist
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param[in] filter The handle to filter.
- * @param[out] playlist_count The count of media playlist
- * @return 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_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_playlist_get_playlist_count_from_db(filter_h filter, int *playlist_count);
/**
- * @brief Iterates through the media playlist with optional @a filter from the media database.
- * @details This function gets all media playlist handles meeting the given filter.
- * The callback function will be invoked for every retrieved media playlist.
- * If NULL is passed to the filter, no filtering is applied.
- *
- * @param [in] filter The handle to audio filter
- * @param [in] callback The callback function to invoke
- * @param [in] user_data User data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @brief Iterates through the media playlists with an optional @a filter from the media database.
+ * @details This function gets all media playlists meeting the given filter.
+ * The callback function will be invoked for every retrieved media playlist.
+ * If @c NULL is passed to the filter, no filtering is applied.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] filter The handle to the audio 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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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().
* @post This function invokes media_playlist_cb().
- * @see #media_playlist_cb
+ *
+ * @see media_playlist_cb()
* @see media_content_connect()
* @see media_filter_create()
- *
*/
int media_playlist_foreach_playlist_from_db(filter_h filter, media_playlist_cb callback, void *user_data);
/**
- * @brief Gets number of media info for the given playlist present in the media database.
+ * @brief Gets the number of the media info for the given playlist present in the media database.
+ * @since_tizen 2.3
+ *
+ * @param[in] playlist_id The ID of the media playlist
+ * @param[in] filter The media filter handle
+ * @param[out] media_count The number of media items
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] playlist_id The ID of media playlist
- * @param [in] filter The handle to media filter
- * @param [out] media_count The number of media items
- * @return 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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_playlist_get_media_count_from_db(int playlist_id, filter_h filter, int *media_count);
/**
- * @brief Iterates through the media files with optional @a filter in the given @a audio @a playlist from the media database.
+ * @brief Iterates through the media files with an optional @a filter in the given audio playlist from the media database.
* @details This function gets all media files associated with the given media playlist and
- * meeting desired filter option and calls registered callback function for
- * every retrieved media info. If NULL is passed to the @a filter, no filtering is applied.
- *
- * @param [in] playlist_id The ID of media playlist
- * @param [in] filter The handle to audio filter
- * @param [in] callback The callback function to invoke
- * @param [in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * meeting desired filter option and calls registered callback function for
+ * every retrieved media info. If @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen 2.3
+ *
+ * @param[in] playlist_id The ID of the media playlist
+ * @param[in] filter The audio filter handle
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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().
* @post This function invokes media_info_cb().
- * @see #media_info_cb
+ *
+ * @see media_info_cb()
* @see media_content_connect()
* @see media_filter_create()
- *
*/
int media_playlist_foreach_media_from_db(int playlist_id, filter_h filter, playlist_member_cb callback, void *user_data);
/**
- * @brief Inserts a new playlist with given name in the media database.
+ * @brief Inserts a new playlist with the given name into the media database.
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks You must release the created handle using media_playlist_destroy().
*
- * @remark The created handle must be released with media_playlist_destroy() by you.
- * @param [in] name The name of the inserted playlist
- * @param [out] playlist A created handle to media playlist
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] name The name of the inserted playlist
+ * @param[out] playlist A created handle to media 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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_playlist_delete_from_db()
- *
*/
int media_playlist_insert_to_db(const char *name, media_playlist_h *playlist);
/**
* @brief Deletes the given playlist from the media database.
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
*
- * @param [in] playlist The handle to media playlist
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] playlist_id The ID of media 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_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_playlist_insert_to_db()
- *
*/
int media_playlist_delete_from_db(int playlist_id);
/**
* @brief Gets the media playlist from the media database.
*
- * @details This function creates a new media playlist handle from the media database by the given playlist_id.
- * media playlist will be created, which is filled with playlist information.
+ * @details This function creates a new media playlist handle from the media database by the given @a playlist_id.
+ * The media playlist will be created and will be filled with the playlist information.
*
- * @remarks @a playlist must be released with media_playlist_destroy() by you.
+ * @since_tizen 2.3
*
- * @param[in] playlist_id The ID of media playlist
- * @param[out] playlist The media playlist handle associated with the playlist ID
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a playlist using media_playlist_destroy().
+ *
+ * @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,
+ * 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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_playlist_destroy()
- *
*/
int media_playlist_get_playlist_from_db(int playlist_id, media_playlist_h *playlist);
/**
* @brief Destroys a playlist handle.
- * @details Function frees all resources related to playlist handle. This
- * handle no longer can be used to perform any operation. New handle has to
- * be created before next usage.
+ * @details This function frees all resources related to the playlist handle. This
+ * handle no longer can be used to perform any operation. A new handle has to
+ * be created before next usage.
*
- * @param [in] playlist The handle to media playlist
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @param[in] 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
- * @see media_playlist_clone()
- * @pre Get copy of playlist handle by calling media_playlist_clone() or media_playlist_insert_to_db()
- * @see media_playlist_clone()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre Get a copy of playlist handle by calling media_playlist_clone() or media_playlist_insert_to_db().
*
+ * @see media_playlist_clone()
*/
int media_playlist_destroy(media_playlist_h playlist);
/**
- * @brief Clones playlist handle.
+ * @brief Clones a playlist handle.
* @details This function copies the media playlist handle from a source to
- * destination. There is no media_playlist_create() function. The media_playlist_h is created internally and available through
- * media playlist foreach function such as media_playlist_foreach_playlist_from_db(). To use this handle outside of these foreach functions,
- * use this function.
+ * destination. There is no media_playlist_create() function. The media_playlist_h is created internally and available through
+ * media playlist foreach function such as media_playlist_foreach_playlist_from_db().
+ * To use this handle outside of these foreach functions, use this function.
*
- * @remark The destination handle must be released with media_playlist_destroy() by you.
+ * @since_tizen 2.3
*
- * @param [in] src The source handle to media playlist
- * @param [out] dst A destination handle to media playlist
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks The destination handle must be released using media_playlist_destroy().
+ *
+ * @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,
+ * 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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @see media_playlist_destroy()
* @see media_playlist_foreach_playlist_from_db()
*/
int media_playlist_clone(media_playlist_h *dst, media_playlist_h src);
/**
- * @brief Gets media playlist's ID.
+ * @brief Gets the media playlist ID.
+ * @since_tizen 2.3
+ *
+ * @param[in] playlist The media playlist handle
+ * @param[out] playlist_id The ID of the media playlist
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] playlist The handle to media playlist
- * @param [out] playlist_id The ID of media playlist
- * @return 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
*/
int media_playlist_get_playlist_id(media_playlist_h playlist, int *playlist_id);
/**
* @brief Gets a name of the playlist.
+ * @since_tizen 2.3
*
- * @remarks @a playlist_name must be released with free() by you.
+ * @remarks You must release @a playlist_name using free().
*
- * @param [in] playlist The handle to media playlist
- * @param [out] playlist_name The playlist name
- * @return 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
+ * @param[in] playlist The media playlist handle
+ * @param[out] playlist_name The playlist name
+ *
+ * @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_playlist_get_name(media_playlist_h playlist, char **playlist_name);
/**
- * @brief Sets the playlist name.
+ * @brief Sets the name of the playlist.
+ * @since_tizen 2.3
*
- * @param[in] playlist The handle to media playlist
+ * @param[in] playlist The media playlist handle
* @param[in] playlist_name The name of the media playlist
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @post media_playlist_update_to_db()
*
*/
@@ -245,114 +326,157 @@ int media_playlist_set_name(media_playlist_h playlist, const char *playlist_name
/**
* @brief Gets a thumbnail path of the playlist.
+ * @since_tizen 2.3
*
- * @remarks @a path must be released with free() by you.
+ * @remarks You must release @a path using free().
*
- * @param [in] playlist The handle to media playlist
- * @param [out] path The path of thumbnail
- * @return 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
+ * @param[in] playlist The media playlist handle
+ * @param[out] path The path of the thumbnail
*
+ * @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_playlist_get_thumbnail_path(media_playlist_h playlist, char **path);
/**
* @brief Sets the thumbnail path of the playlist.
+ * @since_tizen 2.3
+ *
+ * @param[in] playlist The media playlist handle
+ * @param[in] path The path of the thumbnail
*
- * @param[in] playlist The handle to media playlist
- * @param[in] path The path of thumbnail
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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
- * @post media_playlist_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_playlist_update_to_db()
*/
int media_playlist_set_thumbnail_path(media_playlist_h playlist, const char *path);
/**
- * @brief Sets the played order in the playlist.
+ * @brief Sets the playing order in the playlist.
+ * @since_tizen 2.3
*
- * @param[in] playlist The handle to media playlist
- * @param[in] playlist_member_id The ID to member of playlist
- * @param[in] play_order The played order
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] playlist The media playlist handle
+ * @param[in] playlist_member_id The playlist member ID
+ * @param[in] play_order The playing order
+ *
+ * @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
- * @post media_playlist_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_playlist_update_to_db()
*/
int media_playlist_set_play_order(media_playlist_h playlist, int playlist_member_id, int play_order);
/**
* @brief Adds a new media info to the playlist.
+ * @since_tizen 2.3
*
- * @param[in] playlist The handle to media playlist
- * @param[in] media_id The ID to media info which is added
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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,
+ * 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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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().
* @post media_playlist_update_to_db()
+ *
* @see media_content_connect()
* @see media_playlist_remove_media()
- *
*/
int media_playlist_add_media(media_playlist_h playlist, const char *media_id);
/**
- * @brief Removes the playlist member related with media from the given playlist.
+ * @brief Removes the playlist members related with the media from the given playlist.
+ * @since_tizen 2.3
*
- * @param[in] playlist The handle to media playlist
- * @param[in] playlist_member_id The ID to member of playlist
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] playlist The media playlist handle
+ * @param[in] playlist_member_id The playlist member ID
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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().
* @post media_playlist_update_to_db()
+ *
* @see media_content_connect()
* @see media_playlist_add_media()
- *
*/
int media_playlist_remove_media(media_playlist_h playlist, int playlist_member_id);
/**
- * @brief Gets the played order in the playlist.
+ * @brief Gets the played order of the playlist.
+ * @since_tizen 2.3
*
- * @param[in] playlist The handle to media playlist
- * @param[in] playlist_member_id The ID to member of playlist
- * @param [out] play_order The played order
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] playlist The media playlist handle
+ * @param[in] playlist_member_id The playlist member ID
+ * @param[out] play_order The played order
+ *
+ * @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
*/
int media_playlist_get_play_order(media_playlist_h playlist, int playlist_member_id, int *play_order);
/**
* @brief Updates the media playlist to the media database.
*
- * @details The function updates the given media playlist in the media database. The function should be called after any change in playlist, to be updated to the media
- * database. For example, after using media_playlist_set_name() for setting the name of the playlist, media_playlist_update_to_db() function should be called so as to update
- * the given playlist attibutes in the media database.
+ * @details The function updates the given media playlist in the media database.
+ * The function should be called after any change in the playlist, to be updated to the media database.
+ * For example, after using media_playlist_set_name() for setting the name of the playlist, the
+ * media_playlist_update_to_db() function should be called so as to update
+ * the given playlist attributes in the media database.
+ *
+ * @since_tizen 2.3
*
- * @param[in] playlist The handle to media playlist
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] 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_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_playlist_destroy()
* @see media_playlist_add_media()
* @see media_playlist_remove_media()
* @see media_playlist_set_name()
* @see media_playlist_set_play_order()
- *
*/
int media_playlist_update_to_db(media_playlist_h playlist);
diff --git a/include/media_tag.h b/include/media_tag.h
index 9547c15..c0f81ff 100755
--- a/include/media_tag.h
+++ b/include/media_tag.h
@@ -25,121 +25,169 @@
extern "C" {
#endif /* __cplusplus */
+/**
+ * @file media_tag.h
+ * @brief This file contains the media tag API and functions related with handling tags. \n
+ * Functions include operations to get the number and content of the tag, the number of media files \n
+ * and all media items in the tag, to clone, destroy, insert and delete tag from DB, \n
+ * to handle with name, ID, and media info of the tag.
+ */
+
/**
* @addtogroup CAPI_CONTENT_MEDIA_TAG_MODULE
* @{
- *
- * @file media-tag.h
- * @brief This file contains the media tag API and related functions handling with tag. \n
- * Functions include operations to get the number and content of tag, the number of media files \n
- * and all media items in the tag, to clone, destroy, insert and delete tag from db, \n
- * to handle with name, ID, and media info of the tag.
*/
/**
* @brief Inserts a new tag in the media database.
+ * @since_tizen 2.3
*
- * @remark The created tag handle must be released with media_tag_destroy() by you.
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
*
- * @param[in] tag_name The tag name to be inserted
- * @param[out] tag A created handle to media tag
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks The created tag handle must be released using media_tag_destroy().
+ *
+ * @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,
+ * 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_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().
+ *
* @see media_content_connect()
* @see media_tag_delete_from_db()
* @see media_tag_destroy()
- *
*/
int media_tag_insert_to_db(const char *tag_name, media_tag_h *tag);
/**
* @brief Deletes a given tag from the media database.
+ * @since_tizen 2.3
*
- * @param[in] tag The handle to media tag
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] tag_id The ID of media tag
+ *
+ * @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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_tag_insert_to_db()
- *
*/
int media_tag_delete_from_db(int tag_id);
/**
- * @brief Gets the number of tag for the passed @a filter from the media database.
+ * @brief Gets the count of the tag for the passed @a filter from the media database.
+ * @since_tizen 2.3
+ *
+ * @param[in] filter The handle to the filter
+ * @param[out] tag_count The count of the media tag
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param[in] filter The handle to filter
- * @param[out] tag_count The count of media tag
- * @return 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_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_tag_get_tag_count_from_db(filter_h filter, int *tag_count);
/**
* @brief Iterates through tags from the media database.
* @details This function gets all tags meeting a desired @a filter
- * and calls a registered callback function for every retrieved tag. If NULL is passed to the @a filter, no filtering is applied.
+ * and calls a registered callback function for every retrieved tag.
+ * If @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen 2.3
*
- * @param[in] filter The handle to tag filter
- * @param[in] callback The callback function to invoke
+ * @param[in] filter The tag filter handle
+ * @param[in] callback The callback function to be invoked
* @param[in] user_data The user data to be passed to the callback function
- * @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
+ *
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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_tag_cb().
+ *
* @see media_content_connect()
* @see #media_tag_cb
* @see media_filter_create()
- *
*/
int media_tag_foreach_tag_from_db (filter_h filter, media_tag_cb callback, void *user_data);
/**
* @brief Gets the number of media files for the passed @a filter in the given @a tag from the media database.
+ * @since_tizen 2.3
*
- * @param[in] tag_id The ID of media tag
- * @param[in] filter The handle to media filter
+ * @param[in] tag_id The ID of the media tag
+ * @param[in] filter The handle to the media filter
* @param[out] media_count The count of media items
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @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_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
- * @see media_content_connect()
*
+ * @see media_content_connect()
*/
int media_tag_get_media_count_from_db (int tag_id, filter_h filter, int *media_count);
/**
* @brief Iterates through media items for a given tag from the media database.
* @details This function gets all media items associated with a given tag and
- * meeting a desired @a filter and calls a registered callback function for
- * every retrieved media item. If NULL is passed to the @a filter, no filtering is applied.
+ * meeting a desired @a filter and calls a registered callback function for
+ * every retrieved media item. If @c NULL is passed to the @a filter, no filtering is applied.
*
- * @param[in] tag_id The ID of media tag
- * @param[in] filter The handle to media filter
- * @param[in] callback The callback function to invoke
+ * @since_tizen 2.3
+ *
+ * @param[in] tag_id The ID of the media tag
+ * @param[in] filter The handle to the media filter
+ * @param[in] callback The callback function to be invoked
* @param[in] user_data The user data to be passed to the callback function
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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().
* @post This function invokes media_info_cb().
+ *
* @see media_content_connect()
- * @see #media_info_cb
+ * @see media_info_cb()
* @see media_filter_create()
*/
int media_tag_foreach_media_from_db(int tag_id, filter_h filter, media_info_cb callback, void *user_data);
@@ -147,151 +195,206 @@ int media_tag_foreach_media_from_db(int tag_id, filter_h filter, media_info_cb c
/**
* @brief Clones the media tag.
* @details This function copies the media tag handle from a source to destination.
- * There is no media_tag_create() function. The media_tag_h is created internally and available through media tag foreach function
- * such as media_tag_foreach_tag_from_db().
- * To use this handle outside of these foreach functions, use this function.
- * @remark The destination handle must be released with media_tag_destroy() by you.
- *
- * @param[out] dst A destination handle to media tag
- * @param[in] src The source handle to media tag
- * @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
+ * There is no media_tag_create() function. The media_tag_h is created internally and available through media tag foreach function
+ * such as media_tag_foreach_tag_from_db().
+ * To use this handle outside of these foreach functions, use this function.
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks You must release the destination handle using media_tag_destroy().
+ *
+ * @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,
+ * 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_tag_destroy()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @see media_tag_destroy()
*/
int media_tag_clone(media_tag_h *dst, media_tag_h src);
/**
* @brief Destroys the media tag.
* @details This function frees all resources related to the tag handle. The tag handle can no longer
- * be used for any operation. A new tag handle has to be created before next usage.
+ * be used for any operation. A new tag handle has to be created before next usage.
+ *
+ * @since_tizen 2.3
*
* @param[in] tag The media tag handle
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @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 A copy of the media tag handle created by calling media_tag_clone() or media_tag_insert_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre A copy of the media tag handle created by calling media_tag_clone() or media_tag_insert_to_db().
+ *
* @see media_tag_clone()
* @see media_tag_insert_to_db()
- *
*/
int media_tag_destroy(media_tag_h tag);
/**
- * @brief Gets media tag's ID.
+ * @brief Gets the media tag ID.
+ * @since_tizen 2.3
+ *
+ * @param[in] tag The media tag handle
+ * @param[out] tag_id The ID of the media tag
*
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] tag The handle to media tag
- * @param [out] tag_id The ID of media tag
- * @return 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
*/
int media_tag_get_tag_id(media_tag_h tag, int *tag_id);
/**
* @brief Gets the tag name.
+ * @since_tizen 2.3
*
- * @remarks @a tag_name must be released with free() by you.
+ * @remarks You must release @a tag_name using free().
*
- * @param[in] tag The handle to media tag
+ * @param[in] tag The media tag handle
* @param[out] tag_name The name of the tag
- * @return 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
*
+ * @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_tag_get_name(media_tag_h tag, char **tag_name);
/**
* @brief Gets the media tag from the media database.
*
- * @details This function creates a new media tag handle from the media database by the given tag_id.
- * media tag will be created, which is filled with tag information.
+ * @details This function creates a new media tag handle from the media database by the given @a tag_id.
+ * Media tag will be created and will be filled with tag information.
*
- * @remarks @a folder must be released with media_tag_destroy() by you.
+ * @since_tizen 2.3
*
- * @param[in] tag_id The ID of media tag
- * @param[out] tag The media tag handle associated with the tag ID
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a folder using media_tag_destroy().
+ *
+ * @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,
+ * 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
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_tag_destroy()
- *
*/
int media_tag_get_tag_from_db(int tag_id, media_tag_h *tag);
/**
* @brief Adds a new media info to the tag.
+ * @since_tizen 2.3
+ *
+ * @param[in] tag The media tag handle
+ * @param[in] media_id The ID to the media info which is added
*
- * @param[in] tag The handle to media tag
- * @param[in] media_id The ID to media info which is added
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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().
* @post media_tag_update_to_db()
+ *
* @see media_content_connect()
* @see media_tag_remove_media()
- *
*/
int media_tag_add_media(media_tag_h tag, const char *media_id);
/**
* @brief Removes the media info from the given tag.
+ * @since_tizen 2.3
+ *
+ * @param[in] tag The media tag handle
+ * @param[in] media_id The ID to the media info which is removed
*
- * @param[in] tag The handle to media tag
- * @param[in] media_id The ID to media info which is removed
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @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
- * @pre This function requires opened connection to content service by media_content_connect().
+ * @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().
* @post media_tag_update_to_db()
+ *
* @see media_content_connect()
* @see media_tag_add_media()
- *
*/
int media_tag_remove_media(media_tag_h tag, const char *media_id);
/**
- * @brief Sets the tag name.
+ * @brief Sets the name of the tag.
+ * @since_tizen 2.3
*
- * @param[in] tag The handle to media tag
+ * @param[in] tag The media tag handle
* @param[in] tag_name The name of the media tag
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ *
+ * @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
- * @post media_tag_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*
+ * @post media_tag_update_to_db()
*/
int media_tag_set_name(media_tag_h tag, char *tag_name);
/**
* @brief Updates the media tag to the media database.
*
- * @details The function updates the given media tag in the media database. The function should be called after any change in tag attributes, to be updated to the media
- * database. For example, after using media_tag_set_name() for setting the name of the tag, media_tag_update_to_db() function should be called so as to update
- * the given tag attibutes in the media database.
+ * @details The function updates the given media tag in the media database. The function should be called after any change in tag attributes, to be updated to the media
+ * database. For example, after using media_tag_set_name() for setting the name of the tag, the media_tag_update_to_db() function should be called so as to update
+ * the given tag attributes in the media database.
*
- * @param[in] tag The handle to media tag
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] tag The media tag 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 This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see media_tag_destroy()
* @see media_tag_add_media()
* @see media_tag_remove_media()
* @see media_tag_set_name()
- *
*/
int media_tag_update_to_db(media_tag_h tag);
diff --git a/include/media_util_private.h b/include/media_util_private.h
index d0452b7..dc388d0 100755
--- a/include/media_util_private.h
+++ b/include/media_util_private.h
@@ -29,6 +29,9 @@ extern "C" {
/**
*@internal
*/
+
+int _media_util_check_file(const char *path);
+
int _media_util_check_ignore_dir(const char *dir_path, bool *ignore);
diff --git a/include/media_video.h b/include/media_video.h
index c00fbc1..aad7333 100755
--- a/include/media_video.h
+++ b/include/media_video.h
@@ -25,328 +25,441 @@
extern "C" {
#endif /* __cplusplus */
-
/**
- * @addtogroup CAPI_CONTENT_MEDIA_VIDEO_META_MODULE
- * @{
- *
* @file media_video.h
* @brief This file contains the video metadata API and related functions to proceed with video metadata. \n
- * Functions include clonning and destroying video metadata, getting video metadata as width, height, \n
- * album, genre, played parameters etc. and updating video to db.
+ * Functions include cloning and destroying video metadata, getting video metadata such as width, height, \n
+ * album, genre, played parameters etc. and updating video to DB.
*/
/**
- * @brief Clones video metadata.
- * @details This function copies the video metadata handle from a source to
- * destination.
+ * @addtogroup CAPI_CONTENT_MEDIA_VIDEO_META_MODULE
+ * @{
+ */
- * @remark The destination handle must be released with video_meta_destroy() by you.
+/**
+ * @brief Clones the video metadata.
+ * @details This function copies the video metadata handle from a source to
+ * destination.
+ *
+ * @since_tizen 2.3
+ *
+ * @remarks You must release the destination handle using video_meta_destroy().
+ *
+ * @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,
+ * otherwise a negative error value
*
- * @param [out] dst A destination handle to video metadata
- * @param [in] src The source handle to video metadata
- * @return 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
+ *
* @see video_meta_destroy()
*/
int video_meta_clone(video_meta_h *dst, video_meta_h src);
/**
- * @brief Destroys video metadata.
- * @details Function frees all resources related to video metadata handle. This handle
- * no longer can be used to perform any operation. A new handle has to
- * be created before the next use.
+ * @brief Destroys the video metadata.
+ * @details This function frees all resources related to the video metadata handle. This handle
+ * no longer can be used to perform any operation. A new handle has to
+ * be created before the next use.
*
- * @param [in] video The handle to video metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @param[in] video The video metadata 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 video metadata handle by calling video_meta_clone()
- * @see video_meta_clone()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre Get copy of video metadata handle by calling video_meta_clone().
*
+ * @see video_meta_clone()
*/
int video_meta_destroy(video_meta_h video);
/**
- * @brief Gets id of media of given video metadata.
+ * @brief Gets the ID of the media of the given video metadata.
+ * @since_tizen 2.3
*
- * @remarks @a media id must be released with free() by you.
+ * @remarks You must release @a media_id using free().
*
- * @param [in] video The handle to video metadata
- * @param [out] media_id The id of the video
- * @return 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 video_meta_get_media_id(video_meta_h video, char **media_id);
-
-/**
- * @brief Gets the video's title.
+ * @param[in] video The video metadata handle
+ * @param[out] media_id The ID of the video
*
- * @remarks @a title must be released with free() by you.
+ * @return @c 0 on success,
+ * otherwise a negative error value
*
- * @param [in] video The handle to video metadata
- * @param [out] title The title of video metadata
- * @return 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_title(video_meta_h video, char **title);
+int video_meta_get_media_id(video_meta_h video, char **media_id);
/**
* @brief Gets the video's album.
- * If the value is an empty string, the method returns "Unknown".
+ * @details If the value is an empty string, the method returns "Unknown".
*
- * @remarks @a album must be released with free() by you.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] album The video album or NULL
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a album using free().
+ *
+ * @param[in] video The video metadata handle
+ * @param[out] album The video album or @c NULL
+ *
+ * @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_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int video_meta_get_album(video_meta_h video, char **album);
/**
- * @brief Gets the video's artist.
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the video artist.
+ * @details If the value is an empty string, the method returns "Unknown".
*
- * @remarks @a artist must be released with free() by you.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] artist The artist of video metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a artist using free().
+ *
+ * @param[in] video The video metadata handle
+ * @param[out] artist The artist of the video metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int video_meta_get_artist(video_meta_h video, char **artist);
/**
- * @brief Gets the video's album_artist.
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the video album artist.
+ * @details If the value is an empty string, the method returns "Unknown".
*
- * @remarks @a album_artist must be released with free() by you.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] album_artist The album_artist of video metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a album_artist using free().
+ *
+ * @param[in] video The video metadata handle
+ * @param[out] album_artist The album artist of the video metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_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);
/**
- * @brief Gets the video's genre.
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the video genre.
+ * @details If the value is an empty string, the method returns "Unknown".
*
- * @remarks @a genre must be released with free() by you.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] genre The genre of video metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a genre using free().
+ *
+ * @param[in] video The video metadata handle
+ * @param[out] genre The genre of the video metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int video_meta_get_genre(video_meta_h video, char **genre);
/**
- * @brief Gets the video's composer.
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the video composer.
+ * @details If the value is an empty string, the method returns "Unknown".
*
- * @remarks @a composer must be released with free() by you.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] composer The composer of video metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a composer using free().
+ *
+ * @param[in] video The video metadata handle
+ * @param[out] composer The composer of the video metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int video_meta_get_composer(video_meta_h video, char **composer);
/**
- * @brief Gets the video's year.
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the year of the video.
+ * @details If the value is an empty string, the method returns "Unknown".
*
- * @remarks @a year must be released with free() by you.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] year The year of video metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a year using free().
+ *
+ * @param[in] video The video metadata handle
+ * @param[out] year The year of the video metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int video_meta_get_year(video_meta_h video, char **year);
/**
- * @brief Gets the video's recorded_date.
+ * @brief Gets the recorded date of the video.
+ * @since_tizen 2.3
*
- * @remarks @a recorded_date must be released with free() by you.
+ * @remarks You must release @a recorded_date using free().
*
- * @param [in] video The handle to video metadata
- * @param [out] recorded_date The recorded_date of video metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] video The video metadata handle
+ * @param[out] recorded_date The recorded date of the video metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int video_meta_get_recorded_date(video_meta_h video, char **recorded_date);
/**
- * @brief Gets the video's copyright.
+ * @brief Gets the video copyright.
+ * @since_tizen 2.3
*
- * @remarks @a copyright must be released with free() by you.
+ * @remarks You must release @a copyright using free().
*
- * @param [in] video The handle to video metadata
- * @param [out] copyright The copyright of video metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] video The video metadata handle
+ * @param[out] copyright The copyright of the video metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int video_meta_get_copyright(video_meta_h video, char **copyright);
/**
- * @brief Gets the video's track number.
- * If the value is an empty string, the method returns "Unknown".
+ * @brief Gets the track number of the video.
+ * @details If the value is an empty string, the method returns "Unknown".
*
- * @remarks @a track_num must be released with free() by you.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] track_num The track number of video metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @remarks You must release @a track_num using free().
+ *
+ * @param[in] video The video metadata handle
+ * @param[out] track_num The track number of the video metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int video_meta_get_track_num(video_meta_h video, char **track_num);
/**
- * @brief Gets the video's bit rate.
+ * @brief Gets the video bit rate.
+ * @since_tizen 2.3
*
- * @remarks @a bit_rate must be released with free() by you.
+ * @remarks You must release @a bit_rate using free().
*
- * @param [in] video The handle to video metadata
- * @param [out] bit_rate The bit rate of video metadata
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] video The video metadata handle
+ * @param[out] bit_rate The bit rate of the video metadata
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
*/
int video_meta_get_bit_rate(video_meta_h video, int *bit_rate);
/**
- * @brief Gets duration of video metadata.
+ * @brief Gets the duration of video metadata.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] duration The video duration in milliseconds
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] video The video metadata handle
+ * @param[out] duration The video duration in milliseconds
+ *
+ * @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
*/
int video_meta_get_duration(video_meta_h video, int *duration);
/**
- * @brief Gets the video's width in pixels.
+ * @brief Gets the video width in pixels.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] width The video width in pixels
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] video The video metadata handle
+ * @param[out] width The video width in pixels
+ *
+ * @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
*/
int video_meta_get_width(video_meta_h video, int *width);
/**
- * @brief Gets the video's height in pixels.
+ * @brief Gets the video height in pixels.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] height The video height in pixels
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] video The video metadata handle
+ * @param[out] height The video height in pixels
+ *
+ * @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
*/
int video_meta_get_height(video_meta_h video, int *height);
/**
- * @brief Gets the video's played count.
+ * @brief Gets the played count of the video.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] played_count The number of played
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] video The video metadata handle
+ * @param[out] played_count The number of played
+ *
+ * @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
*/
int video_meta_get_played_count(video_meta_h video, int *played_count);
/**
- * @brief Gets the video's time last played parameter.
+ * @brief Gets the last played time parameter of the video.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [out] played_time The time last played in the video
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] video The video metadata handle
+ * @param[out] played_time The time last played in the video
+ *
+ * @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
*/
int video_meta_get_played_time(video_meta_h video, time_t *played_time);
/**
- * @brief Gets the video's position played parameter.
- * @details Function returns video's elapsed playback time parameter as period
- * starting from the beginning of the movie.
+ * @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.
*
- * @param [in] video The handle to video metadata
- * @param [out] played_position The position from the beginning of the video (in milliseconds)
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @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,
+ * 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
*/
int video_meta_get_played_position(video_meta_h video, int *played_position);
/**
- * @brief Sets the video's played count.
+ * @brief Sets the played count of the video.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [in] played_count The number of played
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] video The video metadata handle
+ * @param[in] played_count The number of played
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post video_meta_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post video_meta_update_to_db().
*/
int video_meta_set_played_count(video_meta_h video, int played_count);
/**
- * @brief Sets the video's time last played parameter.
+ * @brief Sets the time last played parameter of the video.
+ * @since_tizen 2.3
*
- * @param [in] video The handle to video metadata
- * @param [in] played_time The time last played in the video
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @param[in] video The video metadata handle
+ * @param[in] played_time The time last played in the video
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post video_meta_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post video_meta_update_to_db().
*/
int video_meta_set_played_time(video_meta_h video, time_t played_time);
/**
- * @brief Sets the video's position played parameter.
- * @details Function returns video's elapsed playback time parameter as period
- * starting from the beginning of the movie.
+ * @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.
*
- * @param [in] video The handle to video metadata
- * @param [in] played_position The position from the beginning of the video (in milliseconds)
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @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,
+ * otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
- * @post video_meta_update_to_db()
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post video_meta_update_to_db().
*/
int video_meta_set_played_position(video_meta_h video, int played_position);
@@ -354,17 +467,30 @@ int video_meta_set_played_position(video_meta_h video, int played_position);
* @brief Updates the video to the media database.
*
* @details The function updates the given video meta in the media database. The function should be called after any change in video attributes, to be updated to the media
- * database. For example, after using video_meta_get_played_time() for setting the played time of the video, video_meta_update_to_db() function should be called so as to update
- * the given video attibutes in the media database.
+ * database. For example, after using video_meta_get_played_time() for setting the played time of the video, the video_meta_update_to_db() function should be called so as to update
+ * the given video attributes in the media database.
*
- * @param[in] image The handle to image
- * @return 0 on success, otherwise a negative error value.
- * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @since_tizen 2.3
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db().
+ *
+ * @param[in] video The video metadata 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_PERMISSION_DENIED Permission denied
+ *
* @pre This function requires opened connection to content service by media_content_connect().
+ *
* @see media_content_connect()
* @see video_meta_set_played_time()
- * @see video_meta_set_played_count()
+ * @see video_meta_set_played_count()s
* @see video_meta_set_played_position()
*/
int video_meta_update_to_db(video_meta_h video);
diff --git a/packaging/capi-content-media-content.spec b/packaging/capi-content-media-content.spec
index 037205d..b891739 100755
--- a/packaging/capi-content-media-content.spec
+++ b/packaging/capi-content-media-content.spec
@@ -1,6 +1,6 @@
Name: capi-content-media-content
Summary: A Media content library in SLP C API
-Version: 0.2.109
+Version: 0.2.133
Release: 0
Group: System/Libraries
License: Apache License, Version 2.0
diff --git a/src/media_audio.c b/src/media_audio.c
index 580cb53..baf0291 100755
--- a/src/media_audio.c
+++ b/src/media_audio.c
@@ -187,6 +187,7 @@ int audio_meta_clone(audio_meta_h *dst, audio_meta_h src)
}
_dst->bitrate = _src->bitrate;
+ _dst->bitpersample = _src->bitpersample;
_dst->samplerate = _src->samplerate;
_dst->channel = _src->channel;
_dst->duration = _src->duration;
@@ -238,37 +239,6 @@ int audio_meta_get_media_id(audio_meta_h audio, char **media_id)
return ret;
}
-int audio_meta_get_title(audio_meta_h audio, char **title)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- audio_meta_s *_audio = (audio_meta_s*)audio;
- if(_audio)
- {
- if(STRING_VALID(_audio->title))
- {
- *title = strdup(_audio->title);
- if(*title == NULL)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
- else
- {
- *title = NULL;
- }
- ret = MEDIA_CONTENT_ERROR_NONE;
-
- }
- else
- {
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
- return ret;
-}
-
int audio_meta_get_album(audio_meta_h audio, char **album_name)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -569,6 +539,25 @@ int audio_meta_get_bit_rate(audio_meta_h audio, int *bit_rate)
return ret;
}
+int audio_meta_get_bitpersample(audio_meta_h audio, int *bitpersample)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ audio_meta_s *_audio = (audio_meta_s*)audio;
+
+ if(_audio && bitpersample)
+ {
+ *bitpersample = _audio->bitpersample;
+ ret = MEDIA_CONTENT_ERROR_NONE;
+ }
+ else
+ {
+ media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+ ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+
+ return ret;
+}
+
int audio_meta_get_sample_rate(audio_meta_h audio, int *sample_rate)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
diff --git a/src/media_content.c b/src/media_content.c
index 0509300..acd732a 100755
--- a/src/media_content.c
+++ b/src/media_content.c
@@ -23,6 +23,11 @@
#include <unicode/uloc.h>
#include <unicode/ucol.h>
#include <vconf.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <fcntl.h>
+
static attribute_h g_attr_handle = NULL;
static attribute_h g_alias_attr_handle = NULL;
@@ -37,6 +42,109 @@ static int __media_content_create_alias_attr_handle(void);
static int __media_content_create_attribute_handle(void);
static int __media_content_destroy_attribute_handle(void);
+#if 0
+static void __collate_icu_close(void* ucol)
+{
+ media_content_debug("close icu collator");
+ ucol_close((UCollator *) ucol);
+}
+
+static int __collate_icu_8(void *ucol, int str1_len, const void *str1, int str2_len, const void *str2)
+{
+ UCharIterator uiter1, uiter2;
+ UErrorCode error = U_ZERO_ERROR;
+
+ uiter_setUTF8(&uiter1, (const char *) str1, str1_len);
+ uiter_setUTF8(&uiter2, (const char *) str2, str2_len);
+
+ UCollationResult result = ucol_strcollIter(
+ (UCollator *) ucol,
+ &uiter1,
+ &uiter2,
+ &error);
+
+ if(U_FAILURE(error)) {
+ media_content_error("__collate_icu_8 ucol_strcollIter error: %d", error);
+ return error;
+ }
+
+#if 0
+ if (result == UCOL_LESS) {
+ media_content_debug("less");
+ } else if (result == UCOL_GREATER) {
+ media_content_debug("greater");
+ } else {
+ media_content_debug("equal");
+ }
+#endif
+
+ return result;
+}
+
+static int __media_content_create_collate(void)
+{
+ int ret = MEDIA_CONTENT_ERROR_NONE;
+ UErrorCode status = U_ZERO_ERROR;
+ UCollator *myCollator = NULL;
+ char *lang = NULL;
+ int32_t apiRules[1];
+
+ lang = vconf_get_str(VCONFKEY_LANGSET);
+ media_content_debug("lang[%s]", lang);
+
+ myCollator = ucol_open(lang, &status);
+
+ if(U_FAILURE(status))
+ {
+ media_content_error("Collator open failed(%s)", u_errorName(status));
+ SAFE_FREE(lang);
+ return MEDIA_CONTENT_ERROR_DB_FAILED;
+ }
+
+ char script[ULOC_SCRIPT_CAPACITY];
+ char maximizedLocale[ULOC_FULLNAME_CAPACITY];
+ UScriptCode scriptCode = USCRIPT_COMMON;
+
+ uloc_addLikelySubtags(lang, maximizedLocale, sizeof(maximizedLocale), &status);
+ uloc_getScript(maximizedLocale, script, sizeof(script), &status);
+ uscript_getCode(script, &scriptCode, 1, &status);
+ media_content_debug("locale[%s] script[%s]", maximizedLocale, script);
+ media_content_debug("[%d]", scriptCode);
+
+ if(scriptCode == USCRIPT_KOREAN)
+ scriptCode = USCRIPT_HANGUL;
+ else if((scriptCode == USCRIPT_SIMPLIFIED_HAN) || (scriptCode == USCRIPT_TRADITIONAL_HAN))
+ scriptCode = USCRIPT_HAN;
+ else if((scriptCode == USCRIPT_JAPANESE) || (scriptCode == USCRIPT_HIRAGANA) || (scriptCode == USCRIPT_KATAKANA) )
+ scriptCode = USCRIPT_KATAKANA_OR_HIRAGANA;
+
+ apiRules[0] = scriptCode;
+
+ SAFE_FREE(lang);
+
+ ucol_setReorderCodes(myCollator, apiRules, 1, &status);
+
+ if(U_FAILURE(status))
+ {
+ media_content_error("setReorder failed(%s)", u_errorName(status));
+ ucol_close(myCollator);
+ return MEDIA_CONTENT_ERROR_DB_FAILED;
+ }
+
+ ucol_setStrength(myCollator, UCOL_PRIMARY);
+
+ ret = sqlite3_create_collation_v2(db_handle, "PREFERRED_LANG", SQLITE_UTF8, myCollator, __collate_icu_8, (void(*)(void*))__collate_icu_close);
+ if (SQLITE_OK != ret)
+ {
+ media_content_error("create_collation failed(%s)", sqlite3_errmsg(db_handle));
+ ucol_close(myCollator);
+ return MEDIA_CONTENT_ERROR_DB_FAILED;
+ }
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+#endif
+
static int __media_content_create_attr_handle(void)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -111,6 +219,9 @@ static int __media_content_create_attr_handle(void)
ret = _media_filter_attribute_add(g_attr_handle, MEDIA_BITRATE, DB_FIELD_MEDIA_BITRATE);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+ ret = _media_filter_attribute_add(g_attr_handle, MEDIA_BITPERSAMPLE, DB_FIELD_MEDIA_BITPERSAMPLE);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
ret = _media_filter_attribute_add(g_attr_handle, MEDIA_SAMPLERATE, DB_FIELD_MEDIA_SAMPLERATE);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
@@ -338,6 +449,9 @@ static int __media_content_create_alias_attr_handle(void)
ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_BITRATE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_BITRATE);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+ ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_BITPERSAMPLE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_BITPERSAMPLE);
+ media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_SAMPLERATE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_SAMPLERATE);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
@@ -587,10 +701,16 @@ int _content_query_prepare(sqlite3_stmt **stmt, char *select_query, char *condit
{
media_content_error("DB_FAILED(0x%08x) fail to sqlite3_prepare(), %s", MEDIA_CONTENT_ERROR_DB_FAILED, sqlite3_errmsg((sqlite3*)db_handle));
- if (err == SQLITE_BUSY)
+ if (err == SQLITE_BUSY) {
+ media_content_error(" BUSY ERROR");
return MEDIA_CONTENT_ERROR_DB_BUSY;
- else
+ } else if (err == SQLITE_PERM) {
+ media_content_error("PERMISSION EROR");
+ return MEDIA_INFO_ERROR_DATABASE_PERMISSION;
+ } else {
+ media_content_error("OTHER ERROR");
return MEDIA_CONTENT_ERROR_DB_FAILED;
+ }
}
}
else
@@ -618,9 +738,13 @@ int _content_error_capi(int type, int content_error)
else if((content_error == MEDIA_INFO_ERROR_DATABASE_CONNECT) || (content_error == MEDIA_INFO_ERROR_DATABASE_DISCONNECT) ||
(content_error == MEDIA_INFO_ERROR_DATABASE_NO_RECORD) ||(content_error == MEDIA_INFO_ERROR_DATABASE_INTERNAL))
return MEDIA_CONTENT_ERROR_DB_FAILED;
+ else if (content_error == MEDIA_INFO_ERROR_DATABASE_BUSY)
+ return MEDIA_CONTENT_ERROR_DB_BUSY;
else if((content_error == MS_MEDIA_ERR_SOCKET_CONN) ||(content_error == MS_MEDIA_ERR_SOCKET_INTERNAL) ||
(content_error == MS_MEDIA_ERR_SOCKET_SEND) ||(content_error == MS_MEDIA_ERR_SOCKET_RECEIVE) || (content_error == MS_MEDIA_ERR_SOCKET_RECEIVE_TIMEOUT))
return MEDIA_CONTENT_ERROR_NETWORK;
+ else if (content_error == MEDIA_INFO_ERROR_DATABASE_PERMISSION)
+ return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
} else if(type == MEDIA_THUMBNAIL_TYPE) {
if(content_error == MEDIA_THUMB_ERROR_NONE)
return MEDIA_CONTENT_ERROR_NONE;
@@ -656,6 +780,8 @@ int _content_error_capi(int type, int content_error)
return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
else if(content_error == MS_MEDIA_ERR_VCONF_GET_FAIL)
return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
+ else if(content_error == MS_MEDIA_ERR_PERMISSION_DENIED)
+ return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
}
return MEDIA_CONTENT_ERROR_INVALID_OPERATION;
@@ -693,6 +819,7 @@ int media_content_connect(void)
ret = _content_error_capi(MEDIA_CONTENT_TYPE, ret);
if(ret == MEDIA_CONTENT_ERROR_NONE) {
ref_count++;
+ //__media_content_create_collate();
} else {
__media_content_destroy_attribute_handle();
}
@@ -784,11 +911,32 @@ int media_content_disconnect(void)
return ret;
}
+static int __media_content_check_file(const char *path)
+{
+ int exist;
+
+ /* check the file exits actually */
+ exist = open(path, O_RDONLY);
+ if(exist < 0) {
+ media_content_error("error [%s, %s]", path, strerror(errno));
+ if (errno == EACCES || errno == EPERM) {
+ return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
+ } else {
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+ }
+
+ close(exist);
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+
int media_content_scan_file(const char *path)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
bool ignore_dir = FALSE;
char *folder_path = NULL;
+ int check_file = MEDIA_CONTENT_ERROR_NONE;
if (!STRING_VALID(path)) {
media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
@@ -797,60 +945,55 @@ int media_content_scan_file(const char *path)
media_content_sec_debug("Path : %s", path);
- if (g_file_test(path, G_FILE_TEST_EXISTS)) {
- if (g_file_test(path, G_FILE_TEST_IS_REGULAR)) {
- /* This means this path has to be inserted or refreshed */
- folder_path = g_path_get_dirname(path);
- ret = _media_util_check_ignore_dir(folder_path, &ignore_dir);
- SAFE_FREE(folder_path);
+ check_file = __media_content_check_file(path);
+ if (check_file == MEDIA_CONTENT_ERROR_NONE) {
+ /* This means this path has to be inserted or refreshed */
+ folder_path = g_path_get_dirname(path);
+ ret = _media_util_check_ignore_dir(folder_path, &ignore_dir);
+ SAFE_FREE(folder_path);
- if(ignore_dir) {
- media_content_error("Invalid folder path");
- return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
+ if(ignore_dir) {
+ media_content_error("Invalid folder path");
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
- media_svc_storage_type_e storage_type;
+ media_svc_storage_type_e storage_type;
- ret = media_svc_get_storage_type(path, &storage_type);
+ ret = media_svc_get_storage_type(path, &storage_type);
+ if(ret != MEDIA_INFO_ERROR_NONE) {
+ media_content_sec_error("media_svc_get_storage_type failed : %d (%s)", ret, path);
+ return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
+ }
+
+ ret = media_svc_check_item_exist_by_path(_content_get_db_handle(), path);
+ if (ret == MEDIA_INFO_ERROR_NONE) {
+ /* Refresh */
+ ret = media_svc_refresh_item(_content_get_db_handle(), storage_type, path);
if(ret != MEDIA_INFO_ERROR_NONE) {
- media_content_sec_error("media_svc_get_storage_type failed : %d (%s)", ret, path);
+ media_content_error("media_svc_refresh_item failed : %d", ret);
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
- ret = media_svc_check_item_exist_by_path(_content_get_db_handle(), path);
- if (ret == MEDIA_INFO_ERROR_NONE) {
- /* Refresh */
- ret = media_svc_refresh_item(_content_get_db_handle(), storage_type, path);
- if(ret != MEDIA_INFO_ERROR_NONE) {
- media_content_error("media_svc_refresh_item failed : %d", ret);
- return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
+ } else if (ret == MEDIA_INFO_ERROR_DATABASE_NO_RECORD) {
+ /* Insert */
+ ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_type, path);
+ if(ret != MEDIA_INFO_ERROR_NONE) {
+ if (ret == MEDIA_INFO_ERROR_DATABASE_CONSTRAINT) {
+ media_content_sec_error("This item is already inserted. This may be normal operation because other process already did this (%s)", path);
+ ret = MEDIA_INFO_ERROR_NONE;
+ } else {
+ media_content_sec_error("media_svc_insert_item_immediately failed : %d (%s)", ret, path);
}
- } else if (ret == MEDIA_INFO_ERROR_DATABASE_NO_RECORD) {
- /* Insert */
- ret = media_svc_insert_item_immediately(_content_get_db_handle(), storage_type, path);
- if(ret != MEDIA_INFO_ERROR_NONE) {
- if (ret == MEDIA_INFO_ERROR_DATABASE_CONSTRAINT) {
- media_content_sec_error("This item is already inserted. This may be normal operation because other process already did this (%s)", path);
- ret = MEDIA_INFO_ERROR_NONE;
- } else {
- media_content_sec_error("media_svc_insert_item_immediately failed : %d (%s)", ret, path);
- }
-
- return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
- }
- } else {
- media_content_error("media_svc_check_item_exist_by_path failed : %d", ret);
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
- } else if (g_file_test(path, G_FILE_TEST_IS_DIR)) {
- /* Dierectory is not accpted in this function */
- media_content_error("This path is directory");
- return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
} else {
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ media_content_error("media_svc_check_item_exist_by_path failed : %d", ret);
+ return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
+ } else if (check_file == MEDIA_CONTENT_ERROR_PERMISSION_DENIED) {
+ media_content_error("You have no permission for this file %d", ret);
+ return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
} else {
/* This means this path has to be deleted */
media_content_debug("This path doesn't exists in file system... So now start to delete it from DB");
@@ -881,6 +1024,26 @@ void _media_content_scan_cb(media_request_result_s* result, void *user_data)
return;
}
+static int __media_content_check_dir(const char *path)
+{
+ DIR *dp = NULL;
+
+ dp = opendir(path);
+ if (dp == NULL) {
+ media_content_error("error [%s, %s]", path, strerror(errno));
+ if (errno == EACCES || errno == EPERM) {
+ return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
+ } else {
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+ }
+
+ closedir(dp);
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+
+
int media_content_scan_folder(const char *path, bool is_recursive, media_scan_completed_cb callback, void *user_data)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -897,6 +1060,11 @@ int media_content_scan_folder(const char *path, bool is_recursive, media_scan_co
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
+ ret = __media_content_check_dir(path);
+ if (ret == MEDIA_CONTENT_ERROR_PERMISSION_DENIED) {
+ return ret;
+ }
+
media_content_scan_cb_data *cb_data = NULL;
cb_data = (media_content_scan_cb_data *)malloc(sizeof(media_content_scan_cb_data));
if (cb_data == NULL) {
diff --git a/src/media_db.c b/src/media_db.c
index 9447043..b53cfe3 100755
--- a/src/media_db.c
+++ b/src/media_db.c
@@ -393,9 +393,6 @@ int _media_db_get_folder(filter_h filter, media_folder_cb callback, void *user_d
while(sqlite3_step(stmt) == SQLITE_ROW)
{
- /*this is temporary log to fix bug*/
- media_content_error("");
-
media_folder_s *_folder = (media_folder_s*)calloc(1, sizeof(media_folder_s));
if(_folder == NULL)
@@ -404,8 +401,6 @@ int _media_db_get_folder(filter_h filter, media_folder_cb callback, void *user_d
SQLITE3_FINALIZE(stmt);
return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
}
- /*this is temporary log to fix bug*/
- media_content_error("folder handle %x", _folder);
if(STRING_VALID((const char *)sqlite3_column_text(stmt, 0)))
_folder->folder_id = strdup((const char *)sqlite3_column_text(stmt, 0));
@@ -504,7 +499,8 @@ int _media_db_get_playlist_item(int playlist_id, filter_h filter, playlist_membe
attr = _content_get_attirbute_handle();
memset(select_query, 0x00, sizeof(select_query));
- snprintf(select_query, sizeof(select_query), SELECT_PLAYLIST_ITEM_ID_FROM_PLAYLIST_VIEW, playlist_id);
+ //snprintf(select_query, sizeof(select_query), SELECT_PLAYLIST_ITEM_ID_FROM_PLAYLIST_VIEW, playlist_id);
+ snprintf(select_query, sizeof(select_query), SELECT_PLAYLIST_ITEM_ALL_FROM_PLAYLIST_VIEW, playlist_id);
ret = __media_db_make_query(filter, attr, select_query, sizeof(select_query), &condition_query, &option_query);
media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
@@ -517,23 +513,26 @@ int _media_db_get_playlist_item(int playlist_id, filter_h filter, playlist_membe
while(sqlite3_step(stmt) == SQLITE_ROW)
{
int playlist_member_id = 0;
- char media_uuid[MEDIA_CONTENT_UUID_SIZE+1];
- media_info_h media = NULL;
- memset(media_uuid, 0x00, sizeof(media_uuid));
+ playlist_member_id = (int)sqlite3_column_int(stmt, 50); //50 is Just for Commercial!
- playlist_member_id = (int)sqlite3_column_int(stmt, 0);
+ media_info_s *_media = (media_info_s*)calloc(1, sizeof(media_info_s));
- if(STRING_VALID((const char *)sqlite3_column_text(stmt, 1)))
- strncpy(media_uuid, (const char *)sqlite3_column_text(stmt, 1), MEDIA_CONTENT_UUID_SIZE);
+ if(_media == NULL)
+ {
+ media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+ SQLITE3_FINALIZE(stmt);
+ return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+ }
- ret = media_info_get_media_from_db(media_uuid, &media);
+ _media_info_item_get_detail(stmt, (media_info_h)_media);
- if(callback(playlist_member_id, media, user_data) == false)
+ if(callback(playlist_member_id, (media_info_h)_media, user_data) == false)
{
- media_info_destroy(media);
+ media_info_destroy((media_info_h)_media);
break;
}
- media_info_destroy(media);
+ media_info_destroy((media_info_h)_media);
+
}
SQLITE3_FINALIZE(stmt);
@@ -729,7 +728,7 @@ int _media_db_get_group_item_count(const char *group_name, filter_h filter, grou
if(group_type == MEDIA_GROUP_NONE)
{
- /* There are 2 ways to get count for media table for performance
+ /* There are 2 ways to get count for media table for performance
If user wants to set offset and count, use SQL SELECT_MEDIA_COUNT_FROM_MEDIA.
If user wants to get count without setting count, SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE */
_filter = (filter_s*)filter;
diff --git a/src/media_filter.c b/src/media_filter.c
index 9c2e311..51e35a5 100755
--- a/src/media_filter.c
+++ b/src/media_filter.c
@@ -57,6 +57,7 @@ static bool __is_pinyin_needed(void)
{
char *lang = NULL;
char *china = "zh_CN";
+ char *hongkong = "zh_HK";
int ret = FALSE;
/*Check CSC first*/
@@ -66,7 +67,8 @@ static bool __is_pinyin_needed(void)
{
/*Check Language Setting*/
lang = vconf_get_str(VCONFKEY_LANGSET);
- if(strncmp(china, lang, strlen(china)) == 0)
+ if((strncmp(china, lang, strlen(china)) == 0) ||
+ (strncmp(hongkong, lang, strlen(hongkong)) == 0))
{
ret = TRUE;
}
diff --git a/src/media_folder.c b/src/media_folder.c
index 4e40618..a59773f 100755
--- a/src/media_folder.c
+++ b/src/media_folder.c
@@ -133,9 +133,6 @@ int media_folder_clone(media_folder_h *dst, media_folder_h src)
int ret = MEDIA_CONTENT_ERROR_NONE;
media_folder_s *_src = (media_folder_s*)src;
- /*this is temporary log to fix bug*/
- media_content_error("");
-
if(_src != NULL)
{
media_folder_s *_dst = (media_folder_s*)calloc(1, sizeof(media_folder_s));
@@ -399,6 +396,8 @@ int media_folder_update_to_db(media_folder_h folder)
sqlite3_free(set_sql);
sqlite3_free(sql);
+ if (ret != MEDIA_CONTENT_ERROR_NONE)
+ return ret;
/* Do folder rename operation using libmedia-service */
ret = media_svc_rename_folder(_content_get_db_handle(), g_src_path, _folder->path);
@@ -434,6 +433,7 @@ int media_folder_set_name(media_folder_h folder, const char *name)
SAFE_FREE(_folder->path);
SAFE_FREE(_folder->name);
+ SAFE_FREE(folder_path);
_folder->path = strdup(new_folder_path);
if(_folder->path == NULL)
diff --git a/src/media_image.c b/src/media_image.c
index c11d538..54f54b7 100755
--- a/src/media_image.c
+++ b/src/media_image.c
@@ -252,68 +252,6 @@ int image_meta_get_date_taken(image_meta_h image, char **date_taken)
return ret;
}
-int image_meta_get_title(image_meta_h image, char **title)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- image_meta_s *_image = (image_meta_s*)image;
- if(_image)
- {
- if(STRING_VALID(_image->title))
- {
- *title = strdup(_image->title);
- if(*title == NULL)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
- else
- {
- *title = NULL;
- }
- ret = MEDIA_CONTENT_ERROR_NONE;
-
- }
- else
- {
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
- return ret;
-}
-
-int image_meta_get_weather(image_meta_h image, char **weather)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- image_meta_s *_image = (image_meta_s*)image;
- if(_image)
- {
- if(STRING_VALID(_image->weather))
- {
- *weather = strdup(_image->weather);
- if(*weather == NULL)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
- else
- {
- *weather = NULL;
- }
- ret = MEDIA_CONTENT_ERROR_NONE;
-
- }
- else
- {
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
- return ret;
-}
-
int image_meta_get_burst_id(image_meta_h image, char **burst_id)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -368,38 +306,6 @@ int image_meta_is_burst_shot(image_meta_h image, bool *is_burst_shot)
return ret;
}
-int image_meta_set_weather(image_meta_h image, const char *weather)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- image_meta_s *_image = (image_meta_s*)image;
-
- if(_image != NULL)
- {
- SAFE_FREE(_image->weather);
-
- if(STRING_VALID(weather))
- {
- _image->weather = strdup(weather);
- if(_image->weather == NULL)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- }
- else
- {
- _image->weather = NULL;
- }
- }
- else
- {
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
- return ret;
-}
-
int image_meta_set_orientation(image_meta_h image, media_content_orientation_e orientation)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
diff --git a/src/media_info.c b/src/media_info.c
index 7b36de4..a3ac262 100755
--- a/src/media_info.c
+++ b/src/media_info.c
@@ -112,8 +112,10 @@ static void __media_info_thumbnail_completed_cb(int error, const char *path, voi
static bool __media_info_delete_batch_cb(media_info_h media, void *user_data)
{
+ int err = MEDIA_INFO_ERROR_NONE;
char *thumb_path = NULL;
media_content_type_e media_type = 0;
+ GArray *thumb_list = (GArray *)user_data;
if(media == NULL)
{
@@ -121,19 +123,22 @@ static bool __media_info_delete_batch_cb(media_info_h media, void *user_data)
return true;
}
- media_info_get_media_type(media, &media_type);
- media_content_debug("media_type : [%d]", media_type);
+ err = media_info_get_media_type(media, &media_type);
+ if (err == MEDIA_INFO_ERROR_NONE) {
+ media_content_debug("media_type : [%d]", media_type);
- media_info_get_thumbnail_path(media, &thumb_path);
- if (STRING_VALID(thumb_path)) {
- if (strncmp(MEDIA_CONTENT_THUMB_DEFAULT_PATH, thumb_path, strlen(MEDIA_CONTENT_THUMB_DEFAULT_PATH)) != 0) {
- media_content_debug("Deleting thumbnail : [%s]", thumb_path);
- if (unlink(thumb_path) < 0) {
- media_content_error("failed to delete : %s", strerror(errno));
+ media_info_get_thumbnail_path(media, &thumb_path);
+ if (STRING_VALID(thumb_path)) {
+ if (strncmp(MEDIA_CONTENT_THUMB_DEFAULT_PATH, thumb_path, strlen(MEDIA_CONTENT_THUMB_DEFAULT_PATH)) != 0) {
+ g_array_append_val(thumb_list, thumb_path);
+ } else {
+ SAFE_FREE(thumb_path);
}
+ } else {
+ SAFE_FREE(thumb_path);
}
-
- SAFE_FREE(thumb_path);
+ } else {
+ media_content_error("media_info_get_media_type failed");
}
return true;
@@ -177,6 +182,15 @@ static int __media_info_insert_batch(media_batch_insert_e insert_type, const cha
if (STRING_VALID(path_array[idx])) {
int size = strlen(path_array[idx]);
+ ret = _media_util_check_file(path_array[idx]);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ fclose(fp);
+ if (unlink(list_path) < 0) {
+ media_content_error("failed to delete : %s", strerror(errno));
+ }
+ return ret;
+ }
+
nwrites = fwrite(path_array[idx], 1, size, fp);
if (nwrites != size) {
media_content_error("failed to write : %s", strerror(errno));
@@ -266,6 +280,7 @@ typedef enum {
MEDIA_INFO_COPYRIGHT,
MEDIA_INFO_TRACK_NUM,
MEDIA_INFO_BITRATE,
+ MEDIA_INFO_BITPERSAMPLE,
MEDIA_INFO_DURATION,
MEDIA_INFO_PLAYED_COUNT, //40
MEDIA_INFO_LAST_PLAYED_TIME,
@@ -464,6 +479,7 @@ void _media_info_item_get_detail(sqlite3_stmt* stmt, media_info_h media)
_media->audio_meta->track_num = strdup((const char *)sqlite3_column_text(stmt, MEDIA_INFO_TRACK_NUM));
_media->audio_meta->bitrate = sqlite3_column_int(stmt, MEDIA_INFO_BITRATE);
+ _media->audio_meta->bitpersample = sqlite3_column_int(stmt, MEDIA_INFO_BITPERSAMPLE);
_media->audio_meta->duration = sqlite3_column_int(stmt, MEDIA_INFO_DURATION);
_media->audio_meta->played_count = sqlite3_column_int(stmt, MEDIA_INFO_PLAYED_COUNT);
_media->audio_meta->played_time = sqlite3_column_int(stmt, MEDIA_INFO_LAST_PLAYED_TIME);
@@ -524,6 +540,11 @@ int media_info_insert_to_db(const char *path, media_info_h *info)
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
+ ret = _media_util_check_file(path);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ return ret;
+ }
+
folder_path = g_path_get_dirname(path);
ret = _media_util_check_ignore_dir(folder_path, &ignore_dir);
SAFE_FREE(folder_path);
@@ -638,6 +659,49 @@ int media_info_delete_from_db(const char *media_id)
return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
}
+static int __media_info_delete_thumb_from_list(GArray *thumb_list)
+{
+ int i = 0;
+ int list_len = 0;
+ char *thumb_path = NULL;
+
+ if (thumb_list != NULL) {
+
+ list_len = thumb_list->len;
+
+ for (i = 0; i < list_len; i ++) {
+ thumb_path = g_array_index(thumb_list, char*, i);
+ media_content_debug("thumb path [%s]", thumb_path);
+ if (unlink(thumb_path) < 0) {
+ media_content_error("failed to delete : %s", strerror(errno));
+ }
+ }
+ }
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+
+static int __media_info_release_thumb_list(GArray *thumb_list)
+{
+ int i = 0;
+ int list_len = 0;
+ char *thumb_path = NULL;
+
+ if (thumb_list != NULL) {
+
+ list_len = thumb_list->len;
+
+ for (i = 0; i < list_len; i ++) {
+ thumb_path = g_array_index(thumb_list, char*, 0);
+ g_array_remove_index(thumb_list,0);
+ SAFE_FREE(thumb_path);
+ }
+
+ g_array_free(thumb_list, FALSE);
+ }
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
+
int media_info_delete_batch_from_db(filter_h filter)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -646,6 +710,7 @@ int media_info_delete_batch_from_db(filter_h filter)
filter_s *_filter = NULL;
attribute_h attr;
char *condition_query = NULL;
+ GArray *thumb_list = NULL;
if(filter == NULL)
{
@@ -653,8 +718,10 @@ int media_info_delete_batch_from_db(filter_h filter)
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
+ thumb_list = g_array_new(FALSE, FALSE, sizeof(char*));
+
/* Delete thumbnail of each item */
- ret = _media_db_get_group_item(NULL, filter, __media_info_delete_batch_cb, NULL, MEDIA_GROUP_NONE);
+ ret = _media_db_get_group_item(NULL, filter, __media_info_delete_batch_cb, thumb_list, MEDIA_GROUP_NONE);
_filter = (filter_s*)filter;
attr = _content_get_attirbute_handle();
@@ -662,7 +729,10 @@ int media_info_delete_batch_from_db(filter_h filter)
if(_filter->condition)
{
ret = _media_filter_attribute_generate(attr, _filter->condition, _filter->condition_collate_type, &condition_query);
- media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ __media_info_release_thumb_list(thumb_list);
+ return ret;
+ }
}
if(STRING_VALID(condition_query))
@@ -672,6 +742,8 @@ int media_info_delete_batch_from_db(filter_h filter)
else
{
SAFE_FREE(condition_query);
+ __media_info_release_thumb_list(thumb_list);
+
return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
}
@@ -683,6 +755,9 @@ int media_info_delete_batch_from_db(filter_h filter)
media_content_debug("Batch deletion is successfull. Send notification for this");
media_svc_publish_noti(_content_get_db_handle(), MS_MEDIA_ITEM_DIRECTORY, MS_MEDIA_ITEM_UPDATE, MEDIA_ROOT_PATH_INTERNAL, -1, NULL, NULL);
media_svc_publish_noti(_content_get_db_handle(), MS_MEDIA_ITEM_DIRECTORY, MS_MEDIA_ITEM_UPDATE, MEDIA_ROOT_PATH_SDCARD, -1, NULL, NULL);
+
+ __media_info_delete_thumb_from_list(thumb_list);
+ __media_info_release_thumb_list(thumb_list);
}
SAFE_FREE(condition_query);
@@ -1257,6 +1332,7 @@ int media_info_clone(media_info_h *dst, media_info_h src)
_dst->audio_meta->samplerate = _src->audio_meta->samplerate;
_dst->audio_meta->duration = _src->audio_meta->duration;
_dst->audio_meta->bitrate = _src->audio_meta->bitrate;
+ _dst->audio_meta->bitpersample = _src->audio_meta->bitpersample;
_dst->audio_meta->played_count = _src->audio_meta->played_count;
_dst->audio_meta->played_time = _src->audio_meta->played_time;
_dst->audio_meta->played_position = _src->audio_meta->played_position;
@@ -1585,6 +1661,7 @@ int media_info_get_audio(media_info_h media, audio_meta_h *audio)
_audio->duration = _media->audio_meta->duration;
_audio->bitrate = _media->audio_meta->bitrate;
+ _audio->bitpersample = _media->audio_meta->bitpersample;
_audio->samplerate = _media->audio_meta->samplerate;
_audio->channel = _media->audio_meta->channel;
_audio->played_time = _media->audio_meta->played_time;
@@ -2879,7 +2956,16 @@ int media_info_refresh_metadata_to_db(const char *media_id)
return ret;
}
+ ret = _media_util_check_file(file_path);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ return ret;
+ }
+
ret = media_svc_refresh_item(_content_get_db_handle(), storage_type, file_path);
+ if (ret != MEDIA_INFO_ERROR_NONE)
+ {
+ ret = _content_error_capi(MEDIA_CONTENT_TYPE, ret);
+ }
SAFE_FREE(file_path);
media_info_destroy(media);
@@ -2902,6 +2988,11 @@ int media_info_move_to_db(media_info_h media, const char* dst_path)
media_info_s *_media = (media_info_s*)media;
+ ret = _media_util_check_file(dst_path);
+ if (ret != MEDIA_CONTENT_ERROR_NONE) {
+ return ret;
+ }
+
ret = media_svc_get_storage_type(_media->file_path, &src_storage_type);
if(ret != MEDIA_INFO_ERROR_NONE)
{
diff --git a/src/media_playlist.c b/src/media_playlist.c
index d839668..bf5341c 100755
--- a/src/media_playlist.c
+++ b/src/media_playlist.c
@@ -390,8 +390,8 @@ int media_playlist_get_playlist_from_db(int playlist_id, media_playlist_h *playl
_playlist->playlist_id = (int)sqlite3_column_int(stmt, 0);
if(STRING_VALID((const char *)sqlite3_column_text(stmt, 1)))
_playlist->name = strdup((const char *)sqlite3_column_text(stmt, 1));
- if(STRING_VALID((const char *)sqlite3_column_text(stmt, 2)))
- _playlist->thumbnail_path = strdup((const char *)sqlite3_column_text(stmt, 2));
+ if(STRING_VALID((const char *)sqlite3_column_text(stmt, 3)))
+ _playlist->thumbnail_path = strdup((const char *)sqlite3_column_text(stmt, 3));
*playlist = (media_playlist_h)_playlist;
}
diff --git a/src/media_util_private.c b/src/media_util_private.c
index 3a22c60..531ef09 100755
--- a/src/media_util_private.c
+++ b/src/media_util_private.c
@@ -17,10 +17,31 @@
#include <dirent.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
#include <media_util_private.h>
#include <media_info_private.h>
#include <media_content_type.h>
+int _media_util_check_file(const char *path)
+{
+ int exist;
+
+ /* check the file exits actually */
+ exist = open(path, O_RDONLY);
+ if(exist < 0) {
+ media_content_error("error [%s, %s]", path, strerror(errno));
+ if (errno == EACCES || errno == EPERM) {
+ return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
+ } else {
+ return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+ }
+ }
+
+ close(exist);
+
+ return MEDIA_CONTENT_ERROR_NONE;
+}
int _media_util_check_ignore_dir(const char *dir_path, bool *ignore)
{
diff --git a/src/media_video.c b/src/media_video.c
index a1f0bda..49b36ee 100755
--- a/src/media_video.c
+++ b/src/media_video.c
@@ -240,38 +240,6 @@ int video_meta_get_media_id(video_meta_h video, char **media_id)
return ret;
}
-int video_meta_get_title(video_meta_h video, char **title)
-{
- int ret = MEDIA_CONTENT_ERROR_NONE;
- video_meta_s *_video = (video_meta_s*)video;
- if(_video)
- {
- if(STRING_VALID(_video->title))
- {
- char *new_string = strdup(_video->title);
- if(NULL == new_string)
- {
- media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
- return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
- }
- *title = new_string;
- }
- else
- {
- *title = NULL;
- }
- ret = MEDIA_CONTENT_ERROR_NONE;
-
- }
- else
- {
- media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
- ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
- }
-
- return ret;
-}
-
int video_meta_get_album(video_meta_h video, char **album)
{
int ret = MEDIA_CONTENT_ERROR_NONE;
diff --git a/test/media-content_test.c b/test/media-content_test.c
index a1345e0..3ceb39f 100755
--- a/test/media-content_test.c
+++ b/test/media-content_test.c
@@ -51,12 +51,6 @@ bool get_audio_meta(audio_meta_h audio)
media_content_debug("audio_id : [%s]", c_value);
SAFE_FREE(c_value);
- ret = audio_meta_get_title(audio, &c_value);
- if(ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- media_content_debug("title : [%s]", c_value);
- SAFE_FREE(c_value);
-
ret = audio_meta_get_album(audio, &c_value);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error when get meta : [%d]", ret);
@@ -164,12 +158,6 @@ bool get_video_meta(video_meta_h video)
media_content_debug("video_id : [%s]", c_value);
SAFE_FREE(c_value);
- ret = video_meta_get_title(video, &c_value);
- if(ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error when get meta : [%d]", ret);
- media_content_debug("title : [%s]", c_value);
- SAFE_FREE(c_value);
-
ret = video_meta_get_album(video, &c_value);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error when get meta : [%d]", ret);
@@ -390,12 +378,6 @@ bool media_item_cb(media_info_h media, void *user_data)
SAFE_FREE(burst_id);
}
- ret = image_meta_get_weather(image, &weather);
- if(ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error image_meta_get_weather : [%d]", ret);
- else
- media_content_debug("[image] weather : %s", weather);
-
ret = image_meta_destroy(image);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error image_meta_destroy : [%d]", ret);
@@ -548,6 +530,7 @@ bool media_item_cb(media_info_h media, void *user_data)
//media_info_update_to_db(media);
SAFE_FREE(media_id);
#endif
+ SAFE_FREE(media_id);
return true;
}
@@ -668,6 +651,8 @@ bool test_album_from_db(int album_id)
if(media_album_get_artist(album_h, &artist) != MEDIA_CONTENT_ERROR_NONE)
{
media_album_destroy(album_h);
+ /* fix prevent: Resource Leak */
+ SAFE_FREE(album_name);
return false;
}
@@ -829,6 +814,7 @@ bool album_list_cb(media_album_h album, void *user_data)
}
media_content_debug("album_name : [%s]", album_name);
+ SAFE_FREE(album_name);
if(media_album_get_artist(album, &artist) != MEDIA_CONTENT_ERROR_NONE)
{
@@ -837,6 +823,7 @@ bool album_list_cb(media_album_h album, void *user_data)
}
media_content_debug("artist : [%s]", artist);
+ SAFE_FREE(artist);
if(media_album_get_album_art(album, &album_art) != MEDIA_CONTENT_ERROR_NONE)
{
@@ -845,9 +832,6 @@ bool album_list_cb(media_album_h album, void *user_data)
}
media_content_debug("album_art : [%s]", album_art);
-
- SAFE_FREE(album_name);
- SAFE_FREE(artist);
SAFE_FREE(album_art);
if(media_album_get_media_count_from_db(album_id, filter, &media_count) != MEDIA_CONTENT_ERROR_NONE)
@@ -1137,9 +1121,6 @@ int test_gallery_scenario(void)
if(ret != MEDIA_CONTENT_ERROR_NONE) {
media_content_error("media_info_get_video failed: %d", ret);
} else {
- ret = video_meta_get_title(video_handle, &title);
- if(ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_title : [%d]", ret);
ret = video_meta_get_artist(video_handle, &artist);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error video_meta_get_artist : [%d]", ret);
@@ -1276,9 +1257,6 @@ int test_gallery_scenario(void)
if(ret != MEDIA_CONTENT_ERROR_NONE) {
media_content_error("media_info_get_video failed: %d", ret);
} else {
- ret = video_meta_get_title(video_handle, &title);
- if(ret != MEDIA_CONTENT_ERROR_NONE)
- media_content_error("error video_meta_get_title : [%d]", ret);
ret = video_meta_get_artist(video_handle, &artist);
if(ret != MEDIA_CONTENT_ERROR_NONE)
media_content_error("error video_meta_get_artist : [%d]", ret);
@@ -1655,6 +1633,9 @@ int test_folder_operation(void)
test_filter_destroy();
+ /* fix prevent: Resource Leak */
+ SAFE_FREE(folder_id);
+
return ret;
}
@@ -2258,6 +2239,10 @@ int test_update_operation()
}
#endif
}
+
+ /* fix prevent: Resource Leak */
+ SAFE_FREE(media_id);
+ SAFE_FREE(media_path);
}
return MEDIA_CONTENT_ERROR_NONE;
@@ -2396,6 +2381,9 @@ bool thumbnail_create_cb(media_info_h media, void *user_data)
media_content_error("media_info_create_thumbnail failed: %d", ret);
}
+ /* fix prevent: Resource leak */
+ SAFE_FREE(media_id);
+
return true;
}
@@ -2435,6 +2423,9 @@ bool thumbnail_cancel_cb(media_info_h media, void *user_data)
if(g_cnt == g_media_cnt)
g_main_loop_quit(g_loop);
+ /* fix prevent: Resource leak */
+ SAFE_FREE(media_id);
+
return true;
}