2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_MEDIA_CONTENT_PRODUCT_H__
18 #define __TIZEN_MEDIA_CONTENT_PRODUCT_H__
20 #include <media_content_type_product.h>
21 #include <media_pvr.h>
22 #include <media_uhd.h>
26 #endif /* __cplusplus */
28 /********** media_content **********/
30 int media_content_scan_folder_v2(const char *path, bool is_recursive, media_scan_completed_cb_v2 callback, void *user_data);
33 /********** media_info **********/
36 * @brief Gets the extract_flag of media info.
39 * @remarks You must release @a title using free().
41 * @param[in] media The media info handle
42 * @param[out] extract_flag The extract_flag of the media info
44 * @return @c 0 on success,
45 * otherwise a negative error value
47 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
48 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
49 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
50 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
52 int media_info_get_extract_flag(media_info_h media, int *extract_flag);
53 int media_info_get_stitched_state(media_info_h media, int *type_360);
54 int media_info_get_stitched_engine(media_info_h media, int *type_360);
56 * @brief Gets the content's played position parameter.
57 * @details Function returns content's elapsed playback position parameter as period
58 * starting from the beginning of the track.
60 * @param[in] media The handle to media info
61 * @param[out] played_position The elapsed time of the content
62 * @return 0 on success, otherwise a negative error value.
63 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
64 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
66 int media_info_get_played_position(media_info_h media, int *played_position);
68 * @brief Gets the provider to media info.
70 * @remarks @a modified_month should be released with free() by you.
72 * @param[in] media The handle to media info
73 * @param[out] category The modified month of media info
74 * @return 0 on success, otherwise a negative error value.
75 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
76 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
77 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
80 int media_info_get_modified_month(media_info_h media, char **modified_month);
83 * @brief Sets the played count to content meta handle.
85 * @param[in] media The handle to media info
86 * @param[in] played_count The played count of content
87 * @return 0 on success, otherwise a negative error value.
88 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
89 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
90 * @post media_info_update_to_db()
92 int media_info_set_played_count(media_info_h media, int played_count);
95 * @brief Sets the played position to content meta handle.
97 * @param[in] media The handle to media info
98 * @param[in] played_position The played position of content
99 * @return 0 on success, otherwise a negative error value.
100 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
101 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
102 * @post media_info_update_to_db()
104 int media_info_set_played_position(media_info_h media, int played_position);
105 int media_info_get_media_info_by_path_from_db(const char* path, media_info_h* media);
106 #ifdef _USE_SENIOR_MODE
107 int media_info_insert_to_db_with_contact_data(const char *path, const char* contact, const char* app_data, media_info_h *info);
108 int media_info_delete_contact_from_db(const char* contact, const char* storage_id);
109 int media_info_delete_item(const char *media_id);
110 int media_info_get_contact(media_info_h media, char **contact);
111 int media_info_get_app_data(media_info_h media, char **app_data);
112 int media_info_set_contact(media_info_h media, const char *contact);
113 int media_info_set_app_data(media_info_h media, const char *app_data);
117 /********** media_folder **********/
119 #ifdef _USE_SENIOR_MODE
120 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);
122 int media_folder_get_scan_status(const char *storage_uuid, char* path, media_folder_scan_status_e *scan_status);
125 * @brief insert media folder into database by folder path
128 * @param[in] folder path
130 * @return @c 0 on success,
131 * otherwise a negative error value
133 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
134 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
136 int media_folder_insert_to_db(const char *path);
138 /********** media_group **********/
141 * @brief Iterates through the media group with optional @a filter from the media database.
142 * @details This function gets the names and counts of media group meeting the given filter.
143 * The callback function will be invoked for every retrieved media group.
144 * If NULL is passed to the filter, no filtering is applied.
146 * @param[in] filter The handle to media filter
147 * @param[in] group The type of media group
148 * @param[in] callback The callback function to invoke
149 * @param[in] user_data The user data to be passed to the callback function
150 * @return 0 on success, otherwise a negative error value.
151 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
152 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
153 * @pre This function requires opened connection to content service by media_content_connect().
154 * @post This function invokes media_group_cb().
155 * @see #media_group_and_count_cb
156 * @see media_content_connect()
157 * @see media_filter_create()
159 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);
162 /********** media_storage **********/
165 * @brief Gets the storage scan status of media storage.
168 * @param[in] storage The media storage handle
169 * @param[out] scan_status The storage type of the media storage
171 * @return @c 0 on success,
172 * otherwise a negative error value
174 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
175 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
177 int media_storage_get_scan_status(const char *storage_uuid, media_storage_scan_status_e *scan_status);
182 #endif /* __cplusplus */
184 #endif /* __TIZEN_MEDIA_CONTENT_PRODUCT_H__ */