Code migration 80/79980/4 accepted/tizen/common/20160719.171952 accepted/tizen/ivi/20160718.104826 accepted/tizen/mobile/20160718.104903 accepted/tizen/tv/20160718.104623 accepted/tizen/wearable/20160718.104753 submit/tizen/20160718.052709
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 14 Jul 2016 00:07:34 +0000 (09:07 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 14 Jul 2016 02:03:31 +0000 (11:03 +0900)
Change-Id: I9dc385992bde04c462846a48987ffcaecb1e3e4f
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
31 files changed:
CMakeLists.txt
capi-content-media-content-product.pc.in [new file with mode: 0644]
doc/media_content_doc.h
include_product/media_audio.h [new file with mode: 0755]
include_product/media_bookmark.h [new file with mode: 0755]
include_product/media_content.h [new file with mode: 0755]
include_product/media_content_internal.h [new file with mode: 0755]
include_product/media_content_type.h [new file with mode: 0755]
include_product/media_face.h [new file with mode: 0755]
include_product/media_filter.h [new file with mode: 0755]
include_product/media_folder.h [new file with mode: 0755]
include_product/media_group.h [new file with mode: 0755]
include_product/media_image.h [new file with mode: 0755]
include_product/media_info.h [new file with mode: 0755]
include_product/media_info_private.h [new file with mode: 0755]
include_product/media_playlist.h [new file with mode: 0755]
include_product/media_pvr.h [new file with mode: 0755]
include_product/media_storage.h [new file with mode: 0755]
include_product/media_tag.h [new file with mode: 0755]
include_product/media_uhd.h [new file with mode: 0755]
include_product/media_util_private.h [new file with mode: 0755]
include_product/media_video.h [new file with mode: 0755]
src/media_content.c
src/media_db.c
src/media_folder.c
src/media_group.c
src/media_info.c
src/media_pvr.c [new file with mode: 0755]
src/media_uhd.c [new file with mode: 0755]
src/media_util_private.c
test/media-content_test.c

index 577efe0..c0c2148 100755 (executable)
@@ -39,12 +39,7 @@ SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIB_INSTALL_DIR}")
 aux_source_directory(src SOURCES)
 ADD_LIBRARY(${fw_name} SHARED ${SOURCES})
 
-IF(TIZEN_PRODUCT_TV)
-    TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS} capi-system-info)
-ELSE()
-    TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
-ENDIF(TIZEN_PRODUCT_TV)
-
+TARGET_LINK_LIBRARIES(${fw_name} ${${fw_name}_LDFLAGS})
 
 SET_TARGET_PROPERTIES(${fw_name}
      PROPERTIES
@@ -64,9 +59,14 @@ INSTALL(
 SET(PC_NAME ${fw_name})
 SET(PC_REQUIRED ${pc_dependents})
 SET(PC_LDFLAGS -l${fw_name})
+IF(TIZEN_PRODUCT_TV)
+    SET(PC_FILE_NAME ${fw_name}-product.pc.in)
+ELSE()
+    SET(PC_FILE_NAME ${fw_name}.pc.in)
+ENDIF(TIZEN_PRODUCT_TV)
 
 CONFIGURE_FILE(
-    ${fw_name}.pc.in
+    ${PC_FILE_NAME}
     ${CMAKE_CURRENT_SOURCE_DIR}/${fw_name}.pc
     @ONLY
 )
diff --git a/capi-content-media-content-product.pc.in b/capi-content-media-content-product.pc.in
new file mode 100644 (file)
index 0000000..6e55b51
--- /dev/null
@@ -0,0 +1,15 @@
+
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=@LIB_INSTALL_DIR@
+includedir=/usr/include/media-content
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@ 
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir} -D_USE_TV_PROFILE
+
index 18f9c8b..0283f6c 100755 (executable)
@@ -98,7 +98,7 @@
  *   \#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.  
+ * 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.
  *
  *
  * @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 
+ * 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). 
+ * 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.
diff --git a/include_product/media_audio.h b/include_product/media_audio.h
new file mode 100755 (executable)
index 0000000..2b8fd7f
--- /dev/null
@@ -0,0 +1,536 @@
+/*
+* 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_AUDIO_META_H__
+#define __TIZEN_AUDIO_META_H__
+
+#include <media_content_type.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file media_audio.h
+ * @brief This file contains the audio metadata API and related functions to proceed with audio metadata. \n
+ *        Description of the audio content involves: album, artist, album_artist, author, genre and description tags. \n
+ *        Parameters of the recording are also supported such as format, bitrate, duration, size etc.
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_AUDIO_META_MODULE
+ * @{
+ */
+
+/**
+ * @brief Clones the audio metadata.
+ * @details This function copies the audio metadata handle from a source to destination.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release the destination handle using audio_meta_destroy().
+ *
+ * @param[out] dst The destination handle to the audio metadata
+ * @param[in]  src The source handle to the audio metadata
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @see audio_meta_destroy()
+ */
+int audio_meta_clone(audio_meta_h *dst, audio_meta_h src);
+
+/**
+ * @brief Destroys the audio metadata.
+ * @details This function frees all resources related to the audio metadata 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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 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 Gets the ID of the media of the given audio metadata.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a media_id using free().
+ *
+ * @param[in]  audio    The audio metadata handle
+ * @param[out] media_id The ID 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_PERMISSION_DENIED Permission denied
+ */
+int audio_meta_get_media_id(audio_meta_h audio, char **media_id);
+
+/**
+ * @brief Gets the album of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no album info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a album using free().
+ *
+ * @param[in]  audio The audio metadata handle
+ * @param[out] album The album of the audio metadata
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int audio_meta_get_album(audio_meta_h audio, char **album);
+
+/**
+ * @brief Gets the artist of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no artist info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a artist using free().
+ *
+ * @param[in]  audio  The audio metadata handle
+ * @param[out] artist The artist of the audio metadata
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int audio_meta_get_artist(audio_meta_h audio, char **artist);
+
+/**
+ * @brief Gets the album artist of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no album artist info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a album_artist using free().
+ *
+ * @param[in]  audio        The audio metadata handle
+ * @param[out] album_artist The album artist of the audio metadata
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int audio_meta_get_album_artist(audio_meta_h audio, char **album_artist);
+
+/**
+ * @brief Gets the genre of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no genre info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a genre using free().
+ *
+ * @param[in]  audio The audio metadata handle
+ * @param[out] genre The genre of the audio metadata
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int audio_meta_get_genre(audio_meta_h audio, char **genre);
+
+/**
+ * @brief Gets the composer of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no composer info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a composer using free().
+ *
+ * @param[in]  audio    The audio metadata handle
+ * @param[out] composer The composer of the audio metadata
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int audio_meta_get_composer(audio_meta_h audio, char **composer);
+
+/**
+ * @brief Gets the year of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no year info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a year using free().
+ *
+ * @param[in]  audio The audio metadata handle
+ * @param[out] year  The year of the audio metadata
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int audio_meta_get_year(audio_meta_h audio, char **year);
+
+/**
+ * @brief Gets the recorded date of the given audio metadata.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 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_PERMISSION_DENIED Permission denied
+ */
+int audio_meta_get_recorded_date(audio_meta_h audio, char **recorded_date);
+
+/**
+ * @brief Gets the copyright notice of the given audio metadata.
+ * @details If the media content has no copyright info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a copyright using free().
+ *
+ * @param[in]  audio     The audio metadata handle
+ * @param[out] copyright The copyright of the audio metadata
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int audio_meta_get_copyright(audio_meta_h audio, char **copyright);
+
+/**
+ * @brief Gets the track number of the given audio metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no track info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a track_num using free().
+ *
+ * @param[in]  audio     The audio metadata handle
+ * @param[out] track_num The audio track number of the audio metadata
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int audio_meta_get_track_num(audio_meta_h audio, char **track_num);
+
+/**
+ * @brief Gets the bitrate of the given audio metadata in bitrate per second.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 bit per sample of the given audio metadata.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  audio       The audio metadata handle
+ * @param[out] sample_rate The audio sample rate[hz]
+ *
+ * @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 the channel of the given audio metadata.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @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 the track duration of the given audio metadata.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. [Use media_info_get_played_count() instead]
+ * @brief Gets the number of times the given audio has been played.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  audio        The audio metadata handle
+ * @param[out] played_count The counter of the audio 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 audio_meta_get_played_count(audio_meta_h audio, int *played_count);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. [Use media_info_get_played_time() instead]
+ * @brief Gets the last played time parameter of the audio.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  audio       The audio metadata handle
+ * @param[out] played_time The last played 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);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif.
+ * @brief Gets the played position parameter of the audio.
+ * @details This function returns the elapsed playback position parameter of the audio as a period
+ *          starting from the beginning of the track.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. [Use media_info_increase_played_count() instead]
+ * @brief Sets the played count of the audio.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @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);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. [Use media_info_set_played_time() instead]
+ * @brief Sets the last played time of the audio.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] audio       The audio metadata handle
+ * @param[in] played_time The last played 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
+ *
+ * @post audio_meta_update_to_db().
+ */
+int audio_meta_set_played_time(audio_meta_h audio, time_t played_time);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif.
+ * @brief Sets the played position of the audio.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks  It is NOT recommended to use this attribute for your application-specific purpose because this attribute can be overwritten by other applications (even 0).
+ *
+ * @param[in] audio           The audio metadata handle
+ * @param[in] played_position The played position of the audio
+ *
+ * @return @c 0 on success,
+ *         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 audio_meta_update_to_db().
+ */
+int audio_meta_set_played_position(audio_meta_h audio, int played_position);
+
+/**
+ * @brief Updates an audio metadata with modified attributes in the media database.
+ * @details The function updates the given audio meta in the media database. The function should be called after any change in audio attributes, to be updated to the media
+ *          database. For example, for setting the played time using audio_meta_get_played_time(), after that the audio_meta_update_to_db() function should be called to update media database.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db().
+ *
+ * @param[in] audio The 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_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 audio_meta_set_played_time()
+ * @see audio_meta_set_played_count()
+ * @see audio_meta_set_played_position()
+ */
+int audio_meta_update_to_db(audio_meta_h audio);
+
+/**
+ *@}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__TIZEN_AUDIO_META_H__*/
diff --git a/include_product/media_bookmark.h b/include_product/media_bookmark.h
new file mode 100755 (executable)
index 0000000..1d329b8
--- /dev/null
@@ -0,0 +1,230 @@
+/*
+* 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_BOOKMARK_H__
+#define __TIZEN_MEDIA_BOOKMARK_H__
+
+#include <media_content_type.h>
+
+#ifdef __cplusplus
+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
+ * @{
+ */
+
+/**
+ * @brief Inserts a new bookmark in media on the specified time offset to the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] 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.
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ * @see media_bookmark_delete_from_db()
+ */
+int media_bookmark_insert_to_db(const char *media_id, time_t time, const char *thumbnail_path);
+
+/**
+ * @brief Removes a media bookmark from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] bookmark_id The ID of 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_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_bookmark_insert_to_db()
+ */
+int media_bookmark_delete_from_db(int bookmark_id);
+
+/**
+ * @brief Gets the number of bookmarks with an optional filter from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_bookmark_get_bookmark_count_from_db(filter_h filter, int *bookmark_count);
+
+/**
+ * @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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks The destination handle must be released using media_bookmark_destroy().
+ *
+ * @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_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 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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the bookmark ID.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  bookmark    The handle to media bookmark
+ * @param[out] bookmark_id The media bookmark 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
+ */
+int media_bookmark_get_bookmark_id(media_bookmark_h bookmark, int *bookmark_id);
+
+/**
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 thumbnail.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @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_bookmark_get_thumbnail_path(media_bookmark_h bookmark, char **path);
+
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /*__TIZEN_MEDIA_BOOKMARK_H__*/
diff --git a/include_product/media_content.h b/include_product/media_content.h
new file mode 100755 (executable)
index 0000000..010fe29
--- /dev/null
@@ -0,0 +1,276 @@
+/*
+* 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_H__
+#define __TIZEN_MEDIA_CONTENT_H__
+
+#include <media_audio.h>
+#include <media_content_type.h>
+#include <media_filter.h>
+#include <media_folder.h>
+#include <media_image.h>
+#include <media_info.h>
+#include <media_tag.h>
+#include <media_video.h>
+#include <media_group.h>
+#include <media_playlist.h>
+#include <media_bookmark.h>
+#include <media_storage.h>
+#include <media_face.h>
+#include <media_pvr.h>
+#include <media_uhd.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
+ * @{
+ */
+
+/**
+ * @brief Connects to the media content service.
+ * @details Any media content related function call should be invoked after this function call.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE      Successful
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post 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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE      Successful
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre media_content_connect()
+ *
+ * @see media_content_connect()
+ *
+ */
+int media_content_disconnect(void);
+
+/**
+ * @brief Requests to scan a media file.
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ *                   %http://tizen.org/privilege/mediastorage \n
+ *                   %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ *                   If you want to access only internal storage by using  this 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 should 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 @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().
+ */
+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 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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ *                   %http://tizen.org/privilege/mediastorage \n
+ *                   %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ *                   If you want to access only internal storage by using  this 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 should 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
+ * @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 Requests to cancel the media folder scanning.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param[in] path         The folder path
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre media_content_scan_folder()
+ */
+int media_content_cancel_scan_folder(const char *path);
+
+/**
+ * @deprecated Deprecated since 3.0. Use media_content_add_db_updated_cb() instead.
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @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);
+
+/**
+ * @deprecated Deprecated since 3.0. Use media_content_remove_db_updated_cb() instead.
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre media_content_set_db_updated_cb()
+ *
+ * @see media_content_set_db_updated_cb()
+ */
+int media_content_unset_db_updated_cb(void);
+
+/**
+ * @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. \n
+ *          media_content_db_update_cb() function will be called when notification of the media DB change is subscribed. \n
+ *          Using this API, multiple callback is possible to register in one process.
+ *
+ * @since_tizen 3.0
+ *
+ * @remarks  To release the registered callback, you must use media_content_remove_db_updated_cb() API. \n
+ *                    media_content_unset_db_updated_cb() API can not release the callbacks added by this API. \n
+ *                    If you set the same callback that you previously added, this API returns MEDIA_CONTENT_ERROR_INVALID_OPERATION error. \n
+ *
+ * @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
+ * @param[out] noti_handle The handle to db updated notification
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ *
+ * @see media_content_db_update_cb()
+ * @see media_content_remove_db_updated_cb()
+ */
+int media_content_add_db_updated_cb(media_content_db_update_cb callback, void *user_data, media_content_noti_h *noti_handle);
+
+
+/**
+ * @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 3.0
+ *
+ * @param[in] noti_handle The handle to db updated notification
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre media_content_add_db_updated_cb()
+ *
+ * @see media_content_add_db_updated_cb()
+ */
+int media_content_remove_db_updated_cb(media_content_noti_h noti_handle);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_CONTENT_H__ */
diff --git a/include_product/media_content_internal.h b/include_product/media_content_internal.h
new file mode 100755 (executable)
index 0000000..4c63f0e
--- /dev/null
@@ -0,0 +1,445 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+
+#ifndef __TIZEN_MEDIA_CONTENT_INTERNAL_H__
+#define __TIZEN_MEDIA_CONTENT_INTERNAL_H__
+
+#include <media_content_type.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @internal
+ * @file media_content_internal.h
+ * @brief This file contains API on main functional operations with storage that are related to media resources in the media database. \n
+ *        Operations include: inserting a new storage in media to the media database, removing storage from database, \n
+ */
+
+/**
+* @internal
+* @brief Insert media storage to database.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @remarks You must release @a storage using media_storage_destroy().
+*
+* @privlevel platform
+* @privilege %http://tizen.org/privilege/content.write
+*
+* @param[in] storage_name The storage name to insert to database
+* @param[in] storage_path The storage path to insert to database
+* @param[in] storage_account The storage account to insert to database
+* @param[in] storage_type The storage type to insert to database
+* @param[out] storage The media storage handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @see media_storage_delete_from_db()
+*/
+int media_storage_insert_to_db(const char *storage_name, const char *storage_path, const char *storage_account, media_content_storage_e storage_type, media_storage_h *storage);
+
+/**
+* @internal
+* @brief Deletes the database for media storage.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @privlevel platform
+* @privilege %http://tizen.org/privilege/content.write
+*
+* @param[in] storage_id The storage ID to delete from database
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @see media_storage_insert_to_db()
+*/
+int media_storage_delete_from_db(const char *storage_id);
+
+/**
+ * @brief Gets the storage account of media storage.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks You must release @a storage_account using free().
+ *
+ * @param[in]  storage The media storage handle
+ * @param[out] storage_account  The storage account of the media storage
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ */
+int media_storage_get_storage_account(media_storage_h storage, char **storage_account);
+
+/**
+* @internal
+* @brief Sets the MIME type of media info handle.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] media The media info handle
+* @param[in] mime_type The MIME type of the media info
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_mime_type(media_info_h media, const char *mime_type);
+
+/**
+* @internal
+* @brief Sets the thumbnail path of media info handle.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] media The media info handle
+* @param[in] thumbnail_path The thumbnail path of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_thumbnail_path(media_info_h media, const char *thumbnail_path);
+
+/**
+* @internal
+* @brief Sets the size of media info handle.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] media The media info handle
+* @param[in] size The size of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_size(media_info_h media, unsigned long long size);
+
+/**
+* @internal
+* @brief Sets the modified time of media info handle.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] media The media info handle
+* @param[in] modified_time The modified time of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_modified_time(media_info_h media, time_t modified_time);
+
+/**
+* @internal
+* @brief Sets the media type of media info handle.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] media The media info handle
+* @param[in] type The media type of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_media_type(media_info_h media, media_content_type_e type);
+
+/**
+* @internal
+* @brief Sets the duration of media info handle.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] media The media info handle
+* @param[in] duration The duration of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_duration(media_info_h media, int duration);
+
+/**
+* @internal
+* @brief Sets the width of media info handle.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] media The media info handle
+* @param[in] width The width of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_width(media_info_h media, int width);
+
+/**
+* @internal
+* @brief Sets the height of media info handle.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] media The media info handle
+* @param[in] height The height of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_height(media_info_h media, int height);
+
+/**
+* @internal
+* @brief Sets the storage type of media info handle.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] media The media info handle
+* @param[in] storage_type The storage type of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_storage_type(media_info_h media, media_content_storage_e storage_type);
+
+/**
+* @internal
+* @brief Sets the storage type of media info handle.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] media The media info handle
+* @param[in] storage_id The storage id of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_storage_id(media_info_h media, const char *storage_id);
+
+/**
+ * @brief Gets the storage scan status of media storage.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param[in]  storage The media storage handle
+ * @param[out] scan_status  The storage type of the media storage
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_storage_get_scan_status(const char *storage_uuid, media_storage_scan_status_e *scan_status);
+
+/**
+ * @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 @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @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
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @see media_content_db_update_cb()
+ * @see media_content_unset_db_updated_cb_v2()
+ */
+int media_content_set_db_updated_cb_v2(media_content_noti_h *noti_handle, media_content_db_update_cb callback, void *user_data);
+
+
+/**
+ * @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 @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @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_v2()
+ *
+ * @see media_content_set_db_updated_cb_v2()
+ */
+int media_content_unset_db_updated_cb_v2(media_content_noti_h noti_handle);
+
+typedef enum {
+       MEDIA_CONTENT_SCAN_PARTIAL_COMPLETE             = 2,
+       MEDIA_CONTENT_SCAN_COMPLETE                     = 3,
+       MEDIA_CONTENT_EXTRACT_COMPLETE          = 4,
+} media_content_complete_phase_e;
+
+typedef void (*media_scan_completed_cb_v2)(media_content_error_e error, media_content_complete_phase_e complete_phase, void * user_data);
+
+typedef struct _media_content_scan_cb_data_v2 {
+       media_scan_completed_cb_v2 callback;
+       void *user_data;
+} media_content_scan_cb_data_v2;
+
+int media_content_scan_folder_v2(const char *path, bool is_recursive, media_scan_completed_cb_v2 callback, void *user_data);
+
+#ifdef _USE_SENIOR_MODE
+int media_info_insert_to_db_with_contact_data(const char *path, const char* contact, const char* app_data, media_info_h *info);
+int media_info_delete_contact_from_db(const char* contact, const char* storage_id);
+int media_info_get_media_info_by_path_from_db(const char* path, media_info_h* media);
+int media_info_delete_item(const char *media_id);
+int media_info_get_contact(media_info_h media, char **contact);
+int media_info_get_app_data(media_info_h media, char **app_data);
+int media_info_set_contact(media_info_h media, const char *contact);
+int media_info_set_app_data(media_info_h media, const char *app_data);
+#endif
+
+#define PVR_DURATION                           "PVR_DURATION"
+#define PVR_TIME_ZONE                          "PVR_TIME_ZONE"
+#define PVR_PTC                                                "PVR_PTC"
+#define PVR_MAJOR                                      "PVR_MAJOR"
+#define PVR_MINOR                                      "PVR_MINOR"
+#define PVR_CHANNEL_TYPE                       "PVR_CHANNEL_TYPE"
+#define PVR_CHANNEL_NAME                       "PVR_CHANNEL_NAME"
+#define PVR_CHANNEL_NUM                                "PVR_CHANNEL_NUM"
+#define PVR_PROGRAM_TITLE                      "PVR_PROGRAM_TITLE"
+#define PVR_PROGRAM_NUM                        "PVR_PROGRAM_NUM"
+#define PVR_PROGRAM_CRID                       "PVR_PROGRAM_CRID"
+#define PVR_GUIDANCE                           "PVR_GUIDANCE"
+#define PVR_SYNOPSIS                           "PVR_SYNOPSIS"
+#define PVR_GENRE                                      "PVR_GENRE"
+#define PVR_LANGUAGE                           "PVR_LANGUAGE"
+#define PVR_EMBARGO_TIME                       "PVR_EMBARGO_TIME"
+#define PVR_EXPIRY_TIME                                "PVR_EXPIRY_TIME"
+#define PVR_START_TIME                         "PVR_START_TIME"
+#define PVR_PROGRAM_START_TIME "PVR_PROGRAM_START_TIME"
+#define PVR_PROGRAM_END_TIME           "PVR_PROGRAM_END_TIME"
+#define PVR_PROGRAM_DATE                       "PVR_PROGRAM_DATE"
+#define PVR_PARENTAL_RATING            "PVR_PARENTAL_RATING"
+#define PVR_TIMER_RECORD                       "PVR_TIMER_RECORD"
+#define PVR_SERIES_RECORD                      "PVR_SERIES_RECORD"
+#define PVR_HD                                         "PVR_HD"
+#define PVR_SUBTITLE                           "PVR_SUBTITLE"
+#define PVR_TTX                                                "PVR_TTX"
+#define PVR_AD                                         "PVR_AD"
+#define PVR_HARDOF_HEARINGRADIO        "PVR_HARDOF_HEARINGRADIO"
+#define PVR_DATA_SERVICE                       "PVR_DATA_SERVICE"
+#define PVR_CONTENT_LOCK                       "PVR_CONTENT_LOCK"
+#define PVR_CONTENT_WATCH              "PVR_CONTENT_WATCH"
+#define PVR_CONTENT_HAS_AUDIO_ONLY     "PVR_CONTENT_HAS_AUDIO_ONLY"
+#define PVR_CONTENT_IS_LOCAL_RECORD    "PVR_CONTENT_IS_LOCAL_RECORD"
+#define PVR_CONTENT_RESOLUTION         "PVR_CONTENT_RESOLUTION"
+#define PVR_CONTENT_ASPECTRATIO                "PVR_CONTENT_ASPECTRATIO"
+#define PVR_MODIFIED_MONTH             "PVR_MODIFIED_MONTH"
+#define PVR_MODIFIED_DATE              "PVR_MODIFIED_DATE"
+#define PVR_SPORTS_TYPE                        "PVR_SPORTS_TYPE"
+#define PVR_GUIDANCE_LENGTH            "PVR_GUIDANCE_LENGTH"
+#define PVR_TVMODE                                     "PVR_TVMODE"
+#define PVR_PLAY_COUNT                         "PVR_PLAY_COUNT"
+#define PVR_PRIVATE_DATA                       "PVR_PRIVATE_DATA"
+#define UHD_CONTENT_TITLE              "UHD_CONTENT_TITLE"
+#define UHD_RELEASE_DATE               "UHD_RELEASE_DATE"
+#define UHD_SUB_TYPE                   "UHD_SUB_TYPE"
+#define UHD_FILE_NAME                  "UHD_FILE_NAME"
+#define UHD_FOLDER_ID                  "UHD_FOLDER_ID"
+#define UHD_PLAYED_COUNT               "UHD_PLAYED_COUNT"
+
+typedef void *media_pvr_h;
+typedef void *media_uhd_h;
+typedef bool (*media_pvr_cb)(media_pvr_h pvr, void *user_data);
+typedef bool (*media_uhd_cb)(media_uhd_h uhd, void *user_data);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /*__TIZEN_MEDIA_CONTENT_INTERNAL_H__*/
diff --git a/include_product/media_content_type.h b/include_product/media_content_type.h
new file mode 100755 (executable)
index 0000000..dbcf05d
--- /dev/null
@@ -0,0 +1,1397 @@
+/*
+* 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_TYPE_H__
+#define __TIZEN_MEDIA_CONTENT_TYPE_H__
+
+#include <time.h>
+#include <tizen.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#ifndef DEPRECATED_API
+#define DEPRECATED_API __attribute__ ((deprecated))
+#endif
+
+#if 0
+#ifndef _USE_SENIOR_MODE
+#define _USE_SENIOR_MODE
+#endif
+#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
+ * @{
+ */
+
+/**
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ * @brief Enumeration for the media file format.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum {
+       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_PVR                  = 5,            /**<The type of PVR */
+       MEDIA_CONTENT_TYPE_UHD                  = 6,            /**<The type of UHD */
+       MEDIA_CONTENT_TYPE_SCSA                 = 7,            /**<The type of SCSA */
+} media_content_type_e;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_CONTENT_MODULE
+ * @brief Enumeration for the storage type.
+ * @details This information is used to establish where the folder is.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum {
+       MEDIA_CONTENT_STORAGE_INTERNAL  = 0,    /**< The device's internal storage */
+       MEDIA_CONTENT_STORAGE_EXTERNAL  = 1,    /**< The device's external storage like sd card*/
+       MEDIA_CONTENT_STORAGE_EXTERNAL_USB = 2, /**< The external USB storage (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
+       MEDIA_CONTENT_STORAGE_CLOUD     = 100,  /**< The Cloud storage (Since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif) */
+} media_content_storage_e;
+
+/**
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ * @brief Enumeration for media content DB update items.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum {
+       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 Enumeration for media content DB update types.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+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_db_update_type_e;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ * @brief Enumeration for orientation types.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+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_e;
+
+/**
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ * @brief Enumeration for ordering.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum {
+       MEDIA_CONTENT_ORDER_ASC   = 0,      /**< Ascending order*/
+       MEDIA_CONTENT_ORDER_DESC  = 1,      /**< Descending order*/
+       MEDIA_CONTENT_ORDER_OTHER = 2,          /** order by order key**/
+} media_content_order_e;
+
+/**
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ * @brief Enumeration for collations.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+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_collation_e;
+
+#define MEDIA_CONTENT_ERROR_CLASS                              TIZEN_ERROR_MEDIA_CONTENT
+
+/**
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ * @brief Enumeration for a media content error.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+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_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_NOT_SUPPORTED           = TIZEN_ERROR_NOT_SUPPORTED,           /**< Not supported */
+} media_content_error_e;
+
+/**
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ * @brief Enumeration for a media group.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef enum {
+       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_MODIFIED_MONTH,              /**< Media group ID for the modified time*/
+       MEDIA_CONTENT_GROUP_MODIFIED_DATE,               /**< Media group ID for the modified date*/
+#ifdef _USE_SENIOR_MODE
+       MEDIA_CONTENT_GROUP_CONTACT,
+#endif
+       MEDIA_CONTENT_GROUP_ALBUM,
+       MEDIA_CONTENT_GROUP_MAX,                /**< Invalid media group ID*/
+       MEDIA_PVR_GROUP_DURATION,
+       MEDIA_PVR_GROUP_TIME_ZONE,
+       MEDIA_PVR_GROUP_PTC,
+       MEDIA_PVR_GROUP_MAJOR,
+       MEDIA_PVR_GROUP_MINOR,
+       MEDIA_PVR_GROUP_CHANNEL_TYPE,
+       MEDIA_PVR_GROUP_CHANNEL_NAME,
+       MEDIA_PVR_GROUP_CHANNEL_NUM,
+       MEDIA_PVR_GROUP_PROGRAM_TITLE,
+       MEDIA_PVR_GROUP_PROGRAM_NUM,
+       MEDIA_PVR_GROUP_PROGRAM_CRID,
+       MEDIA_PVR_GROUP_GUIDANCE,
+       MEDIA_PVR_GROUP_SYNOPSIS,
+       MEDIA_PVR_GROUP_GENRE,
+       MEDIA_PVR_GROUP_LANGUAGE,
+       MEDIA_PVR_GROUP_EMBARGO_TIME,
+       MEDIA_PVR_GROUP_EXPIRY_TIME,
+       MEDIA_PVR_GROUP_START_TIME,
+       MEDIA_PVR_GROUP_PROGRAM_START_TIME,
+       MEDIA_PVR_GROUP_PROGRAM_END_TIME,
+       MEDIA_PVR_GROUP_PROGRAM_DATE,
+       MEDIA_PVR_GROUP_PARENTAL_RATING,
+       MEDIA_PVR_GROUP_TIMER_RECORD,
+       MEDIA_PVR_GROUP_SERIES_RECORD,
+       MEDIA_PVR_GROUP_HD,
+       MEDIA_PVR_GROUP_SUBTITLE,
+       MEDIA_PVR_GROUP_TTX,
+       MEDIA_PVR_GROUP_AD,
+       MEDIA_PVR_GROUP_HARDOF_HEARINGRADIO,
+       MEDIA_PVR_GROUP_DATA_SERVICE,
+       MEDIA_PVR_GROUP_CONTENT_LOCK,
+       MEDIA_PVR_GROUP_CONTENT_WATCH,
+       MEDIA_PVR_GROUP_HAS_AUDIO_ONLY,
+       MEDIA_PVR_GROUP_IS_LOCAL_RECORDED,
+       MEDIA_PVR_GROUP_RESOLUTION,
+       MEDIA_PVR_GROUP_ASPECTRATIO,
+       MEDIA_PVR_GROUP_MODIFIED_MONTH,
+       MEDIA_PVR_GROUP_MODIFIED_DATE,
+       MEDIA_PVR_GROUP_SPORTS_TYPE,
+       MEDIA_PVR_GROUP_GUIDANCE_LENGTH,
+       MEDIA_PVR_GROUP_TVMODE,
+       MEDIA_PVR_GROUP_PLAY_COUNT,
+       MEDIA_PVR_GROUP_PRIVATE_DATA,
+       MEDIA_PVR_GROUP_MAX,
+       MEDIA_UHD_GROUP_CONTENT_TITLE,
+       MEDIA_UHD_GROUP_RELEASE_DATE,
+       MEDIA_UHD_GROUP_SUB_TYPE,
+       MEDIA_UHD_GROUP_FILE_NAME,
+       MEDIA_UHD_GROUP_PLAYED_COUNT,
+       MEDIA_UHD_GROUP_MAX,
+       MEDIA_GROUP_MAX,
+} media_group_e;
+
+/**
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ * @brief Enumeration for a media storage scan status.
+ * @since_tizen 2.3
+ */
+typedef enum {
+       MEDIA_STORAGE_SCAN_NONE = 0,                            /**< Media Scanner not detect storage yet*/
+       MEDIA_STORAGE_SCAN_PREPARE,                             /**< Media Scanner detect storage but not scanning yet*/
+       MEDIA_STORAGE_SCAN_PROCESSING,                  /**< Media Scanner Start Scanning storage*/
+       MEDIA_STORAGE_SCAN_STOP,                                        /**< Media Scanner Stop Scanning storage. Not scanning items can be exist*/
+       MEDIA_STORAGE_SCAN_DONE,                                        /**< Scanning Done but need to extract metadata*/
+       MEDIA_STORAGE_SCAN_META_PROCESSING,             /**< Scanning Done and start to extract metadata*/
+       MEDIA_STORAGE_SCAN_META_STOP,                   /**< Stop extract metadata*/
+       MEDIA_STORAGE_SCAN_COMPLETE,                    /**< Complete scanning*/
+       MEDIA_STORAGE_SCAN_MAX,                                 /**< Invalid status*/
+} media_storage_scan_status_e;
+
+typedef enum {
+       MEDIA_DIR_SCAN_NONE                             = 0,            /**< Media Scanner not detect storage yet*/
+       MEDIA_DIR_SCAN_PREPARE                  = 1,            /**< Media Scanner detect storage but not scanning yet*/
+       MEDIA_DIR_SCAN_PROCESSING               = 2,            /**< Media Scanner Start Scanning storage*/
+       MEDIA_DIR_SCAN_STOP                             = 3,            /**< Stop scanning storage*/
+       MEDIA_DIR_SCAN_DONE                             = 4,            /**< Scanning Done but need to extract metadata*/
+       MEDIA_DIR_SCAN_META_PROCESSING  = 5,            /**< Scanning Done and start to extract metadata*/
+       MEDIA_DIR_SCAN_META_STOP                = 6,            /**< Stop extract metadata*/
+       MEDIA_DIR_SCAN_COMPLETE         = 7,            /**< Complete scanning*/
+} media_folder_scan_status_e;
+
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ * @brief The structure type for the Media info handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct media_info_s *media_info_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_FOLDER_MODULE
+ * @brief The structure type for the Media folder handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct media_folder_s *media_folder_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
+ * @brief The structure type for the Media playlist handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct media_playlist_s *media_playlist_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_TAG_MODULE
+ * @brief The structure type for the Media tag handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct media_tag_s *media_tag_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_BOOKMARK_MODULE
+ * @brief The structure type for the Media bookmark handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct media_bookmark_s *media_bookmark_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_ALBUM_MODULE
+ * @brief The structure type for the Media album handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct media_album_s *media_album_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_IMAGE_MODULE
+ * @brief The structure type for the Image metadata handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct image_meta_s *image_meta_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_VIDEO_META_MODULE
+ * @brief The structure type for the Video metadata handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct video_meta_s *video_meta_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_AUDIO_META_MODULE
+ * @brief The structure type for the Audio metadata handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct audio_meta_s *audio_meta_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_FILTER_MODULE
+ * @brief The structure type for the Media filter handle.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+typedef struct filter_s *filter_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_STORAGE_MODULE
+ * @brief The structure type for the Media storage handle.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ */
+typedef void *media_storage_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_FACE_MODULE
+ * @brief The structure type for the Media face handle.
+ * @since_tizen 3.0
+ */
+typedef void *media_face_h;
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_CONTENT_MODULE
+ * @brief The structure type for the Media content noti handle.
+ * @since_tizen 3.0
+ */
+typedef void *media_content_noti_h;
+
+/**
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ * @brief Called when the media scanning is finished.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] error     The error code
+ * @param[in] user_data The user data passed from the foreach function
+ *
+ * @pre media_content_scan().
+ *
+ * @see media_content_scan()
+ *
+ */
+typedef void (*media_scan_completed_cb)(media_content_error_e error, void * user_data);
+
+/**
+ * @ingroup CAPI_MEDIA_CONTENT_MODULE
+ * @brief Called when the notification of the media DB change is subscribed.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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);
+
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ * @brief Called for every available media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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.
+ *
+ * @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
+ *
+ * @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.
+ *
+ * @see media_info_clone()
+ * @see media_album_foreach_media_from_db()
+ * @see media_playlist_foreach_media_from_db()
+ * @see media_tag_foreach_media_from_db()
+ * @see media_info_foreach_media_from_db()
+ * @see media_folder_foreach_media_from_db()
+ */
+typedef bool (*media_info_cb)(media_info_h media, void *user_data);
+
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ * @brief Called when media items are inserted completely.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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()
+ */
+typedef void (*media_insert_completed_cb)(media_content_error_e error, void * user_data);
+
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ * @brief Called when the burst shot is inserted completely.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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()
+ *
+ */
+typedef void (*media_insert_burst_shot_completed_cb)(media_content_error_e error, void * user_data);
+
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_INFO_MODULE
+ * @brief Called when creating a thumbnail image.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @details This callback is called for completion of generating the thumbnail image.
+ *
+ * @param[in] error     The error code
+ * @param[in] path      The path of the thumbnail which is generated
+ * @param[in] user_data The user data passed from the foreach function
+ *
+ * @pre media_info_create_thumbnail()
+ *
+ * @see media_info_create_thumbnail()
+ */
+typedef void (*media_thumbnail_completed_cb)(media_content_error_e error, const char *path, void *user_data);
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
+ * @brief Called when face detection on the image is completed.
+ *
+ * @details The following error codes can be delivered. \n
+ *         #MEDIA_CONTENT_ERROR_NONE, \n
+ *         #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, \n
+ *         #MEDIA_CONTENT_ERROR_INVALID_OPERATION, \n
+ *         #MEDIA_CONTENT_ERROR_DB_FAILED, \n
+ *         #MEDIA_CONTENT_ERROR_DB_BUSY, \n
+ *         #MEDIA_CONTENT_ERROR_UNSUPPORTED_CONTENT
+ *
+ * @since_tizen 3.0
+ *
+ * @remarks The callback is called in a separate thread(not in the main loop).
+ *
+ * @param[in] error     The error code
+ * @param[in] face_count      The number of all detected faces
+ * @param[in] user_data The user data passed from the foreach function
+ *
+ * @pre media_info_start_face_detection()
+ *
+ * @see media_info_start_face_detection()
+ */
+typedef void (*media_face_detection_completed_cb)(media_content_error_e error, const int face_count, void *user_data);
+
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_FOLDER_MODULE
+ * @brief Called for every available media folder.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @details Iterates over a list of folders.
+ *
+ * @remarks To use the @a folder outside this function, copy the handle with the media_folder_clone() function.
+ *
+ * @param[in] folder    The handle to the media folder
+ * @param[in] user_data The user data passed from the foreach function
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ *         otherwise @c false to break out of the loop
+ *
+ * @pre media_folder_foreach_folder_from_db() will invoke this function.
+ * @see media_folder_clone()
+ * @see media_folder_foreach_folder_from_db()
+ */
+typedef bool (*media_folder_cb)(media_folder_h folder, void *user_data);
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
+ * @brief Called for every playlist in the obtained list of playlists.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @details Iterates over a playlist list.
+ *
+ * @remarks To use the @a playlist outside this function, copy the handle with the media_playlist_clone() function.
+ *
+ * @param[in] playlist  The handle to the media playlist
+ * @param[in] user_data The user data passed from the foreach function
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ *         otherwise @c false to break out of the loop
+ *
+ * @pre media_playlist_foreach_playlist_from_db() will invoke this function.
+ *
+ * @see media_playlist_clone()
+ * @see media_playlist_foreach_playlist_from_db()
+ */
+typedef bool (*media_playlist_cb)(media_playlist_h playlist, void *user_data);
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
+ * @brief Called for every media info with playlist member ID in the obtained list of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @details Iterates over playlist members.
+ *
+ * @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
+ *
+ * @pre media_playlist_foreach_media_from_db() will invoke this function.
+ *
+ * @see media_info_clone()
+ * @see media_playlist_foreach_media_from_db()
+ */
+typedef bool (*playlist_member_cb)(int playlist_member_id, media_info_h media, void *user_data);
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_TAG_MODULE
+ * @brief Called for every tag in the obtained list of tags.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @details Iterates over a list of tags.
+ *
+ * @remarks To use the @a tag outside this function, copy the handle with the media_tag_clone() function.
+ *
+ * @param[in] tag       The handle to the media tag
+ * @param[in] user_data The user data passed from the foreach function
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ *         otherwise @c false to break out of the loop
+ *
+ * @pre media_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()
+ */
+typedef bool (*media_tag_cb)(media_tag_h tag, void *user_data);
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_BOOKMARK_MODULE
+ * @brief Called for every bookmark in the obtained list of bookmarks.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @details Iterates over a bookmark list.
+ *
+ * @remarks To use the @a bookmark outside this function, copy the handle with the media_bookmark_clone() function.
+ *
+ * @param[in] bookmark  The handle to the video bookmark
+ * @param[in] user_data The user data passed from the foreach function
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ *         otherwise @c false to break out of the loop
+ *
+ * @pre media_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 Called for every album in the obtained list of groups.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @details Iterates over an album list.
+ *
+ * @remarks To use the @a album outside this function, copy the handle with the media_album_clone() function.
+ *
+ * @param[in] album     The handle to the media album
+ * @param[in] user_data The user data passed from the foreach function
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ *         otherwise @c false to break out of the loop
+ *
+ * @pre media_album_foreach_album_from_db() will invoke this function.
+ *
+ * @see media_album_clone()
+ * @see media_album_foreach_album_from_db()
+ */
+typedef bool (*media_album_cb)(media_album_h album, void *user_data);
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_GROUP_MODULE
+ * @brief Called for every group in the obtained list of groups.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @details Iterates over a media group list.
+ *
+ * @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
+ *
+ * @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);
+
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_GROUP_MODULE
+ * @brief Iterates over media group list
+ *
+ * @details This callback is called for every group in obtained list of groups
+.\n
+ *
+ * @remarks You should not free group_name returned by this function.
+ *
+ * @param[in] group_name The name of media group
+ * @param[in] count Media count 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_and_count_from_db() will invoke this function.
+ * @see media_group_foreach_group_and_count_from_db()
+ */
+typedef bool (*media_group_and_count_cb)(const char *group_name, int count, void *user_data);
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_STORAGE_MODULE
+ * @brief Called for every storage in the obtained list of storages.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @details Iterates over a media storage list.
+ *
+ * @remarks You should not destroy @a storage returned by this function.
+ *
+ * @param[in] storage     The handle of the media storage
+ * @param[in] user_data  The user data passed from the foreach function
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ *         otherwise @c false to break out of the loop
+ *
+ * @pre media_storage_foreach_storage_from_db() will invoke this function.
+ *
+ * @see media_storage_foreach_storage_from_db()
+ */
+typedef bool (*media_storage_cb)(media_storage_h storage, void *user_data);
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_FACE_MODULE
+ * @brief Called for every face in the obtained list of face.
+ * @since_tizen 3.0
+ *
+ * @details Iterates over a media face list.
+ *
+ * @remarks You should not destroy @a face returned by this function.
+ *
+ * @param[in] face     The handle of the media face
+ * @param[in] user_data  The user data passed from the foreach function
+ *
+ * @return @c true to continue with the next iteration of the loop,
+ *         otherwise @c false to break out of the loop
+ *
+ * @pre media_info_foreach_face_from_db() will invoke this function.
+ *
+ * @see media_info_foreach_face_from_db()
+ */
+typedef bool (*media_face_cb)(media_face_h face, void *user_data);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_FILTER_MODULE
+ * @{
+ */
+
+ /**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_ID "MEDIA_ID" /**< Media ID */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_PATH "MEDIA_PATH"  /**< Media full path */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_DISPLAY_NAME "MEDIA_DISPLAY_NAME"  /**< Media base name */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_TYPE "MEDIA_TYPE"  /**< Media type: 0-image, 1-video, 2-sound, 3-music, 4-other*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_MIME_TYPE "MEDIA_MIME_TYPE"  /**< Media MIME type */
+
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_SIZE "MEDIA_SIZE"  /**< Media MIME size */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_ADDED_TIME "MEDIA_ADDED_TIME"  /**< Media added time */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_MODIFIED_TIME "MEDIA_MODIFIED_TIME"  /**< Media modified time */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_TIMELINE "MEDIA_TIMELINE"  /**< Media modified time */
+
+#define MEDIA_FOLDER_ID "MEDIA_FOLDER_ID" /**< Media folder ID */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_THUMBNAIL_PATH "MEDIA_THUMBNAIL_PATH"  /**< Media thumbnail path */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_TITLE "MEDIA_TITLE"  /**< Media title get from tag or file name */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_ALBUM "MEDIA_ALBUM"  /**< Media album name*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_ARTIST "MEDIA_ARTIST"  /**< Media artist*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_ALBUM_ARTIST "MEDIA_ALBUM_ARTIST"  /**< Media album_artist*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_GENRE "MEDIA_GENRE"  /**< Media genre*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_COMPOSER "MEDIA_COMPOSER"  /**< Media composer*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_YEAR "MEDIA_YEAR"  /**< Media year*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_RECORDED_DATE "MEDIA_RECORDED_DATE"  /**< Media recorded date*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_COPYRIGHT "MEDIA_COPYRIGHT"  /**< Media copyright*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_TRACK_NUM "MEDIA_TRACK_NUM"  /**< Media track number*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_DESCRIPTION "MEDIA_DESCRIPTION"  /**< Media description*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_BITRATE "MEDIA_BITRATE"  /**< Media bitrate*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_BITPERSAMPLE "MEDIA_BITPERSAMPLE"  /**< Media bit per sample*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_SAMPLERATE "MEDIA_SAMPLERATE"  /**< Media sample rate*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_CHANNEL "MEDIA_CHANNEL"  /**< Media channel*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_DURATION "MEDIA_DURATION"  /**< Media duration */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_LONGITUDE "MEDIA_LONGITUDE"  /**< Media longitude */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_LATITUDE "MEDIA_LATITUDE"  /**< Media latitude */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_ALTITUDE "MEDIA_ALTITUDE"  /**< Media altitude */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_WIDTH "MEDIA_WIDTH"  /**< Media width*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_HEIGHT "MEDIA_HEIGHT"  /**< Media height*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_DATETAKEN "MEDIA_DATETAKEN"  /**< Media datetaken*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_ORIENTATION "MEDIA_ORIENTATION"  /**< Media orientation*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_BURST_ID "BURST_ID"  /**< Media burst ID*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_PLAYED_COUNT "MEDIA_PLAYED_COUNT"  /**< Media playedcount*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_LAST_PLAYED_TIME "MEDIA_LAST_PLAYED_TIME"  /**< Media last played time*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_LAST_PLAYED_POSITION "MEDIA_LAST_PLAYED_POSITION"  /**< Media last played position of file*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_RATING "MEDIA_RATING"  /**< Media rating*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_FAVOURITE "MEDIA_FAVOURITE"  /**< 0-not favourite, 1-favourite*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_AUTHOR "MEDIA_AUTHOR"  /**< Media authore*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_PROVIDER "MEDIA_PROVIDER"  /**< Media provider*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_CONTENT_NAME "MEDIA_CONTENT_NAME"  /**< Media content name*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_CATEGORY "MEDIA_CATEGORY"  /**< Media category*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_LOCATION_TAG "MEDIA_LOCATION_TAG"  /**< Media location tag*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_AGE_RATING "MEDIA_AGE_RATING"  /**< Media age rating*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_KEYWORD "MEDIA_KEYWORD"  /**< Media keyword*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_WEATHER "MEDIA_WEATHER"  /**< Media weather*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_IS_DRM "MEDIA_IS_DRM"  /**< Is DRM. 0-not drm, 1-drm*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_STORAGE_TYPE "MEDIA_STORAGE_TYPE"  /**< Media storage. 0-internal storage, 1-external storage*/
+
+#define MEDIA_MODIFIED_MONTH "MEDIA_MODIFIED_MONTH"            /**< media modified month */
+#define MEDIA_MODIFIED_DATE "MEDIA_MODIFIED_DATE"              /**< media modified date */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ */
+#define MEDIA_EXPOSURE_TIME "MEDIA_EXPOSURE_TIME"      /**< media exposure_time*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ */
+#define MEDIA_FNUMBER "MEDIA_FNUMBER"  /**< media fnumber*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ */
+#define MEDIA_ISO "MEDIA_ISO"  /**< media iso*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ */
+#define MEDIA_MODEL "MEDIA_MODEL"      /**< media model*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_FILE_NAME_PINYIN "MEDIA_FILE_NAME_PINYIN"  /**< Media file name pinyin */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_TITLE_PINYIN "MEDIA_TITLE_PINYIN"  /**< Media title pinyin */
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_ALBUM_PINYIN "MEDIA_ALBUM_PINYIN"  /**< Media album pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_ARTIST_PINYIN "MEDIA_ARTIST_PINYIN"  /**< Media artist pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_ALBUM_ARTIST_PINYIN "MEDIA_ALBUM_ARTIST_PINYIN"  /**< Media album_artist pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_GENRE_PINYIN "MEDIA_GENRE_PINYIN"  /**< Media genre pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_COMPOSER_PINYIN "MEDIA_COMPOSER_PINYIN"  /**< Media composer pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_COPYRIGHT_PINYIN "MEDIA_COPYRIGHT_PINYIN"  /**< Media copyright pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_DESCRIPTION_PINYIN "MEDIA_DESCRIPTION_PINYIN"  /**< Media description pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_AUTHOR_PINYIN "MEDIA_AUTHOR_PINYIN"  /**< Media authore pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_PROVIDER_PINYIN "MEDIA_PROVIDER_PINYIN"  /**< Media provider pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_CONTENT_NAME_PINYIN "MEDIA_CONTENT_NAME_PINYIN"  /**< Media content name pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_CATEGORY_PINYIN "MEDIA_CATEGORY_PINYIN"  /**< Media category pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_LOCATION_TAG_PINYIN "MEDIA_LOCATION_TAG_PINYIN"  /**< Media location tag pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_AGE_RATING_PINYIN "MEDIA_AGE_RATING_PINYIN"  /**< Media age rating pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ */
+#define MEDIA_KEYWORD_PINYIN "MEDIA_KEYWORD_PINYIN"  /**< Media keyword pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of media filter and order keyword.
+ * @since_tizen 3.0
+ *
+ */
+#define MEDIA_360 "MEDIA_360"
+
+#ifdef _USE_SENIOR_MODE
+#define MEDIA_CONTACT  "MEDIA_CONTACT"
+#define MEDIA_APP_DATA "MEDIA_APP_DATA"
+#endif
+
+/**
+ * @}
+ */
+
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_FOLDER_MODULE
+ * @{
+ */
+
+ /**
+ * @brief You can use above define to set the condition of folder filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+#define FOLDER_ID "FOLDER_ID"  /**< Folder ID */
+
+/**
+* @brief You can use above define to set the condition of folder filter and order keyword.
+* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+*/
+#define FOLDER_PATH "FOLDER_PATH"  /**< Folder full path */
+
+/**
+* @brief You can use above define to set the condition of folder filter and order keyword.
+* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+*/
+#define FOLDER_NAME "FOLDER_NAME"  /**< Folder base name */
+
+/**
+* @brief You can use above define to set the condition of folder filter and order keyword.
+* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+*/
+#define FOLDER_MODIFIED_TIME "FOLDER_MODIFIED_TIME"  /**< Folder modified time */
+
+/**
+* @brief You can use above define to set the condition of folder filter and order keyword.
+* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+*/
+#define FOLDER_STORAGE_TYPE "FOLDER_STORAGE_TYPE"  /**< Folder storage. 0-internal storage, 1-external storage*/
+
+/**
+* @brief You can use above define to set the condition of folder filter and order keyword.
+* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+*/
+#define FOLDER_NAME_PINYIN "FOLDER_NAME_PINYIN"  /**< Folder base name pinyin*/
+
+/**
+ * @brief You can use above define to set the condition of folder filter and order keyword.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ */
+#define FOLDER_ORDER "FOLDER_ORDER"  /**< Folder order info */
+
+/**
+ * @brief You can use above define to set the condition of folder filter and order keyword.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ */
+#define FOLDER_PARENT_FOLDER_ID "FOLDER_PARENT_FOLDER_ID"      /**< parent folder id */
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
+ * @{
+ * @brief You can use above define to set the condition of playlist filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+#define PLAYLIST_NAME "PLAYLIST_NAME"  /**< Playlist name */
+
+/**
+ * @brief You can use above define to set the condition of playlist filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+#define PLAYLIST_MEMBER_ORDER "PLAYLIST_MEMBER_ORDER"  /**< Playlist name */
+
+/**
+ * @brief You can use above define to set the condition of playlist filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+#define PLAYLIST_MEDIA_COUNT "PLAYLIST_MEDIA_COUNT"  /**< Media count in playlist view */
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_TAG_MODULE
+ * @{
+ * @brief You can use above define to set the condition of tag filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+#define TAG_NAME "TAG_NAME"  /**< Tag name */
+
+/**
+ * @brief You can use above define to set the condition of tag filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+#define TAG_MEDIA_COUNT "TAG_MEDIA_COUNT"  /**< Media count in tag view */
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_BOOKMARK_MODULE
+ * @{
+ * @brief You can use above define to set the condition of bookmark filter and order keyword.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ */
+#define BOOKMARK_MARKED_TIME "BOOKMARK_MARKED_TIME"  /**< Bookmark marked time */
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_STORAGE_MODULE
+ * @{
+ * @brief You can use above define to set the condition of storage filter and order keyword.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ */
+#define MEDIA_STORAGE_ID                                       "STORAGE_ID"  /**< Storage ID */
+
+/**
+ * @brief You can use above define to set the condition of storage filter and order keyword.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ */
+#define MEDIA_STORAGE_PATH                             "STORAGE_PATH"  /**< Storage path */
+
+/**
+ * @brief You can use above define to set the condition of face filter and order keyword.
+ * @since_tizen 3.0
+ */
+#define MEDIA_FACE_TAG                                         "MEDIA_FACE_TAG"        /**< face tag */
+
+/**
+ * @}
+ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /*__TIZEN_MEDIA_CONTENT_TYPE_H__*/
diff --git a/include_product/media_face.h b/include_product/media_face.h
new file mode 100755 (executable)
index 0000000..5effa89
--- /dev/null
@@ -0,0 +1,324 @@
+/*
+* Copyright (c) 2014 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_IMAGE_FACE_H__
+#define __TIZEN_MEDIA_IMAGE_FACE_H__
+
+#include <media_content_type.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file media_face.h
+ * @brief This file contains the media face API and related to all operations with the face information of the image in Media DB. \n
+ *             Functions include cloning and destroying the face handler, getting face information such as face id, face coordinates in file, \n
+ *             face tag. Face information will be managed by DB. To insert face information, you should use media_face_insert_to_db() \n
+ *             or media_info_start_face_detection() API. And you can insert,update,delete face information manually.
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_FACE_MODULE
+ * @{
+ */
+
+/**
+ * @brief Clones the face handle.
+ * @details This function copies the face handle from a source to
+ * destination. There is no media_face_create() function. The media_face_h is created internally and available through
+ * media face foreach function such as media_face_foreach_face_from_db(). To use this handle outside of these foreach functions,
+ * use this function.
+ *
+ * @since_tizen 3.0
+ * @remark The destination handle must be released with media_event_destroy() by you.
+ *
+ * @param [in] src The source face handle
+ * @param [out] dst A destination face 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
+ *
+ * @see media_face_destroy()
+ * @see media_face_foreach_face_from_db()
+ */
+int media_face_clone(media_face_h *dst, media_face_h src);
+
+/**
+ * @brief Destroys the face handle.
+ * @details Function frees all resources related to face handle. This
+ * handle no longer can be used to perform any operation. New handle has to
+ * be created before next usage.
+ *
+ * @since_tizen 3.0
+ *
+ * @param [in] face The face handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see media_face_clone()
+ *
+ * @pre Get copy of face handle by calling media_face_clone() or Get face handle by calling media_info_foreach_face_from_db()
+ *
+ */
+int media_face_destroy(media_face_h face);
+
+/**
+ * @brief Gets the face id from the face handle.
+ *
+ * @since_tizen 3.0
+ *
+ * @remarks You must release @a face_id using free().
+ *
+ * @param [in] face The face handle
+ * @param [out] face_id The uuid of the face handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_face_get_face_id(media_face_h face, char **face_id);
+
+/**
+ * @brief Gets the media uuid from the face handle.
+ *
+ * @since_tizen 3.0
+ *
+ * @remarks You must release @a media_id using free().
+ *
+ * @param [in] face The face handle
+ * @param [out] media_id The media uuid of the face handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_face_get_media_id(media_face_h face, char **media_id);
+
+ /**
+ * @brief Gets the face's rectangle from the face handle.
+ * @details This API can get the face's rectangle information. returned rectangle information includes the orientation value.
+ *
+ * @since_tizen 3.0
+ *
+ * @param [in] face The face handle
+ * @param [out] rect_x The x position of face of the face handle
+ * @param [out] rect_y The y position of face of the face handle
+ * @param [out] rect_w The width of face of the face handle
+ * @param [out] rect_h The height of face of the face handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_face_get_face_rect(media_face_h face, unsigned int *rect_x, unsigned int *rect_y, unsigned int *rect_w, unsigned int *rect_h);
+
+/**
+ * @brief Gets the orientation from the face handle.
+ * @details This API can get the orientation value from the original image.
+ *
+ * @since_tizen 3.0
+ *
+ * @param [in] face The face handle
+ * @param [out] orientation The orientation of the face handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_face_get_orientation(media_face_h face, media_content_orientation_e *orientation);
+
+/**
+ * @brief Gets the tag from the face handle.
+ *
+ * @since_tizen 3.0
+ *
+ * @remarks You must release @a tag using free().
+ *
+ * @param [in] face The face handle
+ * @param [out] tag The tag of the face handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_face_get_tag(media_face_h face, char **tag);
+
+/**
+ * @brief Creates the face handle.
+ *
+ * @since_tizen 3.0
+ *
+ * @param [out] face The face handle
+ *
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see media_face_destroy()
+ */
+int media_face_create(const char *media_id, media_face_h *face);
+
+/**
+ * @brief Sets the face rectangle of the face handle
+ *
+ * @since_tizen 3.0
+ *
+ * @param[in] face The face handle
+ * @param[in] rect_x The integer to set as a position x of face rectangle
+ * @param[in] rect_y The integer to set as a position y of face rectangle
+ * @param[in] rect_w The integer to set as a width  of face rectangle
+ * @param[in] rect_h The integer to set as a height of face rectangle
+ *
+ * @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
+ *
+ * @post media_face_insert_to_db()
+ * @post media_face_update_to_db()
+ *
+ */
+int media_face_set_face_rect(media_face_h face, unsigned int rect_x, unsigned int rect_y, unsigned int rect_w, unsigned int rect_h);
+
+/**
+ * @brief Sets the orientation of the face handle
+ * @details This API may set the value of the original image orientation.
+ *
+ * @since_tizen 3.0
+ *
+ * @param[in] face The face handle
+ * @param[in] orientation The integer to set as an orientation
+ *
+ * @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
+ *
+ * @post media_face_insert_to_db()
+ * @post media_face_update_to_db()
+ *
+ */
+int media_face_set_orientation(media_face_h face, media_content_orientation_e orientation);
+
+/**
+ * @brief Sets the tag of the face handle.
+ *
+ * @since_tizen 3.0
+ *
+ * @param [in] face The face handle
+ * @param [in] tag The tag of the face 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
+ *
+ * @post media_face_insert_to_db()
+ * @post media_face_update_to_db()
+ */
+int media_face_set_tag(media_face_h face, const char *tag);
+
+/**
+ * @brief Inserts a new face in the media database.
+ * @since_tizen 3.0
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks The created tag handle must be released using media_tag_destroy().
+ *
+ * @param [in] face The face 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
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @see media_content_connect()
+ * @see media_face_destroy()
+ * @see media_face_set_xxx()
+ */
+int media_face_insert_to_db(media_face_h face);
+
+/**
+ * @brief Updates the face details to the media database.
+ *
+ * @details The function updates the given media face in the media database. The function should be called after any change in face, to be updated to the media
+ * database. For example, after using media_face_set_orientation() for setting the orientation of the face, media_face_update_to_db() function should be called so as to update
+ * the given face attributes in the media database.
+ * @since_tizen 3.0
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] face The face handle to update
+ *
+ * @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()
+ * @see media_face_destroy()
+ * @see media_face_set_xxx()
+ *
+ */
+int media_face_update_to_db(media_face_h face);
+
+/**
+ * @brief Deletes the face with given face uuid from the media database.
+ *
+ * @since_tizen 3.0
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param [in] face_id The id of media face
+ *
+ * @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_face_delete_from_db(const char *face_id);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_IMAGE_FACE_H__ */
diff --git a/include_product/media_filter.h b/include_product/media_filter.h
new file mode 100755 (executable)
index 0000000..d88dcd6
--- /dev/null
@@ -0,0 +1,268 @@
+/*
+* 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_FILTER_H__
+#define __TIZEN_MEDIA_FILTER_H__
+
+#include <media_content_type.h>
+
+
+#ifdef __cplusplus
+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
+ * @{
+ */
+
+/**
+ * @brief Creates a media filter handle.
+ * @details This function creates a media filter handle. The handle can be
+ *          used to get the filtered information based on filter properties i.e. offset, count, condition for searching and order.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] filter The handle to the media filter
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @see media_filter_create()
+ */
+int media_filter_destroy(filter_h filter);
+
+/**
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 Sets the @a condition for the given @a filter.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @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 Sets the media filter content @a order and order keyword i.e. either descending or ascending.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @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 Sets the @a storage id for the given @a filter.
+ * @details You can use this API when you want to search items only in the specific storage
+ *
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param[in] filter       The handle to the media filter
+ * @param[in] storage_id    The storage_id for browsing or searching
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @see media_filter_create()
+ * @see media_filter_destroy()
+ */
+int media_filter_set_storage(filter_h filter, const char *storage_id);
+
+/**
+ * @brief Gets the @a offset and @a count for the given @a filter used to limit the number of items returned.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @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 Gets the @a condition for the given @a filter.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @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 Gets the media filter's content @a order and order keyword i.e. either descending or ascending.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a order_keyword using free().
+ *
+ * @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 @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);
+
+/**
+ * @brief Get the @a storage id for given @a filter.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks You must release @a storage_id using free().
+ *
+ * @param[in] filter The handle to media info filter
+ * @param[out] storage_id The storage_id which is used in filter
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @see media_filter_create()
+ * @see media_filter_destroy()
+ */
+int media_filter_get_storage(filter_h filter, char **storage_id);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_FILTER_H__ */
diff --git a/include_product/media_folder.h b/include_product/media_folder.h
new file mode 100755 (executable)
index 0000000..b9524c6
--- /dev/null
@@ -0,0 +1,476 @@
+/*
+* 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_FOLDER_H__
+#define __TIZEN_MEDIA_FOLDER_H__
+
+
+#include <media_content_type.h>
+
+
+#ifdef __cplusplus
+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
+ * @{
+ */
+
+
+/**
+ * @brief Gets the count of folder for the passed @a filter from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_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 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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 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 @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @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_filter_create()
+ */
+int media_folder_foreach_folder_from_db(filter_h filter, media_folder_cb callback, void *user_data);
+
+/**
+ * @brief Gets the count of media files for the passed @a filter in the given @a folder from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_folder_get_media_count_from_db(const char *folder_id, filter_h filter, int *media_count);
+
+/**
+ * @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 @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_info_cb().
+ *
+ * @see #media_info_cb
+ * @see media_content_connect()
+ * @see media_filter_create()
+ */
+int media_folder_foreach_media_from_db(const char *folder_id, filter_h filter, media_info_cb callback, void *user_data);
+
+#ifdef _USE_SENIOR_MODE
+int media_folder_foreach_media_from_db_by_union_select(const char* folder_id, filter_h filter1, filter_h filter2, media_info_cb callback, void* user_data);
+#endif
+
+/**
+ * @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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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()
+ */
+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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] folder The handle to the media folder
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_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 the media folder ID.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @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_folder_id(media_folder_h folder, char **folder_id);
+
+/**
+ * @brief Gets the parent folder ID.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks You must release @a parent_folder_id using free().
+ *
+ * @param[in]  folder    The handle to the media folder
+ * @param[out] parent_folder_id The ID of the upper media folder
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int media_folder_get_parent_folder_id(media_folder_h folder, char **parent_folder_id);
+
+/**
+ * @brief Gets the absolute path to the media folder.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a path using free().
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ *
+ */
+int media_folder_get_path(media_folder_h folder, char **path);
+
+/**
+ * @brief Gets the media folder name.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a folder_name using free().
+ *
+ * @param[in]  folder      The handle to the media folder
+ * @param[out] folder_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
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  folder The handle to the media folder
+ * @param[out] date   The modified date of the 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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  folder       The handle to the media folder
+ * @param[out] storage_type The storage type of the media folder
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @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 storage id of the folder.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks You must release @a storage_id using free().
+ *
+ * @param[in]  folder      The handle to the media folder
+ * @param[out] storage_id The storage id of the media folder
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int media_folder_get_storage_id(media_folder_h folder, char **storage_id);
+
+/**
+ * @brief Gets the folder viewing order.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param[in] folder The handle to the media folder
+ * @param[out] order   The viewing order of the media folder
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post media_folder_update_to_db()
+ */
+int media_folder_get_order(media_folder_h folder, int *order);
+
+/**
+ * @brief Gets the media folder from the media database.
+ *
+ * @details This function creates a new media folder handle from the media database by the given @a folder_id.
+ *          Media folder will be created, which is filled with folder information.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a folder using media_folder_destroy().
+ *
+ * @param[in]  folder_id The ID of the media folder
+ * @param[out] folder    The media folder handle associated with the folder 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_folder_destroy()
+ *
+ */
+int media_folder_get_folder_from_db(const char *folder_id, media_folder_h *folder);
+
+/**
+ * @brief Sets the folder name.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] folder The handle to the media folder
+ * @param[in] name   The name of the media folder
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @post media_folder_update_to_db()
+ */
+int media_folder_set_name(media_folder_h folder, const char *name);
+
+/**
+ * @brief Sets the folder viewing order.
+ * @details If you set the order value for each folder, you can sort in ascending or descending order as the set order values using the filter. \n
+ *                 Moreover, more detailed settings are possible when used with the filter. \n
+ *
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ * @remarks  If you don't set the order value, the order value will be set default value. Default is 0. \n
+ *                    If you don't use the filter, the set order value does not effect the folder viewing order.
+ *
+ * @param[in] folder The handle to the media folder
+ * @param[in] order   The viewing order of the media folder
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @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_order(media_folder_h folder, int order);
+
+/**
+ * @brief Updates the media folder to the media database.
+ *
+ * @details The function updates the given media folder in the media database. The function should be called after any change in folder attributes, to be updated to the media
+ *          database. For example, after using media_folder_set_name() for setting the name of the folder, the media_folder_update_to_db() function should be called so as to update
+ *          the given folder attributes in the media database.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] folder The handle to the media folder
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ * @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);
+
+int media_folder_get_scan_status(const char *storage_uuid, char* path, media_folder_scan_status_e *scan_status);
+
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_FOLDER_H__ */
diff --git a/include_product/media_group.h b/include_product/media_group.h
new file mode 100755 (executable)
index 0000000..d3718a7
--- /dev/null
@@ -0,0 +1,460 @@
+/*
+* 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_GROUP_H__
+#define __TIZEN_MEDIA_GROUP_H__
+
+
+#include <media_content_type.h>
+
+
+#ifdef __cplusplus
+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
+ * @{
+ */
+
+/**
+ * @brief Gets the number of the album for the passed @a filter from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_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 @c NULL is passed to the filter, no filtering is applied.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_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 the number of media info for the given album present in the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_album_get_media_count_from_db(int album_id, filter_h filter, int *media_count);
+
+/**
+ * @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 @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_info_cb().
+ *
+ * @see #media_info_cb
+ * @see media_content_connect()
+ * @see media_filter_create()
+ */
+int media_album_foreach_media_from_db(int album_id, filter_h filter, media_info_cb callback, void *user_data);
+
+/**
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release the destination handle using media_album_destroy().
+ *
+ * @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_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 the ID of the album.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @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_album_foreach_album_from_db()
+ */
+int media_album_get_album_id(media_album_h album, int *album_id);
+
+/**
+ * @brief Gets the name of the album.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a album_name using free().
+ *
+ * @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 the name of the artist from the given album.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a artist using free().
+ *
+ * @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 the album art path from the album.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a album_art using free().
+ *
+ * @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 @a album_id.
+ *          Media album will be created and will be filled with the album information.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ * @see media_album_destroy()
+ */
+int media_album_get_album_from_db(int album_id, media_album_h *album);
+
+
+/**
+ * @}
+ */
+
+
+/**
+* @addtogroup CAPI_CONTENT_MEDIA_GROUP_MODULE
+* @{
+*/
+
+ /**
+ * @brief Gets the number of the group for the passed @a filter from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_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 and counts 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
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @pre This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_group_cb().
+ * @see #media_group_and_count_cb
+ * @see media_content_connect()
+ * @see media_filter_create()
+ */
+int media_group_foreach_group_and_count_from_db(filter_h filter, media_group_e group, media_group_and_count_cb callback, void *user_data);
+
+ /**
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_group_cb().
+ *
+ * @see #media_group_cb
+ * @see media_content_connect()
+ * @see media_filter_create()
+ */
+int media_group_foreach_group_from_db(filter_h filter, media_group_e group, media_group_cb callback, void *user_data);
+
+ /**
+ * @brief Gets the count of the media info for the given media group present in the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_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 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 @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_info_cb().
+ *
+ * @see media_info_cb()
+ * @see media_content_connect()
+ * @see media_filter_create()
+ */
+int media_group_foreach_media_from_db(const char *group_name, media_group_e group, filter_h filter, media_info_cb callback, void *user_data);
+
+ /**
+  * @}
+  */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_GROUP_H__ */
diff --git a/include_product/media_image.h b/include_product/media_image.h
new file mode 100755 (executable)
index 0000000..e6eb0c0
--- /dev/null
@@ -0,0 +1,335 @@
+/*
+* 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_IMAGE_META_H__
+#define __TIZEN_IMAGE_META_H__
+
+#include <media_content_type.h>
+
+#ifdef __cplusplus
+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
+ * @{
+ */
+
+
+/**
+ * @brief Clones the image metadata.
+ * @details The function copies the image metadata handle from a source to destination.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ *
+ * @see image_meta_destroy()
+ */
+int image_meta_clone(image_meta_h *dst, image_meta_h src);
+
+/**
+ * @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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] image The image metadata handle
+ *
+ * @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 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 an image.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the image width in pixels.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the image height in pixels.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 image creation time.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  image      The image metadata handle
+ * @param[out] date_taken The time, when image was taken (in seconds, since the Epoch)
+ *
+ * @return @c 0 on success,
+ *         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_date_taken(image_meta_h image, char **date_taken);
+
+/**
+ * @brief Gets the burst shot ID.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a burst_id using free().
+ *
+ * @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
+ *
+ * @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 Gets the exposure time from exif.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks @a exposure time must be released with free() by you.
+ *
+ * @param[in] media The handle to image metadata
+ * @param[out] exposure_time The value of exposure_time, getting from exif
+ *
+ * @return 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ */
+int image_meta_get_exposure_time(image_meta_h image, char **exposure_time);
+
+/**
+ * @brief Gets the fnumber from exif.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param[in] media The handle toimage metadata
+ * @param[out] fnumber The value of fnumber, getting from exif
+ *
+ * @return 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ */
+int image_meta_get_fnumber(image_meta_h image, double *fnumber);
+
+/**
+ * @brief Gets the iso from exif.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param[in] media The handle toimage metadata
+ * @param[out] iso The value of iso, getting from exif
+ *
+ * @return 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ */
+int image_meta_get_iso(image_meta_h image, int *iso);
+
+/**
+ * @brief Gets the model from exif.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks @a model must be released with free() by you.
+ *
+ * @param[in] media The handle toimage metadata
+ * @param[out] model The value of model, getting from exif
+ *
+ * @return 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ */
+int image_meta_get_model(image_meta_h image, char **model);
+
+/**
+ * @brief Checks whether the media is a burst shot image.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @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_is_burst_shot(image_meta_h image, bool *is_burst_shot);
+
+/**
+ * @brief Sets an orientation of the image.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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);
+
+/**
+ * @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, the image_meta_update_to_db() function should be called so as to update
+ *          the given image attributes in the media database.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks 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_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 image_meta_set_orientation()
+ */
+int image_meta_update_to_db(image_meta_h image);
+
+/**
+ * @}
+ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__TIZEN_IMAGE_META_H__*/
diff --git a/include_product/media_info.h b/include_product/media_info.h
new file mode 100755 (executable)
index 0000000..e5a9582
--- /dev/null
@@ -0,0 +1,1940 @@
+/*
+* 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_INFORMATION_H__
+#define __TIZEN_MEDIA_INFORMATION_H__
+
+#include <media_content_type.h>
+
+
+
+#ifdef __cplusplus
+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
+ * @{
+ */
+
+/**
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ *                   %http://tizen.org/privilege/mediastorage \n
+ *                   %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must 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 should add privilege http://tizen.org/privilege/externalstorage. \n
+ *                   If you can access both storage, you must add all privilege.
+ *
+ * @param[in]  path The path to the media file
+ * @param[out] info The handle to the media info
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_info_insert_to_db(const char *path, media_info_h *info);
+
+/**
+ * @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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ *                   %http://tizen.org/privilege/mediastorage \n
+ *                   %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ *                   If you want to access only internal storage by using  this 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 should 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_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ * @see media_insert_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 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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ *                   %http://tizen.org/privilege/mediastorage \n
+ *                   %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ *                   If you want to access only internal storage with this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
+ *                   Or if you want to access only external storage with this API, you should 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_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ * @see media_insert_burst_shot_completed_cb()
+ */
+int media_info_insert_burst_shot_to_db(const char **path_array, unsigned int array_length, media_insert_burst_shot_completed_cb callback, void *user_data);
+
+/**
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_info_delete_from_db(const char *media_id);
+
+/**
+ * @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 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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @param[in] filter  The handle to filter
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_info_delete_batch_from_db(filter_h filter);
+
+
+/**
+ * @brief Destroys media info.
+ * @details The function frees all resources related to the media info handle. This handle
+ *          can no longer be used to perform any operation. New media info handle has to
+ *          be created before the next usage.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 Get copy of media_info handle by calling media_info_clone().
+ *
+ * @see media_info_clone()
+ */
+int media_info_destroy(media_info_h media);
+
+/**
+ * @brief Clones the media info handle.
+ *
+ * @details This function copies the media info handle from a source to the destination.
+ *          There is no media_info_create() function. The media_info_h is created internally and
+ *          available through media info foreach function such as media_info_foreach_media_from_db().
+ *          To use this handle outside of these foreach functions, use this function.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ *
+ * @see media_info_destroy()
+ * @see media_album_foreach_media_from_db()
+ * @see media_playlist_foreach_media_from_db()
+ * @see media_group_foreach_media_from_db
+ * @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 count of media info for the passed @a filter from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  filter      The handle to filter
+ * @param[out] media_count The count of 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_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_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 @c NULL is passed to the @a filter, then no filtering is applied.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_info_cb().
+ *
+ * @see media_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 count of media tags for the passed @a filter in the given @a media_id from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_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 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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_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 bookmarks for the passed @a filter in the given media ID from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_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 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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_bookmark_cb().
+ *
+ * @see media_content_connect()
+ * @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 the number of face for the passed @a media_id from the media database.
+ * @since_tizen 3.0
+ * @param[in] media_id media id
+ * @param[in]  filter          The handle to the media filter
+ * @param[out] face_count The count of media face
+ * @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_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_get_face_count_from_db(const char *media_id, filter_h filter, int *face_count);
+
+/**
+ * @brief Iterates through the media files with optional @a media_id in the given @a face @a face from the media database.
+ * @details This function gets all media face info associated with the given media id and
+ * meeting desired filter option and calls registered callback function for
+ * every retrieved media face info. If NULL is passed to the @a filter, no filtering is applied.
+ * @since_tizen 3.0
+ * @param [in] media_id media id
+ * @param[in]  filter          The handle to the 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
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ * @pre This function requires opened connection to content service by media_content_connect().
+ * @see media_content_connect()
+ * @see media_filter_create()
+ *
+ */
+int media_info_foreach_face_from_db(const char *media_id, filter_h filter, media_face_cb callback, void *user_data);
+
+/**
+ * @brief Gets the image metadata for a given media info.
+ * @details This function returns an image metadata handle retrieved from the media info.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 a video metadata for a given media info.
+ * @details This function returns a video metadata handle retrieved from the media info handle.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release the @a video handle using video_meta_destroy().
+ *
+ * @param[in]  media The media info handle
+ * @param[out] video A handle to the video meta
+ *
+ * @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 video_meta_destroy()
+ */
+int media_info_get_video(media_info_h media, video_meta_h *video);
+
+/**
+ * @brief Gets an audio metadata for a given media info.
+ * @details This function returns an audio metadata handle retrieved from the media info handle.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release the @a audio handle using audio_meta_destroy().
+ *
+ * @param[in]  media The media info handle
+ * @param[out] audio A handle to the audio meta
+ *
+ * @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 audio_meta_destroy()
+ */
+int media_info_get_audio(media_info_h media, audio_meta_h *audio);
+
+/**
+ * @brief Gets the tag ID for the media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  media The media info handle
+ * @param[out] 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_PERMISSION_DENIED Permission denied
+ */
+int media_info_get_media_id(media_info_h media, char **media_id);
+
+/**
+ * @brief Gets the path to the media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a path using free().
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ *
+ */
+int media_info_get_file_path(media_info_h media, char **path);
+
+/**
+ * @brief Gets the name of the media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a name using free().
+ *
+ * @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 the content type of the media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the MIME type from the media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a mime_type using free().
+ *
+ * @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 the media file size.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the addition time of the media.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the date of modification of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the timeline of media info.
+ * @details If the image file has the creation time, the value of the timeline is the creation time.\n
+ *          Otherwise, the value of the timeline is the same as modified time.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a path using free(). \n
+ *                   If the thumbnail extraction for the given media has not been requested yet, this API returns NULL. To create a thumbnail, you should use media_info_create_thumbnail() API. \n
+ *                   Since 3.0, this function returns an empty string if media_info_create_thumbnail() has failed to create a thumbnail for the given media.
+ *
+ * @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 of media info.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media info has no description, the method returns empty string.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a description using free().
+ *
+ * @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 the longitude of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the latitude of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the altitude of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the weather of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the rating of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 favorite status of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a author using free().
+ *
+ * @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 of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a provider using free().
+ *
+ * @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 of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a content_name using free().
+ *
+ * @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 of media info.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media info has no title, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a title using free().
+ *
+ * @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 extract_flag of media info.
+ * @since_tizen 2.3
+ *
+ * @remarks You must release @a title using free().
+ *
+ * @param[in]  media         The media info handle
+ * @param[out] extract_flag  The extract_flag 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_extract_flag(media_info_h media, int *extract_flag);
+
+/**
+ * @brief Gets the category of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a category using free().
+ *
+ * @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 of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a location_tag using free().
+ *
+ * @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 of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a age_rating using free().
+ *
+ * @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 of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a keyword using free().
+ *
+ * @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 Gets the storage id of media info.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks You must release @a storage_id using free().
+ *
+ * @param[in]  media   The media info handle
+ * @param[out] storage_id The storage id of the media info
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int media_info_get_storage_id(media_info_h media, char **storage_id);
+
+/**
+ * @brief Checks whether the media is protected via DRM.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 Checks whether the media is 360 content.
+ * @since_tizen 3.0
+ *
+ * @param[in]  media  The media info handle
+ * @param[out] is_360 @c true if media is 360 content,
+ *                    otherwise @c false if media is not 360 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
+ */
+int media_info_is_360_content(media_info_h media, bool *is_360);
+
+/**
+ * @brief Gets the storage type of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 content's played position parameter.
+ * @details Function returns content's elapsed playback position parameter as period
+ * starting from the beginning of the track.
+ *
+ * @param [in] media The handle to media info
+ * @param [out] played_position The elapsed time of the content
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_info_get_played_position(media_info_h media, int *played_position);
+
+/**
+ * @brief Gets number which represents how many times given content has been played.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param [in] media The handle to media info
+ * @param [out] count_played The counter of content played
+ *
+ * @return 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_info_get_played_count(media_info_h media, int *played_count);
+
+/**
+ * @brief Gets the content's played time parameter.
+ * @details Function returns content's elapsed playback time parameter as period
+ *          starting from the beginning of the track.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param [in] media The handle to media info
+ * @param [out] played_time The elapsed time of the content
+ *
+ * @return 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_info_get_played_time(media_info_h media, time_t *played_time);
+
+/**
+ * @brief Gets the media info from the media database.
+ *
+ * @details This function creates a new media handle from the media database by the given @a media_id.
+ *          Media info will be created and filled with information.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 Increments the played count to content meta handle.
+ * @detalis You can increase the played(opened) count of the media file.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param [in] media The handle to media info
+ *
+ * @return 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @post media_info_update_to_db()
+ */
+int media_info_increase_played_count(media_info_h media);
+
+/**
+ * @brief Gets the provider to media info.
+ *
+ * @remarks @a modified_month must be released with free() by you.
+ *
+ * @param[in] media The handle to media info
+ * @param[out] category The modified month 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
+ *
+ */
+int media_info_get_modified_month(media_info_h media, char **modified_month);
+
+/**
+ * @brief Sets the played count to content meta handle.
+ *
+ * @param [in] media The handle to media info
+ * @param [in] played_count The played count of content
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @post media_info_update_to_db()
+ */
+int media_info_set_played_count(media_info_h media, int played_count);
+
+/**
+ * @brief Sets the played time to content meta handle.
+ * @detalis You can set the latest played(opened) time of the media file. the latest played time to be set the current time on the system.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param [in] media The handle to media info
+ *
+ * @return 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @post media_info_update_to_db()
+ */
+int media_info_set_played_time(media_info_h media);
+
+/**
+ * @brief Sets the played position to content meta handle.
+ *
+ * @param [in] media The handle to media info
+ * @param [in] played_position The played position of content
+ * @return 0 on success, otherwise a negative error value.
+ * @retval #MEDIA_CONTENT_ERROR_NONE Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @post media_info_update_to_db()
+ */
+int media_info_set_played_position(media_info_h media, int played_position);
+
+/**
+ * @brief Sets the display name of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the description of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the longitude of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the latitude of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the altitude of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the weather of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the rating of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the favorite of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the author of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the provider of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 the content name of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the category of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the location tag of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the age rating of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the keyword of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks The function should be called after any change in media, to be updated to the media
+ *          database. For example, after using media_info_set_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_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ * @see media_info_set_display_name()
+ * @see media_info_set_description()
+ * @see media_info_set_longitude()
+ * @see media_info_set_latitude()
+ * @see media_info_set_altitude()
+ * @see media_info_set_rating()
+ * @see media_info_set_favorite()
+ * @see media_info_set_author()
+ * @see media_info_set_provider()
+ * @see media_info_set_content_name()
+ * @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 Refreshes the media metadata to the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ *                   %http://tizen.org/privilege/mediastorage \n
+ *                   %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ *                   If you want to access only internal storage by using  this 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 should add privilege http://tizen.org/privilege/externalstorage. \n
+ *                   If you can access both storage, you should add all privilege.
+ *
+ * @param[in] media_id The 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_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_info_refresh_metadata_to_db(const char *media_id);
+
+/**
+ * @brief Sets the added time of media info.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ *                   %http://tizen.org/privilege/mediastorage \n
+ *                   %http://tizen.org/privilege/externalstorage
+ *
+ * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
+ *                   If you want to access only internal storage by using  this 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 should 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 @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_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_info_move_to_db(media_info_h media, const char* dst_path);
+
+/**
+ * @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. \n
+ *          Since 3.0, a thumbnail is not automatically extracted during media scanning. \n
+ *          Therefore, if there exists no thumbnail for the given media, you MUST call this function to create a thumbnail.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks If you want to destroy media handle before callback invoked, you must cancel thumbnail request by using media_info_cancel_thumbnail() \n
+ *          Since 3.0, if creation of a thumbnail is failed, empty string will be passed through media_thumbnail_completed_cb().
+ *          Items in external storage except MMC not supported.
+ *
+ * @param[in] media     The 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 @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
+
+/**
+ * @brief Cancels the creation of image's thumbnail for the given media.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks If you request cancel for the already thumbnail created media, this API return MEDIA_CONTENT_ERROR_INVALID_OPERATION
+ *
+ * @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
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ * @see media_content_connect()
+ */
+int media_info_cancel_thumbnail(media_info_h media);
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
+ * @brief Starts face detection for the given image, asynchronously.
+ * @details This function detects faces for given image item and calls the given callback function when the detection is completed. \n
+ *          The given callback function is called when the detection is completed. \n
+ *          To obtain the detected faces, call the media_info_foreach_face_from_db() function.
+ *
+ * @since_tizen 3.0
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write \n
+ *                   %http://tizen.org/privilege/mediastorage
+ *
+ * @remarks If you want to destroy the media handle before callback invoked, you must cancel the face detection request by using media_info_cancel_face_detection(). \n
+ *          If face detection fails, the @a face_count argument in media_face_detection_completed_cb() will be set to 0.
+ *          Media items in external storage are not supported, with the exception of MMC items.
+ *
+ * @param[in] media     The media info handle
+ * @param[in] callback  The callback function to be invoked when detection is completed
+ * @param[in] user_data The user data to be passed to the callback function
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED     Not supported
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ * @see media_info_cancel_face_detection()
+ */
+int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data);
+
+/**
+ * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
+ * @brief Cancels face detection of image for the given media.
+ * @details This function cancels face detection for given media item. \n
+ *          If you cancel face detection request before callback is invoked, the callback registered by media_info_start_face_detection() API will not be invoked.
+ *
+ * @since_tizen 3.0
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks If face detection is already done when you request the cancellation, this API return MEDIA_CONTENT_ERROR_INVALID_OPERATION
+ *
+ * @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
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ * @see media_info_start_face_detection()
+ */
+int media_info_cancel_face_detection(media_info_h media);
+
+/**
+* @brief Creates the media info handle.
+* @details If the information about the file that is already known, you can use this API to generate empty handler.
+*          And you can add the information to the generated handler using media_info_set_XXX() API.
+*          After filling the information to the handler, you can insert into database using media_info_insert_to_db_with_data() API.
+* @since_tizen 3.0
+*
+*
+* @privilege %http://tizen.org/privilege/mediastorage \n
+*                      %http://tizen.org/privilege/externalstorage
+*
+* @remarks 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 should add privilege http://tizen.org/privilege/externalstorage. \n
+*                   If you can access both storage, you must add all privilege.
+*
+* @param[in] path The path to create the media info handle
+* @param[out] media The media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @see media_info_insert_to_db_with_data()
+* @see media_info_destroy()
+*/
+int media_info_create(const char *path, media_info_h *media);
+
+/**
+* @brief Inserts media info to database with media info data.
+* @details After filling the information to the generated handler using media_info_create() API, you can insert into database using this API.
+* @since_tizen 3.0
+*
+* @remarks You must create media handle using media_info_create(),
+*               and release @a info using media_info_destroy().
+*
+* @privlevel public
+* @privilege %http://tizen.org/privilege/content.write
+*
+* @param[in] media The media info handle to be inserted
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @see media_info_create()
+*/
+int media_info_insert_to_db_with_data(media_info_h media);
+
+/**
+* @brief Sets the title of media info handle.
+* @since_tizen 3.0
+*
+* @param[in] media The media info handle
+* @param[in] title The title of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_title(media_info_h media, const char *title);
+
+/**
+* @brief Sets the album of media info handle.
+* @since_tizen 3.0
+*
+* @param[in] media The media info handle
+* @param[in] album The album of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_album(media_info_h media, const char *album);
+
+/**
+* @brief Sets the artist of media info handle.
+* @since_tizen 3.0
+*
+* @param[in] media The media info handle
+* @param[in] artist The artist of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_artist(media_info_h media, const char *artist);
+
+/**
+* @brief Sets the genre of media info handle.
+* @since_tizen 3.0
+*
+* @param[in] media The media info handle
+* @param[in] genre The genre of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_genre(media_info_h media, const char *genre);
+
+/**
+* @brief Sets the recorded date of media info handle.
+* @since_tizen 3.0
+*
+* @param[in] media The media info handle
+* @param[in] recorded_date The recorded date of media info handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+*
+* @post media_info_insert_to_db_with_data()
+*/
+int media_info_set_recorded_date(media_info_h media, const char *recorded_date);
+
+
+/**
+ * @}
+ */
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_INFORMATION_H__ */
diff --git a/include_product/media_info_private.h b/include_product/media_info_private.h
new file mode 100755 (executable)
index 0000000..bc1abfc
--- /dev/null
@@ -0,0 +1,1058 @@
+/*
+* 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_INFO_PRIVATE_H__
+#define __TIZEN_MEDIA_INFO_PRIVATE_H__
+
+
+#include <unistd.h>
+#include <asm/unistd.h>
+#include <string.h>
+#include <sqlite3.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <glib.h>
+#include <media-svc.h>
+#include <media_content_type.h>
+#include <media_content_internal.h>
+#include <dlog.h>
+#include <media-util.h>
+#include <errno.h>
+#include <tzplatform_config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
+* @{
+*
+* @file media_info_private.h
+* @brief This file contains the media info API and related structure and enumeration. \n
+*        Description of the audio, video,image content involves: album, artist, album_artist, author, genre and description tags. \n
+*        Parameters of the recording are also supported, as: format, bitrate, duration, size etc. \n
+*        Defenitions of media DB fields and tables, operations with media data relating to DB and handling with media filter attributes.
+*/
+
+
+#define LOG_TAG "CAPI_CONTENT_MEDIA_CONTENT"
+
+#define SAFE_STRLCPY(dst, src, n)      ((g_strlcpy(dst, src, n) < n) ? TRUE : FALSE)
+#define SAFE_STRLCAT(dst, src, n)      g_strlcat(dst, src, n);
+#define SAFE_FREE(src)         {if (src) {free(src); src = NULL; } }
+#define SAFE_G_FREE(src)       {if (src) {g_free(src); src = NULL; } }
+#define STRING_VALID(str)              ((str != NULL && strlen(str) > 0) ? TRUE : FALSE)
+#define SQLITE3_FINALIZE(x)    {if (x != NULL) sqlite3_finalize(x); }
+#define SQLITE3_SAFE_FREE(x)   {if (x != NULL) {sqlite3_free(x); x = NULL; } }
+
+#define MEDIA_CONTENT_THUMB_DEFAULT_PATH               tzplatform_mkpath(TZ_USER_SHARE, "media/.thumb/thumb_default.png")
+#define MEDIA_CONTENT_INSERT_FILES_PATH                "/tmp"
+
+#define MAX_QUERY_SIZE 4096
+#define DEFAULT_QUERY_SIZE 1024
+#define COLLATE_STR_SIZE 32
+#define MEDIA_CONTENT_UUID_SIZE        36
+#define BATCH_REQUEST_MAX 300
+
+typedef enum {
+       MEDIA_INFO_UUID = 0,
+       MEDIA_INFO_PATH,
+       MEDIA_INFO_FILE_NAME,
+       MEDIA_INFO_TYPE,
+       MEDIA_INFO_MIME_TYPE,
+       MEDIA_INFO_SIZE,
+       MEDIA_INFO_ADDED_TIME,
+       MEDIA_INFO_MODIFIED_TIME,
+       MEDIA_INFO_THUMBNAIL_PATH,
+       MEDIA_INFO_DESCRIPTION,
+       MEDIA_INFO_RATING,
+       MEDIA_INFO_FAVOURITE,
+       MEDIA_INFO_AUTHOR,
+       MEDIA_INFO_PROVIDER,
+       MEDIA_INFO_CONTENT_NAME,
+       MEDIA_INFO_CATEGORY,
+       MEDIA_INFO_LOCATION_TAG,
+       MEDIA_INFO_AGE_RATING,
+       MEDIA_INFO_KEYWORD,
+       MEDIA_INFO_IS_DRM,
+       MEDIA_INFO_STORAGE_TYPE,
+       MEDIA_INFO_LONGITUDE,
+       MEDIA_INFO_LATITUDE,
+       MEDIA_INFO_ALTITUDE,
+       MEDIA_INFO_EXPOSURE_TIME,
+       MEDIA_INFO_FNUMBER,
+       MEDIA_INFO_ISO,
+       MEDIA_INFO_MODEL,
+       MEDIA_INFO_WIDTH,
+       MEDIA_INFO_HEIGHT,
+       MEDIA_INFO_DATETAKEN,
+       MEDIA_INFO_ORIENTATION,
+       MEDIA_INFO_TITLE,
+       MEDIA_INFO_ALBUM,
+       MEDIA_INFO_ARTIST,
+       MEDIA_INFO_ALBUM_ARTIST,
+       MEDIA_INFO_GENRE,
+       MEDIA_INFO_COMPOSER,
+       MEDIA_INFO_YEAR,
+       MEDIA_INFO_RECORDED_DATE,
+       MEDIA_INFO_COPYRIGHT,
+       MEDIA_INFO_TRACK_NUM,
+       MEDIA_INFO_BITRATE,
+       MEDIA_INFO_BITPERSAMPLE,
+       MEDIA_INFO_DURATION,
+       MEDIA_INFO_PLAYED_COUNT,
+       MEDIA_INFO_LAST_PLAYED_TIME,
+       MEDIA_INFO_LAST_PLAYED_POSITION,
+       MEDIA_INFO_SAMPLERATE,
+       MEDIA_INFO_CHANNEL,
+       MEDIA_INFO_BURST_ID,
+       MEDIA_INFO_TIMELINE,
+       MEDIA_INFO_WEATHER,
+       MEDIA_INFO_SYNC_STATUS,
+       MEDIA_INFO_STORAGE_UUID,
+       MEDIA_INFO_IS_360,
+       MEDIA_INFO_EXTRACT_FLAG,
+       MEDIA_INFO_MODIFIED_MONTH,
+#ifdef _USE_SENIOR_MODE
+       MEDIA_INFO_CONTACT,
+       MEDIA_INFO_APP_DATA,
+#endif
+       MEDIA_INFO_ITEM_MAX,
+} media_info_item_e;
+
+typedef enum {
+       MEDIA_CONTENT_TYPE = 0,
+       MEDIA_THUMBNAIL_TYPE,
+       MEDIA_REGISTER_TYPE
+} media_info_error_type_e;
+
+typedef enum {
+       MEDIA_TAG_ADD,
+       MEDIA_TAG_REMOVE,
+       MEDIA_TAG_UPDATE_TAG_NAME,
+} tag_function_e;
+
+typedef enum {
+       MEDIA_PLAYLIST_ADD,
+       MEDIA_PLAYLIST_REMOVE,
+       MEDIA_PLAYLIST_UPDATE_PLAYLIST_NAME,
+       MEDIA_PLAYLIST_UPDATE_THUMBNAIL_PATH,
+       MEDIA_PLAYLIST_UPDATE_PLAY_ORDER,
+} playlist_function_e;
+
+typedef enum {
+       MEDIA_GROUP_NONE,
+       MEDIA_GROUP_ALBUM,
+       MEDIA_GROUP_FOLDER,
+       MEDIA_GROUP_PLAYLIST,
+       MEDIA_GROUP_TAG,
+       MEDIA_GROUP_BOOKMARK,
+       MEDIA_GROUP_TAG_BY_MEDIA_ID,
+       MEDIA_GROUP_BOOKMARK_BY_MEDIA_ID,
+       MEDIA_GROUP_STORAGE,
+       MEDIA_GROUP_FACE_BY_MEDIA_ID,
+       MEDIA_GROUP_PVR,
+       MEDIA_GROUP_UHD,
+} group_list_e;
+
+typedef enum {
+       MEDIA_BATCH_INSERT_NORMAL,
+       MEDIA_BATCH_INSERT_BURSTSHOT,
+} media_batch_insert_e;
+
+typedef struct _filter_s {
+       char *storage_id;
+       char *condition;
+       char *order_keyword;
+       media_content_order_e order_type;
+       media_content_collation_e condition_collate_type;
+       media_content_collation_e order_collate_type;
+       int offset;
+       int count;
+} filter_s;
+
+typedef struct {
+       char *folder_id;
+       char *parent_folder_id;
+       char *path;
+       char *name;
+       time_t modified_time;
+       media_content_storage_e storage_type;
+       char *storage_uuid;
+       int folder_order;
+} media_folder_s;
+
+typedef struct {
+       int tag_id;
+       char *name;
+       GList *item_list;
+} media_tag_s;
+
+typedef struct {
+       int bookmark_id;
+       char *media_id;
+       time_t marked_time;
+       char *thumbnail_path;
+} media_bookmark_s;
+
+typedef struct {
+       int album_id;
+       char *name;
+       char *artist;
+       char *album_art_path;
+} media_album_s;
+
+typedef struct {
+       int playlist_id;
+       char *name;
+       char *thumbnail_path;
+       GList *item_list;
+} media_playlist_s;
+
+typedef struct {
+       char *media_id;
+       int width;
+       int height;
+       char *date_taken;
+       char *title;
+       char *burst_id;
+       char *weather;
+       char *exposure_time;
+       double fnumber;
+       int iso;
+       char *model;
+       media_content_orientation_e orientation;
+} image_meta_s;
+
+typedef struct _image_mm_meta_s {
+       int width;
+       int height;
+} image_mm_meta_s;
+
+typedef struct {
+       char *media_id;
+       char *title;
+       char *album;
+       char *artist;
+       char *album_artist;
+       char *genre;
+       char *composer;
+       char *year;
+       char *recorded_date;
+       char *copyright;
+       char *track_num;
+       int bitrate;
+       int duration;
+       int width;
+       int height;
+       int played_count;
+       time_t played_time;
+       int played_position;
+} video_meta_s;
+
+typedef struct {
+       char *media_id;
+       char *title;
+       char *album;
+       char *artist;
+       char *album_artist;
+       char *genre;
+       char *composer;
+       char *year;
+       char *recorded_date;
+       char *copyright;
+       char *track_num;
+       int bitrate;
+       int bitpersample;
+       int samplerate;
+       int channel;
+       int duration;
+       int played_count;
+       time_t played_time;
+       int played_position;
+} audio_meta_s;
+
+typedef struct {
+       char *media_id;
+       char *file_path;
+       char *display_name;
+       media_content_type_e media_type;
+       char *mime_type;
+       unsigned long long size;
+       time_t added_time;
+       time_t modified_time;
+       time_t timeline;
+       char *thumbnail_path;
+       char *description;
+       double longitude;
+       double latitude;
+       double altitude;
+       char *weather;
+       int rating;
+       time_t favourite;
+       char *title;
+       char *author;
+       char *provider;
+       char *content_name;
+       char *category;
+       char *location_tag;
+       char *age_rating;
+       char *keyword;
+       int is_drm;
+       int storage_type;
+       int played_count;
+       time_t played_time;
+       int played_position;
+       char *modified_month;
+       char *storage_uuid;
+       int sync_status;
+       unsigned int request_id;
+       unsigned int face_request_id;
+       int is_360;
+       int extract_flag;
+#ifdef _USE_SENIOR_MODE
+       char* contact;
+       char* app_data;
+#endif
+       image_meta_s *image_meta;
+       video_meta_s *video_meta;
+       audio_meta_s *audio_meta;
+} media_info_s;
+
+typedef struct {
+       char *media_id;
+       int function;
+       char *tag_name;
+} media_tag_item_s;
+
+typedef struct {
+       char *media_id;
+       int function;
+       char *playlist_name;
+       char *thumbnail_path;
+       int playlist_member_id;
+       int play_order;
+} media_playlist_item_s;
+
+typedef struct {
+       char *storage_id;
+       char *storage_name;
+       char *storage_path;
+       char *storage_account;
+       int storage_type;
+} media_storage_s;
+
+typedef struct {
+       char *face_id;                          /* face uuid */
+       char *media_id;                 /* media uuid */
+       unsigned int face_rect_x;       /* x position of face */
+       unsigned int face_rect_y;       /* y position of face */
+       unsigned int face_rect_w;       /* width of face */
+       unsigned int face_rect_h;       /* height of face */
+       int orientation;                        /* orientation */
+       char *face_tag;                 /* face tag */
+} media_face_s;
+
+typedef struct {
+       char *media_id;
+       char *storage_id;
+       char *path;
+       unsigned long long size;
+       int duration;
+       int timezone;
+       int ptc;
+       int major;
+       int minor;
+       int channel_type;
+       char *channel_name;
+       char *channel_num;
+       char *program_title;
+       int program_num;
+       char *program_crid;
+       char *guidance;
+       char *synopsis;
+       char *genre;
+       char *language;
+       int embargo_time;
+       int expiry_time;
+       int start_time;
+       int program_start_time;
+       int program_end_time;
+       int program_date;
+       int parental_rating;
+       int timer_record;
+       int series_record;
+       int hd;
+       int subtitle;
+       int ttx;
+       int ad;
+       int hard_of_hearing_radio;
+       int data_service;
+       int content_lock;
+       int content_watch;
+       int has_audio_only;
+       int is_local_record;
+       int resolution;
+       int aspectratio;
+       char* modified_month;
+       int sports_type;
+       int guidance_length;
+       int tvmode;
+       int play_count;
+       int highlight;
+       char* private_data;
+} media_pvr_s;
+
+typedef struct {
+       char *media_id;
+       char *storage_id;
+       char *path;
+       unsigned long long size;
+       char *content_id;
+       char *content_title;
+       char *file_name;
+       char* release_date;
+       time_t modified_time;
+       int played_position;
+       int sub_type;
+       int played_count;
+} media_uhd_s;
+
+typedef struct _attribute_map_s {
+       GHashTable *attr_map;
+} attribute_s;
+
+typedef struct {
+       media_info_s *handle;
+       void *user_data;
+       media_thumbnail_completed_cb thumbnail_completed_cb;
+} media_thumbnail_cb_s;
+
+typedef struct {
+       media_info_s *handle;
+       void *user_data;
+       media_face_detection_completed_cb face_completed_cb;
+} media_face_cb_s;
+
+typedef struct {
+       media_insert_completed_cb insert_completed_cb;
+       char *insert_list_path;
+       void *user_data;
+} media_insert_cb_s;
+
+typedef struct {
+       media_content_db_update_cb update_noti_cb;
+       void *user_data;
+} media_noti_cb_s;
+
+typedef struct attribute_s *attribute_h;
+
+
+typedef struct _media_content_cb_data {
+       media_scan_completed_cb callback;
+       void *user_data;
+} media_content_scan_cb_data;
+
+
+/* DB Table */
+#define DB_TABLE_MEDIA                 "media"
+#define DB_TABLE_FOLDER                "folder"
+#define DB_TABLE_ALBUM                 "album"
+#define DB_TABLE_TAG                   "tag"
+#define DB_TABLE_TAG_MAP               "tag_map"
+#define DB_TABLE_PLAYLIST              "playlist"
+#define DB_TABLE_PLAYLIST_MAP  "playlist_map"
+#define DB_TABLE_BOOKMARK              "bookmark"
+#define DB_TABLE_STORAGE               "storage"
+#define DB_TABLE_MEDIA_VIEW    "media_view"
+#define DB_TABLE_FACE                  "face"
+#define DB_TABLE_FACE_SCAN_LIST        "face_scan_list"
+#define DB_TABLE_PVR                           "pvr"
+#define DB_TABLE_UHD                                           "uhd"
+
+/* DB View */
+#define DB_VIEW_PLAYLIST       "playlist_view"
+#define DB_VIEW_TAG                    "tag_view"
+
+/* DB Table Alias */
+#define DB_TABLE_ALIAS_MEDIA                   "m"
+#define DB_TABLE_ALIAS_FOLDER                  "f"
+#define DB_TABLE_ALIAS_PLAYLIST                        "p"
+#define DB_TABLE_ALIAS_PLAYLIST_MAP    "pm"
+#define DB_TABLE_ALIAS_TAG                             "t"
+#define DB_TABLE_ALIAS_BOOKMARK                "b"
+#define DB_TABLE_ALIAS_ALBUM                   "a"
+
+/* DB field for media */
+#define DB_FIELD_MEDIA_ID                                      "media_uuid"
+#define DB_FIELD_MEDIA_PATH                            "path"
+#define DB_FIELD_MEDIA_DISPLAY_NAME            "file_name"
+#define DB_FIELD_MEDIA_TYPE                                    "media_type"
+#define DB_FIELD_MEDIA_MIME_TYPE                       "mime_type"
+#define DB_FIELD_MEDIA_SIZE                                    "size"
+#define DB_FIELD_MEDIA_ADDED_TIME                      "added_time"
+#define DB_FIELD_MEDIA_MODIFIED_TIME           "modified_time"
+#define DB_FIELD_MEDIA_FOLDER_ID                       "folder_uuid"
+#define DB_FIELD_MEDIA_TIMELINE                                "timeline"
+#define DB_FIELD_MEDIA_THUMBNAIL_PATH  "thumbnail_path"
+#define DB_FIELD_MEDIA_TITLE                           "title"
+#define DB_FIELD_MEDIA_ALBUM                           "album"
+#define DB_FIELD_MEDIA_ARTIST                          "artist"
+#define DB_FIELD_MEDIA_ALBUM_ARTIST                    "album_artist"
+#define DB_FIELD_MEDIA_GENRE                           "genre"
+#define DB_FIELD_MEDIA_COMPOSER                        "composer"
+#define DB_FIELD_MEDIA_YEAR                            "year"
+#define DB_FIELD_MEDIA_RECORDED_DATE           "recorded_date"
+#define DB_FIELD_MEDIA_COPYRIGHT                       "copyright"
+#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"
+#define DB_FIELD_MEDIA_LONGITUDE                       "longitude"
+#define DB_FIELD_MEDIA_LATITUDE                        "latitude"
+#define DB_FIELD_MEDIA_ALTITUDE                        "altitude"
+#define DB_FIELD_MEDIA_WIDTH                           "width"
+#define DB_FIELD_MEDIA_HEIGHT                          "height"
+#define DB_FIELD_MEDIA_DATETAKEN                       "datetaken"
+#define DB_FIELD_MEDIA_ORIENTATION             "orientation"
+#define DB_FIELD_MEDIA_BURST_ID                        "burst_id"
+#define DB_FIELD_MEDIA_PLAYED_COUNT            "played_count"
+#define DB_FIELD_MEDIA_LAST_PLAYED_TIME                "last_played_time"
+#define DB_FIELD_MEDIA_LAST_PLAYED_POSITION    "last_played_position"
+#define DB_FIELD_MEDIA_RATING                          "rating"
+#define DB_FIELD_MEDIA_FAVOURITE                       "favourite"
+#define DB_FIELD_MEDIA_AUTHOR                          "author"
+#define DB_FIELD_MEDIA_PROVIDER                        "provider"
+#define DB_FIELD_MEDIA_CONTENT_NAME            "content_name"
+#define DB_FIELD_MEDIA_CATEGORY                        "category"
+#define DB_FIELD_MEDIA_LOCATION_TAG            "location_tag"
+#define DB_FIELD_MEDIA_AGE_RATING                      "age_rating"
+#define DB_FIELD_MEDIA_KEYWORD                 "keyword"
+#define DB_FIELD_MEDIA_WEATHER                 "weather"
+#define DB_FIELD_MEDIA_IS_DRM                          "is_drm"
+#define DB_FIELD_MEDIA_STORAGE_TYPE            "storage_type"
+#define DB_FIELD_MEDIA_MODIFIED_MONTH  "modified_month"
+#define DB_FIELD_MEDIA_MODIFIED_DATE   "modified_date"
+#define DB_FIELD_MEDIA_EXPOSURE_TIME   "exposure_time"
+#define DB_FIELD_MEDIA_FNUMBER                 "fnumber"
+#define DB_FIELD_MEDIA_ISO                             "iso"
+#define DB_FIELD_MEDIA_MODEL                   "model"
+#define DB_FIELD_MEDIA_FILE_NAME_PINYIN                        "file_name_pinyin"
+#define DB_FIELD_MEDIA_TITLE_PINYIN                                    "title_pinyin"
+#define DB_FIELD_MEDIA_ALBUM_PINYIN                            "album_pinyin"
+#define DB_FIELD_MEDIA_ARTIST_PINYIN                           "artist_pinyin"
+#define DB_FIELD_MEDIA_ALBUM_ARTIST_PINYIN             "album_artist_pinyin"
+#define DB_FIELD_MEDIA_GENRE_PINYIN                            "genre_pinyin"
+#define DB_FIELD_MEDIA_COMPOSER_PINYIN                 "composer_pinyin"
+#define DB_FIELD_MEDIA_COPYRIGHT_PINYIN                        "copyright_pinyin"
+#define DB_FIELD_MEDIA_DESCRIPTION_PINYIN                      "description_pinyin"
+#define DB_FIELD_MEDIA_AUTHOR_PINYIN                           "author_pinyin"
+#define DB_FIELD_MEDIA_PROVIDER_PINYIN                 "provider_pinyin"
+#define DB_FIELD_MEDIA_CONTENT_NAME_PINYIN             "content_name_pinyin"
+#define DB_FIELD_MEDIA_CATEGORY_PINYIN                 "category_pinyin"
+#define DB_FIELD_MEDIA_LOCATION_TAG_PINYIN             "location_tag_pinyin"
+#define DB_FIELD_MEDIA_AGE_RATING_PINYIN                       "age_rating_pinyin"
+#define DB_FIELD_MEDIA_KEYWORD_PINYIN                          "keyword_pinyin"
+#define DB_FIELD_MEDIA_360                                                     "is_360"
+#ifdef _USE_SENIOR_MODE
+#define DB_FIELD_MEDIA_CONTACT                 "contact"
+#define DB_FIELD_MEDIA_APP_DATA                        "app_data"
+#endif
+
+/* DB field for folder */
+#define DB_FIELD_FOLDER_ID                             "folder_uuid"
+#define DB_FIELD_FOLDER_PATH                   "path"
+#define DB_FIELD_FOLDER_NAME                   "name"
+#define DB_FIELD_FOLDER_MODIFIED_TIME  "modified_time"
+#define DB_FIELD_FOLDER_STORAGE_TYPE   "storage_type"
+#define DB_FIELD_FOLDER_NAME_PINYIN    "name_pinyin"
+#define DB_FIELD_FOLDER_ORDER                  "folder_order"
+#define DB_FIELD_FOLDER_PARENT_FOLDER_ID       "parent_folder_uuid"
+
+/* DB field for playlist */
+#define DB_FIELD_PLAYLIST_ID                                   "playlist_id"
+#define DB_FIELD_PLAYLIST_NAME                         "name"
+#define DB_FIELD_PLAYLIST_MEMBER_ORDER "play_order"
+#define DB_FIELD_PLAYLIST_MEDIA_COUNT                  "media_count"
+
+/* DB field for tag */
+#define DB_FIELD_TAG_ID                        "tag_id"
+#define DB_FIELD_TAG_NAME              "name"
+#define DB_FIELD_TAG_MEDIA_COUNT                       "media_count"
+
+/* DB field for bookmark */
+#define DB_FIELD_BOOKMARK_ID   "bookmark_id"
+#define DB_FIELD_BOOKMARK_MARKED_TIME  "marked_time"
+
+/* DB field for album*/
+#define DB_FIELD_ALBUM_ID                      "album_id"
+#define DB_FIELD_ALBUM_NAME            "name"
+#define DB_FIELD_ALBUM_ARTIST          "artist"
+
+/* DB field for Storage*/
+#define DB_FIELD_STORAGE_ID                    "storage_uuid"
+#define DB_FIELD_STORAGE_PATH          "storage_path"
+
+/* DB field for Face */
+#define DB_FIELD_FACE_TAG                      "face_tag"
+
+/* DB field for PVR*/
+#define DB_FIELD_PVR_DURATION                                  "duration"
+#define DB_FIELD_PVR_TIME_ZONE                                 "timezone"
+#define DB_FIELD_PVR_PTC                                               "ptc"
+#define DB_FIELD_PVR_MAJOR                                             "major"
+#define DB_FIELD_PVR_MINOR                                             "minor"
+#define DB_FIELD_PVR_CHANNEL_TYPE                              "channel_type"
+#define DB_FIELD_PVR_CHANNEL_NAME                      "channel_name"
+#define DB_FIELD_PVR_CHANNEL_NUM                       "channel_num"
+#define DB_FIELD_PVR_PROGRAM_TITLE                     "program_title"
+#define DB_FIELD_PVR_PROGRAM_NUM                       "program_num"
+#define DB_FIELD_PVR_PROGRAM_CRID                              "program_crid"
+#define DB_FIELD_PVR_GUIDANCE                                  "guidance"
+#define DB_FIELD_PVR_SYNOPSIS                                  "synopsis"
+#define DB_FIELD_PVR_GENRE                                             "genre"
+#define DB_FIELD_PVR_LANGUAGE                                  "language"
+#define DB_FIELD_PVR_EMBARGO_TIME                              "embargo_time"
+#define DB_FIELD_PVR_EXPIRY_TIME                               "expiry_time"
+#define DB_FIELD_PVR_START_TIME                                "start_time"
+#define DB_FIELD_PVR_PROGRAM_START_TIME                "program_start_time"
+#define DB_FIELD_PVR_PROGRAM_END_TIME          "program_end_time"
+#define DB_FIELD_PVR_PROGRAM_DATE                      "program_date"
+#define DB_FIELD_PVR_PARENTAL_RATING                   "parental_rating"
+#define DB_FIELD_PVR_TIMER_RECORD                              "timer_record"
+#define DB_FIELD_PVR_SERIES_RECORD                             "series_record"
+#define DB_FIELD_PVR_HD                                                        "hd"
+#define DB_FIELD_PVR_SUBTITLE                                  "subtitle"
+#define DB_FIELD_PVR_TTX                                               "ttx"
+#define DB_FIELD_PVR_AD                                                        "ad"
+#define DB_FIELD_PVR_HARDOF_HEARINGRADIO       "hard_of_hearing_radio"
+#define DB_FIELD_PVR_DATA_SERVICE                              "data_service"
+#define DB_FIELD_PVR_CONTENT_LOCK                              "content_lock"
+#define DB_FIELD_PVR_CONTENT_WATCH                     "content_watch"
+#define DB_FIELD_PVR_HAS_AUDIO_ONLY                    "has_audio_only"
+#define DB_FIELD_PVR_IS_LOCAL_RECORD                   "is_local_record"
+#define DB_FIELD_PVR_RESOLUTION                                "resolution"
+#define DB_FIELD_PVR_ASPECTRATIO                               "aspectratio"
+#define DB_FIELD_PVR_MODIFIED_MONTH                    "modified_month"
+#define DB_FIELD_PVR_MODIFIED_DATE                     "modified_date"
+#define DB_FIELD_PVR_SPORTS_TYPE                               "sports_type"
+#define DB_FIELD_PVR_GUIDANCE_LENGTH                   "guidance_length"
+#define DB_FIELD_PVR_TVMODE                                            "tvmode"
+#define DB_FIELD_PVR_PLAY_COUNT                                        "play_count"
+#define DB_FIELD_PVR_PRIVATE_DATA               "private_data"
+
+/* DB fiedl for UHD */
+#define DB_FIELD_UHD_CONTENT_TITLE             "content_title"
+#define DB_FIELD_UHD_RELEASE_DATE                      "release_date"
+#define DB_FIELD_UHD_SUB_TYPE                  "sub_type"
+#define DB_FIELD_UHD_FILE_NAME                 "file_name"
+#define DB_FIELD_UHD_PLAYED_COUNT                      "played_count"
+
+/* DB Query Keyword */
+#define QUERY_KEYWORD_AND "AND"
+#define QUERY_KEYWORD_OR "OR"
+#define QUERY_KEYWORD_ORDER_BY "ORDER BY"
+#define QUERY_KEYWORD_LIMIT "limit"
+#define QUERY_KEYWORD_DESC "DESC"
+#define QUERY_KEYWORD_SPACE " "
+#define QUERY_KEYWORD_OPEN_BRACKET "("
+#define QUERY_KEYWORD_BRACKET ")"
+
+/* DB TABLE JOIN */
+/*#define FOLDER_MEDIA_JOIN                                    "("DB_TABLE_FOLDER" AS f LEFT OUTER JOIN '%s' AS m ON f.folder_uuid=m.folder_uuid AND m.validity=1) WHERE f.storage_uuid IN (SELECT storage_uuid FROM "DB_TABLE_STORAGE" WHERE validity=1) " */
+#define FOLDER_MEDIA_JOIN                                      "("DB_TABLE_FOLDER" AS f LEFT OUTER JOIN '%s' AS m ON f.folder_uuid=m.folder_uuid AND m.validity=1) WHERE f.validity=1 "
+#define BOOKMARK_MEDIA_JOIN                            "("DB_TABLE_BOOKMARK" AS b INNER JOIN '%s' AS m \
+                                                                                       ON (b.media_uuid = m.media_uuid)) WHERE m.validity=1"
+#define ALBUM_MEDIA_JOIN                                       "("DB_TABLE_ALBUM" AS a INNER JOIN '%s' AS m \
+                                                                                       ON (a.album_id = m.album_id)) WHERE m.validity=1"
+#define FACE_MEDIA_JOIN                                                "("DB_TABLE_FACE" AS fa INNER JOIN '%s' AS m \
+                                                                                               ON (fa.media_uuid = m.media_uuid)) WHERE m.validity=1"
+
+/* Get Group info */
+#define SELECT_MEDIA_GROUP_AND_COUNT           "SELECT %s, COUNT(*) FROM '%s' WHERE validity=1 "
+
+/* Get Group List */
+#define SELECT_ALBUM_LIST                      "SELECT DISTINCT a.album_id, a.name, a.artist, a.album_art FROM "ALBUM_MEDIA_JOIN
+#define SELECT_MEDIA_GROUP_LIST        "SELECT DISTINCT %s FROM '%s' WHERE validity=1 "
+
+#define SELECT_FOLDER_LIST                     "SELECT DISTINCT f.folder_uuid, f.path, f.name, f.storage_type, f.modified_time, f.storage_uuid, f.folder_order, f.parent_folder_uuid FROM "FOLDER_MEDIA_JOIN
+#define SELECT_FOLDER_LIST_BY_STORAGE_ID       SELECT_FOLDER_LIST"AND f.storage_uuid='%s' "
+#define SELECT_TAG_LIST                                "SELECT DISTINCT tag_id, name FROM "DB_VIEW_TAG" WHERE 1 "
+#define SELECT_PLAYLIST_LIST                   "SELECT DISTINCT playlist_id, name, p_thumbnail_path FROM "DB_VIEW_PLAYLIST" WHERE 1 "
+
+/* Get Group Count */
+#define SELECT_ALBUM_COUNT             "SELECT COUNT(DISTINCT a.album_id) FROM "ALBUM_MEDIA_JOIN
+#define SELECT_FOLDER_COUNT            "SELECT COUNT(DISTINCT f.folder_uuid) FROM "FOLDER_MEDIA_JOIN
+#define SELECT_FOLDER_COUNT_BY_STORAGE_ID              SELECT_FOLDER_COUNT"AND f.storage_uuid='%s' "
+#define SELECT_TAG_COUNT                       "SELECT COUNT(DISTINCT tag_id) FROM "DB_VIEW_TAG" WHERE 1 "
+#define SELECT_PLAYLIST_COUNT          "SELECT COUNT(DISTINCT playlist_id) FROM "DB_VIEW_PLAYLIST" WHERE 1 "
+#define SELECT_BOOKMARK_COUNT  "SELECT COUNT(DISTINCT b.bookmark_id) FROM "BOOKMARK_MEDIA_JOIN
+#define SELECT_MEDIA_GROUP_COUNT       "SELECT COUNT(*) FROM ("SELECT_MEDIA_GROUP_LIST
+/*count(distinct x) count only non-null values, but select distinct X returns include null. so sync the result of count and list, don't use count(distinct x)*/
+
+/* Get Media Count of Group */
+#define SELECT_MEDIA_COUNT_FROM_MEDIA                  "SELECT COUNT(*) FROM ("SELECT_MEDIA_ITEM               /*to apply limit condition. "SELECT COUNT(*) FROM "DB_TABLE_MEDIA" WHERE validity=1" */
+#define SELECT_MEDIA_COUNT_FROM_MEDIA_SIMPLE   "SELECT COUNT(*) FROM '%s' WHERE validity=1 "
+#define SELECT_MEDIA_COUNT_FROM_ALBUM                  "SELECT COUNT(*) FROM '%s' WHERE validity=1 AND album_id='%d'"
+#define SELECT_MEDIA_COUNT_FROM_GROUP                  "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP         /*to apply limit condition. */
+#define SELECT_MEDIA_COUNT_FROM_GROUP_NULL             "SELECT COUNT(*) FROM ("SELECT_MEDIA_FROM_GROUP_NULL    /* to apply limit condition. */
+#define SELECT_MEDIA_COUNT_FROM_FOLDER                 "SELECT COUNT(*) FROM '%s' WHERE validity=1 AND folder_uuid='%q'"
+#define SELECT_MEDIA_COUNT_FROM_STORAGE                        "SELECT COUNT(*) FROM '%s' WHERE validity=1 AND storage_uuid='%q'"
+#define SELECT_MEDIA_COUNT_FROM_TAG                            "SELECT COUNT(*) FROM "DB_VIEW_TAG" WHERE (tag_id=%d AND media_count>0) "
+#define SELECT_MEDIA_COUNT_FROM_PLAYLIST                       "SELECT COUNT(*) FROM "DB_VIEW_PLAYLIST" WHERE (playlist_id=%d and media_count>0) "
+
+/* Get Group Info by Group ID*/
+#define SELECT_ALBUM_FROM_ALBUM                "SELECT * FROM "DB_TABLE_ALBUM" WHERE album_id=%d"
+#define SELECT_FOLDER_FROM_FOLDER              "SELECT * FROM "DB_TABLE_FOLDER" WHERE folder_uuid='%s'"
+#define SELECT_FOLDER_BY_PATH                  "SELECT * FROM "DB_TABLE_FOLDER" WHERE path='%q'"
+#define SELECT_PLAYLIST_FROM_PLAYLIST  "SELECT * FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d"
+#define SELECT_TAG_FROM_TAG                    "SELECT * FROM "DB_TABLE_TAG" WHERE tag_id=%d"
+#define SELECT_TAG_BY_NAME                             "SELECT * FROM "DB_TABLE_TAG" WHERE name='%q'"
+
+/* Tag info*/
+#define INSERT_TAG_TO_TAG                                              "INSERT INTO "DB_TABLE_TAG" (name) VALUES (%Q)"
+#define REMOVE_TAG_ITEM_FROM_TAG_MAP           "DELETE FROM "DB_TABLE_TAG_MAP" WHERE tag_id=%d AND media_uuid='%q';"
+#define UPDATE_TAG_NAME_FROM_TAG                       "UPDATE "DB_TABLE_TAG" SET name='%q' WHERE tag_id=%d;"
+#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 */
+#ifdef _USE_SENIOR_MODE
+#define MEDIA_INFO_ITEM "media_uuid, path, file_name, media_type, mime_type, size, added_time, modified_time, thumbnail_path, description, \
+                                                       rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status, storage_uuid, is_360, extract_flag, modified_date, contact, app_data"
+#else
+#define MEDIA_INFO_ITEM "media_uuid, path, file_name, media_type, mime_type, size, added_time, modified_time, thumbnail_path, description, \
+                                                       rating, favourite, author, provider, content_name, category, location_tag, age_rating, keyword, is_drm, storage_type, longitude, latitude, altitude, exposure_time, fnumber, iso, model, width, height, datetaken, orientation, title, album, artist, album_artist, genre, composer, year, recorded_date, copyright, track_num, bitrate, bitpersample, duration, played_count, last_played_time, last_played_position, samplerate, channel, burst_id, timeline, weather, sync_status, storage_uuid, is_360, extract_flag, modified_date"
+#endif
+
+/*Folder info*/
+#define UPDATE_FOLDER_ORDER                                    "UPDATE "DB_TABLE_FOLDER" SET folder_order=%d WHERE folder_uuid=%Q"
+
+/* 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;"
+#define UPDATE_PLAYLIST_ORDER_FROM_PLAYLIST_MAP                "UPDATE "DB_TABLE_PLAYLIST_MAP" SET play_order=%d WHERE playlist_id=%d AND _id=%d;"
+
+/* Bookmark */
+#define INSERT_BOOKMARK_TO_BOOKMARK                    "INSERT INTO "DB_TABLE_BOOKMARK" (media_uuid, marked_time, thumbnail_path) VALUES ('%q', '%d', %Q)"
+#define SELECT_BOOKMARK_COUNT_BY_MEDIA_ID              "SELECT COUNT(*) FROM "BOOKMARK_MEDIA_JOIN" AND b.media_uuid='%s'"
+#define SELECT_BOOKMARK_LIST_BY_MEDIA_ID                       "SELECT b.bookmark_id, b.media_uuid, b.marked_time, b.thumbnail_path FROM "BOOKMARK_MEDIA_JOIN" AND b.media_uuid='%s'"
+
+/* Update Meta*/
+#define UPDATE_AV_META_FROM_MEDIA      "UPDATE '%s' SET played_count=%d, last_played_time=%d, last_played_position=%d WHERE media_uuid='%q'"
+#define UPDATE_IMAGE_META_FROM_MEDIA   "UPDATE '%s' SET orientation=%d, weather=%Q WHERE media_uuid='%q'"
+
+#define UPDATE_VIDEO_MM_DATA_FROM_MEDIA                "UPDATE '%s' SET bitrate=%d, duration=%d, width=%d, height=%d WHERE media_uuid='%q'"
+#define UPDATE_AUDIO_MM_DATA_FROM_MEDIA                "UPDATE '%s' SET duration=%d, bitrate=%d, bitpersample=%d, samplerate=%d, channel=%d WHERE media_uuid='%q'"
+#define UPDATE_IMAGE_MM_DATA_FROM_MEDIA                "UPDATE '%s' SET width=%d, height=%d WHERE media_uuid='%q'"
+#define SELECT_VIDEO_MM_DATA_FROM_MEDIA                "SELECT bitrate, duration, width, height FROM '%s' WHERE media_uuid='%q'"
+#define SELECT_AUDIO_MM_DATA_FROM_MEDIA                "SELECT duration, bitrate, bitpersample, samplerate, channel FROM '%s' WHERE media_uuid='%q'"
+#define SELECT_IMAGE_MM_DATA_FROM_MEDIA                "SELECT width, height FROM '%s' WHERE media_uuid='%q'"
+
+#define SELECT_MEDIA_ITEM                                      "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1"
+#define SELECT_MEDIA_FROM_MEDIA                        "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND media_uuid='%s'"
+#define SELECT_MEDIA_BY_PATH                           "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND path='%q'"
+#define SELECT_MEDIA_FROM_ALBUM                        "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND album_id=%d"
+#define SELECT_MEDIA_FROM_GROUP                        "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND %s='%q'"
+#define SELECT_MEDIA_FROM_GROUP_NULL   "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND %s IS NULL"
+#define SELECT_MEDIA_FROM_FOLDER                       "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND folder_uuid='%s'"
+#define SELECT_MEDIA_FROM_STORAGE              "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE validity=1 AND storage_uuid='%s'"
+#define SELECT_MEDIA_FROM_TAG                          "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE media_uuid IN (SELECT media_uuid FROM "DB_TABLE_TAG_MAP" WHERE tag_id=%d) AND validity=1"
+#define SELECT_MEDIA_FROM_PLAYLIST             "SELECT "MEDIA_INFO_ITEM" FROM '%s' WHERE media_uuid IN (SELECT media_uuid FROM "DB_TABLE_PLAYLIST_MAP" WHERE playlist_id=%d) AND validity=1"
+#define SELECT_MEDIA_PATH_BY_ID                        "SELECT path FROM "DB_TABLE_MEDIA_VIEW" WHERE media_uuid='%q'"
+#define SELECT_MEDIA_STORAGE_ID_BY_ID          "SELECT storage_uuid FROM "DB_TABLE_MEDIA_VIEW" WHERE media_uuid='%q'"
+
+/* Delete */
+#define DELETE_MEDIA_FROM_MEDIA_BATCH  "DELETE FROM  '%s' WHERE %s"
+#define DELETE_PLAYLIST_FROM_PLAYLIST          "DELETE FROM "DB_TABLE_PLAYLIST" WHERE playlist_id=%d"
+#define DELETE_TAG_FROM_TAG                            "DELETE FROM "DB_TABLE_TAG" WHERE tag_id=%d"
+#define DELETE_BOOKMARK_FROM_BOOKMARK  "DELETE FROM "DB_TABLE_BOOKMARK" WHERE bookmark_id=%d"
+
+/* Storage*/
+#define SELECT_STORAGE_COUNT                           "SELECT COUNT(*) FROM "DB_TABLE_STORAGE" WHERE validity=1"
+#define SELECT_STORAGE_LIST                                    "SELECT * FROM "DB_TABLE_STORAGE" WHERE validity=1"
+#define SELECT_STORAGE_INFO_FROM_STORAGE       "SELECT * FROM "DB_TABLE_STORAGE" WHERE validity=1 AND storage_uuid='%s'"
+
+/* Face */
+#define DELETE_FACE_FROM_FACE                  "DELETE FROM "DB_TABLE_FACE" WHERE face_uuid='%q'"
+#define INSERT_FACE_TO_FACE                            "INSERT INTO "DB_TABLE_FACE" (face_uuid, media_uuid, face_rect_x , face_rect_y, face_rect_w, face_rect_h, orientation, face_tag) VALUES ('%q', '%q', %d, %d, %d, %d, %d, %Q);"
+#define UPDATE_FACE_TO_FACE                    "UPDATE "DB_TABLE_FACE" SET face_rect_x=%d, face_rect_y=%d, face_rect_w=%d, face_rect_h=%d, orientation=%d, face_tag=%Q WHERE face_uuid='%q'"
+#define SELECT_MEDIA_COUNT_FROM_MEDIA_BY_ID            "SELECT COUNT(*) FROM "DB_TABLE_MEDIA_VIEW" WHERE media_uuid='%q' AND validity=1"
+#define SELECT_FACE_COUNT_BY_MEDIA_ID          "SELECT COUNT(*) FROM "FACE_MEDIA_JOIN" AND fa.media_uuid='%s'"
+#define SELECT_FACE_LIST_BY_MEDIA_ID           "SELECT fa.face_uuid, fa.media_uuid, fa.face_rect_x, fa.face_rect_y, fa.face_rect_w, fa.face_rect_h, fa.orientation, fa.face_tag FROM "FACE_MEDIA_JOIN" AND fa.media_uuid='%s'"
+#define SELECT_FACE_PATH_FROM_MEDIA            "SELECT path FROM "DB_TABLE_MEDIA_VIEW" media_uuid='%s'"
+
+#define DEFAULT_MEDIA_STORAGE_ID                       "media"
+
+#define SELECT_VALID_STORAGE_FROM_PVR  "WHERE storage_uuid IN (SELECT storage_uuid FROM "DB_TABLE_STORAGE" WHERE validity=1)"
+#define SELECT_PVR_COUNT                                       "SELECT COUNT(*) FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR
+#define SELECT_PVR_LIST                                        "SELECT * FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR
+#define SELECT_PVR_COUNT_BY_STORAGE_ID SELECT_PVR_COUNT" AND storage_uuid='%s'"
+#define SELECT_PVR_LIST_BY_STORAGE_ID          SELECT_PVR_LIST" AND storage_uuid='%s'"
+#define SELECT_PVR_FROM_PVR                            "SELECT * FROM "DB_TABLE_PVR" WHERE media_uuid='%q'"
+#define UPDATE_PVR_META_FROM_PVR               "UPDATE "DB_TABLE_PVR" SET program_title=%Q, content_lock=%d, content_watch=%d, play_count=%d, highlight=%d WHERE media_uuid='%q'"
+#define UPDATE_PVR_LOCAL_RECORD_PVR            "UPDATE "DB_TABLE_PVR" SET is_local_record=%d WHERE path='%q' AND storage_uuid='%q'"
+
+#define SELECT_PVR_GROUP_LIST                                          "SELECT DISTINCT %s FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR
+#define SELECT_PVR_GROUP_LIST_BY_STORAGE_ID            "SELECT DISTINCT %s FROM "DB_TABLE_PVR" WHERE storage_uuid='%s'"
+#define SELECT_PVR_GROUP_COUNT                                 "SELECT COUNT(*) FROM ("SELECT_PVR_GROUP_LIST
+#define SELECT_PVR_GROUP_COUNT_BY_STORAGE_ID   "SELECT COUNT(*) FROM ("SELECT_PVR_GROUP_LIST_BY_STORAGE_ID
+#define SELECT_PVR_FROM_GROUP                                          "SELECT * FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR" AND %s='%q'"
+#define SELECT_PVR_FROM_GROUP_BY_STORAGE_ID            "SELECT * FROM "DB_TABLE_PVR" WHERE storage_uuid='%s' AND %s='%q'"
+#define SELECT_PVR_COUNT_FROM_GROUP                            "SELECT COUNT(*) FROM ("SELECT_PVR_FROM_GROUP
+#define SELECT_PVR_COUNT_FROM_GROUP_BY_STORAGE_ID      "SELECT COUNT(*) FROM ("SELECT_PVR_FROM_GROUP_BY_STORAGE_ID
+#define SELECT_PVR_FROM_GROUP_NULL                                     "SELECT * FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR" AND %s IS NULL"
+#define SELECT_PVR_FROM_GROUP_NULL_BY_STORAGE_ID       "SELECT * FROM "DB_TABLE_PVR" WHERE storage_uuid='%s' AND %s IS NULL"
+#define SELECT_PVR_COUNT_FROM_GROUP_NULL                       "SELECT COUNT(*) FROM ("SELECT_PVR_FROM_GROUP_NULL
+#define SELECT_PVR_COUNT_FROM_GROUP_NULL_BY_STORAGE_ID "SELECT COUNT(*) FROM ("SELECT_PVR_FROM_GROUP_NULL_BY_STORAGE_ID
+#define SELECT_PVR_GROUP_AND_COUNT_BY_STORAGE_ID               "SELECT %s, COUNT(*) FROM "DB_TABLE_PVR" WHERE storage_uuid='%s'"
+#define SELECT_PVR_GROUP_AND_COUNT                                             "SELECT %s, COUNT(*) FROM "DB_TABLE_PVR" "SELECT_VALID_STORAGE_FROM_PVR
+
+#define SELECT_VALID_STORAGE_FROM_UHD  "WHERE storage_uuid IN (SELECT storage_uuid FROM "DB_TABLE_STORAGE" WHERE validity=1)"
+#define SELECT_UHD_GROUP_LIST                                          "SELECT DISTINCT %s FROM "DB_TABLE_UHD" "SELECT_VALID_STORAGE_FROM_UHD
+#define SELECT_UHD_GROUP_LIST_BY_STORAGE_ID            "SELECT DISTINCT %s FROM "DB_TABLE_UHD" WHERE storage_uuid='%s'"
+#define SELECT_UHD_GROUP_COUNT                                 "SELECT COUNT(*) FROM ("SELECT_UHD_GROUP_LIST
+#define SELECT_UHD_GROUP_COUNT_BY_STORAGE_ID   "SELECT COUNT(*) FROM ("SELECT_UHD_GROUP_LIST_BY_STORAGE_ID
+#define SELECT_UHD_FROM_GROUP                                          "SELECT * FROM "DB_TABLE_UHD" "SELECT_VALID_STORAGE_FROM_UHD" AND %s='%q'"
+#define SELECT_UHD_FROM_GROUP_BY_STORAGE_ID            "SELECT * FROM "DB_TABLE_UHD" WHERE storage_uuid='%s' AND %s='%q'"
+#define SELECT_UHD_COUNT_FROM_GROUP                            "SELECT COUNT(*) FROM ("SELECT_UHD_FROM_GROUP
+#define SELECT_UHD_COUNT_FROM_GROUP_BY_STORAGE_ID      "SELECT COUNT(*) FROM ("SELECT_UHD_FROM_GROUP_BY_STORAGE_ID
+#define SELECT_UHD_FROM_GROUP_NULL                                     "SELECT * FROM "DB_TABLE_UHD" "SELECT_VALID_STORAGE_FROM_UHD" AND %s IS NULL"
+#define SELECT_UHD_FROM_GROUP_NULL_BY_STORAGE_ID       "SELECT * FROM "DB_TABLE_UHD" WHERE storage_uuid='%s' AND %s IS NULL"
+#define SELECT_UHD_COUNT_FROM_GROUP_NULL                       "SELECT COUNT(*) FROM ("SELECT_UHD_FROM_GROUP_NULL
+#define SELECT_UHD_COUNT_FROM_GROUP_NULL_BY_STORAGE_ID "SELECT COUNT(*) FROM ("SELECT_UHD_FROM_GROUP_NULL_BY_STORAGE_ID
+#define SELECT_UHD_GROUP_AND_COUNT_BY_STORAGE_ID               "SELECT %s, COUNT(*) FROM "DB_TABLE_UHD" WHERE storage_uuid='%s'"
+#define SELECT_UHD_GROUP_AND_COUNT                                             "SELECT %s, COUNT(*) FROM "DB_TABLE_UHD" "SELECT_VALID_STORAGE_FROM_UHD
+
+#define SELECT_UHD_COUNT                                       "SELECT COUNT(*) FROM "DB_TABLE_UHD" "SELECT_VALID_STORAGE_FROM_UHD
+#define SELECT_UHD_COUNT_BY_STORAGE_ID SELECT_UHD_COUNT" AND storage_uuid='%s'"
+#define SELECT_UHD_LIST                                        "SELECT * FROM "DB_TABLE_UHD" "SELECT_VALID_STORAGE_FROM_UHD
+#define SELECT_UHD_LIST_BY_STORAGE_ID  SELECT_UHD_LIST" AND storage_uuid='%s'"
+#define SELECT_UHD_FROM_UHD                            "SELECT * FROM "DB_TABLE_UHD" WHERE media_uuid='%q'"
+#define UPDATE_UHD_META_FROM_UHD               "UPDATE "DB_TABLE_UHD" SET content_title=%Q, release_date=%Q, played_position=%d, sub_type=%d, played_count=%d WHERE media_uuid='%q'"
+
+int _content_query_prepare(sqlite3_stmt **stmt, char *select_query, char *condition_query, char *option_query);
+int _content_error_capi(int type, int cotent_error);
+int _content_query_sql(char *query_str);
+MediaSvcHandle* _content_get_db_handle(void);
+attribute_h _content_get_attirbute_handle(void);
+attribute_h _content_get_alias_attirbute_handle(void);
+int _media_info_get_media_info_from_db(const char *path, const char *storage_id, media_info_h media);
+void _media_info_item_get_detail(sqlite3_stmt *stmt, media_info_h media);
+int _media_db_get_group_count(filter_h filter, group_list_e group_type, int *group_count);
+int _media_db_get_media_group_count(media_group_e group, filter_h filter, int *group_count);
+int _media_db_get_media_group(media_group_e group, filter_h filter, media_group_cb callback, void *user_data);
+int _media_db_get_media_group_and_count(media_group_e group, filter_h filter, media_group_and_count_cb callback, void *user_data);
+int _media_db_get_album(filter_h filter, media_album_cb callback, void *user_data);
+int _media_db_get_folder(filter_h filter, media_folder_cb callback, void *user_data);
+int _media_db_get_playlist(filter_h filter, media_playlist_cb callback, void *user_data);
+int _media_db_get_playlist_item(int playlist_id, filter_h filter, playlist_member_cb callback, void *user_data);
+int _media_db_get_tag(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data);
+int _media_db_get_bookmark(const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
+int _media_db_get_face(const char *media_id, filter_h filter, media_face_cb callback, void *user_data);
+int _media_db_get_group_item_count_by_id(int group_id, filter_h filter, group_list_e group_type, int *item_count);
+int _media_db_get_group_item_count(const char *group_name, filter_h filter, group_list_e group_type, int *item_count);
+int _media_db_get_group_item_by_id(int group_id, filter_h filter, media_info_cb callback, void *user_data, group_list_e group_type);
+int _media_db_get_group_item(const char *group_name, filter_h filter, media_info_cb callback, void *user_data, group_list_e group_type);
+#ifdef _USE_SENIOR_MODE
+int _content_query_prepare_by_union_select(sqlite3_stmt **stmt, char *select_query1, char *condition_query1, char *option_query1, char *select_query2, char *condition_query2, char *option_query2);
+int _media_db_get_group_item_by_union_select(const char *group_name, filter_h filter1, filter_h filter2, media_info_cb callback, void *user_data);
+#endif
+int _media_db_get_media_group_item_count(const char *group_name, filter_h filter, media_group_e group, int *item_count);
+int _media_db_get_media_group_item(const char *group_name, filter_h filter, media_group_e group, media_info_cb callback, void *user_data);
+int _media_db_get_storage(filter_h filter, media_storage_cb callback, void *user_data);
+int _media_db_get_storage_id_by_media_id(const char *media_id, char *storage_id);
+int _media_db_get_storage(filter_h filter, media_storage_cb callback, void *user_data);
+int _media_db_get_storage_id_by_media_id(const char *media_id, char *storage_id);
+int _media_db_get_pvr(filter_h filter, media_pvr_cb callback, void *user_data);
+void _media_pvr_item_get_detail(sqlite3_stmt* stmt, media_pvr_h pvr);
+int _media_db_get_pvr_group_item(const char *group_name, filter_h filter, media_group_e group, media_pvr_cb callback, void *user_data);
+int _media_db_get_uhd(filter_h filter, media_uhd_cb callback, void *user_data);
+void _media_uhd_item_get_detail(sqlite3_stmt* stmt, media_uhd_h uhd);
+
+/**
+ * @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.
+ * @remarks The @a handle must be released with media_filter_attribute_destory() by you.
+ * @param[out] filter A handle to media filter attribute
+ * @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 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
+ * @param[in] user_attr The user attribute
+ * @param[in] platform_attr The platform attribute
+ * @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 media_filter_attribute_remove()
+ *
+ */
+int _media_filter_attribute_add(attribute_h atrr, const char *user_attr, const 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
+ * has to be created before the next usage.
+ *
+ * @param[in] filter The handle to media filter attribute
+ * @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
+ * @param[in] user_attr The user attribute
+ * @param[in] platform_attr The platform attribute
+ * @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 media_filter_attribute_create()
+ * @see media_filter_attribute_destory()
+ *
+ */
+int _media_filter_attribute_generate(attribute_h attr, char *condition, media_content_collation_e collate_type, char **generated_condition);
+
+
+/**
+ * @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
+ * @param[in] attr The attribute
+ * @param[in] generated_option The handle to generated option
+ * @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_DB_FAILED Filed DB
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ * @see media_filter_attribute_create()
+ * @see media_filter_attribute_destory()
+ *
+ */
+
+int _media_filter_attribute_option_generate(attribute_h attr, filter_h filter, char **generated_option);
+
+GMutex* _content_get_db_mutex(void);
+
+
+#define FONT_COLOR_RESET    "\033[0m"
+#define FONT_COLOR_RED      "\033[31m"
+#define FONT_COLOR_GREEN    "\033[32m"
+#define FONT_COLOR_YELLOW   "\033[33m"
+#define FONT_COLOR_BLUE     "\033[34m"
+#define FONT_COLOR_PURPLE   "\033[35m"
+#define FONT_COLOR_CYAN     "\033[36m"
+#define FONT_COLOR_GRAY     "\033[37m"
+
+#define media_content_gettid() syscall(__NR_gettid)
+
+#define media_content_retv_if(expr, val) do { \
+                       if (expr) { \
+                               LOGE(FONT_COLOR_RED"[%d]", media_content_gettid());    \
+                               return (val); \
+                       } \
+               } while (0)
+
+#define media_content_retvm_if(expr, val, fmt, arg...) do { \
+                       if (expr) { \
+                               LOGE(FONT_COLOR_RED"[%d]"fmt"", media_content_gettid(), ##arg);     \
+                               return (val); \
+                       } \
+               } while (0)
+
+#define media_content_debug(fmt, arg...) do { \
+                       LOGD(FONT_COLOR_RESET"[%d]"fmt"", media_content_gettid(), ##arg);     \
+               } while (0)
+
+#define media_content_info(fmt, arg...) do { \
+                       LOGI(FONT_COLOR_GREEN"[%d]"fmt"", media_content_gettid(), ##arg);     \
+               } while (0)
+
+#define media_content_error(fmt, arg...) do { \
+                       LOGE(FONT_COLOR_RED"[%d]"fmt"", media_content_gettid(), ##arg);     \
+               } while (0)
+
+#define media_content_debug_func() do { \
+                       LOGD(FONT_COLOR_RESET"[%d]", media_content_gettid());     \
+               } while (0)
+
+#define media_content_sec_debug(fmt, arg...) do { \
+                       SECURE_LOGD(FONT_COLOR_RESET"[%d]"fmt"", media_content_gettid(), ##arg);     \
+               } while (0)
+
+#define media_content_sec_warn(fmt, arg...) do { \
+                       SECURE_LOGW(FONT_COLOR_GREEN"[%d]"fmt"", media_content_gettid(), ##arg);     \
+               } while (0)
+
+#define media_content_sec_error(fmt, arg...) do { \
+                       SECURE_LOGE(FONT_COLOR_RED"[%d]"fmt"", media_content_gettid(), ##arg);     \
+               } while (0)
+
+#define ERR_BUF_LENGTH 256
+#define media_content_stderror(fmt) do { \
+                       char media_content_stderror_buf[ERR_BUF_LENGTH] = {0, }; \
+                       strerror_r(errno, media_content_stderror_buf, ERR_BUF_LENGTH);  \
+                       LOGE(FONT_COLOR_RED fmt" : STANDARD ERROR [%s]", media_content_stderror_buf); \
+               } while (0)
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /*__TIZEN_MEDIA_INFO_PRIVATE_H__*/
diff --git a/include_product/media_playlist.h b/include_product/media_playlist.h
new file mode 100755 (executable)
index 0000000..fdd233c
--- /dev/null
@@ -0,0 +1,563 @@
+/*
+* 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_PLAYLIST_H__
+#define __TIZEN_MEDIA_PLAYLIST_H__
+
+#include <media_content_type.h>
+
+#ifdef __cplusplus
+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
+ * @{
+ */
+
+
+/**
+ * @brief Gets the number of playlists for the passed @a filter from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_playlist_get_playlist_count_from_db(filter_h filter, int *playlist_count);
+
+/**
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_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 the number of the media info for the given playlist present in the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_playlist_get_media_count_from_db(int playlist_id, filter_h filter, int *media_count);
+
+/**
+ * @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 @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_info_cb().
+ *
+ * @see media_info_cb()
+ * @see media_content_connect()
+ * @see media_filter_create()
+ */
+int media_playlist_foreach_media_from_db(int playlist_id, filter_h filter, playlist_member_cb callback, void *user_data);
+
+/**
+ * @brief Inserts a new playlist with the given name into the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks You must release the created handle using media_playlist_destroy().
+ *
+ * @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_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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @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_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_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 @a playlist_id.
+ *          The media playlist will be created and will be filled with the playlist information.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ * @see media_playlist_destroy()
+ */
+int media_playlist_get_playlist_from_db(int playlist_id, media_playlist_h *playlist);
+
+/**
+ * @brief Destroys a playlist handle.
+ * @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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 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 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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_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 the media playlist ID.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a playlist_name using free().
+ *
+ * @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 name of the playlist.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] playlist      The media playlist handle
+ * @param[in] playlist_name The name of the 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_PERMISSION_DENIED Permission denied
+ *
+ * @post media_playlist_update_to_db()
+ *
+ */
+int media_playlist_set_name(media_playlist_h playlist, const char *playlist_name);
+
+/**
+ * @brief Gets a thumbnail path of the playlist.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a path using free().
+ *
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] playlist The media playlist handle
+ * @param[in] 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
+ *
+ * @post media_playlist_update_to_db()
+ */
+int media_playlist_set_thumbnail_path(media_playlist_h playlist, const char *path);
+
+
+/**
+ * @brief Sets the playing order in the playlist.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 members related with the media from the given playlist.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 of the playlist.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_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_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);
+
+/**
+ * @brief Imports the playlist from m3u playlist file.
+ * @details This api reads a playlist from the m3u playlist file and insert into the db.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks   http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
+ *                     http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
+ *                     This api does not support the file of extended m3u playlist.
+ *
+ * @param[in] playlist_name The name of the playlist to save
+ * @param[in] path The path to import the playlist file
+ * @param[out] playlist The media playlist handle
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int media_playlist_import_from_file(const char *playlist_name, const char *path, media_playlist_h *playlist);
+
+/**
+ * @brief Exports the playlist to m3u playlist file.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks   http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
+ *                     http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
+ *
+ * @param[in] playlist The media playlist handle
+ * @param[in] path path The path to export the playlist
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int media_playlist_export_to_file(media_playlist_h playlist, const char* path);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /*__TIZEN_MEDIA_PLAYLIST_H__*/
diff --git a/include_product/media_pvr.h b/include_product/media_pvr.h
new file mode 100755 (executable)
index 0000000..761fa1c
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+* 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_PVR_H__
+#define __TIZEN_MEDIA_PVR_H__
+
+#include <media_content_internal.h>
+#include <media_content_type.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* The enumerations of PVR content Resolution*/
+typedef enum {
+       MEDIA_PVR_RESOLUTION_DEFAULT = 0,
+       MEDIA_PVR_RESOLUTION_288I,
+       MEDIA_PVR_RESOLUTION_480I,
+       MEDIA_PVR_RESOLUTION_480P,
+       MEDIA_PVR_RESOLUTION_576I,
+       MEDIA_PVR_RESOLUTION_576P,
+       MEDIA_PVR_RESOLUTION_720P,
+       MEDIA_PVR_RESOLUTION_1080I,
+       MEDIA_PVR_RESOLUTION_1080P,
+       MEDIA_PVR_RESOLUTION_AUDIO_ONLY,
+       MEDIA_PVR_RESOLUTION_MAX
+} media_pvr_resolution_e;
+
+/* The enumerations of PVR content aspectratio*/
+typedef enum {
+       MEDIA_PVR_ASPECTRATIO_UNKNOWN   = 0,
+       MEDIA_PVR_ASPECTRATIO_100_100           = 1, /* 1:1 */
+       MEDIA_PVR_ASPECTRATIO_300_400           = 2, /* 3:4 */
+       MEDIA_PVR_ASPECTRATIO_900_1600  = 3, /* 9:16 */
+       MEDIA_PVR_ASPECTRATIO_100_221           = 4, /* 1:2.21 */
+} media_pvr_aspectratio_e;
+
+int media_pvr_get_media_count_from_db(filter_h filter, int *media_count);
+int media_pvr_foreach_media_from_db(filter_h filter, media_pvr_cb callback, void *user_data);
+int media_pvr_destroy(media_pvr_h pvr);
+int media_pvr_clone(media_pvr_h *dst, media_pvr_h src);
+int media_pvr_get_pvr_from_db(const char *media_id, media_pvr_h *pvr);
+int media_pvr_get_media_id(media_pvr_h pvr, char **media_id);
+int media_pvr_get_channel_name(media_pvr_h pvr, char **channel_name);
+int media_pvr_get_channel_num(media_pvr_h pvr, char **channel_num);
+int media_pvr_get_program_title(media_pvr_h pvr, char **program_title);
+int media_pvr_get_program_crid(media_pvr_h pvr, char **program_crid);
+int media_pvr_get_guidance(media_pvr_h pvr, char **guidance);
+int media_pvr_get_synopsis(media_pvr_h pvr, char **synopsis);
+int media_pvr_get_genre(media_pvr_h pvr, char **genre);
+int media_pvr_get_language(media_pvr_h pvr, char **language);
+int media_pvr_get_path(media_pvr_h pvr, char **path);
+int media_pvr_get_storage_id(media_pvr_h pvr, char **storage_id);
+int media_pvr_get_size(media_pvr_h pvr, unsigned long long *size);
+int media_pvr_get_timezone(media_pvr_h pvr, int *timezone);
+int media_pvr_get_ptc(media_pvr_h pvr, int *ptc);
+int media_pvr_get_major(media_pvr_h pvr, int *major);
+int media_pvr_get_minor(media_pvr_h pvr, int *minor);
+int media_pvr_get_channel_type(media_pvr_h pvr, int *channel_type);
+int media_pvr_get_program_num(media_pvr_h pvr, int *program_num);
+int media_pvr_get_duration(media_pvr_h pvr, int *duration);
+int media_pvr_get_embargo_time(media_pvr_h pvr, int *embaro_time);
+int media_pvr_get_expiry_time(media_pvr_h pvr, int *expiry_time);
+int media_pvr_get_parental_rating(media_pvr_h pvr, int *parental_rating);
+int media_pvr_get_start_time(media_pvr_h pvr, int *start_time);
+int media_pvr_get_program_start_time(media_pvr_h pvr, int *program_start_time);
+int media_pvr_get_program_end_time(media_pvr_h pvr, int *end_time);
+int media_pvr_get_program_date(media_pvr_h pvr, int *program_date);
+int media_pvr_get_timer_record(media_pvr_h pvr, bool* timer_record);
+int media_pvr_get_series_record(media_pvr_h pvr, bool* series_record);
+int media_pvr_get_hd(media_pvr_h pvr, int* hd);
+int media_pvr_get_subtitle(media_pvr_h pvr, bool* subtitle);
+int media_pvr_get_ttx(media_pvr_h pvr, bool* ttx);
+int media_pvr_get_ad(media_pvr_h pvr, bool* ad);
+int media_pvr_get_hard_of_hearing_radio(media_pvr_h pvr, bool* hardOfHearingRadio);
+int media_pvr_get_data_service(media_pvr_h pvr, bool* data_service);
+int media_pvr_get_content_lock(media_pvr_h pvr, bool* content_lock);
+int media_pvr_get_content_watch(media_pvr_h pvr, bool* content_watch);
+int media_pvr_get_has_audio_only(media_pvr_h pvr, bool* has_audio_only);
+int media_pvr_get_is_local_record(media_pvr_h pvr, bool* is_local_record);
+int media_pvr_get_resolution(media_pvr_h pvr, media_pvr_resolution_e* resolution);
+int media_pvr_get_aspectratio(media_pvr_h pvr, media_pvr_aspectratio_e* aspectratio);
+int media_pvr_get_modified_month(media_pvr_h pvr, char **modified_month);
+int media_pvr_get_sports_type(media_pvr_h pvr, int* sports_type);
+int media_pvr_get_guidance_length(media_pvr_h pvr, int* guidance_length);
+int media_pvr_get_tvmode(media_pvr_h pvr, int* tvmode);
+int media_pvr_get_play_count(media_pvr_h pvr, int* play_count);
+int media_pvr_get_private_data(media_pvr_h pvr, char **private_data);
+int media_pvr_get_highlight(media_pvr_h pvr, bool *highlight);
+int media_pvr_set_play_count(media_pvr_h pvr, int play_count);
+int media_pvr_set_program_title(media_pvr_h pvr, const char *program_title);
+int media_pvr_set_content_lock(media_pvr_h pvr, bool content_lock);
+int media_pvr_set_content_watch(media_pvr_h pvr, bool content_watch);
+int media_pvr_set_highlight(media_pvr_h pvr, bool highlight);
+int media_pvr_update_to_db(media_pvr_h pvr);
+int media_pvr_group_foreach_media_from_db(const char *group_name, media_group_e group, filter_h filter, media_pvr_cb callback, void *user_data);
+int media_pvr_set_is_local_record(const char *pvr_path, bool is_local_record);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_PVR_H__ */
diff --git a/include_product/media_storage.h b/include_product/media_storage.h
new file mode 100755 (executable)
index 0000000..3761ee4
--- /dev/null
@@ -0,0 +1,323 @@
+/*
+* Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+
+#ifndef __TIZEN_MEDIA_STORAGE_H__
+#define __TIZEN_MEDIA_STORAGE_H__
+
+
+#include <media_content_type.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file media_storage.h
+ * @brief This file contains API on main functional operations with storage that are related to media resources in the media database. \n
+ *        Operations include: getting number of storages, cloning and destroying storage, getting storage`s ID, name, path and type.
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_STORAGE_MODULE
+ * @{
+ */
+
+/**
+* @brief Gets media storage from database.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @remarks You must release the handle using media_storage_destroy(). \n
+*
+* @param[in] storage_id The storage id to get media storage info
+* @param[out] storage The media storage handle
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY    Out of memory
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB Operation failed
+* @retval #MEDIA_CONTENT_ERROR_DB_BUSY                  DB Operation busy
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+
+*
+* @pre This function requires opened connection to content service by media_content_connect().
+*
+* @see media_content_connect()
+*/
+int media_storage_get_storage_info_from_db(const char *storage_id, media_storage_h *storage);
+
+/**
+* @brief Gets the count of media storage for the passed @a filter from the media database.
+* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+*
+* @param[in] filter The handle to filter
+* @param[out] storage_count The count of storage
+*
+* @return @c 0 on success,
+*           otherwise a negative error value
+*
+* @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+* @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+* @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
+* @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB Operation failed
+* @retval #MEDIA_CONTENT_ERROR_DB_BUSY                  DB Operation busy
+* @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+*
+* @pre This function requires opened connection to content service by media_content_connect().
+*
+* @see media_content_connect()
+*/
+int media_storage_get_storage_count_from_db(filter_h filter, int *storage_count);
+
+/**
+ * @brief Iterates through media storage from the media database.
+ * @details This function gets all media storage handles meeting the given @a filter.
+ *          The @a callback function will be invoked for every retrieved media storage.
+ *          If @c NULL is passed to the @a filter, then no filtering is applied.
+ *
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param[in] filter    The media storage handle filter
+ * @param[in] callback  The callback function to be invoked
+ * @param[in] user_data The user data to be passed to the callback function
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_storage_destroy().
+ *
+ * @see media_content_connect()
+ * @see media_storage_destroy()
+ */
+int media_storage_foreach_storage_from_db(filter_h filter, media_storage_cb callback, void *user_data);
+
+/**
+ * @brief Gets the count of media files for the passed @a filter in the given @a storage from the media database.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param[in] storage_id    The ID of the media storage
+ * @param[in] filter       The filter of the media content
+ * @param[out] media_count The count of media storage items
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_storage_get_media_count_from_db(const char *storage_id, filter_h filter, int *media_count);
+
+/**
+ * @brief Iterates through the media files with an optional @a filter in the given @a storage from the media database.
+ * @details This function gets all media files associated with the given storage and
+ *          meeting desired filter option and calls registered callback function for
+ *          every retrieved media item. If @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks   Do not call updating DB function like media_info_update_to_db(), media_info_refresh_metadata_to_db(), audio_meta_update_to_db(), image_meta_update_to_db() and video_meta_update_to_db()  in your callback function,
+ *                    your callback function is invoked as inline function. \n
+ *                    So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB. \n
+ *                    We do not recommend you call updating DB function in callback of foreach function.
+ *
+ * @param[in] storage_id The ID of the media storage
+ * @param[in] filter    The handle to the media info filter
+ * @param[in] callback  The callback function to be invoked
+ * @param[in] user_data The user data to be passed to the callback function
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_info_cb().
+ *
+ * @see #media_info_cb
+ * @see media_content_connect()
+ * @see media_filter_create()
+ */
+int media_storage_foreach_media_from_db(const char *storage_id, filter_h filter, media_info_cb callback, void *user_data);
+
+/**
+ * @brief Destroys media storage handle.
+ * @details The function frees all resources related to the media storage handle. This handle
+ *          can no longer be used to perform any operation. New media storage handle has to
+ *          be created before the next usage.
+ *
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param[in]  storage  The media storage handle
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @pre Get copy of media_storage_h handle by calling media_storage_clone().
+ *
+ * @see media_storage_clone()
+ */
+int media_storage_destroy(media_storage_h storage);
+
+/**
+ * @brief Clones the media storage handle.
+ *
+ * @details This function copies the media storage handle from a source to the destination.
+ *          There is no media_storage_create() function. The media_storage_h is created internally and
+ *          available through media storage foreach function such as media_storage_foreach_storage_from_db().
+ *          To use this handle outside of these foreach functions, use this function.
+ *
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks You must release the destination handle using media_storage_destroy().
+ *
+ * @param[out] dst  The destination handle to the media storage
+ * @param[in]  src  The source handle to media storage
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @see media_storage_destroy()
+ * @see media_storage_foreach_storage_from_db()
+ * @see media_storage_get_storage_info_from_db()
+ */
+int media_storage_clone(media_storage_h *dst, media_storage_h src);
+
+/**
+ * @brief Gets the storage id of media storage.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks You must release @a storage_id using free().
+ *
+ * @param[in]  storage The media storage handle
+ * @param[out] storage_id  The storage id of the media storage
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ */
+int media_storage_get_id(media_storage_h storage, char **storage_id);
+
+/**
+ * @brief Gets the storage name of media storage.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks You must release @a storage_name using free().
+ *                   If the requested storage is not the cloud storage, this API returns NULL.
+ *
+ * @param[in]  storage The media storage handle
+ * @param[out] storage_name  The storage name of the media storage
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ */
+int media_storage_get_name(media_storage_h storage, char **storage_name);
+
+/**
+ * @brief Gets the storage path of media storage.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @remarks You must release @a storage_path using free().
+ *
+ * @param[in]  storage The media storage handle
+ * @param[out] storage_path  The storage path of the media storage
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ */
+int media_storage_get_path(media_storage_h storage, char **storage_path);
+
+/**
+ * @brief Gets the storage type of media storage.
+ * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
+ *
+ * @param[in]  storage The media storage handle
+ * @param[out] storage_type  The storage type of the media storage
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_storage_get_type(media_storage_h storage, media_content_storage_e *storage_type);
+
+/**
+ * @brief Gets the storage scan status of media storage.
+ * @since_tizen 2.4
+ *
+ * @param[in]  storage The media storage handle
+ * @param[out] scan_status  The storage type of the media storage
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int media_storage_get_scan_status(const char *storage_uuid, media_storage_scan_status_e *scan_status);
+
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_STORAGE_H__ */
diff --git a/include_product/media_tag.h b/include_product/media_tag.h
new file mode 100755 (executable)
index 0000000..bcc28ab
--- /dev/null
@@ -0,0 +1,432 @@
+/*
+* 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_TAG_H__
+#define __TIZEN_MEDIA_TAG_H__
+
+#include <media_content_type.h>
+
+#ifdef __cplusplus
+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
+ * @{
+ */
+
+/**
+ * @brief Inserts a new tag in the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks The 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_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_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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_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_tag_insert_to_db()
+ */
+int media_tag_delete_from_db(int tag_id);
+
+/**
+ * @brief Gets the count of the tag for the passed @a filter from the media database.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_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 @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ */
+int media_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 @c NULL is passed to the @a filter, no filtering is applied.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @post This function invokes media_info_cb().
+ *
+ * @see media_content_connect()
+ * @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);
+
+/**
+ * @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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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 the media tag ID.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a tag_name using free().
+ *
+ * @param[in]  tag      The media tag handle
+ * @param[out] tag_name The name of the 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_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 @a tag_id.
+ *          Media tag will be created and will be filled with tag information.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
+ * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre This function requires opened connection to content service by media_content_connect().
+ *
+ * @see media_content_connect()
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] tag      The media tag handle
+ * @param[in] media_id The ID to the media info which is added
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @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 @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] tag      The media tag handle
+ * @param[in] media_id The ID to the media info which is removed
+ *
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ *
+ * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
+ * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ *
+ * @pre  This function requires opened connection to content service by media_content_connect().
+ * @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 name of the tag.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] tag      The media tag handle
+ * @param[in] tag_name The name 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_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, the media_tag_update_to_db() function should be called so as to update
+ *          the given tag attributes in the media database.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @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
+ * @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_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);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_TAG_H__ */
diff --git a/include_product/media_uhd.h b/include_product/media_uhd.h
new file mode 100755 (executable)
index 0000000..d4e7a93
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+* 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_UHD_H__
+#define __TIZEN_MEDIA_UHD_H__
+
+#include <media_content_internal.h>
+#include <media_content_type.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+int media_uhd_get_media_count_from_db(filter_h filter, int *media_count);
+int media_uhd_foreach_media_from_db(filter_h filter, media_uhd_cb callback, void *user_data);
+int media_uhd_destroy(media_uhd_h uhd);
+int media_uhd_clone(media_uhd_h *dst, media_uhd_h src);
+
+int media_uhd_get_uhd_from_db(const char *media_id, media_uhd_h *uhd);
+int media_uhd_get_media_id(media_uhd_h uhd, char **media_id);
+int media_uhd_get_storage_id(media_uhd_h uhd, char **storage_id);
+int media_uhd_get_path(media_uhd_h uhd, char **path);
+int media_uhd_get_size(media_uhd_h uhd, unsigned long long *size);
+int media_uhd_get_content_id(media_uhd_h uhd, char **content_id);
+int media_uhd_get_content_title(media_uhd_h uhd, char **content_title);
+int media_uhd_get_file_name(media_uhd_h uhd, char **file_name);
+int media_uhd_get_release_date(media_uhd_h uhd, char **release_date);
+int media_uhd_get_modified_time(media_uhd_h uhd, time_t *modified_time);
+int media_uhd_get_played_position(media_uhd_h uhd, int *played_position);
+int media_uhd_get_sub_type(media_uhd_h uhd, int *sub_type);
+int media_uhd_get_played_count(media_uhd_h uhd, int *played_count);
+
+int media_uhd_set_played_position(media_uhd_h uhd, int played_position);
+int media_uhd_set_content_title(media_uhd_h uhd, const char *content_title);
+int media_uhd_set_release_date(media_uhd_h uhd, const char *release_date);
+int media_uhd_set_sub_type(media_uhd_h uhd, int sub_type);
+int media_uhd_set_played_count(media_uhd_h uhd, int played_count);
+
+int media_uhd_update_to_db(media_uhd_h uhd);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __TIZEN_MEDIA_UHD_H__ */
diff --git a/include_product/media_util_private.h b/include_product/media_util_private.h
new file mode 100755 (executable)
index 0000000..80f4550
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+* 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_UTIL_PRIVATE_H__
+#define __TIZEN_MEDIA_UTIL_PRIVATE_H__
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <stdbool.h>
+#include <media_content_type.h>
+
+/**
+ *@internal
+ */
+
+int _media_util_check_file_exist(const char *path);
+int _media_util_check_ignore_file(const char *path, bool *ignore);
+int _media_util_check_ignore_dir(const char *dir_path, bool *ignore);
+
+#ifdef _USE_SENIOR_MODE
+bool _media_content_is_support_senior_mode();
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /*__TIZEN_MEDIA_UTIL_PRIVATE_H__*/
diff --git a/include_product/media_video.h b/include_product/media_video.h
new file mode 100755 (executable)
index 0000000..2f2d083
--- /dev/null
@@ -0,0 +1,520 @@
+/*
+* 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_VIDEO_META_H__
+#define __TIZEN_VIDEO_META_H__
+
+#include <media_content_type.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file media_video.h
+ * @brief This file contains the video metadata API and related functions to proceed with video metadata. \n
+ *        Functions include cloning and destroying video metadata, getting video metadata such as width, height, \n
+ *        album, genre, played parameters etc. and updating video to DB.
+ */
+
+/**
+ * @addtogroup CAPI_CONTENT_MEDIA_VIDEO_META_MODULE
+ * @{
+ */
+
+/**
+ * @brief Clones the video metadata.
+ * @details This function copies the video metadata handle from a source to destination.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ *
+ * @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 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.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 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 the ID of the media of the given video metadata.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a media_id using free().
+ *
+ * @param[in]  video    The video metadata handle
+ * @param[out] media_id The ID of 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_OUT_OF_MEMORY     Out of memory
+ * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
+ */
+int video_meta_get_media_id(video_meta_h video, char **media_id);
+
+/**
+ * @brief Gets the album of the given video metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no album info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a album using free().
+ *
+ * @param[in]  video The video metadata handle
+ * @param[out] album The album 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_PERMISSION_DENIED Permission denied
+ */
+int video_meta_get_album(video_meta_h video, char **album);
+
+/**
+ * @brief Gets the artist of the given video metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no artist info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ */
+int video_meta_get_artist(video_meta_h video, char **artist);
+
+/**
+ * @brief Gets the video album artist.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no album artist info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ */
+int video_meta_get_album_artist(video_meta_h video, char **album_artist);
+
+/**
+ * @brief Gets the genre of the given video metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no genre info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ */
+int video_meta_get_genre(video_meta_h video, char **genre);
+
+/**
+ * @brief Gets the composer of the given video metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no composer info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ */
+int video_meta_get_composer(video_meta_h video, char **composer);
+
+/**
+ * @brief Gets the year of the given video metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no year info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ */
+int video_meta_get_year(video_meta_h video, char **year);
+
+/**
+ * @brief Gets the recorded date of the video.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a recorded_date using free().
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ */
+int video_meta_get_recorded_date(video_meta_h video, char **recorded_date);
+
+/**
+ * @brief Gets the copyright notice of the given video metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no copyright info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks You must release @a copyright using free().
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ */
+int video_meta_get_copyright(video_meta_h video, char **copyright);
+
+/**
+ * @brief Gets the track number of the given videoo metadata.
+ * @details If the value is an empty string, the method returns "Unknown". \n
+ *                Since 3.0, if the media content has no track info, the method returns empty string.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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_PERMISSION_DENIED Permission denied
+ */
+int video_meta_get_track_num(video_meta_h video, char **track_num);
+
+/**
+ * @brief Gets the bitrate of the given video metadata in bitrate per second.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  video    The video metadata handle
+ * @param[out] bit_rate The video bit rate 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 video_meta_get_bit_rate(video_meta_h video, int *bit_rate);
+
+/**
+ * @brief Gets the track duration of the given videoo metadata.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 width of the given videoo metadata.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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 height of the given videoo metadata.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. [Use media_info_get_played_count() instead]
+ * @brief Gets the played count of the video.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  video        The video metadata handle
+ * @param[out] played_count The counter of the video 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);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. [Use media_info_get_played_time() instead]
+ * @brief Gets the last played time parameter of the video.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  video       The video metadata handle
+ * @param[out] played_time The last played time of 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);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif.
+ * @brief Gets the played position parameter of the video.
+ * @details This function returns the elapsed playback position parameter of the video as period
+ *          starting from the beginning of the movie.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in]  video           The video metadata handle
+ * @param[out] played_position The elapsed time of 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_position(video_meta_h video, int *played_position);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. [Use media_info_increase_played_count() instead]
+ * @brief Sets the played count of the video.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @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
+ * @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);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif. [Use media_info_set_played_time() instead]
+ * @brief Sets the last played time of the video.
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @param[in] video       The video metadata handle
+ * @param[in] played_time The last played time of 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
+ *
+ * @post video_meta_update_to_db().
+ */
+int video_meta_set_played_time(video_meta_h video, time_t played_time);
+
+/**
+ * @deprecated Deprecated since @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif.
+ * @brief Sets the played position of the video.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @remarks  It is NOT recommended to use this attribute for your application-specific purpose because this attribute can be overwritten by other applications (even 0).
+ *
+ * @param[in] video           The video metadata handle
+ * @param[in] played_position The position from the beginning of the video (in milliseconds)
+ *
+ * @return @c 0 on success,
+ *         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 video_meta_update_to_db().
+ */
+int video_meta_set_played_position(video_meta_h video, int played_position);
+
+/**
+ * @brief Updates an video metadata with modified attributes in the media database.
+ * @details The function updates the given video meta in the media database. The function should be called after any change in video attributes, to be updated to the media
+ *          database. For example, for setting the played time using video_meta_get_played_time(), after that the video_meta_update_to_db() function should be called to update media database.
+ *
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ *
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/content.write
+ *
+ * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db().
+ *
+ * @param[in] video The 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_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 video_meta_set_played_time()
+ * @see video_meta_set_played_count()
+ * @see video_meta_set_played_position()
+ */
+int video_meta_update_to_db(video_meta_h video);
+
+/**
+ *@}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__TIZEN_VIDEO_META_H__*/
index 313cb6d..d3f6a89 100755 (executable)
@@ -23,6 +23,9 @@
 #include <unicode/uscript.h>
 #include <unicode/uloc.h>
 #include <unicode/ucol.h>
+#ifdef _USE_TV_PROFILE
+#include <vconf.h>
+#endif
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
 #include <cynara-session.h>
 #include <cynara-error.h>
 #include <cynara-creds-socket.h>
+#ifdef _USE_TV_PROFILE
+#include <media_pvr.h>
+#include <media_uhd.h>
+#endif
 
 static attribute_h g_attr_handle = NULL;
 static attribute_h g_alias_attr_handle = NULL;
@@ -88,7 +95,10 @@ static int __media_content_create_attr_handle(void)
 
        ret = _media_filter_attribute_add(g_attr_handle, MEDIA_TIMELINE, DB_FIELD_MEDIA_TIMELINE);
        media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
-
+#ifdef _USE_TV_PROFILE
+       ret = _media_filter_attribute_add(g_attr_handle, MEDIA_FOLDER_ID, DB_FIELD_MEDIA_FOLDER_ID);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+#endif
        ret = _media_filter_attribute_add(g_attr_handle, MEDIA_THUMBNAIL_PATH, DB_FIELD_MEDIA_THUMBNAIL_PATH);
        media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
 
@@ -294,7 +304,172 @@ static int __media_content_create_attr_handle(void)
        /* Face */
        ret = _media_filter_attribute_add(g_attr_handle, MEDIA_FACE_TAG, DB_FIELD_FACE_TAG);
        media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+#ifdef _USE_TV_PROFILE
+       ret = _media_filter_attribute_add(g_attr_handle, MEDIA_MODIFIED_MONTH, DB_FIELD_MEDIA_MODIFIED_DATE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, MEDIA_MODIFIED_DATE, DB_FIELD_MEDIA_MODIFIED_DATE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+#endif
+#ifdef _USE_SENIOR_MODE
+       if (_media_content_is_support_senior_mode()) {
+               ret = _media_filter_attribute_add(g_attr_handle, MEDIA_CONTACT, DB_FIELD_MEDIA_CONTACT);
+               media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+               ret = _media_filter_attribute_add(g_attr_handle, MEDIA_APP_DATA, DB_FIELD_MEDIA_APP_DATA);
+               media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+       }
+#endif
+#ifdef _USE_TV_PROFILE
+       /* PVR*/
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_DURATION, DB_FIELD_PVR_DURATION);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_TIME_ZONE, DB_FIELD_PVR_TIME_ZONE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_PTC, DB_FIELD_PVR_PTC);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_MAJOR, DB_FIELD_PVR_MAJOR);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_MINOR, DB_FIELD_PVR_MINOR);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_CHANNEL_TYPE, DB_FIELD_PVR_CHANNEL_TYPE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_CHANNEL_NAME, DB_FIELD_PVR_CHANNEL_NAME);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_CHANNEL_NUM, DB_FIELD_PVR_CHANNEL_NUM);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_TITLE, DB_FIELD_PVR_PROGRAM_TITLE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_NUM, DB_FIELD_PVR_PROGRAM_NUM);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_CRID, DB_FIELD_PVR_PROGRAM_CRID);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_GUIDANCE, DB_FIELD_PVR_GUIDANCE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_SYNOPSIS, DB_FIELD_PVR_SYNOPSIS);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_GENRE, DB_FIELD_PVR_GENRE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_LANGUAGE, DB_FIELD_PVR_LANGUAGE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_EMBARGO_TIME, DB_FIELD_PVR_EMBARGO_TIME);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_EXPIRY_TIME, DB_FIELD_PVR_EXPIRY_TIME);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_START_TIME, DB_FIELD_PVR_START_TIME);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_START_TIME, DB_FIELD_PVR_PROGRAM_START_TIME);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_END_TIME, DB_FIELD_PVR_PROGRAM_END_TIME);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_PROGRAM_DATE, DB_FIELD_PVR_PROGRAM_DATE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_PARENTAL_RATING, DB_FIELD_PVR_PARENTAL_RATING);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_TIMER_RECORD, DB_FIELD_PVR_TIMER_RECORD);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_SERIES_RECORD, DB_FIELD_PVR_SERIES_RECORD);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_HD, DB_FIELD_PVR_HD);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_SUBTITLE, DB_FIELD_PVR_SUBTITLE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_TTX, DB_FIELD_PVR_TTX);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_AD, DB_FIELD_PVR_AD);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_TTX, DB_FIELD_PVR_TTX);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_DATA_SERVICE, DB_FIELD_PVR_DATA_SERVICE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_LOCK, DB_FIELD_PVR_CONTENT_LOCK);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_WATCH, DB_FIELD_PVR_CONTENT_WATCH);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_HAS_AUDIO_ONLY, DB_FIELD_PVR_HAS_AUDIO_ONLY);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_IS_LOCAL_RECORD, DB_FIELD_PVR_IS_LOCAL_RECORD);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_RESOLUTION, DB_FIELD_PVR_RESOLUTION);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_CONTENT_ASPECTRATIO, DB_FIELD_PVR_ASPECTRATIO);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_MODIFIED_MONTH, DB_FIELD_PVR_MODIFIED_DATE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_MODIFIED_DATE, DB_FIELD_PVR_MODIFIED_DATE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_SPORTS_TYPE, DB_FIELD_PVR_SPORTS_TYPE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_GUIDANCE_LENGTH, DB_FIELD_PVR_GUIDANCE_LENGTH);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_TVMODE, DB_FIELD_PVR_TVMODE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_PLAY_COUNT, DB_FIELD_PVR_PLAY_COUNT);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, PVR_PRIVATE_DATA, DB_FIELD_PVR_PRIVATE_DATA);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       /* UHD*/
+       ret = _media_filter_attribute_add(g_attr_handle, UHD_CONTENT_TITLE, DB_FIELD_UHD_CONTENT_TITLE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, UHD_RELEASE_DATE, DB_FIELD_UHD_RELEASE_DATE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
 
+       ret = _media_filter_attribute_add(g_attr_handle, UHD_SUB_TYPE, DB_FIELD_UHD_SUB_TYPE);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, UHD_FILE_NAME, DB_FIELD_UHD_FILE_NAME);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, UHD_FOLDER_ID, DB_FIELD_FOLDER_ID);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       ret = _media_filter_attribute_add(g_attr_handle, UHD_PLAYED_COUNT, DB_FIELD_UHD_PLAYED_COUNT);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+#endif
        return ret;
 }
 
@@ -332,6 +507,10 @@ static int __media_content_create_alias_attr_handle(void)
 
        ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_TIMELINE, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_TIMELINE);
        media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+#ifdef _USE_TV_PROFILE
+       ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_FOLDER_ID, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_FOLDER_ID);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+#endif
 
        ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_THUMBNAIL_PATH, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_THUMBNAIL_PATH);
        media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
@@ -456,6 +635,16 @@ static int __media_content_create_alias_attr_handle(void)
        ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_360, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_360);
        media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
 
+#ifdef _USE_SENIOR_MODE
+       if (_media_content_is_support_senior_mode()) {
+               ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_CONTACT, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_CONTACT);
+               media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+               ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_APP_DATA, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_APP_DATA);
+               media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+       }
+#endif
+
        /* Pinyin*/
        ret = _media_filter_attribute_add(g_alias_attr_handle, MEDIA_FILE_NAME_PINYIN, DB_TABLE_ALIAS_MEDIA"."DB_FIELD_MEDIA_FILE_NAME_PINYIN);
        media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
@@ -690,6 +879,63 @@ int _content_query_prepare(sqlite3_stmt **stmt, char *select_query, char *condit
        return MEDIA_CONTENT_ERROR_NONE;
 }
 
+#ifdef _USE_SENIOR_MODE
+int _content_query_prepare_by_union_select(sqlite3_stmt **stmt, char *select_query1, char *condition_query1, char *option_query1, char *select_query2, char *condition_query2, char *option_query2)
+{
+       int len = 0;
+       int err = MEDIA_CONTENT_ERROR_NONE;
+       char query[MAX_QUERY_SIZE] = {0, };
+       memset(query, '\0', sizeof(query));
+
+       media_content_retvm_if(db_handle == NULL, MEDIA_CONTENT_ERROR_DB_FAILED, "database is not connected");
+       media_content_retvm_if(!STRING_VALID(select_query1), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "invalid select_query1");
+       media_content_retvm_if(!STRING_VALID(select_query2), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "invalid select_query2");
+
+       if (!STRING_VALID(condition_query1))
+               condition_query1 = (char *)" ";
+
+       if (!STRING_VALID(option_query1))
+               option_query1 = (char *)" ";
+
+       if (!STRING_VALID(condition_query2))
+               condition_query2 = (char *)" ";
+
+       if (!STRING_VALID(option_query2))
+               option_query2 = (char *)" ";
+
+       len = snprintf(query, sizeof(query), "SELECT * FROM (%s %s %s) as table1 UNION ALL SELECT * FROM (%s %s %s) as table2",
+                       select_query1, condition_query1, option_query1, select_query2, condition_query2, option_query2);
+       if (len > 0 && len < MAX_QUERY_SIZE) {
+               query[len] = '\0';
+       } else if (len >= MAX_QUERY_SIZE) {
+               query[MAX_QUERY_SIZE -1] = '\0';
+       } else {
+               media_content_error("snprintf failed");
+               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       media_content_sec_debug("Query : [%s]", query);
+
+       err = sqlite3_prepare_v2((sqlite3*)db_handle, query, strlen(query), stmt, NULL);
+       if (err != SQLITE_OK) {
+               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) {
+                       media_content_error(" BUSY ERROR");
+                       return MEDIA_CONTENT_ERROR_DB_BUSY;
+               } else if (err == SQLITE_PERM) {
+                       media_content_error("PERMISSION EROR");
+                       return MEDIA_CONTENT_ERROR_PERMISSION_DENIED;
+               } else {
+                       media_content_error("OTHER ERROR");
+                       return MEDIA_CONTENT_ERROR_DB_FAILED;
+               }
+       }
+
+       return MEDIA_CONTENT_ERROR_NONE;
+}
+#endif
+
 int _content_error_capi(int type, int content_error)
 {
        if (content_error != MEDIA_CONTENT_ERROR_NONE)
@@ -925,17 +1171,60 @@ void _media_content_scan_cb(media_request_result_s* result, void *user_data)
        media_content_scan_cb_data *cb_data = user_data;
 
        err = result->result;
+#ifdef _USE_TV_PROFILE
+       if (result->request_type != MEDIA_REQUEST_SCAN_COMPLETE &&
+               result->request_type != MEDIA_REQUEST_SCAN_PARTIAL) {
+               if (cb_data && cb_data->callback) {
+                       media_content_debug("begin:User callback is being called now, result=%d", err);
+                       cb_data->callback(err, cb_data->user_data);
+                       media_content_debug("end:User callback is being called now, result=%d", err);
+               }
 
+               SAFE_FREE(cb_data);
+       }
+#else
        if (cb_data && cb_data->callback) {
                media_content_debug("User callback is being called now");
                cb_data->callback(err, cb_data->user_data);
        }
 
        SAFE_FREE(cb_data);
+#endif
 
        return;
 }
 
+#ifdef _USE_TV_PROFILE
+void _media_content_scan_cb_v2(media_request_result_s* result, void *user_data)
+{
+       int err = -1;
+       media_content_scan_cb_data_v2 *cb_data = user_data;
+       media_content_complete_phase_e complete_phase = -1;
+       if (!cb_data)
+               media_content_debug("cb_data is NULL");
+       err = result->result;
+       media_content_debug("result is %d", err);
+
+       if (result->request_type == MEDIA_REQUEST_SCAN_PARTIAL)
+               complete_phase = MEDIA_CONTENT_SCAN_PARTIAL_COMPLETE;
+       else if (result->request_type == MEDIA_REQUEST_SCAN_COMPLETE)
+               complete_phase = MEDIA_CONTENT_SCAN_COMPLETE;
+       else if (result->request_type == MEDIA_REQUEST_EXTRACT_COMPLETE)
+               complete_phase = MEDIA_CONTENT_EXTRACT_COMPLETE;
+
+       if (cb_data && cb_data->callback)
+               cb_data->callback(err, complete_phase, cb_data->user_data);
+       else
+               media_content_debug("run error");
+
+       if ((result->request_type != MEDIA_REQUEST_SCAN_COMPLETE) &&
+       (result->request_type != MEDIA_REQUEST_SCAN_PARTIAL))
+               SAFE_FREE(cb_data);
+
+       return;
+}
+#endif
+
 static int __media_content_check_dir(const char *path)
 {
        DIR *dp = NULL;
@@ -1004,6 +1293,40 @@ int media_content_scan_folder(const char *path, bool is_recursive, media_scan_co
        return _content_error_capi(MEDIA_REGISTER_TYPE, ret);
 }
 
+#ifdef _USE_TV_PROFILE
+int media_content_scan_folder_v2(const char *path, bool is_recursive, media_scan_completed_cb_v2 callback, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       bool ignore_dir = FALSE;
+       char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0, };
+
+       media_content_retvm_if(!STRING_VALID(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid path");
+       memset(storage_id, 0x00, sizeof(storage_id));
+
+       ret = _media_util_check_ignore_dir(path, &ignore_dir);
+       media_content_retvm_if(ignore_dir, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "Invalid folder path");
+
+       ret = __media_content_check_dir(path);
+       media_content_retvm_if(ret == MEDIA_CONTENT_ERROR_PERMISSION_DENIED, ret, "Permission Denied");
+
+       media_content_scan_cb_data_v2* cb_data = NULL;
+       cb_data = (media_content_scan_cb_data_v2*)malloc(sizeof(media_content_scan_cb_data_v2));
+       media_content_retvm_if(cb_data == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+
+       cb_data->callback = callback;
+       cb_data->user_data = user_data;
+
+       ret = media_svc_get_storage_id(_content_get_db_handle(), path, storage_id);
+       /*FIX ME. need to check ret value?*/
+
+       ret = media_directory_scanning_async(path, storage_id, is_recursive, _media_content_scan_cb_v2, cb_data, tzplatform_getuid(TZ_USER_NAME));
+       if (ret != MS_MEDIA_ERR_NONE)
+               media_content_error("media_directory_scanning_async failed : %d", ret);
+
+       return _content_error_capi(MEDIA_REGISTER_TYPE, ret);
+}
+#endif
+
 int media_content_cancel_scan_folder(const char *path)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -1150,4 +1473,9 @@ int media_content_remove_db_updated_cb(media_content_noti_h noti_handle)
 
        return _content_error_capi(MEDIA_REGISTER_TYPE, ret);
 }
-
+#ifdef _USE_TV_PROFILE
+GMutex* _content_get_db_mutex(void)
+{
+       return &db_mutex;
+}
+#endif
index d809330..6a6711e 100755 (executable)
@@ -82,6 +82,116 @@ static char * __media_db_get_group_name(media_group_e group)
                return (char *) DB_FIELD_MEDIA_KEYWORD;
        case MEDIA_CONTENT_GROUP_WEATHER:
                return (char *) DB_FIELD_MEDIA_WEATHER;
+#ifdef _USE_TV_PROFILE
+       case MEDIA_CONTENT_GROUP_MODIFIED_MONTH:
+               return (char *) DB_FIELD_MEDIA_MODIFIED_DATE;
+       case MEDIA_CONTENT_GROUP_MODIFIED_DATE:
+               return (char *) DB_FIELD_MEDIA_MODIFIED_DATE;
+#endif
+#ifdef _USE_SENIOR_MODE
+       case MEDIA_CONTENT_GROUP_CONTACT:
+               return (char *) DB_FIELD_MEDIA_CONTACT;
+#endif
+#ifdef _USE_TV_PROFILE
+       case MEDIA_CONTENT_GROUP_ALBUM:
+               return (char *) DB_FIELD_MEDIA_ALBUM;
+       case MEDIA_PVR_GROUP_DURATION:
+               return (char *) DB_FIELD_PVR_DURATION;
+       case MEDIA_PVR_GROUP_TIME_ZONE:
+               return (char *) DB_FIELD_PVR_TIME_ZONE;
+       case MEDIA_PVR_GROUP_PTC:
+               return (char *) DB_FIELD_PVR_PTC;
+       case MEDIA_PVR_GROUP_MAJOR:
+               return (char *) DB_FIELD_PVR_MAJOR;
+       case MEDIA_PVR_GROUP_MINOR:
+               return (char *) DB_FIELD_PVR_MINOR;
+       case MEDIA_PVR_GROUP_CHANNEL_TYPE:
+               return (char *) DB_FIELD_PVR_CHANNEL_TYPE;
+       case MEDIA_PVR_GROUP_CHANNEL_NAME:
+               return (char *) DB_FIELD_PVR_CHANNEL_NAME;
+       case MEDIA_PVR_GROUP_CHANNEL_NUM:
+               return (char *) DB_FIELD_PVR_CHANNEL_NUM;
+       case MEDIA_PVR_GROUP_PROGRAM_TITLE:
+               return (char *) DB_FIELD_PVR_PROGRAM_TITLE;
+       case MEDIA_PVR_GROUP_PROGRAM_NUM:
+               return (char *) DB_FIELD_PVR_PROGRAM_NUM;
+       case MEDIA_PVR_GROUP_PROGRAM_CRID:
+               return (char *) DB_FIELD_PVR_PROGRAM_CRID;
+       case MEDIA_PVR_GROUP_GUIDANCE:
+               return (char *) DB_FIELD_PVR_GUIDANCE;
+       case MEDIA_PVR_GROUP_SYNOPSIS:
+               return (char *) DB_FIELD_PVR_SYNOPSIS;
+       case MEDIA_PVR_GROUP_GENRE:
+               return (char *) DB_FIELD_PVR_GENRE;
+       case MEDIA_PVR_GROUP_LANGUAGE:
+               return (char *) DB_FIELD_PVR_LANGUAGE;
+       case MEDIA_PVR_GROUP_EMBARGO_TIME:
+               return (char *) DB_FIELD_PVR_EMBARGO_TIME;
+       case MEDIA_PVR_GROUP_EXPIRY_TIME:
+               return (char *) DB_FIELD_PVR_EXPIRY_TIME;
+       case MEDIA_PVR_GROUP_START_TIME:
+               return (char *) DB_FIELD_PVR_START_TIME;
+       case MEDIA_PVR_GROUP_PROGRAM_START_TIME:
+               return (char *) DB_FIELD_PVR_PROGRAM_START_TIME;
+       case MEDIA_PVR_GROUP_PROGRAM_END_TIME:
+               return (char *) DB_FIELD_PVR_PROGRAM_END_TIME;
+       case MEDIA_PVR_GROUP_PROGRAM_DATE:
+               return (char *) DB_FIELD_PVR_PROGRAM_DATE;
+       case MEDIA_PVR_GROUP_PARENTAL_RATING:
+               return (char *) DB_FIELD_PVR_PARENTAL_RATING;
+       case MEDIA_PVR_GROUP_TIMER_RECORD:
+               return (char *) DB_FIELD_PVR_TIMER_RECORD;
+       case MEDIA_PVR_GROUP_SERIES_RECORD:
+               return (char *) DB_FIELD_PVR_SERIES_RECORD;
+       case MEDIA_PVR_GROUP_HD:
+               return (char *) DB_FIELD_PVR_HD;
+       case MEDIA_PVR_GROUP_SUBTITLE:
+               return (char *) DB_FIELD_PVR_SUBTITLE;
+       case MEDIA_PVR_GROUP_TTX:
+               return (char *) DB_FIELD_PVR_TTX;
+       case MEDIA_PVR_GROUP_AD:
+               return (char *) DB_FIELD_PVR_AD;
+       case MEDIA_PVR_GROUP_HARDOF_HEARINGRADIO:
+               return (char *) DB_FIELD_PVR_HARDOF_HEARINGRADIO;
+       case MEDIA_PVR_GROUP_DATA_SERVICE:
+               return (char *) DB_FIELD_PVR_DATA_SERVICE;
+       case MEDIA_PVR_GROUP_CONTENT_LOCK:
+               return (char *) DB_FIELD_PVR_CONTENT_LOCK;
+       case MEDIA_PVR_GROUP_CONTENT_WATCH:
+               return (char *) DB_FIELD_PVR_CONTENT_WATCH;
+       case MEDIA_PVR_GROUP_HAS_AUDIO_ONLY:
+               return (char *) DB_FIELD_PVR_HAS_AUDIO_ONLY;
+       case MEDIA_PVR_GROUP_IS_LOCAL_RECORDED:
+               return (char *) DB_FIELD_PVR_IS_LOCAL_RECORD;
+       case MEDIA_PVR_GROUP_RESOLUTION:
+               return (char *) DB_FIELD_PVR_RESOLUTION;
+       case MEDIA_PVR_GROUP_ASPECTRATIO:
+               return (char *) DB_FIELD_PVR_ASPECTRATIO;
+       case MEDIA_PVR_GROUP_MODIFIED_MONTH:
+               return (char *) DB_FIELD_PVR_MODIFIED_DATE;
+       case MEDIA_PVR_GROUP_MODIFIED_DATE:
+               return (char *) DB_FIELD_PVR_MODIFIED_DATE;
+       case MEDIA_PVR_GROUP_SPORTS_TYPE:
+               return (char *) DB_FIELD_PVR_SPORTS_TYPE;
+       case MEDIA_PVR_GROUP_GUIDANCE_LENGTH:
+               return (char *) DB_FIELD_PVR_GUIDANCE_LENGTH;
+       case MEDIA_PVR_GROUP_TVMODE:
+               return (char *) DB_FIELD_PVR_TVMODE;
+       case MEDIA_PVR_GROUP_PLAY_COUNT:
+               return (char *) DB_FIELD_PVR_PLAY_COUNT;
+       case MEDIA_PVR_GROUP_PRIVATE_DATA:
+               return (char *) DB_FIELD_PVR_PRIVATE_DATA;
+       case MEDIA_UHD_GROUP_CONTENT_TITLE:
+               return (char *) DB_FIELD_UHD_CONTENT_TITLE;
+       case MEDIA_UHD_GROUP_RELEASE_DATE:
+               return (char *) DB_FIELD_UHD_RELEASE_DATE;
+       case MEDIA_UHD_GROUP_SUB_TYPE:
+               return (char *) DB_FIELD_UHD_SUB_TYPE;
+       case MEDIA_UHD_GROUP_FILE_NAME:
+               return (char *) DB_FIELD_UHD_FILE_NAME;
+       case MEDIA_UHD_GROUP_PLAYED_COUNT:
+               return (char *) DB_FIELD_UHD_PLAYED_COUNT;
+#endif
        default:
                return NULL;
        }
@@ -93,7 +203,9 @@ static int __media_db_make_query(filter_h filter, attribute_h attr, char *select
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
        filter_s *_filter = NULL;
-
+#ifdef _USE_TV_PROFILE
+       g_mutex_lock(_content_get_db_mutex());
+#endif
        if (filter != NULL) {
                _filter = (filter_s*)filter;
 
@@ -108,12 +220,22 @@ static int __media_db_make_query(filter_h filter, attribute_h attr, char *select
                        SAFE_STRLCAT(bracket_added_condition, QUERY_KEYWORD_BRACKET, MAX_QUERY_SIZE);
 
                        ret = _media_filter_attribute_generate(attr, bracket_added_condition, _filter->condition_collate_type, condition_query);
+#ifdef _USE_TV_PROFILE
+                       if (ret != MEDIA_CONTENT_ERROR_NONE) {
+                               g_mutex_unlock(_content_get_db_mutex());
+                               return ret;
+                       }
+#else
                        media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+#endif
                }
 
                ret = _media_filter_attribute_option_generate(attr, filter, option_query);
                if (ret != MEDIA_CONTENT_ERROR_NONE) {
                        SAFE_FREE(*condition_query);
+#ifdef _USE_TV_PROFILE
+                       g_mutex_unlock(_content_get_db_mutex());
+#endif
                        return ret;
                }
 
@@ -122,6 +244,9 @@ static int __media_db_make_query(filter_h filter, attribute_h attr, char *select
                        SAFE_STRLCAT(select_query, QUERY_KEYWORD_AND, select_query_size);
                }
        }
+#ifdef _USE_TV_PROFILE
+       g_mutex_unlock(_content_get_db_mutex());
+#endif
 
        return ret;
 }
@@ -197,6 +322,10 @@ int _media_db_get_group_count(filter_h filter, group_list_e group_type, int *gro
                        return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
                }
                break;
+#ifdef _USE_TV_PROFILE
+       case MEDIA_GROUP_PVR:
+       case MEDIA_GROUP_UHD:
+#endif
        default:
                {
                        media_content_error("Invalid group type [%d]", group_type);
@@ -233,12 +362,29 @@ int _media_db_get_media_group_count(media_group_e group, filter_h filter, int *g
 
        attr = _content_get_attirbute_handle();
        memset(select_query, 0x00, sizeof(select_query));
-
+#ifdef _USE_TV_PROFILE
+       if (group < MEDIA_PVR_GROUP_DURATION) { /*media content*/
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_COUNT, __media_db_get_group_name(group), _filter->storage_id);
+               else
+                       snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_COUNT, __media_db_get_group_name(group), DB_TABLE_MEDIA_VIEW);
+       } else if (group < MEDIA_UHD_GROUP_CONTENT_TITLE) { /*pvr content*/
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_PVR_GROUP_COUNT_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
+               else
+                       snprintf(select_query, sizeof(select_query), SELECT_PVR_GROUP_COUNT, __media_db_get_group_name(group));
+       } else { /*uhd content*/
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_UHD_GROUP_COUNT_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
+               else
+                       snprintf(select_query, sizeof(select_query), SELECT_UHD_GROUP_COUNT, __media_db_get_group_name(group));
+       }
+#else
        if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
                snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_COUNT, __media_db_get_group_name(group), _filter->storage_id);
        else
                snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_COUNT, __media_db_get_group_name(group), DB_TABLE_MEDIA_VIEW);
-
+#endif
        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);
 
@@ -278,12 +424,29 @@ int _media_db_get_media_group(media_group_e group, filter_h filter, media_group_
 
        attr = _content_get_attirbute_handle();
        memset(select_query, 0x00, sizeof(select_query));
-
+#ifdef _USE_TV_PROFILE
+       if (group < MEDIA_PVR_GROUP_DURATION) { /*media content */
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_LIST, __media_db_get_group_name(group), _filter->storage_id);
+               else
+                       snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_LIST, __media_db_get_group_name(group), DB_TABLE_MEDIA_VIEW);
+       } else if (group < MEDIA_UHD_GROUP_CONTENT_TITLE) { /*pvr content */
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_PVR_GROUP_LIST_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
+               else
+                       snprintf(select_query, sizeof(select_query), SELECT_PVR_GROUP_LIST, __media_db_get_group_name(group));
+       } else { /* uhd content */
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_UHD_GROUP_LIST_BY_STORAGE_ID, __media_db_get_group_name(group), _filter->storage_id);
+               else
+                       snprintf(select_query, sizeof(select_query), SELECT_UHD_GROUP_LIST, __media_db_get_group_name(group));
+       }
+#else
        if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
                snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_LIST, __media_db_get_group_name(group), _filter->storage_id);
        else
                snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_LIST, __media_db_get_group_name(group), DB_TABLE_MEDIA_VIEW);
-
+#endif
        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);
 
@@ -307,7 +470,76 @@ int _media_db_get_media_group(media_group_e group, filter_h filter, media_group_
 
        return ret;
 }
+#ifdef _USE_TV_PROFILE
+int _media_db_get_media_group_and_count(media_group_e group, filter_h filter, media_group_and_count_cb callback, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       char select_query[DEFAULT_QUERY_SIZE];
+       char group_query[DEFAULT_QUERY_SIZE];
+       char *condition_query = NULL;
+       char *option_query = NULL;
+       char *name = NULL;
+       sqlite3_stmt *stmt = NULL;
+       attribute_h attr = NULL;
+       filter_s *_filter = (filter_s*)filter;
+
+       attr = _content_get_attirbute_handle();
+       memset(select_query, 0x00, sizeof(select_query));
+       memset(group_query, 0x00, sizeof(group_query));
+
+       char* group_name = __media_db_get_group_name(group);
+       if (!STRING_VALID(group_name)) {
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+               media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+       }
+
+       if (group < MEDIA_PVR_GROUP_DURATION) { /*media content*/
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_AND_COUNT, group_name, _filter->storage_id);
+               else
+                       snprintf(select_query, sizeof(select_query), SELECT_MEDIA_GROUP_AND_COUNT, group_name, DB_TABLE_MEDIA_VIEW);
+       } else if (group < MEDIA_UHD_GROUP_CONTENT_TITLE) {/*pvr content*/
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_PVR_GROUP_AND_COUNT_BY_STORAGE_ID, group_name, _filter->storage_id);
+               else
+                       snprintf(select_query, sizeof(select_query), SELECT_PVR_GROUP_AND_COUNT, group_name);
+       } else {/*uhd content*/
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_UHD_GROUP_AND_COUNT_BY_STORAGE_ID, group_name, _filter->storage_id);
+               else
+                       snprintf(select_query, sizeof(select_query), SELECT_UHD_GROUP_AND_COUNT, group_name);
+       }
+
+       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);
+
+       if (STRING_VALID(option_query))
+               snprintf(group_query, sizeof(group_query), "GROUP BY %s %s", group_name, option_query);
+       else
+               snprintf(group_query, sizeof(group_query), "GROUP BY %s", group_name);
+
+       ret = _content_query_prepare(&stmt, select_query, condition_query, group_query);
+       SAFE_FREE(condition_query);
+       SAFE_FREE(option_query);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       while (sqlite3_step(stmt) == SQLITE_ROW) {
+               if (STRING_VALID((const char *)sqlite3_column_text(stmt, 0)))
+                       name = strdup((const char *)sqlite3_column_text(stmt, 0));
+
+               if (callback(name, sqlite3_column_int(stmt, 1), user_data) == false) {
+                       SAFE_FREE(name);
+                       break;
+               }
+
+               SAFE_FREE(name);
+       }
 
+       SQLITE3_FINALIZE(stmt);
+
+       return ret;
+}
+#endif
 int _media_db_get_album(filter_h filter, media_album_cb callback, void *user_data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -785,6 +1017,18 @@ int _media_db_get_group_item_count(const char *group_name, filter_h filter, grou
                        tmp_query = sqlite3_mprintf(SELECT_FACE_COUNT_BY_MEDIA_ID, DB_TABLE_MEDIA_VIEW, group_name);
 
                SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
+#ifdef _USE_TV_PROFILE
+       } else if (group_type == MEDIA_GROUP_PVR) {
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_PVR_COUNT_BY_STORAGE_ID, _filter->storage_id);
+               else
+                       SAFE_STRLCAT(select_query, SELECT_PVR_COUNT, sizeof(select_query));
+       } else if (group_type == MEDIA_GROUP_UHD) {
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_UHD_COUNT_BY_STORAGE_ID, _filter->storage_id);
+               else
+                       SAFE_STRLCAT(select_query, SELECT_UHD_COUNT, sizeof(select_query));
+#endif
        } else {
                media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
                return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
@@ -951,6 +1195,86 @@ int _media_db_get_group_item(const char *group_name, filter_h filter, media_info
        return ret;
 }
 
+#ifdef _USE_SENIOR_MODE
+int _media_db_get_group_item_by_union_select(const char *group_name, filter_h filter1, filter_h filter2, media_info_cb callback, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       char select_query1[MAX_QUERY_SIZE] = {0, };
+       char *condition_query1 = NULL;
+       char *option_query1 = NULL;
+       char select_query2[MAX_QUERY_SIZE] = {0, };
+       char *condition_query2 = NULL;
+       char *option_query2 = NULL;
+       sqlite3_stmt *stmt = NULL;
+       attribute_h attr = NULL;
+       filter_s *_filter1 = (filter_s*)filter1;
+       filter_s *_filter2 = (filter_s*)filter2;
+
+       attr = _content_get_attirbute_handle();
+
+       memset(select_query1, 0x00, sizeof(select_query1));
+
+       if ((_filter1 != NULL) && STRING_VALID(_filter1->storage_id))
+               snprintf(select_query1, sizeof(select_query1), SELECT_MEDIA_FROM_FOLDER, _filter1->storage_id, group_name);
+       else
+               snprintf(select_query1, sizeof(select_query1), SELECT_MEDIA_FROM_FOLDER, DB_TABLE_MEDIA_VIEW, group_name);
+
+       ret = __media_db_make_query(filter1, attr, select_query1, sizeof(select_query1), &condition_query1, &option_query1);
+       if (ret != MEDIA_CONTENT_ERROR_NONE) {
+               SAFE_FREE(condition_query1);
+               SAFE_FREE(option_query1);
+               media_content_error("create select_query1 failed");
+               return ret;
+       }
+
+       memset(select_query2, 0x00, sizeof(select_query2));
+
+       if ((_filter2 != NULL) && STRING_VALID(_filter2->storage_id))
+               snprintf(select_query2, sizeof(select_query2), SELECT_MEDIA_FROM_FOLDER, _filter2->storage_id, group_name);
+       else
+               snprintf(select_query2, sizeof(select_query2), SELECT_MEDIA_FROM_FOLDER, DB_TABLE_MEDIA_VIEW, group_name);
+
+       ret = __media_db_make_query(filter2, attr, select_query2, sizeof(select_query2), &condition_query2, &option_query2);
+       if (ret != MEDIA_CONTENT_ERROR_NONE) {
+               SAFE_FREE(condition_query1);
+               SAFE_FREE(option_query1);
+               SAFE_FREE(condition_query2);
+               SAFE_FREE(option_query2);
+               media_content_error("create select_query2 failed");
+               return ret;
+       }
+
+       ret = _content_query_prepare_by_union_select(&stmt, select_query1, condition_query1, option_query1, select_query2, condition_query2, option_query2);
+       SAFE_FREE(condition_query1);
+       SAFE_FREE(option_query1);
+       SAFE_FREE(condition_query2);
+       SAFE_FREE(option_query2);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       while (sqlite3_step(stmt) == SQLITE_ROW) {
+               media_info_s *item = (media_info_s*)calloc(1, sizeof(media_info_s));
+               if (item == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       SQLITE3_FINALIZE(stmt);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+
+               _media_info_item_get_detail(stmt, (media_info_h)item);
+
+               if (callback((media_info_h)item, user_data) == false) {
+                       media_info_destroy((media_info_h)item);
+                       break;
+               }
+
+               media_info_destroy((media_info_h)item);
+       }
+
+       SQLITE3_FINALIZE(stmt);
+
+       return ret;
+}
+#endif
+
 int _media_db_get_media_group_item_count(const char *group_name, filter_h filter, media_group_e group, int *item_count)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -964,7 +1288,51 @@ int _media_db_get_media_group_item_count(const char *group_name, filter_h filter
 
        attr = _content_get_attirbute_handle();
        memset(select_query, 0x00, sizeof(select_query));
+#ifdef _USE_TV_PROFILE
+       if (group < MEDIA_PVR_GROUP_DURATION) { /*media content */
+               if (group_name != NULL) {
+                       if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                               tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_GROUP, _filter->storage_id, __media_db_get_group_name(group), group_name);
+                       else
+                               tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_GROUP, DB_TABLE_MEDIA_VIEW, __media_db_get_group_name(group), group_name);
+
+                       SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
+               } else {
+                       if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                               snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_GROUP_NULL, _filter->storage_id, __media_db_get_group_name(group));
+                       else
+                               snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_GROUP_NULL, DB_TABLE_MEDIA_VIEW, __media_db_get_group_name(group));
+               }
+       } else if (group < MEDIA_UHD_GROUP_CONTENT_TITLE) {/*pvr content*/
+               if (group_name != NULL) {
+                       if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                               tmp_query = sqlite3_mprintf(SELECT_PVR_COUNT_FROM_GROUP_BY_STORAGE_ID, _filter->storage_id, __media_db_get_group_name(group), group_name);
+                       else
+                               tmp_query = sqlite3_mprintf(SELECT_PVR_COUNT_FROM_GROUP, __media_db_get_group_name(group), group_name);
 
+                       SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
+               } else {
+                       if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                               snprintf(select_query, sizeof(select_query), SELECT_PVR_COUNT_FROM_GROUP_NULL_BY_STORAGE_ID, _filter->storage_id, __media_db_get_group_name(group));
+                       else
+                               snprintf(select_query, sizeof(select_query), SELECT_PVR_COUNT_FROM_GROUP_NULL, __media_db_get_group_name(group));
+               }
+       } else {/*uhd content*/
+               if (group_name != NULL) {
+                       if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                               tmp_query = sqlite3_mprintf(SELECT_UHD_COUNT_FROM_GROUP_BY_STORAGE_ID, _filter->storage_id, __media_db_get_group_name(group), group_name);
+                       else
+                               tmp_query = sqlite3_mprintf(SELECT_UHD_COUNT_FROM_GROUP, __media_db_get_group_name(group), group_name);
+
+                       SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
+               } else {
+                       if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                               snprintf(select_query, sizeof(select_query), SELECT_UHD_COUNT_FROM_GROUP_NULL_BY_STORAGE_ID, _filter->storage_id, __media_db_get_group_name(group));
+                       else
+                               snprintf(select_query, sizeof(select_query), SELECT_UHD_COUNT_FROM_GROUP_NULL, __media_db_get_group_name(group));
+               }
+       }
+#else
        if (group_name != NULL) {
                if ((_filter != NULL) && STRING_VALID(_filter->storage_id)) {
                        tmp_query = sqlite3_mprintf(SELECT_MEDIA_COUNT_FROM_GROUP, _filter->storage_id, __media_db_get_group_name(group), group_name);
@@ -979,7 +1347,7 @@ int _media_db_get_media_group_item_count(const char *group_name, filter_h filter
                else
                        snprintf(select_query, sizeof(select_query), SELECT_MEDIA_COUNT_FROM_GROUP_NULL, DB_TABLE_MEDIA_VIEW, __media_db_get_group_name(group));
        }
-
+#endif
        ret = __media_db_make_query(filter, attr, select_query, sizeof(select_query), &condition_query, &option_query);
        if (ret != MEDIA_CONTENT_ERROR_NONE) {
                if (tmp_query != NULL)
@@ -1129,6 +1497,286 @@ int _media_db_get_storage(filter_h filter, media_storage_cb callback, void *user
 
        return ret;
 }
+#ifdef _USE_TV_PROFILE
+int _media_db_get_pvr_group_item(const char *group_name, filter_h filter, media_group_e group, media_pvr_cb callback, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       char select_query[DEFAULT_QUERY_SIZE];
+       char *tmp_query = NULL;
+       char *condition_query = NULL;
+       char *option_query = NULL;
+       sqlite3_stmt *stmt = NULL;
+       attribute_h attr = NULL;
+       filter_s *_filter = (filter_s*)filter;
+
+       attr = _content_get_attirbute_handle();
+       memset(select_query, 0x00, sizeof(select_query));
+
+       if (group_name != NULL) {
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       tmp_query = sqlite3_mprintf(SELECT_PVR_FROM_GROUP_BY_STORAGE_ID, _filter->storage_id, __media_db_get_group_name(group), group_name);
+               else
+                       tmp_query = sqlite3_mprintf(SELECT_PVR_FROM_GROUP, __media_db_get_group_name(group), group_name);
+
+               SAFE_STRLCAT(select_query, tmp_query, sizeof(select_query));
+       } else {
+               if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+                       snprintf(select_query, sizeof(select_query), SELECT_PVR_FROM_GROUP_NULL_BY_STORAGE_ID, _filter->storage_id, __media_db_get_group_name(group));
+               else
+                       snprintf(select_query, sizeof(select_query), SELECT_PVR_FROM_GROUP_NULL, __media_db_get_group_name(group));
+       }
+
+       ret = __media_db_make_query(filter, attr, select_query, sizeof(select_query), &condition_query, &option_query);
+       if (ret != MEDIA_CONTENT_ERROR_NONE) {
+               if (tmp_query != NULL)
+                       sqlite3_free(tmp_query);
+               return ret;
+       }
+
+       ret = _content_query_prepare(&stmt, select_query, condition_query, option_query);
+       if (tmp_query != NULL)
+               sqlite3_free(tmp_query);
+       SAFE_FREE(condition_query);
+       SAFE_FREE(option_query);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       while (sqlite3_step(stmt) == SQLITE_ROW) {
+               media_pvr_s *item = (media_pvr_s*)calloc(1, sizeof(media_pvr_s));
+               if (item == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       SQLITE3_FINALIZE(stmt);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+
+               _media_pvr_item_get_detail(stmt, (media_pvr_h)item);
+
+               if (callback((media_pvr_h)item, user_data) == false) {
+                       media_info_destroy((media_pvr_h)item);
+                       break;
+               }
+
+               media_pvr_destroy((media_pvr_h)item);
+       }
+
+       SQLITE3_FINALIZE(stmt);
+
+       return ret;
+}
+
+typedef enum {
+       MEDIA_PVR_MEDIA_ID = 0,
+       MEDIA_PVR_STORAGE_ID,
+       MEDIA_PVR_PATH,
+       MEDIA_PVR_SIZE,
+       MEDIA_PVR_DURATION,
+       MEDIA_PVR_TIME_ZONE,
+       MEDIA_PVR_PTC,
+       MEDIA_PVR_MAJOR,
+       MEDIA_PVR_MINOR,
+       MEDIA_PVR_CHANNEL_TYPE,
+       MEDIA_PVR_CHANNEL_NAME,
+       MEDIA_PVR_CHANNEL_NUM,
+       MEDIA_PVR_PROGRAM_TITLE,
+       MEDIA_PVR_PROGRAM_NUM,
+       MEDIA_PVR_PROGRAM_CRID,
+       MEDIA_PVR_GUIDANCE,
+       MEDIA_PVR_SYNOPSIS,
+       MEDIA_PVR_GENRE,
+       MEDIA_PVR_LANGUAGE,
+       MEDIA_PVR_EMBARGO_TIME,
+       MEDIA_PVR_EXPIRY_TIME,
+       MEDIA_PVR_START_TIME,
+       MEDIA_PVR_PROGRAM_START_TIME,
+       MEDIA_PVR_PROGRAM_END_TIME,
+       MEDIA_PVR_PROGRAM_DATE,
+       MEDIA_PVR_PARENTAL_RATING,
+       MEDIA_PVR_TIMER_RECORD,
+       MEDIA_PVR_SERIES_RECORD,
+       MEDIA_PVR_HD,
+       MEDIA_PVR_SUBTITLE,
+       MEDIA_PVR_TTX,
+       MEDIA_PVR_AD,
+       MEDIA_PVR_HARDOF_HEARINGRADIO,
+       MEDIA_PVR_DATA_SERVICE,
+       MEDIA_PVR_CONTENT_LOCK,
+       MEDIA_PVR_CONTENT_WATCH,
+       MEDIA_PVR_HAS_AUDIO_ONLY,
+       MEDIA_PVR_IS_LOCAL_RECORDED,
+       MEDIA_PVR_RESOLUTION,
+       MEDIA_PVR_ASPECTRATIO,
+       MEDIA_PVR_MODIFIED_MONTH,
+       MEDIA_PVR_SPORTS_TYPE,
+       MEDIA_PVR_GUIDANCE_LENGTH,
+       MEDIA_PVR_TVMODE,
+       MEDIA_PVR_PLAY_COUNT,
+       MEDIA_PVR_PRIVATE_DATA,
+       MEDIA_PVR_HIGHLIGHT,
+} media_pvr_field_e;
+
+void _media_pvr_item_get_detail(sqlite3_stmt* stmt, media_pvr_h pvr)
+{
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_MEDIA_ID)))
+               _pvr->media_id = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_MEDIA_ID));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_STORAGE_ID)))
+               _pvr->storage_id = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_STORAGE_ID));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_PATH)))
+               _pvr->path = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_PATH));
+
+       _pvr->size = (unsigned long long)sqlite3_column_int64(stmt, MEDIA_PVR_SIZE);
+
+       _pvr->duration = (int)sqlite3_column_int(stmt, MEDIA_PVR_DURATION);
+
+       _pvr->timezone = (int)sqlite3_column_int(stmt, MEDIA_PVR_TIME_ZONE);
+
+       _pvr->ptc = (int)sqlite3_column_int(stmt, MEDIA_PVR_PTC);
+
+       _pvr->major = (int)sqlite3_column_int(stmt, MEDIA_PVR_MAJOR);
+
+       _pvr->minor = (int)sqlite3_column_int(stmt, MEDIA_PVR_MINOR);
+
+       _pvr->channel_type = (int)sqlite3_column_int(stmt, MEDIA_PVR_CHANNEL_TYPE);
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_CHANNEL_NAME)))
+               _pvr->channel_name = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_CHANNEL_NAME));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_CHANNEL_NUM)))
+               _pvr->channel_num = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_CHANNEL_NUM));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_PROGRAM_TITLE)))
+               _pvr->program_title = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_PROGRAM_TITLE));
+
+       _pvr->program_num = (int)sqlite3_column_int(stmt, MEDIA_PVR_PROGRAM_NUM);
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_PROGRAM_CRID)))
+               _pvr->program_crid = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_PROGRAM_CRID));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_GUIDANCE)))
+               _pvr->guidance = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_GUIDANCE));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_SYNOPSIS)))
+               _pvr->synopsis = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_SYNOPSIS));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_GENRE)))
+               _pvr->genre = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_GENRE));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_LANGUAGE)))
+               _pvr->language = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_LANGUAGE));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_MODIFIED_MONTH)))
+               _pvr->modified_month = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_MODIFIED_MONTH));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_PVR_PRIVATE_DATA)))
+               _pvr->private_data = strdup((const char *)sqlite3_column_text(stmt, MEDIA_PVR_PRIVATE_DATA));
+
+       _pvr->embargo_time = (int)sqlite3_column_int(stmt, MEDIA_PVR_EMBARGO_TIME);
+
+       _pvr->expiry_time = (int)sqlite3_column_int(stmt, MEDIA_PVR_EXPIRY_TIME);
+
+       _pvr->start_time = (int)sqlite3_column_int(stmt, MEDIA_PVR_START_TIME);
+
+       _pvr->program_start_time = (int)sqlite3_column_int(stmt, MEDIA_PVR_PROGRAM_START_TIME);
+
+       _pvr->program_end_time = (int)sqlite3_column_int(stmt, MEDIA_PVR_PROGRAM_END_TIME);
+
+       _pvr->program_date = (int)sqlite3_column_int(stmt, MEDIA_PVR_PROGRAM_DATE);
+
+       _pvr->parental_rating = (int)sqlite3_column_int(stmt, MEDIA_PVR_PARENTAL_RATING);
+
+       _pvr->timer_record = (int)sqlite3_column_int(stmt, MEDIA_PVR_TIMER_RECORD);
+
+       _pvr->series_record = (int)sqlite3_column_int(stmt, MEDIA_PVR_SERIES_RECORD);
+
+       _pvr->hd = (int)sqlite3_column_int(stmt, MEDIA_PVR_HD);
+
+       _pvr->subtitle = (int)sqlite3_column_int(stmt, MEDIA_PVR_SUBTITLE);
+
+       _pvr->ttx = (int)sqlite3_column_int(stmt, MEDIA_PVR_TTX);
+
+       _pvr->ad = (int)sqlite3_column_int(stmt, MEDIA_PVR_AD);
+
+       _pvr->hard_of_hearing_radio = (int)sqlite3_column_int(stmt, MEDIA_PVR_HARDOF_HEARINGRADIO);
+
+       _pvr->data_service = (int)sqlite3_column_int(stmt, MEDIA_PVR_DATA_SERVICE);
+
+       _pvr->content_lock = (int)sqlite3_column_int(stmt, MEDIA_PVR_CONTENT_LOCK);
+
+       _pvr->content_watch = (int)sqlite3_column_int(stmt, MEDIA_PVR_CONTENT_WATCH);
+
+       _pvr->has_audio_only = (int)sqlite3_column_int(stmt, MEDIA_PVR_HAS_AUDIO_ONLY);
+
+       _pvr->is_local_record = (int)sqlite3_column_int(stmt, MEDIA_PVR_IS_LOCAL_RECORDED);
+
+       _pvr->resolution = (int)sqlite3_column_int(stmt, MEDIA_PVR_RESOLUTION);
+
+       _pvr->aspectratio = (int)sqlite3_column_int(stmt, MEDIA_PVR_ASPECTRATIO);
+
+       _pvr->sports_type = (int)sqlite3_column_int(stmt, MEDIA_PVR_SPORTS_TYPE);
+
+       _pvr->guidance_length = (int)sqlite3_column_int(stmt, MEDIA_PVR_GUIDANCE_LENGTH);
+
+       _pvr->tvmode = (int)sqlite3_column_int(stmt, MEDIA_PVR_TVMODE);
+
+       _pvr->play_count = (int)sqlite3_column_int(stmt, MEDIA_PVR_PLAY_COUNT);
+
+       _pvr->highlight = (int)sqlite3_column_int(stmt, MEDIA_PVR_HIGHLIGHT);
+
+       return;
+}
+
+int _media_db_get_pvr(filter_h filter, media_pvr_cb callback, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       char select_query[DEFAULT_QUERY_SIZE];
+       char *condition_query = NULL;
+       char *option_query = NULL;
+       sqlite3_stmt *stmt = NULL;
+       attribute_h attr = NULL;
+       filter_s *_filter = (filter_s*)filter;
+
+       attr = _content_get_attirbute_handle();
+       memset(select_query, 0x00, sizeof(select_query));
+
+       if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+               snprintf(select_query, sizeof(select_query), SELECT_PVR_LIST_BY_STORAGE_ID, _filter->storage_id);
+       else
+               SAFE_STRLCAT(select_query, SELECT_PVR_LIST, sizeof(select_query));
+
+       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);
+
+       ret = _content_query_prepare(&stmt, select_query, condition_query, option_query);
+       SAFE_FREE(condition_query);
+       SAFE_FREE(option_query);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       while (sqlite3_step(stmt) == SQLITE_ROW) {
+               media_pvr_s *_pvr = (media_pvr_s*)calloc(1, sizeof(media_pvr_s));
+
+               if (_pvr == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       SQLITE3_FINALIZE(stmt);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+
+               _media_pvr_item_get_detail(stmt, (media_pvr_h)_pvr);
+
+               if (callback((media_pvr_h)_pvr, user_data) == false) {
+                       media_pvr_destroy((media_pvr_h) _pvr);
+                       break;
+               }
+
+               media_pvr_destroy((media_pvr_h) _pvr);
+       }
+
+       SQLITE3_FINALIZE(stmt);
+
+       return ret;
+}
+#endif
 
 int _media_db_get_storage_id_by_media_id(const char *media_id, char *storage_id)
 {
@@ -1154,3 +1802,104 @@ int _media_db_get_storage_id_by_media_id(const char *media_id, char *storage_id)
 
        return ret;
 }
+#ifdef _USE_TV_PROFILE
+typedef enum {
+       MEDIA_UHD_MEDIA_ID = 0,
+       MEDIA_UHD_STORAGE_ID,
+       MEDIA_UHD_PATH,
+       MEDIA_UHD_SIZE,
+       MEDIA_UHD_CONTENT_ID,
+       MEDIA_UHD_CONTENT_TITLE,
+       MEDIA_UHD_FILE_NAME,
+       MEDIA_UHD_FOLDER_ID,
+       MEDIA_UHD_RELEASE_DATE,
+       MEDIA_UHD_MODIFIED_TIME,
+       MEDIA_UHD_PLAYED_POSITION,
+       MEDIA_UHD_SUB_TYPE,
+       MEDIA_UHD_PLAYED_COUNT,
+} media_uhd_field_e;
+
+void _media_uhd_item_get_detail(sqlite3_stmt* stmt, media_uhd_h uhd)
+{
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_UHD_MEDIA_ID)))
+               _uhd->media_id = strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_MEDIA_ID));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_UHD_STORAGE_ID)))
+               _uhd->storage_id = strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_STORAGE_ID));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_UHD_PATH)))
+               _uhd->path = strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_PATH));
+
+       _uhd->size = (unsigned long long)sqlite3_column_int64(stmt, MEDIA_UHD_SIZE);
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_UHD_CONTENT_ID)))
+               _uhd->content_id = strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_CONTENT_ID));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_UHD_CONTENT_TITLE)))
+               _uhd->content_title = strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_CONTENT_TITLE));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_UHD_FILE_NAME)))
+               _uhd->file_name = strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_FILE_NAME));
+
+       if (STRING_VALID((const char *)sqlite3_column_text(stmt, MEDIA_UHD_RELEASE_DATE)))
+               _uhd->release_date = strdup((const char *)sqlite3_column_text(stmt, MEDIA_UHD_RELEASE_DATE));
+
+       _uhd->modified_time = (int)sqlite3_column_int(stmt, MEDIA_UHD_MODIFIED_TIME);
+       _uhd->played_position = (int)sqlite3_column_int(stmt, MEDIA_UHD_PLAYED_POSITION);
+       _uhd->sub_type = (int)sqlite3_column_int(stmt, MEDIA_UHD_SUB_TYPE);
+       _uhd->played_count = (int)sqlite3_column_int(stmt, MEDIA_UHD_PLAYED_COUNT);
+
+       return;
+}
+
+int _media_db_get_uhd(filter_h filter, media_uhd_cb callback, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       char select_query[DEFAULT_QUERY_SIZE];
+       char *condition_query = NULL;
+       char *option_query = NULL;
+       sqlite3_stmt *stmt = NULL;
+       attribute_h attr = NULL;
+       filter_s *_filter = (filter_s*)filter;
+
+       attr = _content_get_attirbute_handle();
+       memset(select_query, 0x00, sizeof(select_query));
+
+       if ((_filter != NULL) && STRING_VALID(_filter->storage_id))
+               snprintf(select_query, sizeof(select_query), SELECT_UHD_LIST_BY_STORAGE_ID, _filter->storage_id);
+       else
+               SAFE_STRLCAT(select_query, SELECT_UHD_LIST, sizeof(select_query));
+
+       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);
+
+       ret = _content_query_prepare(&stmt, select_query, condition_query, option_query);
+       SAFE_FREE(condition_query);
+       SAFE_FREE(option_query);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       while (sqlite3_step(stmt) == SQLITE_ROW) {
+               media_uhd_s *_uhd = (media_uhd_s*)calloc(1, sizeof(media_uhd_s));
+
+               if (_uhd == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       SQLITE3_FINALIZE(stmt);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+
+               _media_uhd_item_get_detail(stmt, (media_uhd_h)_uhd);
+
+               if (callback((media_uhd_h)_uhd, user_data) == false) {
+                       media_uhd_destroy((media_uhd_h) _uhd);
+                       break;
+               }
+               media_uhd_destroy((media_uhd_h) _uhd);
+       }
+
+       SQLITE3_FINALIZE(stmt);
+
+       return ret;
+}
+#endif
index 470a620..8bf71e9 100755 (executable)
@@ -76,6 +76,22 @@ int media_folder_foreach_media_from_db(const char *folder_id, filter_h filter, m
        return ret;
 }
 
+#ifdef _USE_SENIOR_MODE
+int media_folder_foreach_media_from_db_by_union_select(const char* folder_id, filter_h filter1, filter_h filter2, media_info_cb callback, void* user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+
+       if ((callback != NULL) && STRING_VALID(folder_id)) {
+               ret = _media_db_get_group_item_by_union_select(folder_id, filter1, filter2, callback, user_data);
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+#endif
+
 int media_folder_destroy(media_folder_h folder)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -496,3 +512,25 @@ int media_folder_set_order(media_folder_h folder, int order)
 
        return ret;
 }
+#ifdef _USE_TV_PROFILE
+int media_folder_get_scan_status(const char *storage_uuid, char* path, media_folder_scan_status_e *scan_status)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       int status = MEDIA_DIR_SCAN_NONE;
+
+       if (STRING_VALID(storage_uuid) && STRING_VALID(path)) {
+               ret = media_svc_get_folder_scan_status(_content_get_db_handle(), storage_uuid, path, &status);
+               if (ret != MS_MEDIA_ERR_NONE) {
+                       media_content_error("media_svc_get_folder_scan_status failed");
+                       ret = _content_error_capi(MEDIA_CONTENT_TYPE, ret);
+               } else {
+                       *scan_status = status;
+               }
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+#endif
index 71fb29e..e35e495 100755 (executable)
@@ -268,8 +268,11 @@ int media_album_get_album_art(media_album_h album, char **album_art)
 int media_group_get_group_count_from_db(filter_h filter, media_group_e group, int *group_count)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-
+#ifdef _USE_TV_PROFILE
+       if ((group < MEDIA_CONTENT_GROUP_DISPLAY_NAME) || (group >= MEDIA_GROUP_MAX) || (group_count == NULL)) {
+#else
        if ((group < MEDIA_CONTENT_GROUP_DISPLAY_NAME) || (group >= MEDIA_CONTENT_GROUP_MAX) || (group_count == NULL)) {
+#endif
                media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
                ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
        } else {
@@ -278,12 +281,30 @@ int media_group_get_group_count_from_db(filter_h filter, media_group_e group, in
 
        return ret;
 }
+#ifdef _USE_TV_PROFILE
+int media_group_foreach_group_and_count_from_db(filter_h filter, media_group_e group, media_group_and_count_cb callback, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+
+       if ((callback == NULL) || (group < MEDIA_CONTENT_GROUP_DISPLAY_NAME) || (group >= MEDIA_GROUP_MAX)) {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       } else {
+               ret = _media_db_get_media_group_and_count(group, filter, callback, user_data);
+       }
+
+       return ret;
+}
+#endif
 
 int media_group_foreach_group_from_db(filter_h filter, media_group_e group, media_group_cb callback, void *user_data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-
+#ifdef _USE_TV_PROFILE
+       if ((callback == NULL) || (group < MEDIA_CONTENT_GROUP_DISPLAY_NAME) || (group >= MEDIA_GROUP_MAX)) {
+#else
        if ((callback == NULL) || (group < MEDIA_CONTENT_GROUP_DISPLAY_NAME) || (group >= MEDIA_CONTENT_GROUP_MAX)) {
+#endif
                media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
                ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
        } else {
@@ -296,8 +317,11 @@ int media_group_foreach_group_from_db(filter_h filter, media_group_e group, medi
 int media_group_get_media_count_from_db(const char *group_name, media_group_e group, filter_h filter, int *media_count)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-
+#ifdef _USE_TV_PROFILE
+       if ((media_count == NULL) || (group < MEDIA_CONTENT_GROUP_DISPLAY_NAME) || (group >= MEDIA_GROUP_MAX)) {
+#else
        if ((media_count == NULL) || (group < MEDIA_CONTENT_GROUP_DISPLAY_NAME) || (group >= MEDIA_CONTENT_GROUP_MAX)) {
+#endif
                media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
                ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
        } else {
@@ -310,8 +334,11 @@ int media_group_get_media_count_from_db(const char *group_name, media_group_e gr
 int media_group_foreach_media_from_db(const char *group_name, media_group_e group, filter_h filter, media_info_cb callback, void *user_data)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
-
+#ifdef _USE_TV_PROFILE
+       if ((callback == NULL) || (group < MEDIA_CONTENT_GROUP_DISPLAY_NAME) || (group >= MEDIA_GROUP_MAX)) {
+#else
        if ((callback == NULL) || (group < MEDIA_CONTENT_GROUP_DISPLAY_NAME) || (group >= MEDIA_CONTENT_GROUP_MAX)) {
+#endif
                media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
                ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
        } else {
index c3b9364..bfc0d5d 100755 (executable)
@@ -20,6 +20,9 @@
 #include <media_info_private.h>
 #include <media_util_private.h>
 #include <system_info.h>
+#ifdef _USE_TV_PROFILE
+#include <media_content_internal.h>
+#endif
 
 static void __media_info_insert_completed_cb(media_request_result_s *result, void *user_data);
 static void __media_info_thumbnail_completed_cb(int error, const char *path, void *user_data);
@@ -476,6 +479,120 @@ int media_info_insert_burst_shot_to_db(const char **path_array, unsigned int arr
        return __media_info_insert_batch(MEDIA_BATCH_INSERT_BURSTSHOT, path_array, array_length, callback, user_data);
 }
 
+#ifdef _USE_SENIOR_MODE
+int media_info_insert_to_db_with_contact_data(const char *path, const char* contact, const char* app_data, media_info_h *info)
+{
+       int ret = media_info_insert_to_db(path, info);
+       media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_insert_to_db [%s] failed", path);
+
+       ret = media_info_set_contact(*info, contact);
+       if (ret != MEDIA_CONTENT_ERROR_NONE) {
+               media_content_error("media_info_set_contact [%s] failed", contact);
+
+               media_info_s* _media_info = (media_info_s*)*info;
+               ret = media_info_delete_from_db(_media_info->media_id);
+               media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_delete_from_db [%s] failed", _media_info->media_id);
+
+               media_info_destroy(*info);
+               return ret;
+       }
+
+       ret = media_info_set_app_data(*info, app_data);
+       if (ret != MEDIA_CONTENT_ERROR_NONE) {
+               media_content_error("media_info_set_app_data [%s] failed", app_data);
+
+               media_info_s* _media_info = (media_info_s*)*info;
+               ret = media_info_delete_from_db(_media_info->media_id);
+               media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_delete_from_db [%s] failed", _media_info->media_id);
+
+               media_info_destroy(*info);
+               return ret;
+       }
+
+       ret = media_info_update_to_db(*info);
+       if (ret != MEDIA_CONTENT_ERROR_NONE) {
+               media_content_error("media_info_update_to_db [] failed");
+
+               media_info_s* _media_info = (media_info_s*)*info;
+               ret = media_info_delete_from_db(_media_info->media_id);
+               media_content_retvm_if(ret != MEDIA_CONTENT_ERROR_NONE, ret, "media_info_delete_from_db [%s] failed", _media_info->media_id);
+
+               media_info_destroy(*info);
+               return ret;
+       }
+
+       return ret;
+}
+
+int media_info_delete_contact_from_db(const char* contact, const char* storage_id)
+{
+       return -1;
+}
+
+int media_info_get_media_info_by_path_from_db(const char* path, media_info_h* media)
+{
+       char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0,};
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_content_retvm_if(!STRING_VALID(path), MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "invalid path");
+       media_content_retvm_if(media == NULL, MEDIA_CONTENT_ERROR_INVALID_PARAMETER, "invalid info");
+
+       memset(storage_id, 0x00, sizeof(storage_id));
+       ret = media_svc_get_storage_id(_content_get_db_handle(), path, storage_id);
+       if (ret != MS_MEDIA_ERR_NONE) {
+               media_content_error("media_svc_get_storage_id failed : %d", ret);
+               return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
+       }
+
+       media_info_s *_media = (media_info_s*)calloc(1, sizeof(media_info_s));
+       media_content_retvm_if(_media == NULL, MEDIA_CONTENT_ERROR_OUT_OF_MEMORY, "OUT_OF_MEMORY");
+
+       ret =  _media_info_get_media_info_from_db(path, storage_id, (media_info_h)_media);
+       *media = (media_info_h)_media;
+
+       return ret;
+}
+
+int media_info_delete_item(const char *media_id)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       char *path = NULL;
+       char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0,};
+
+       if (!STRING_VALID(media_id)) {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       memset(storage_id, 0x00, sizeof(storage_id));
+
+       ret = __media_info_get_media_path_by_id_from_db(media_id, &path);
+       if (ret != MEDIA_CONTENT_ERROR_NONE) {
+               media_content_error("__media_info_get_media_path_by_id_from_db failed : %d", ret);
+               SAFE_FREE(path);
+               return ret;
+       }
+
+       ret = _media_db_get_storage_id_by_media_id(media_id, storage_id);
+       if (ret != MEDIA_CONTENT_ERROR_NONE) {
+               media_content_error("_media_db_get_storage_id_by_media_id failed : %d", ret);
+               SAFE_FREE(path);
+               return ret;
+       }
+
+       ret = media_svc_delete_item_by_path(_content_get_db_handle(), storage_id, path, tzplatform_getuid(TZ_USER_NAME));
+       if (ret != MEDIA_CONTENT_ERROR_NONE) {
+               media_content_error("remove from DB failed : %d", ret);
+               SAFE_FREE(path);
+               return ret;
+       }
+
+       ret = media_svc_remove_file(path);
+       SAFE_FREE(path);
+       return _content_error_capi(MEDIA_CONTENT_TYPE, ret);
+}
+
+#endif
+
 int media_info_delete_from_db(const char *media_id)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -638,8 +755,15 @@ int media_info_destroy(media_info_h media)
                SAFE_FREE(_media->age_rating);
                SAFE_FREE(_media->keyword);
                SAFE_FREE(_media->title);
+#ifdef _USE_TV_PROFILE
+               SAFE_FREE(_media->modified_month);
+#endif
                SAFE_FREE(_media->weather);
                SAFE_FREE(_media->storage_uuid);
+#ifdef _USE_SENIOR_MODE
+               SAFE_FREE(_media->contact);
+               SAFE_FREE(_media->app_data);
+#endif
 
                if (_media->image_meta) {
                        SAFE_FREE(_media->image_meta->media_id);
@@ -836,6 +960,35 @@ int media_info_clone(media_info_h *dst, media_info_h src)
                                return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
                        }
                }
+#ifdef _USE_TV_PROFILE
+               if (STRING_VALID(_src->modified_month)) {
+                       _dst->modified_month = strdup(_src->modified_month);
+                       if (_dst->modified_month == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_info_destroy((media_info_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+#endif
+#ifdef _USE_SENIOR_MODE
+               if (STRING_VALID(_src->contact)) {
+                       _dst->contact = strdup(_src->contact);
+                       if (_dst->contact == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_info_destroy((media_info_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->app_data)) {
+                       _dst->app_data = strdup(_src->app_data);
+                       if (_dst->app_data == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_info_destroy((media_info_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+#endif
 
                _dst->media_type = _src->media_type;
                _dst->size = _src->size;
@@ -856,6 +1009,9 @@ int media_info_clone(media_info_h *dst, media_info_h src)
                _dst->request_id = _src->request_id;
                _dst->face_request_id = _src->face_request_id;
                _dst->is_360 = _src->is_360;
+#ifdef _USE_TV_PROFILE
+               _dst->extract_flag = _src->extract_flag;
+#endif
 
                if (_src->media_type == MEDIA_CONTENT_TYPE_IMAGE && _src->image_meta) {
                        _dst->image_meta = (image_meta_s *)calloc(1, sizeof(image_meta_s));
@@ -1568,6 +1724,23 @@ int media_info_get_title(media_info_h media, char **title)
 
        return ret;
 }
+#ifdef _USE_TV_PROFILE
+int media_info_get_extract_flag(media_info_h media, int *extract_flag)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_info_s *_media = (media_info_s *)media;
+
+       if (_media && extract_flag) {
+               *extract_flag = _media->extract_flag;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+#endif
 
 int media_info_get_description(media_info_h media, char **description)
 {
@@ -1907,6 +2080,24 @@ int media_info_get_storage_type(media_info_h media, media_content_storage_e *sto
        return ret;
 }
 
+#ifdef _USE_TV_PROFILE
+int media_info_get_played_position(media_info_h media, int *played_position)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_info_s *_media = (media_info_s*)media;
+
+       if (_media) {
+               *played_position = _media->played_position;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+#endif
+
 int media_info_get_played_count(media_info_h media, int *played_count)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -1955,6 +2146,98 @@ int media_info_increase_played_count(media_info_h media)
        return ret;
 }
 
+#ifdef _USE_TV_PROFILE
+int media_info_get_modified_month(media_info_h media, char **modified_month)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_info_s *_media = (media_info_s*)media;
+
+       if (_media && modified_month) {
+               if (STRING_VALID(_media->modified_month)) {
+                       *modified_month = strdup(_media->modified_month);
+                       if (*modified_month == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *modified_month = NULL;
+               }
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+#endif
+#ifdef _USE_SENIOR_MODE
+int media_info_get_contact(media_info_h media, char **contact)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_info_s *_media = (media_info_s*)media;
+
+       if (_media && contact) {
+               if (STRING_VALID(_media->contact)) {
+                       *contact = strdup(_media->contact);
+                       if (*contact == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *contact = NULL;
+               }
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_info_get_app_data(media_info_h media, char **app_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_info_s *_media = (media_info_s*)media;
+
+       if (_media && app_data) {
+               if (STRING_VALID(_media->app_data)) {
+                       *app_data = strdup(_media->app_data);
+                       if (*app_data == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *app_data = NULL;
+               }
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+#endif
+#ifdef _USE_TV_PROFILE
+int media_info_set_played_count(media_info_h media, int played_count)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+
+       media_info_s *_media = (media_info_s*)media;
+
+       if (_media) {
+               _media->played_count = played_count;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+#endif
+
 int media_info_set_played_time(media_info_h media)
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -1972,6 +2255,22 @@ int media_info_set_played_time(media_info_h media)
 
        return ret;
 }
+#ifdef _USE_TV_PROFILE
+int media_info_set_played_position(media_info_h media, int played_position)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_info_s *_media = (media_info_s*)media;
+
+       if ((_media != NULL) && (played_position >= 0)) {
+               _media->played_position = played_position;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+#endif
 
 int media_info_get_media_from_db(const char *media_id, media_info_h *media)
 {
@@ -2401,15 +2700,28 @@ int media_info_update_to_db(media_info_h media)
                                recorded_date = strdup(_media->audio_meta->recorded_date);
                }
 
-               set_sql = sqlite3_mprintf("file_name=%Q, added_time=%d, description=%Q, longitude=%f, latitude=%f, altitude=%f, \
-                       played_count=%d, last_played_time=%d, last_played_position=%d, \
-                       rating=%d, favourite=%d, author=%Q, provider=%Q, content_name=%Q, category=%Q, location_tag=%Q, age_rating=%Q, keyword=%Q, weather=%Q, sync_status=%d, \
-                       file_name_pinyin=%Q, description_pinyin=%Q, author_pinyin=%Q, provider_pinyin=%Q, content_name_pinyin=%Q, category_pinyin=%Q, location_tag_pinyin=%Q, age_rating_pinyin=%Q, keyword_pinyin=%Q, title=%Q, \
-                       album=%Q, artist=%Q, genre=%Q, recorded_date=%Q",
-                       _media->display_name, _media->added_time, _media->description, _media->longitude, _media->latitude, _media->altitude, _media->played_count, _media->played_time, _media->played_position, _media->rating, _media->favourite,
-                       _media->author, _media->provider, _media->content_name, _media->category, _media->location_tag, _media->age_rating, _media->keyword, _media->weather, _media->sync_status,
-                       file_name_pinyin, description_pinyin, author_pinyin, provider_pinyin, content_name_pinyin, category_pinyin, location_tag_pinyin, age_rating_pinyin, keyword_pinyin, _media->title,
-                       album, artist, genre, recorded_date);
+#ifdef _USE_SENIOR_MODE
+               if (_media_content_is_support_senior_mode()) {
+                       set_sql = sqlite3_mprintf("file_name=%Q, added_time=%d, description=%Q, longitude=%f, latitude=%f, altitude=%f, \
+                               played_count=%d, last_played_time=%d, last_played_position=%d, \
+                               rating=%d, favourite=%d, author=%Q, provider=%Q, content_name=%Q, category=%Q, location_tag=%Q, age_rating=%Q, keyword=%Q, weather=%Q, sync_status=%d, \
+                               file_name_pinyin=%Q, description_pinyin=%Q, author_pinyin=%Q, provider_pinyin=%Q, content_name_pinyin=%Q, category_pinyin=%Q, location_tag_pinyin=%Q, age_rating_pinyin=%Q, keyword_pinyin=%Q, title=%Q, contact=%Q, app_data=%Q",
+                               _media->display_name, _media->added_time, _media->description, _media->longitude, _media->latitude, _media->altitude, _media->played_count, _media->played_time, _media->played_position, _media->rating, _media->favourite,
+                               _media->author, _media->provider, _media->content_name, _media->category, _media->location_tag, _media->age_rating, _media->keyword, _media->weather, _media->sync_status,
+                               file_name_pinyin, description_pinyin, author_pinyin, provider_pinyin, content_name_pinyin, category_pinyin, location_tag_pinyin, age_rating_pinyin, keyword_pinyin, _media->title, _media->contact, _media->app_data);
+               } else
+#endif
+               {
+                       set_sql = sqlite3_mprintf("file_name=%Q, added_time=%d, description=%Q, longitude=%f, latitude=%f, altitude=%f, \
+                               played_count=%d, last_played_time=%d, last_played_position=%d, \
+                               rating=%d, favourite=%d, author=%Q, provider=%Q, content_name=%Q, category=%Q, location_tag=%Q, age_rating=%Q, keyword=%Q, weather=%Q, sync_status=%d, \
+                               file_name_pinyin=%Q, description_pinyin=%Q, author_pinyin=%Q, provider_pinyin=%Q, content_name_pinyin=%Q, category_pinyin=%Q, location_tag_pinyin=%Q, age_rating_pinyin=%Q, keyword_pinyin=%Q, title=%Q, \
+                               album=%Q, artist=%Q, genre=%Q, recorded_date=%Q",
+                               _media->display_name, _media->added_time, _media->description, _media->longitude, _media->latitude, _media->altitude, _media->played_count, _media->played_time, _media->played_position, _media->rating, _media->favourite,
+                               _media->author, _media->provider, _media->content_name, _media->category, _media->location_tag, _media->age_rating, _media->keyword, _media->weather, _media->sync_status,
+                               file_name_pinyin, description_pinyin, author_pinyin, provider_pinyin, content_name_pinyin, category_pinyin, location_tag_pinyin, age_rating_pinyin, keyword_pinyin, _media->title,
+                               album, artist, genre, recorded_date);
+               }
 
                sql = sqlite3_mprintf("UPDATE %Q SET %s WHERE media_uuid=%Q", _media->storage_uuid, set_sql, _media->media_id);
 
@@ -2701,6 +3013,13 @@ static int __media_info_map_data_usr_to_svc(media_info_s *media, media_svc_conte
        svc_content_info->played_count = media->played_count;
        svc_content_info->favourate = media->favourite;
 
+#ifdef _USE_SENIOR_MODE
+       if (_media_content_is_support_senior_mode()) {
+               svc_content_info->contact = g_strdup(media->contact);
+               svc_content_info->app_data = g_strdup(media->app_data);
+       }
+#endif
+
        svc_content_info->media_meta.title = g_strdup(media->title);
        svc_content_info->media_meta.rating = media->rating;
        svc_content_info->media_meta.description = g_strdup(media->description);
@@ -3296,3 +3615,16 @@ int media_info_set_storage_type(media_info_h media, media_content_storage_e stor
 
        return MEDIA_CONTENT_ERROR_NONE;
 }
+
+#ifdef _USE_SENIOR_MODE
+int media_info_set_contact(media_info_h media, const char *contact)
+{
+       return __media_info_set_str_data(media, MEDIA_INFO_CONTACT, contact);
+}
+
+int media_info_set_app_data(media_info_h media, const char *app_data)
+{
+       return __media_info_set_str_data(media, MEDIA_INFO_APP_DATA, app_data);
+}
+#endif
+
diff --git a/src/media_pvr.c b/src/media_pvr.c
new file mode 100755 (executable)
index 0000000..a916b44
--- /dev/null
@@ -0,0 +1,1309 @@
+ /*
+ * 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.
+ */
+
+#ifdef _USE_TV_PROFILE
+#include <media_content.h>
+#include <media_content_internal.h>
+#include <media_info_private.h>
+#include <media_util_private.h>
+#include <media_pvr.h>
+
+
+int media_pvr_get_media_count_from_db(filter_h filter, int *media_count)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+
+       if (media_count) {
+               ret = _media_db_get_group_item_count(NULL, filter, MEDIA_GROUP_PVR, media_count);
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_foreach_media_from_db(filter_h filter, media_pvr_cb callback, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+
+       if (callback != NULL) {
+               ret = _media_db_get_pvr(filter, callback, user_data);
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_destroy(media_pvr_h pvr)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+       if (_pvr) {
+               SAFE_FREE(_pvr->media_id);
+               SAFE_FREE(_pvr->storage_id);
+               SAFE_FREE(_pvr->channel_name);
+               SAFE_FREE(_pvr->channel_num);
+               SAFE_FREE(_pvr->program_title);
+               SAFE_FREE(_pvr->program_crid);
+               SAFE_FREE(_pvr->guidance);
+               SAFE_FREE(_pvr->synopsis);
+               SAFE_FREE(_pvr->genre);
+               SAFE_FREE(_pvr->language);
+               SAFE_FREE(_pvr->path);
+               SAFE_FREE(_pvr->modified_month);
+               SAFE_FREE(_pvr->private_data);
+               SAFE_FREE(_pvr);
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_clone(media_pvr_h *dst, media_pvr_h src)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_src = (media_pvr_s*)src;
+
+       if (_src != NULL) {
+               media_pvr_s *_dst = (media_pvr_s*)calloc(1, sizeof(media_pvr_s));
+               if (_dst == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+
+               if (STRING_VALID(_src->media_id)) {
+                       _dst->media_id = strdup(_src->media_id);
+                       if (_dst->media_id == NULL) {
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->channel_name)) {
+                       _dst->channel_name = strdup(_src->channel_name);
+                       if (_dst->channel_name == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->channel_num)) {
+                       _dst->channel_num = strdup(_src->channel_num);
+                       if (_dst->channel_num == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->program_title)) {
+                       _dst->program_title = strdup(_src->program_title);
+                       if (_dst->program_title == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->program_crid)) {
+                       _dst->program_crid = strdup(_src->program_crid);
+                       if (_dst->program_crid == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->guidance)) {
+                       _dst->guidance = strdup(_src->guidance);
+                       if (_dst->guidance == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->synopsis)) {
+                       _dst->synopsis = strdup(_src->synopsis);
+                       if (_dst->synopsis == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->genre)) {
+                       _dst->genre = strdup(_src->genre);
+                       if (_dst->genre == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->language)) {
+                       _dst->language = strdup(_src->language);
+                       if (_dst->language == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->path)) {
+                       _dst->path = strdup(_src->path);
+                       if (_dst->path == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->storage_id)) {
+                       _dst->storage_id = strdup(_src->storage_id);
+                       if (_dst->storage_id == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->modified_month)) {
+                       _dst->modified_month = strdup(_src->modified_month);
+                       if (_dst->modified_month == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->private_data)) {
+                       _dst->private_data = strdup(_src->private_data);
+                       if (_dst->private_data == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_pvr_destroy((media_pvr_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+               _dst->duration = _src->duration;
+               _dst->timezone = _src->timezone;
+               _dst->ptc = _src->ptc;
+               _dst->major = _src->major;
+               _dst->minor = _src->minor;
+               _dst->channel_type = _src->channel_type;
+               _dst->program_num = _src->program_num;
+               _dst->timer_record = _src->timer_record;
+               _dst->series_record = _src->series_record;
+               _dst->hd = _src->hd;
+               _dst->subtitle = _src->subtitle;
+               _dst->ttx = _src->ttx;
+               _dst->ad = _src->ad;
+               _dst->hard_of_hearing_radio = _src->hard_of_hearing_radio;
+               _dst->data_service = _src->data_service;
+               _dst->content_lock = _src->content_lock;
+               _dst->embargo_time = _src->embargo_time;
+               _dst->expiry_time = _src->expiry_time;
+               _dst->size = _src->size;
+               _dst->parental_rating = _src->parental_rating;
+               _dst->start_time = _src->start_time;
+               _dst->program_start_time = _src->program_start_time;
+               _dst->program_end_time = _src->program_end_time;
+               _dst->program_date = _src->program_date;
+               _dst->content_watch = _src->content_watch;
+               _dst->has_audio_only = _src->has_audio_only;
+               _dst->is_local_record = _src->is_local_record;
+               _dst->resolution = _src->resolution;
+               _dst->aspectratio = _src->aspectratio;
+               _dst->sports_type = _src->sports_type;
+               _dst->guidance_length = _src->guidance_length;
+               _dst->tvmode = _src->tvmode;
+               _dst->play_count = _src->play_count;
+
+               *dst = (media_pvr_h)_dst;
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_pvr_from_db(const char *media_id, media_pvr_h *pvr)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       char *select_query = NULL;
+       sqlite3_stmt *stmt = NULL;
+
+       if (!STRING_VALID(media_id) || (pvr == NULL)) {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       select_query = sqlite3_mprintf(SELECT_PVR_FROM_PVR, media_id);
+
+       ret = _content_query_prepare(&stmt, select_query, NULL, NULL);
+       sqlite3_free(select_query);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       media_pvr_s *_pvr = NULL;
+
+       while (sqlite3_step(stmt) == SQLITE_ROW) {
+               if (_pvr)
+                       media_pvr_destroy((media_pvr_h)_pvr);
+
+               _pvr = (media_pvr_s*)calloc(1, sizeof(media_pvr_s));
+
+               if (_pvr == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       SQLITE3_FINALIZE(stmt);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+
+               _media_pvr_item_get_detail(stmt, (media_pvr_h)_pvr);
+
+               *pvr = (media_info_h)_pvr;
+       }
+
+       SQLITE3_FINALIZE(stmt);
+
+       return ret;
+}
+
+int media_pvr_get_media_id(media_pvr_h pvr, char **media_id)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && media_id) {
+               if (STRING_VALID(_pvr->media_id)) {
+                       *media_id = strdup(_pvr->media_id);
+                       if (*media_id == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *media_id = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_channel_name(media_pvr_h pvr, char **channel_name)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && channel_name) {
+               if (STRING_VALID(_pvr->channel_name)) {
+                       *channel_name = strdup(_pvr->channel_name);
+                       if (*channel_name == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *channel_name = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_channel_num(media_pvr_h pvr, char **channel_num)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && channel_num) {
+               if (STRING_VALID(_pvr->channel_num)) {
+                       *channel_num = strdup(_pvr->channel_num);
+                       if (*channel_num == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *channel_num = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_program_title(media_pvr_h pvr, char **program_title)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && program_title) {
+               if (STRING_VALID(_pvr->program_title)) {
+                       *program_title = strdup(_pvr->program_title);
+                       if (*program_title == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *program_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 media_pvr_get_program_crid(media_pvr_h pvr, char **program_crid)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && program_crid) {
+               if (STRING_VALID(_pvr->program_crid)) {
+                       *program_crid = strdup(_pvr->program_crid);
+                       if (*program_crid == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *program_crid = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_guidance(media_pvr_h pvr, char **guidance)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && guidance) {
+               if (STRING_VALID(_pvr->guidance)) {
+                       *guidance = strdup(_pvr->guidance);
+                       if (*guidance == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *guidance = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_synopsis(media_pvr_h pvr, char **synopsis)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && synopsis) {
+               if (STRING_VALID(_pvr->synopsis)) {
+                       *synopsis = strdup(_pvr->synopsis);
+                       if (*synopsis == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *synopsis = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_genre(media_pvr_h pvr, char **genre)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && genre) {
+               if (STRING_VALID(_pvr->genre)) {
+                       *genre = strdup(_pvr->genre);
+                       if (*genre == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *genre = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_language(media_pvr_h pvr, char **language)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && language) {
+               if (STRING_VALID(_pvr->language)) {
+                       *language = strdup(_pvr->language);
+                       if (*language == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *language = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_path(media_pvr_h pvr, char **path)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && path) {
+               if (STRING_VALID(_pvr->path)) {
+                       *path = strdup(_pvr->path);
+                       if (*path == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *path = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_storage_id(media_pvr_h pvr, char **storage_id)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && storage_id) {
+               if (STRING_VALID(_pvr->storage_id)) {
+                       *storage_id = strdup(_pvr->storage_id);
+                       if (*storage_id == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *storage_id = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_size(media_pvr_h pvr, unsigned long long *size)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && size) {
+               *size = _pvr->size;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_timezone(media_pvr_h pvr, int *timezone)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && timezone) {
+               *timezone = _pvr->timezone;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_ptc(media_pvr_h pvr, int *ptc)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && ptc) {
+               *ptc = _pvr->ptc;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_major(media_pvr_h pvr, int *major)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && major) {
+               *major = _pvr->major;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_minor(media_pvr_h pvr, int *minor)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && minor) {
+               *minor = _pvr->minor;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_channel_type(media_pvr_h pvr, int *channel_type)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && channel_type) {
+               *channel_type = _pvr->channel_type;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_program_num(media_pvr_h pvr, int *program_num)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && program_num) {
+               *program_num = _pvr->program_num;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_duration(media_pvr_h pvr, int *duration)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && duration) {
+               *duration = _pvr->duration;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_embargo_time(media_pvr_h pvr, int *embargo_time)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && embargo_time) {
+               *embargo_time = _pvr->embargo_time;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_expiry_time(media_pvr_h pvr, int *expiry_time)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && expiry_time) {
+               *expiry_time = _pvr->expiry_time;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_parental_rating(media_pvr_h pvr, int *parental_rating)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && parental_rating) {
+               *parental_rating = _pvr->parental_rating;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_start_time(media_pvr_h pvr, int *start_time)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && start_time) {
+               *start_time = _pvr->start_time;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_program_start_time(media_pvr_h pvr, int *program_start_time)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && program_start_time) {
+               *program_start_time = _pvr->program_start_time;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_program_end_time(media_pvr_h pvr, int *end_time)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && end_time) {
+               *end_time = _pvr->program_end_time;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_program_date(media_pvr_h pvr, int *program_date)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && program_date) {
+               *program_date = _pvr->program_date;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_timer_record(media_pvr_h pvr, bool* timer_record)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && timer_record) {
+               *timer_record = _pvr->timer_record;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_series_record(media_pvr_h pvr, bool* series_record)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && series_record) {
+               *series_record = _pvr->series_record;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_hd(media_pvr_h pvr, int* hd)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && hd) {
+               *hd = _pvr->hd;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_subtitle(media_pvr_h pvr, bool* subtitle)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && subtitle) {
+               *subtitle = _pvr->subtitle;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_ttx(media_pvr_h pvr, bool* ttx)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && ttx) {
+               *ttx = _pvr->ttx;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_ad(media_pvr_h pvr, bool* ad)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && ad) {
+               *ad = _pvr->ad;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_hard_of_hearing_radio(media_pvr_h pvr, bool* hard_of_hearing_radio)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && hard_of_hearing_radio) {
+               *hard_of_hearing_radio = _pvr->hard_of_hearing_radio;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_data_service(media_pvr_h pvr, bool* data_service)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && data_service) {
+               *data_service = _pvr->data_service;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_content_lock(media_pvr_h pvr, bool* content_lock)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && content_lock) {
+               *content_lock = _pvr->content_lock;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_content_watch(media_pvr_h pvr, bool* content_watch)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && content_watch) {
+               *content_watch = _pvr->content_watch;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_has_audio_only(media_pvr_h pvr, bool* has_audio_only)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && has_audio_only) {
+               *has_audio_only = _pvr->has_audio_only;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_is_local_record(media_pvr_h pvr, bool* is_local_record)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && is_local_record) {
+               *is_local_record = _pvr->is_local_record;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_resolution(media_pvr_h pvr, media_pvr_resolution_e* resolution)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && resolution) {
+               *resolution = _pvr->resolution;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_aspectratio(media_pvr_h pvr, media_pvr_aspectratio_e* aspectratio)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && aspectratio) {
+               *aspectratio = _pvr->aspectratio;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_modified_month(media_pvr_h pvr, char **modified_month)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && modified_month) {
+               if (STRING_VALID(_pvr->modified_month)) {
+                       *modified_month = strdup(_pvr->modified_month);
+                       if (*modified_month == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *modified_month = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_sports_type(media_pvr_h pvr, int* sports_type)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && sports_type) {
+               *sports_type = _pvr->sports_type;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_guidance_length(media_pvr_h pvr, int* guidance_length)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && guidance_length) {
+               *guidance_length = _pvr->guidance_length;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_tvmode(media_pvr_h pvr, int* tvmode)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && tvmode) {
+               *tvmode = _pvr->tvmode;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_play_count(media_pvr_h pvr, int* play_count)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && play_count) {
+               *play_count = _pvr->play_count;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_private_data(media_pvr_h pvr, char **private_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && private_data) {
+               if (STRING_VALID(_pvr->private_data)) {
+                       *private_data = strdup(_pvr->private_data);
+                       if (*private_data == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *private_data = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_get_highlight(media_pvr_h pvr, bool *highlight)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr && highlight) {
+               *highlight = _pvr->highlight;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_set_play_count(media_pvr_h pvr, int play_count)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr != NULL) {
+               _pvr->play_count = play_count;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_set_program_title(media_pvr_h pvr, const char *program_title)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr != NULL && STRING_VALID(program_title)) {
+               SAFE_FREE(_pvr->program_title);
+               _pvr->program_title = strdup(program_title);
+               if (_pvr->program_title == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_set_content_lock(media_pvr_h pvr, bool content_lock)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr != NULL) {
+               _pvr->content_lock = content_lock;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_set_content_watch(media_pvr_h pvr, bool content_watch)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr != NULL) {
+               _pvr->content_watch = content_watch;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_set_highlight(media_pvr_h pvr, bool highlight)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+
+       if (_pvr != NULL) {
+               _pvr->highlight = highlight;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_update_to_db(media_pvr_h pvr)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_s *_pvr = (media_pvr_s*)pvr;
+       char *update_query = NULL;
+
+       if (_pvr != NULL && STRING_VALID(_pvr->media_id) && STRING_VALID(_pvr->path)) {
+               update_query = sqlite3_mprintf(UPDATE_PVR_META_FROM_PVR, _pvr->program_title, _pvr->content_lock, _pvr->content_watch, _pvr->play_count, _pvr->highlight, _pvr->media_id);
+
+               ret = _content_query_sql(update_query);
+               sqlite3_free(update_query);
+
+               if (ret == MEDIA_CONTENT_ERROR_NONE)
+                       media_svc_update_pvr_info(_content_get_db_handle(), _pvr->path, _pvr->program_title, _pvr->content_lock);
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_pvr_group_foreach_media_from_db(const char *group_name, media_group_e group, filter_h filter, media_pvr_cb callback, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+
+       if ((callback == NULL) || (group < MEDIA_PVR_GROUP_DURATION) || (group >= MEDIA_GROUP_MAX)) {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       } else {
+               ret = _media_db_get_pvr_group_item(group_name, filter, group, callback, user_data);
+       }
+
+       return ret;
+}
+
+int media_pvr_set_is_local_record(const char *pvr_path, bool is_local_record)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       char *update_query = NULL;
+       char storage_id[MEDIA_CONTENT_UUID_SIZE+1] = {0,};
+
+       if (pvr_path == NULL) {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       } else {
+
+               /*get the storage uuid*/
+               ret = media_svc_get_storage_id(_content_get_db_handle(), pvr_path, storage_id);
+               if (ret == MS_MEDIA_ERR_NONE) {
+                       media_content_error("storage uuid [%s]", storage_id);
+                       update_query = sqlite3_mprintf(UPDATE_PVR_LOCAL_RECORD_PVR, is_local_record, pvr_path, storage_id);
+
+                       ret = _content_query_sql(update_query);
+                       sqlite3_free(update_query);
+               } else {
+                       media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+                       media_content_error("pvr path[%s] error[%d]", pvr_path, ret);
+                       ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+               }
+       }
+
+       return ret;
+}
+#endif
diff --git a/src/media_uhd.c b/src/media_uhd.c
new file mode 100755 (executable)
index 0000000..39c8208
--- /dev/null
@@ -0,0 +1,564 @@
+ /*
+ * 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.
+ */
+#ifdef _USE_TV_PROFILE
+#include <media_content.h>
+#include <media_content_internal.h>
+#include <media_info_private.h>
+#include <media_util_private.h>
+#include <media_uhd.h>
+
+int media_uhd_get_media_count_from_db(filter_h filter, int *media_count)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+
+       if (media_count) {
+               ret = _media_db_get_group_item_count(NULL, filter, MEDIA_GROUP_UHD, media_count);
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_foreach_media_from_db(filter_h filter, media_uhd_cb callback, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+
+       if (callback != NULL) {
+               ret = _media_db_get_uhd(filter, callback, user_data);
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_destroy(media_uhd_h uhd)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+       if (_uhd) {
+               SAFE_FREE(_uhd->media_id);
+               SAFE_FREE(_uhd->storage_id);
+               SAFE_FREE(_uhd->path);
+               SAFE_FREE(_uhd->content_id);
+               SAFE_FREE(_uhd->content_title);
+               SAFE_FREE(_uhd->file_name);
+               SAFE_FREE(_uhd->release_date);
+               SAFE_FREE(_uhd);
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_clone(media_uhd_h *dst, media_uhd_h src)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_src = (media_uhd_s*)src;
+
+       if (_src != NULL) {
+               media_uhd_s *_dst = (media_uhd_s*)calloc(1, sizeof(media_uhd_s));
+               if (_dst == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+
+               if (STRING_VALID(_src->media_id)) {
+                       _dst->media_id = strdup(_src->media_id);
+                       if (_dst->media_id == NULL) {
+                               media_uhd_destroy((media_uhd_h)_dst);
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->storage_id)) {
+                       _dst->storage_id = strdup(_src->storage_id);
+                       if (_dst->storage_id == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_uhd_destroy((media_uhd_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->path)) {
+                       _dst->path = strdup(_src->path);
+                       if (_dst->path == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_uhd_destroy((media_uhd_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->content_id)) {
+                       _dst->content_id = strdup(_src->content_id);
+                       if (_dst->content_id == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_uhd_destroy((media_uhd_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->content_title)) {
+                       _dst->content_title = strdup(_src->content_title);
+                       if (_dst->content_title == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_uhd_destroy((media_uhd_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->release_date)) {
+                       _dst->release_date = strdup(_src->release_date);
+                       if (_dst->release_date == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_uhd_destroy((media_uhd_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               if (STRING_VALID(_src->file_name)) {
+                       _dst->file_name = strdup(_src->file_name);
+                       if (_dst->file_name == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               media_uhd_destroy((media_uhd_h)_dst);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               }
+
+               _dst->size = _src->size;
+               _dst->modified_time = _src->modified_time;
+               _dst->played_position = _src->played_position;
+               _dst->sub_type = _src->sub_type;
+               _dst->played_count = _src->played_count;
+               *dst = (media_uhd_h)_dst;
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_uhd_from_db(const char *media_id, media_uhd_h *uhd)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       char *select_query = NULL;
+       sqlite3_stmt *stmt = NULL;
+
+       if (!STRING_VALID(media_id) || (uhd == NULL)) {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               return MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       select_query = sqlite3_mprintf(SELECT_UHD_FROM_UHD, media_id);
+
+       ret = _content_query_prepare(&stmt, select_query, NULL, NULL);
+       sqlite3_free(select_query);
+       media_content_retv_if(ret != MEDIA_CONTENT_ERROR_NONE, ret);
+
+       media_uhd_s *_uhd = NULL;
+
+       while (sqlite3_step(stmt) == SQLITE_ROW) {
+               if (_uhd)
+                       media_uhd_destroy((media_uhd_h)_uhd);
+
+               _uhd = (media_uhd_s*)calloc(1, sizeof(media_uhd_s));
+
+               if (_uhd == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       SQLITE3_FINALIZE(stmt);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+
+               _media_uhd_item_get_detail(stmt, (media_uhd_h)_uhd);
+
+               *uhd = (media_uhd_h)_uhd;
+       }
+
+       SQLITE3_FINALIZE(stmt);
+
+       return ret;
+}
+
+int media_uhd_get_media_id(media_uhd_h uhd, char **media_id)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd && media_id) {
+               if (STRING_VALID(_uhd->media_id)) {
+                       *media_id = strdup(_uhd->media_id);
+                       if (*media_id == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *media_id = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_storage_id(media_uhd_h uhd, char **storage_id)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd && storage_id) {
+               if (STRING_VALID(_uhd->storage_id)) {
+                       *storage_id = strdup(_uhd->storage_id);
+                       if (*storage_id == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *storage_id = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_path(media_uhd_h uhd, char **path)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd && path) {
+               if (STRING_VALID(_uhd->path)) {
+                       *path = strdup(_uhd->path);
+                       if (*path == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *path = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_size(media_uhd_h uhd, unsigned long long *size)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd && size) {
+               *size = _uhd->size;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_content_id(media_uhd_h uhd, char **content_id)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd && content_id) {
+               if (STRING_VALID(_uhd->content_id)) {
+                       *content_id = strdup(_uhd->content_id);
+                       if (*content_id == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *content_id = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_content_title(media_uhd_h uhd, char **content_title)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd && content_title) {
+               if (STRING_VALID(_uhd->content_title)) {
+                       *content_title = strdup(_uhd->content_title);
+                       if (*content_title == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *content_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 media_uhd_get_file_name(media_uhd_h uhd, char **file_name)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd && file_name) {
+               if (STRING_VALID(_uhd->file_name)) {
+                       *file_name = strdup(_uhd->file_name);
+                       if (*file_name == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *file_name = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_release_date(media_uhd_h uhd, char **release_date)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd && release_date) {
+               if (STRING_VALID(_uhd->release_date)) {
+                       *release_date = strdup(_uhd->release_date);
+                       if (*release_date == NULL) {
+                               media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                               return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+                       }
+               } else {
+                       *release_date = NULL;
+               }
+
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_modified_time(media_uhd_h uhd, time_t *modified_time)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd && modified_time) {
+               *modified_time = _uhd->modified_time;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_played_position(media_uhd_h uhd, int *played_position)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd) {
+               *played_position = _uhd->played_position;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_sub_type(media_uhd_h uhd, int *sub_type)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd) {
+               *sub_type = _uhd->sub_type;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_get_played_count(media_uhd_h uhd, int *played_count)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd) {
+               *played_count = _uhd->played_count;
+               ret = MEDIA_CONTENT_ERROR_NONE;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_set_played_position(media_uhd_h uhd, int played_position)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if ((_uhd != NULL) && (played_position >= 0)) {
+               _uhd->played_position = played_position;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_set_content_title(media_uhd_h uhd, const char *content_title)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd != NULL && STRING_VALID(content_title)) {
+               SAFE_FREE(_uhd->content_title);
+               _uhd->content_title = strdup(content_title);
+               if (_uhd->content_title == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_set_release_date(media_uhd_h uhd, const char *release_date)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd != NULL && STRING_VALID(release_date)) {
+               SAFE_FREE(_uhd->release_date);
+               _uhd->release_date = strdup(release_date);
+               if (_uhd->release_date == NULL) {
+                       media_content_error("OUT_OF_MEMORY(0x%08x)", MEDIA_CONTENT_ERROR_OUT_OF_MEMORY);
+                       return MEDIA_CONTENT_ERROR_OUT_OF_MEMORY;
+               }
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_set_sub_type(media_uhd_h uhd, int sub_type)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if ((_uhd != NULL) && (sub_type >= 0)) {
+               _uhd->sub_type = sub_type;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_set_played_count(media_uhd_h uhd, int played_count)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+
+       if (_uhd != NULL) {
+               _uhd->played_count = played_count;
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+
+int media_uhd_update_to_db(media_uhd_h uhd)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_uhd_s *_uhd = (media_uhd_s*)uhd;
+       char *update_query = NULL;
+
+       if (_uhd != NULL && STRING_VALID(_uhd->media_id) && STRING_VALID(_uhd->path)) {
+               update_query = sqlite3_mprintf(UPDATE_UHD_META_FROM_UHD, _uhd->content_title, _uhd->release_date, _uhd->played_position, _uhd->sub_type, _uhd->played_count, _uhd->media_id);
+
+               ret = _content_query_sql(update_query);
+               sqlite3_free(update_query);
+       } else {
+               media_content_error("INVALID_PARAMETER(0x%08x)", MEDIA_CONTENT_ERROR_INVALID_PARAMETER);
+               ret = MEDIA_CONTENT_ERROR_INVALID_PARAMETER;
+       }
+
+       return ret;
+}
+#endif
index fd37b7e..aecba91 100755 (executable)
@@ -22,6 +22,9 @@
 #include <media_util_private.h>
 #include <media_info_private.h>
 #include <media_content_type.h>
+#ifdef _USE_TV_PROFILE
+#include <system_info.h>
+#endif
 
 int _media_util_check_file_exist(const char *path)
 {
@@ -146,6 +149,12 @@ int _media_util_check_ignore_dir(const char *dir_path, bool *ignore)
                                if (is_root == TRUE)
                                        break;
                        }
+#ifdef _USE_SENIOR_MODE
+                       if (_media_content_is_support_senior_mode()) {
+                               if ((storage_type == MEDIA_SVC_STORAGE_EXTERNAL) && (strcmp(search_path, MEDIA_ROOT_PATH_SENIOR_MODE) == 0))
+                                       break;
+                       }
+#endif
 
                        leaf_path = strrchr(search_path, '/');
                        if (leaf_path != NULL) {
@@ -161,3 +170,18 @@ int _media_util_check_ignore_dir(const char *dir_path, bool *ignore)
 
        return MEDIA_CONTENT_ERROR_NONE;
 }
+
+#ifdef _USE_SENIOR_MODE
+bool _media_content_is_support_senior_mode()
+{
+       bool bSupportSeniorMode = false;
+
+       if (system_info_get_value_bool(SYSTEM_INFO_KEY_GET_SENIOR_MODE_SUPPORTED, &bSupportSeniorMode) != SYSTEM_INFO_ERROR_NONE) {
+               media_content_debug("Get senior mode support failed");
+               return false;
+       }
+       /* media_content_debug("Senior mode Support : [%d]", bSupportSeniorMode); */
+       return bSupportSeniorMode;
+}
+#endif
+
index cdb5fc5..b6b830d 100755 (executable)
@@ -2625,9 +2625,9 @@ int test_start_face_detection(int cancel)
        else
                media_content_debug("media_count : [%d]", g_media_cnt);
 
-       if (g_media_cnt == 0) {
+       if (g_media_cnt == 0)
                goto END;
-       }
+
        g_loop = g_main_loop_new(NULL, FALSE);
        context = g_main_loop_get_context(g_loop);
        source = g_idle_source_new();
@@ -3499,6 +3499,322 @@ int test_face_add_del(void)
        return ret;
 }
 
+#ifdef _USE_TV_PROFILE
+filter_h g_tv_filter = NULL;
+
+int test_tv_filter_create(void)
+{
+       media_content_debug("\n============Filter Create============\n\n");
+
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+
+       ret = media_filter_create(&g_tv_filter);
+
+       ret = media_filter_set_storage(g_tv_filter, "0a22a163-e634-4a2e-ba14-0469a969eea0");
+
+       ret = media_filter_set_order(g_tv_filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_STORAGE_ID, MEDIA_CONTENT_COLLATE_DEFAULT);
+
+       return ret;
+}
+
+int test_tv_filter_destroy(void)
+{
+       media_content_debug("\n============Filter Destroy============\n\n");
+
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+
+       ret = media_filter_destroy(g_tv_filter);
+
+       return ret;
+}
+
+bool pvr_item_cb(media_pvr_h pvr, void *user_data)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       char *c_value = NULL;
+       int i_value = 0;
+       bool b_value = false;
+       unsigned long long l_value = 0;
+
+       if (pvr == NULL) {
+               media_content_debug("NO Item");
+               return true;
+       }
+
+       ret = media_pvr_get_media_id(pvr, &c_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_media_id");
+       media_content_debug("media_id [%s]", c_value);
+       SAFE_FREE(c_value);
+
+       ret = media_pvr_get_channel_name(pvr, &c_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_channel_name");
+       media_content_debug("channel_name [%s]", c_value);
+       SAFE_FREE(c_value);
+
+       ret = media_pvr_get_program_title(pvr, &c_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_program_title");
+       media_content_debug("program_title [%s]", c_value);
+       SAFE_FREE(c_value);
+
+       ret = media_pvr_get_program_crid(pvr, &c_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_program_crid");
+       media_content_debug("program_crid [%s]", c_value);
+       SAFE_FREE(c_value);
+
+       ret = media_pvr_get_guidance(pvr, &c_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_guidance");
+       media_content_debug("guidance [%s]", c_value);
+       SAFE_FREE(c_value);
+
+       ret = media_pvr_get_synopsis(pvr, &c_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_synopsis");
+       media_content_debug("synopsis [%s]", c_value);
+       SAFE_FREE(c_value);
+
+       ret = media_pvr_get_genre(pvr, &c_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_synopsis");
+       media_content_debug("genre [%s]", c_value);
+       SAFE_FREE(c_value);
+
+       ret = media_pvr_get_language(pvr, &c_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_language");
+       media_content_debug("language [%s]", c_value);
+       SAFE_FREE(c_value);
+
+       ret = media_pvr_get_path(pvr, &c_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_path");
+       media_content_debug("path [%s]", c_value);
+       SAFE_FREE(c_value);
+
+       ret = media_pvr_get_storage_id(pvr, &c_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_storage_id");
+       media_content_debug("storage_id [%s]", c_value);
+       SAFE_FREE(c_value);
+
+       ret = media_pvr_get_size(pvr, &l_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_size");
+       media_content_debug("size [%ld]", l_value);
+
+       ret = media_pvr_get_timezone(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_timezone");
+       media_content_debug("timezone [%d]", i_value);
+
+       ret = media_pvr_get_ptc(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_ptc");
+       media_content_debug("ptc [%d]", i_value);
+
+       ret = media_pvr_get_major(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_major");
+       media_content_debug("[%d]", i_value);
+
+       ret = media_pvr_get_minor(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_minor");
+       media_content_debug("minor [%d]", i_value);
+
+       ret = media_pvr_get_channel_type(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_channel_type");
+       media_content_debug("channel_type [%d]", i_value);
+
+       ret = media_pvr_get_program_num(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_program_num");
+       media_content_debug("program_num [%d]", i_value);
+
+       ret = media_pvr_get_duration(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_duration");
+       media_content_debug("duration [%d]", i_value);
+
+       ret = media_pvr_get_embargo_time(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_embargo_time");
+       media_content_debug("embargo_time [%d]", i_value);
+
+       ret = media_pvr_get_expiry_time(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_expiry_time");
+       media_content_debug("expiry_time [%d]", i_value);
+
+       ret = media_pvr_get_parental_rating(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_parental_rating");
+       media_content_debug("parental_rating [%d]", i_value);
+
+       ret = media_pvr_get_start_time(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_start_time");
+       media_content_debug("start_time [%d]", i_value);
+
+       ret = media_pvr_get_program_start_time(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_program_start_time");
+       media_content_debug("program_start_time [%d]", i_value);
+
+       ret = media_pvr_get_program_end_time(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_program_end_time");
+       media_content_debug("program_end_time [%d]", i_value);
+
+       ret = media_pvr_get_program_date(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_program_date");
+       media_content_debug("program_date [%d]", i_value);
+
+       ret = media_pvr_get_timer_record(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_timer_record");
+       media_content_debug("timer_record [%d]", b_value);
+
+       ret = media_pvr_get_series_record(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_series_record");
+       media_content_debug("series_record [%d]", b_value);
+
+       ret = media_pvr_get_hd(pvr, &i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_hd");
+       media_content_debug("hd [%d]", i_value);
+
+       ret = media_pvr_get_subtitle(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_subtitle");
+       media_content_debug("subtitle [%d]", b_value);
+
+       ret = media_pvr_get_ttx(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_ttx");
+       media_content_debug("ttx [%d]", b_value);
+
+       ret = media_pvr_get_ad(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_ad");
+       media_content_debug("ad [%d]", b_value);
+
+       ret = media_pvr_get_hard_of_hearing_radio(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_hard_of_hearing_radio");
+       media_content_debug("hard_of_hearing_radio [%d]", b_value);
+
+       ret = media_pvr_get_data_service(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_data_service");
+       media_content_debug("data_service [%d]", b_value);
+
+       ret = media_pvr_get_content_lock(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_content_lock");
+       media_content_debug("content_lock [%d]", b_value);
+
+       ret = media_pvr_get_content_watch(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_content_watch");
+       media_content_debug("content_watch [%d]", b_value);
+
+       ret = media_pvr_get_has_audio_only(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_has_audio_only");
+       media_content_debug("has_audio_only [%d]", b_value);
+
+       ret = media_pvr_get_is_local_record(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_is_local_record");
+       media_content_debug("is_local_record [%d]", b_value);
+
+       ret = media_pvr_get_resolution(pvr, (media_pvr_resolution_e*)&i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_resolution");
+       media_content_debug("resolution [%d]", i_value);
+
+       ret = media_pvr_get_aspectratio(pvr, (media_pvr_aspectratio_e*)&i_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_aspectratio");
+       media_content_debug("aspectratio [%d]", i_value);
+
+       ret = media_pvr_get_highlight(pvr, &b_value);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_get_highlight");
+       media_content_debug("highlight [%d]", b_value);
+
+
+       return TRUE;
+}
+
+int test_pvr()
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       int media_count = 0;
+
+       media_content_debug("\n============PVR Test============\n\n");
+
+       test_tv_filter_create();
+
+       ret = media_pvr_get_media_count_from_db(g_tv_filter, &media_count);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("media_pvr_get_media_count_from_db failed: %d", ret);
+       else
+               media_content_debug("media_count : [%d]", media_count);
+
+       ret = media_pvr_foreach_media_from_db(g_tv_filter, pvr_item_cb, NULL);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("media_pvr_foreach_media_from_db is failed");
+
+       test_tv_filter_destroy();
+
+       return ret;
+}
+
+int test_pvr_update_db(void)
+{
+       int ret = MEDIA_CONTENT_ERROR_NONE;
+       media_pvr_h pvr = NULL;
+
+       ret = media_pvr_get_pvr_from_db("ff9b5a9a-a7b4-47f4-8255-84e007e25f13", &pvr);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("media_pvr_get_pvr_from_db failed: %d", ret);
+
+       ret = media_pvr_set_content_lock(pvr, TRUE);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_set_content_lock");
+
+       ret = media_pvr_set_content_watch(pvr, TRUE);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_set_content_watch");
+
+       ret = media_pvr_set_program_title(pvr, "TEST TITLE");
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_set_program_title");
+
+       ret = media_pvr_set_highlight(pvr, TRUE);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_set_highlight");
+
+       ret = media_pvr_update_to_db(pvr);
+       if (ret != MEDIA_CONTENT_ERROR_NONE)
+               media_content_error("Fail to media_pvr_update_to_db");
+
+       if (pvr != NULL)
+               media_pvr_destroy(pvr);
+
+       return ret;
+}
+#endif
+
 int main(int argc, char *argv[])
 {
        int ret = MEDIA_CONTENT_ERROR_NONE;
@@ -3508,6 +3824,14 @@ int main(int argc, char *argv[])
        ret = test_connect_database();
        if (ret != MEDIA_CONTENT_ERROR_NONE)
                return MEDIA_CONTENT_ERROR_NONE;
+#ifdef _USE_TV_PROFILE
+       test_pvr();
+
+       test_pvr_update_db();
+
+       test_pvr();
+#endif
+
 #if 0
        ret = test_start_face_detection(FALSE);
        if (ret != MEDIA_CONTENT_ERROR_NONE)