[ACR-1129] Add feature
[platform/core/api/media-content.git] / include_product / media_info.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16
17
18 #ifndef __TIZEN_MEDIA_INFORMATION_H__
19 #define __TIZEN_MEDIA_INFORMATION_H__
20
21 #include <media_content_type.h>
22
23
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 /**
30  * @file media_info.h
31  * @brief This file contains the media info API and related functions to proceed with it. \n
32  *        You can use the functions to insert, delete, count and get list of content files from media database. \n
33  *        You can get properties of content file such as size, mime_type, modified_time etc. And you can set properties such as provider, favorite etc. \n
34  *        And you can get bookmark, face, tag info related the content file.
35  */
36
37
38 /**
39  * @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
40  * @{
41  */
42
43 /**
44  * @brief  Inserts the content file into the media database.
45  * @details In general, you can use this API to insert content files into the media database. \n
46  *                You can use media_content_scan_file()/media_content_scan_folder() API instead of this API.
47  *
48  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
49  *
50  * @privlevel public
51  * @privilege %http://tizen.org/privilege/content.write \n
52  *                   %http://tizen.org/privilege/mediastorage \n
53  *                   %http://tizen.org/privilege/externalstorage
54  *
55  * @remarks You must release the handle using media_info_destroy(). \n
56  *                   You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
57  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
58  *                   Or if you want to access only external storage by using  this API, you should add privilege http://tizen.org/privilege/externalstorage. \n
59  *                   If you can access both storage, you must add all privilege.
60  * @remarks Since 4.0, this function is related to the following feature:\n
61  *              %http://tizen.org/feature/content.scanning.others\n
62  *              If this feature is not suppported on the device, MEDIA_CONTENT_TYPE_OTHERS type file is not scanned.
63  *
64  * @param[in]  path The path of the content file to add
65  * @param[out] info The handle of the inserted content file
66  *
67  * @return @c 0 on success,
68  *         otherwise a negative error value
69  *
70  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
71  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
72  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
73  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
74  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
75  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
76  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
77  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
78  * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED     Not supported
79  *
80  * @pre This function requires opened connection to content service by media_content_connect().
81  *
82  * @see media_content_connect()
83  * @see media_content_scan_file()
84  * @see media_content_scan_folder()
85  */
86 int media_info_insert_to_db(const char *path, media_info_h *info);
87
88 /**
89  * @brief Inserts content files into the media database, asynchronously.
90  * @details This function can insert multiple content files into the media database.
91  *
92  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
93  *
94  * @privlevel public
95  * @privilege %http://tizen.org/privilege/content.write \n
96  *                   %http://tizen.org/privilege/mediastorage \n
97  *                   %http://tizen.org/privilege/externalstorage
98  *
99  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
100  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
101  *                   Or if you want to access only external storage by using  this API, you should add privilege http://tizen.org/privilege/externalstorage. \n
102  *                   If you can access both storage, you must add all privilege.
103  * @remarks Since 4.0, this function is related to the following feature:\n
104  *              %http://tizen.org/feature/content.scanning.others\n
105  *              If this feature is not suppported on the device, MEDIA_CONTENT_TYPE_OTHERS type file is not scanned.
106  *
107  * @param[in] path_array   The path array of the content files to add
108  * @param[in] array_length The length of the array
109  * @param[in] callback     The callback to be invoked when media items inserted completely
110  * @param[in] user_data    The user data to be passed to the callback function
111  *
112  * @return @c 0 on success,
113  *         otherwise a negative error value
114  *
115  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
116  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
117  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
118  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
119  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
120  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
121  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
122  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
123  * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED     Not supported
124  *
125  * @pre This function requires opened connection to content service by media_content_connect().
126  *
127  * @see media_content_connect()
128  * @see media_insert_completed_cb()
129  */
130 int media_info_insert_batch_to_db(const char **path_array, unsigned int array_length, media_insert_completed_cb callback, void *user_data);
131
132 /**
133  * @deprecated Deprecated since 4.0.
134  * @brief Inserts the burst shot images into the media database, asynchronously.
135  * @details This function inserts burst images into the media database.
136  *          media_insert_burst_shot_completed_cb() will be called when insertion to media database is finished.
137  *
138  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
139  *
140  * @privlevel public
141  * @privilege %http://tizen.org/privilege/content.write \n
142  *                   %http://tizen.org/privilege/mediastorage \n
143  *                   %http://tizen.org/privilege/externalstorage
144  *
145  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
146  *                   If you want to access only internal storage with this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
147  *                   Or if you want to access only external storage with this API, you should add privilege http://tizen.org/privilege/externalstorage. \n
148  *                   If you can access both storage, you must add all privilege.
149  *
150  * @param[in] path_array   The path array of the burst shot images to add
151  * @param[in] array_length The length of the array
152  * @param[in] callback     The callback to be invoked when the images are inserted completely
153  * @param[in] user_data    The user data to be passed to the callback function
154  *
155  * @return @c 0 on success,
156  *         otherwise a negative error value
157  *
158  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
159  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
160  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
161  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
162  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
163  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
164  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
165  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
166  *
167  * @pre This function requires opened connection to content service by media_content_connect().
168  *
169  * @see media_content_connect()
170  * @see media_insert_burst_shot_completed_cb()
171  */
172 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) TIZEN_DEPRECATED_API;
173
174 /**
175  * @brief Deletes the media information from the media database.
176  * @details This function only remove media information in the media database. \n
177  *               You can use media_content_scan_file()/media_content_scan_folder() API instead of this API if file is removed from the file system.
178  *
179  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
180  *
181  * @privlevel public
182  * @privilege %http://tizen.org/privilege/content.write
183  *
184  * @param[in] media_id  The media ID. It can get from media info handle.
185  *
186  * @return @c 0 on success,
187  *         otherwise a negative error value
188  *
189  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
190  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
191  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
192  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
193  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
194  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
195  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
196  *
197  * @pre This function requires opened connection to content service by media_content_connect().
198  *
199  * @see media_content_connect()
200  * @see media_content_scan_file()
201  * @see media_content_scan_folder()
202  */
203 int media_info_delete_from_db(const char *media_id);
204
205 /**
206  * @deprecated Deprecated since 4.0.
207  * @brief Deletes media information that meets the conditions of the filter from the media database.
208  * @details This function can delete multiple media information from the media database.
209  *
210  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
211  *
212  * @privlevel public
213  * @privilege %http://tizen.org/privilege/content.write
214  *
215  * @param[in] filter  The filter handle
216  *
217  * @return @c 0 on success,
218  *         otherwise a negative error value
219  *
220  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
221  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
222  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
223  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
224  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
225  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
226  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
227  *
228  * @pre This function requires opened connection to content service by media_content_connect().
229  *
230  * @see media_content_connect()
231  * @see media_filter_create()
232  */
233 int media_info_delete_batch_from_db(filter_h filter) TIZEN_DEPRECATED_API;
234
235
236 /**
237  * @brief Destroys media info.
238  * @details The function frees all resources related to the media info handle. This handle
239  *          can no longer be used to perform any operation. New media info handle has to
240  *          be created before the next usage.
241  *
242  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
243  *
244  * @param[in]  media  The media info handle
245  *
246  * @return @c 0 on success,
247  *         otherwise a negative error value
248  *
249  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
250  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
251  *
252  * @pre Get copy of media_info handle by calling media_info_clone().
253  *
254  * @see media_info_clone()
255  */
256 int media_info_destroy(media_info_h media);
257
258 /**
259  * @brief Clones the media info handle.
260  *
261  * @details This function copies the media info handle from a source to the destination.
262  *          There is no media_info_create() function. The media_info_h is created internally and
263  *          available through media info foreach function such as media_info_foreach_media_from_db() or media_info_insert_to_db().
264  *          To use this handle outside of these foreach functions, use this function.
265  *
266  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
267  *
268  * @remarks You must release the destination handle using media_info_destroy().
269  *
270  * @param[out] dst  The destination handle to the media info
271  * @param[in]  src  The source handle to media info
272  *
273  * @return @c 0 on success,
274  *         otherwise a negative error value
275  *
276  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
277  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
278  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
279  *
280  * @see media_info_destroy()
281  * @see media_album_foreach_media_from_db()
282  * @see media_playlist_foreach_media_from_db()
283  * @see media_group_foreach_media_from_db()
284  * @see media_tag_foreach_media_from_db()
285  * @see media_info_foreach_media_from_db()
286  * @see media_info_insert_to_db()
287  * @see media_folder_foreach_media_from_db()
288  */
289 int media_info_clone(media_info_h *dst, media_info_h src);
290
291 /**
292  * @brief Gets the count of media info for the passed @a filter from the media database.
293  * @details If @c NULL is passed to the @a filter, then no filtering is applied.
294  *
295  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
296  *
297  *
298  * @param[in]  filter      The handle to filter
299  * @param[out] media_count The count of media
300  *
301  * @return @c 0 on success,
302  *         otherwise a negative error value
303  *
304  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
305  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
306  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
307  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
308  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
309  *
310  * @pre This function requires opened connection to content service by media_content_connect().
311  *
312  * @see media_content_connect()
313  * @see media_filter_create()
314  */
315 int media_info_get_media_count_from_db(filter_h filter, int *media_count);
316
317 /**
318  * @brief Iterates through media info from the media database.
319  * @details This function gets all media info handles meeting the given @a filter.
320  *          The @a callback function will be invoked for every retrieved media info.
321  *          If @c NULL is passed to the @a filter, then no filtering is applied.
322  *
323  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
324  *
325  * @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,
326  *                   your callback function is invoked as inline function.
327  *                   So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB.
328  *                   We do not recommend you call updating DB function in callback of foreach function.
329  *
330  * @param[in] filter    The media info handle filter
331  * @param[in] callback  The callback function to be invoked
332  * @param[in] user_data The user data to be passed to the callback function
333  *
334  * @return @c 0 on success,
335  *         otherwise a negative error value
336  *
337  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
338  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
339  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
340  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
341  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
342  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
343  *
344  * @pre  This function requires opened connection to content service by media_content_connect().
345  * @post This function invokes media_info_cb().
346  *
347  * @see media_content_connect()
348  * @see #media_info_cb
349  * @see media_filter_create()
350  */
351 int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, void *user_data);
352
353 /**
354  * @brief Gets the count of media tags for the passed @a filter in the given @a media_id from the media database.
355  * @details If @c NULL is passed to the @a filter, then no filtering is applied.
356  *
357  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
358  *
359  * @param[in]  media_id  The ID of the media info
360  * @param[in]  filter    The handle to the media filter
361  * @param[out] tag_count The count of the media tag
362  *
363  * @return @c 0 on success,
364  *         otherwise a negative error value
365  *
366  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
367  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
368  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
369  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
370  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
371  *
372  * @pre This function requires opened connection to content service by media_content_connect().
373  *
374  * @see media_content_connect()
375  * @see media_filter_create()
376  */
377 int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count);
378
379 /**
380  * @brief Iterates through the media tag in the given media info from the media database.
381  * @details This function gets all the media tags associated with the given @a media_id and calls @a callback for every retrieved media tag. \n
382  *               If @c NULL is passed to the @a filter, then no filtering is applied.
383  *
384  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
385  *
386  * @param[in] media_id  The ID of the media info
387  * @param[in] filter    The handle to the media filter
388  * @param[in] callback  The callback function to be invoked
389  * @param[in] user_data The user data to be passed to the callback function
390  *
391  * @return @c 0 on success,
392  *         otherwise a negative error value
393  *
394  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
395  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
396  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
397  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
398  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
399  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
400  *
401  * @pre  This function requires opened connection to content service by media_content_connect().
402  * @post This function invokes media_tag_cb().
403  *
404  * @see media_content_connect()
405  * @see #media_tag_cb
406  * @see media_filter_create()
407  */
408 int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data);
409
410 /**
411  * @brief Gets the number of bookmarks for the passed @a filter in the given media ID from the media database.
412  * @details If @c NULL is passed to the @a filter, then no filtering is applied.
413  *
414  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
415  *
416  * @param[in]  media_id        The ID of the media info
417  * @param[in]  filter          The handle to the media filter
418  * @param[out] bookmark_count  The count of the media tag
419  *
420  * @return @c 0 on success,
421  *         otherwise a negative error value
422  *
423  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
424  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
425  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
426  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
427  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
428  *
429  * @pre This function requires opened connection to content service by media_content_connect().
430  *
431  * @see media_content_connect()
432  * @see media_filter_create()
433  */
434 int media_info_get_bookmark_count_from_db(const char *media_id, filter_h filter, int *bookmark_count);
435
436 /**
437  * @brief Iterates through the media bookmark in the given media info from the media database.
438  * @details This function gets all media bookmarks associated with the given media and calls @a callback for every retrieved media bookmark.
439  *                If @c NULL is passed to the @a filter, then no filtering is applied.
440  *
441  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
442  *
443  * @param[in] media_id  The ID of the media info
444  * @param[in] filter    The handle to the media filter
445  * @param[in] callback  The callback function to be invoked
446  * @param[in] user_data The user data to be passed to the callback function
447  *
448  * @return @c 0 on success,
449  *         otherwise a negative error value
450  *
451  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
452  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
453  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
454  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
455  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
456  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
457  *
458  * @pre  This function requires opened connection to content service by media_content_connect().
459  * @post This function invokes media_bookmark_cb().
460  *
461  * @see media_content_connect()
462  * @see media_bookmark_cb()
463  * @see media_filter_create()
464  */
465 int media_info_foreach_bookmark_from_db(const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
466
467 /**
468  * @brief Gets the number of face for the passed @a media_id from the media database.
469  * @details If @c NULL is passed to the @a filter, then no filtering is applied.
470  *
471  * @since_tizen 3.0
472  *
473  * @param[in] media_id media id
474  * @param[in]  filter          The handle to the media filter
475  * @param[out] face_count The count of media face
476  *
477  * @return 0 on success, otherwise a negative error value.
478  *
479  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
480  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
481  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
482  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
483  *
484  * @pre This function requires opened connection to content service by media_content_connect().
485  * @see media_content_connect()
486  * @see media_filter_create()
487  *
488  */
489 int media_info_get_face_count_from_db(const char *media_id, filter_h filter, int *face_count);
490
491 /**
492  * @brief Iterates through the media files with optional @a media_id in the given @a face @a face from the media database.
493  * @details This function gets all media face info associated with the given media id and
494  * meeting desired filter option and calls @a callback for
495  * every retrieved media face info. If NULL is passed to the @a filter, no filtering is applied.
496  *
497  * @since_tizen 3.0
498  *
499  * @param [in] media_id media id
500  * @param[in]  filter          The handle to the media filter
501  * @param [in] callback The callback function to invoke
502  * @param [in] user_data The user data to be passed to the callback function
503  *
504  * @return 0 on success, otherwise a negative error value.
505  *
506  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
507  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
508  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
509  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
510  *
511  * @pre This function requires opened connection to content service by media_content_connect().
512  * @see media_content_connect()
513  * @see media_filter_create()
514  *
515  */
516 int media_info_foreach_face_from_db(const char *media_id, filter_h filter, media_face_cb callback, void *user_data);
517
518 /**
519  * @brief Gets the image metadata handle for a given media info
520  * @details This function returns an image metadata handle retrieved from the media info.
521  *
522  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
523  *
524  * @remarks You must release the @a image handle using image_meta_destroy().
525  *
526  * @param[in]  media  The media info handle
527  * @param[out] image  A handle to image metadata
528  *
529  * @return @c 0 on success,
530  *         otherwise a negative error value
531  *
532  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
533  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
534  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
535  *
536  * @see image_meta_destroy()
537  */
538 int media_info_get_image(media_info_h media, image_meta_h *image);
539
540 /**
541  * @brief Gets a video metadata handle for a given media info.
542  * @details This function returns a video metadata handle retrieved from the media info handle.
543  *
544  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
545  *
546  * @remarks You must release the @a video handle using video_meta_destroy().
547  *
548  * @param[in]  media The media info handle
549  * @param[out] video A handle to the video meta
550  *
551  * @return @c 0 on success,
552  *         otherwise a negative error value
553  *
554  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
555  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
556  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
557  *
558  * @see video_meta_destroy()
559  */
560 int media_info_get_video(media_info_h media, video_meta_h *video);
561
562 /**
563  * @brief Gets an audio metadata handle for a given media info.
564  * @details This function returns an audio metadata handle retrieved from the media info handle.
565  *
566  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
567  *
568  * @remarks You must release the @a audio handle using audio_meta_destroy().
569  *
570  * @param[in]  media The media info handle
571  * @param[out] audio A handle to the audio meta
572  *
573  * @return @c 0 on success,
574  *         otherwise a negative error value
575  *
576  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
577  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
578  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
579  *
580  * @see audio_meta_destroy()
581  */
582 int media_info_get_audio(media_info_h media, audio_meta_h *audio);
583
584 /**
585  * @brief Gets the media ID
586  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
587  *
588  * @param[in]  media The media info handle
589  * @param[out] media_id     The media ID
590  *
591  * @return @c 0 on success,
592  *         otherwise a negative error value
593  *
594  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
595  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
596  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
597  */
598 int media_info_get_media_id(media_info_h media, char **media_id);
599
600 /**
601  * @brief Gets the full path of the content file.
602  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
603  *
604  * @remarks You must release @a path using free().
605  *
606  * @param[in]  media The media info handle
607  * @param[out] path  The full path of the content file
608  *
609  * @return @c 0 on success,
610  *         otherwise a negative error value
611  *
612  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
613  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
614  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
615  *
616  */
617 int media_info_get_file_path(media_info_h media, char **path);
618
619 /**
620  * @brief Gets the file name including the extension of the content file.
621  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
622  *
623  * @remarks You must release @a name using free().
624  *
625  * @param[in]  media The media info handle
626  * @param[out] name  The file name including the extension of the content file
627  *
628  * @return @c 0 on success,
629  *         otherwise a negative error value
630  *
631  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
632  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
633  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
634  */
635 int media_info_get_display_name(media_info_h media, char **name);
636
637 /**
638  * @brief Gets the content type of the content file.
639  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
640  *
641  * @param[in]  media The media info handle
642  * @param[out] type  The content type of the content file (#media_content_type_e)
643  *
644  * @return @c 0 on success,
645  *         otherwise a negative error value
646  *
647  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
648  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
649  *
650  * @see #media_content_type_e
651  */
652 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
653
654 /**
655  * @brief Gets the MIME type of the content file.
656  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
657  *
658  * @remarks You must release @a mime_type using free().
659  *
660  * @param[in]  media     The media info handle
661  * @param[out] mime_type The MIME type of the content file
662  *
663  * @return @c 0 on success,
664  *         otherwise a negative error value
665  *
666  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
667  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
668  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
669  */
670 int media_info_get_mime_type(media_info_h media, char **mime_type);
671
672 /**
673  * @brief Gets the content file size.
674  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
675  *
676  * @param[in]  media The media info handle
677  * @param[out] size  The content file size
678  *
679  * @return @c 0 on success,
680  *         otherwise a negative error value
681  *
682  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
683  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
684  */
685 int media_info_get_size(media_info_h media, unsigned long long *size);
686
687 /**
688  * @brief Gets the added time of the content file.
689  * @details The added time refers to the time that content file was first added to media database.
690  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
691  *
692  * @param[in]  media      The media info handle
693  * @param[out] added_time The added time to the media database
694  *
695  * @return @c 0 on success,
696  *         otherwise a negative error value
697  *
698  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
699  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
700  */
701 int media_info_get_added_time(media_info_h media, time_t *added_time);
702
703 /**
704  * @brief Gets the modified time of the content file.
705  * @details The modified time refers to the last modification time provided by the file system.
706  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
707  *
708  * @param[in]  media The media info handle
709  * @param[out] time  The last modification time of the content file
710  *
711  * @return @c 0 on success,
712  *         otherwise a negative error value
713  *
714  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
715  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
716  */
717 int media_info_get_modified_time(media_info_h media, time_t *time);
718
719 /**
720  * @brief Gets the timeline of content file.
721  * @details If the content file has the creation time information (like Content recored date or Image creation date), that value is timeline. \n
722  *               Otherwise, timeline value is the same as modified time.
723  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
724  *
725  * @param[in]  media The media info handle
726  * @param[out] time  The timeline of content file
727  *
728  * @return @c 0 on success,
729  *         otherwise a negative error value
730  *
731  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
732  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
733  */
734 int media_info_get_timeline(media_info_h media, time_t *time);
735
736 /**
737  * @brief Gets the thumbnail path of content file.
738  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
739  *
740  * @remarks You must release @a path using free(). \n
741  *                   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
742  *                   Since 3.0, this function returns an empty string if media_info_create_thumbnail() has failed to create a thumbnail for the given media.
743  *
744  * @param[in]  media The media info handle
745  * @param[out] path  The thumbnail path
746  *
747  * @return @c 0 on success,
748  *         otherwise a negative error value
749  *
750  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
751  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
752  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
753  */
754 int media_info_get_thumbnail_path(media_info_h media, char **path);
755
756 /**
757  * @brief Gets the description of content file.
758  * @details If the value is an empty string, the method returns "Unknown". \n
759  *                Since 3.0, if the media info has no description, the method returns empty string.
760  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
761  *
762  * @remarks You must release @a description using free().
763  *
764  * @param[in]  media       The media info handle
765  * @param[out] description The description of the content file
766  *
767  * @return @c 0 on success,
768  *         otherwise a negative error value
769  *
770  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
771  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
772  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
773  */
774 int media_info_get_description(media_info_h media, char **description);
775
776 /**
777  * @brief Gets the longitude of content file.
778  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
779  *
780  * @param[in]  media     The media info handle
781  * @param[out] longitude The longitude of the content file
782  *
783  * @return @c 0 on success,
784  *         otherwise a negative error value
785  *
786  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
787  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
788  */
789 int media_info_get_longitude(media_info_h media, double *longitude);
790
791 /**
792  * @brief Gets the latitude of content file.
793  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
794  *
795  * @param[in]  media    The media info handle
796  * @param[out] latitude The latitude of the content file
797  *
798  * @return @c 0 on success,
799  *         otherwise a negative error value
800  *
801  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
802  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
803  *
804  */
805 int media_info_get_latitude(media_info_h media, double* latitude);
806
807 /**
808  * @brief Gets the altitude of content file.
809  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
810  *
811  * @param[in]  media    The media info handle
812  * @param[out] altitude The altitude of the content file
813  *
814  * @return @c 0 on success,
815  *         otherwise a negative error value
816  *
817  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
818  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
819  */
820 int media_info_get_altitude(media_info_h media, double* altitude);
821
822 /**
823  * @deprecated Deprecated since 4.0.
824  * @brief Gets the weather of content file.
825  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
826  *
827  * @param[in]  media   The media info handle
828  * @param[out] weather The weather of the content file
829  *
830  * @return @c 0 on success,
831  *         otherwise a negative error value
832  *
833  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
834  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
835  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
836  */
837 int media_info_get_weather(media_info_h media, char **weather) TIZEN_DEPRECATED_API;
838
839 /**
840  * @brief Gets the rating of content file.
841  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
842  *
843  * @param[in]  media  The media info handle
844  * @param[out] rating The rating of the content file
845  *
846  * @return @c 0 on success,
847  *         otherwise a negative error value
848  *
849  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
850  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
851  */
852 int media_info_get_rating(media_info_h media, int *rating);
853
854 /**
855  * @brief Gets the favorite status of content file which User set.
856  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
857  *
858  * @param[in]  media     The media info handle
859  * @param[out] favorite  @c true if content file is set as favorite,
860  *                       otherwise @c false if content file is not set as favorite
861  *
862  * @return @c 0 on success,
863  *         otherwise a negative error value
864  *
865  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
866  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
867  *
868  * @see media_info_set_favorite()
869  */
870 int media_info_get_favorite(media_info_h media, bool* favorite);
871
872 /**
873  * @deprecated Deprecated since 4.0.
874  * @brief Gets the author of content file.
875  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
876  *
877  * @remarks You must release @a author using free().
878  *
879  * @param[in]  media  The media info handle
880  * @param[out] author The author of the content file
881  *
882  * @return @c 0 on success,
883  *         otherwise a negative error value
884  *
885  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
886  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
887  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
888  */
889 int media_info_get_author(media_info_h media, char **author) TIZEN_DEPRECATED_API;
890
891 /**
892  * @deprecated Deprecated since 4.0.
893  * @brief Gets the provider of content file which User set.
894  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
895  *
896  * @remarks You must release @a provider using free().
897  *
898  * @param[in]  media    The media info handle
899  * @param[out] provider The provider of the content file
900  *
901  * @return @c 0 on success,
902  *         otherwise a negative error value
903  *
904  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
905  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
906  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
907  *
908  * @see media_info_set_provider()
909  */
910 int media_info_get_provider(media_info_h media, char **provider) TIZEN_DEPRECATED_API;
911
912 /**
913  * @deprecated Deprecated since 4.0. Redundant, use media_info_get_display_name() instead.
914  * @brief Gets the content name of content file which User set.
915  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
916  *
917  * @remarks You must release @a content_name using free().
918  *
919  * @param[in]  media        The media info handle
920  * @param[out] content_name The content name of the content file
921  *
922  * @return @c 0 on success,
923  *         otherwise a negative error value
924  *
925  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
926  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
927  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
928  *
929  * @see media_info_set_content_name()
930  */
931 int media_info_get_content_name(media_info_h media, char **content_name) TIZEN_DEPRECATED_API;
932
933 /**
934  * @brief Gets the title of content file.
935  * @details If the value is an empty string, the method returns "Unknown". \n
936  *                Since 3.0, if the content file has no title, the method returns empty string.
937  *
938  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
939  *
940  * @remarks You must release @a title using free().
941  *
942  * @param[in]  media  The media info handle
943  * @param[out] title  The title of the content file
944  *
945  * @return @c 0 on success,
946  *         otherwise a negative error value
947  *
948  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
949  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
950  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
951  */
952 int media_info_get_title(media_info_h media, char **title);
953
954 /**
955  * @deprecated Deprecated since 4.0.
956  * @brief Gets the category of content file which User set.
957  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
958  *
959  * @remarks You must release @a category using free().
960  *
961  * @param[in]  media    The media info handle
962  * @param[out] category The category of the content file
963  *
964  * @return @c 0 on success,
965  *         otherwise a negative error value
966  *
967  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
968  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
969  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
970  *
971  * @see media_info_set_category()
972  */
973 int media_info_get_category(media_info_h media, char **category) TIZEN_DEPRECATED_API;
974
975 /**
976  * @deprecated Deprecated since 4.0.
977  * @brief Gets the location tag of content file which User set.
978  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
979  *
980  * @remarks You must release @a location_tag using free().
981  *
982  * @param[in]  media        The media info handle
983  * @param[out] location_tag The location of the content file
984  *
985  * @return @c 0 on success,
986  *         otherwise a negative error value
987  *
988  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
989  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
990  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
991  *
992  * @see media_info_set_location_tag()
993  */
994 int media_info_get_location_tag(media_info_h media, char **location_tag) TIZEN_DEPRECATED_API;
995
996 /**
997  * @deprecated Deprecated since 4.0.
998  * @brief Gets the age_rating of content file which User set.
999  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1000  *
1001  * @remarks You must release @a age_rating using free().
1002  *
1003  * @param[in]  media      The media info handle
1004  * @param[out] age_rating The age rating of the content file
1005  *
1006  * @return @c 0 on success,
1007  *         otherwise a negative error value
1008  *
1009  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1010  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1011  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1012  *
1013  * @see media_info_set_age_rating()
1014  */
1015 int media_info_get_age_rating(media_info_h media, char **age_rating) TIZEN_DEPRECATED_API;
1016
1017 /**
1018  * @deprecated Deprecated since 4.0. Use media_tag_insert_to_db() instead.
1019  * @brief Gets the keyword of content file which User set.
1020  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1021  *
1022  * @remarks You must release @a keyword using free().
1023  *
1024  * @param[in]  media   The media info handle
1025  * @param[out] keyword The keyword of the content file
1026  *
1027  * @return @c 0 on success,
1028  *         otherwise a negative error value
1029  *
1030  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1031  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1032  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1033  *
1034  * @see media_info_set_keyword()
1035  */
1036 int media_info_get_keyword(media_info_h media, char **keyword) TIZEN_DEPRECATED_API;
1037
1038 /**
1039  * @brief Gets the storage id of content file.
1040  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1041  *
1042  * @remarks You must release @a storage_id using free().
1043  *
1044  * @param[in]  media   The media info handle
1045  * @param[out] storage_id The storage id of the content file
1046  *
1047  * @return @c 0 on success,
1048  *         otherwise a negative error value
1049  *
1050  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1051  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1052  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1053  */
1054 int media_info_get_storage_id(media_info_h media, char **storage_id);
1055
1056 /**
1057  * @brief Checks whether the media is protected via DRM.
1058  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1059  *
1060  * @param[in]  media  The media info handle
1061  * @param[out] is_drm @c true if media is DRM media,
1062  *                    otherwise @c false if media is not DRM media
1063  *
1064  * @return @c 0 on success,
1065  *         otherwise a negative error value
1066  *
1067  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1068  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1069  */
1070 int media_info_is_drm(media_info_h media, bool *is_drm);
1071
1072 /**
1073  * @brief Checks whether the content file is 360 content.
1074  * @since_tizen 3.0
1075  *
1076  * @param[in]  media  The media info handle
1077  * @param[out] is_360 @c true if media is 360 content,
1078  *                    otherwise @c false if media is not 360 content
1079  *
1080  * @return @c 0 on success,
1081  *         otherwise a negative error value
1082  *
1083  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1084  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1085  */
1086 int media_info_is_360_content(media_info_h media, bool *is_360);
1087
1088 /**
1089  * @brief Gets the storage type of content file.
1090  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1091  *
1092  * @param[in]  media        The media info handle
1093  * @param[out] storage_type The storage type of the content file
1094  *
1095  * @return @c 0 on success,
1096  *         otherwise a negative error value
1097  *
1098  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1099  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1100  */
1101 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type);
1102
1103 /**
1104  * @deprecated Deprecated since 4.0. \n
1105  *        This function does not guarantee independence of the played count value between applications. It is recommended that the value is managed by the application.
1106  * @brief Gets number which represents how many times given content has been played.
1107  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1108  *
1109  * @param [in] media The handle to media info
1110  * @param [out] played_count The counter of content played
1111  *
1112  * @return 0 on success,
1113  *         otherwise a negative error value
1114  *
1115  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1116  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1117  */
1118 int media_info_get_played_count(media_info_h media, int *played_count) TIZEN_DEPRECATED_API;
1119
1120 /**
1121  * @deprecated Deprecated since 4.0. \n
1122  *        This function does not guarantee independence of the played time value between applications. It is recommended that the value is managed by the application.
1123  * @brief Gets the content's played time parameter.
1124  * @details Function returns content's elapsed playback time parameter as period
1125  *          starting from the beginning of the track.
1126  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1127  *
1128  * @param [in] media The handle to media info
1129  * @param [out] played_time The elapsed time of the content
1130  *
1131  * @return 0 on success,
1132  *         otherwise a negative error value
1133  *
1134  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1135  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1136  */
1137 int media_info_get_played_time(media_info_h media, time_t *played_time) TIZEN_DEPRECATED_API;
1138
1139 /**
1140  * @brief Gets the media info from the media database.
1141  *
1142  * @details This function creates a new media handle from the media database by the given @a media_id.
1143  *          Media info will be created and filled with information.
1144  *
1145  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1146  *
1147  * @remarks You must release @a media using media_tag_destroy().
1148  *
1149  * @param[in]  media_id The ID of media info
1150  * @param[out] media    The media handle associated with the media ID
1151  *
1152  * @return @c 0 on success,
1153  *         otherwise a negative error value
1154  *
1155  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1156  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1157  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1158  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1159  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1160  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1161  *
1162  * @pre This function requires opened connection to content service by media_content_connect().
1163  *
1164  * @see media_content_connect()
1165  * @see media_info_destroy()
1166  */
1167 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
1168
1169 /**
1170  * @deprecated Deprecated since 4.0. \n
1171  *        This function does not guarantee independence of the played count value between applications. It is recommended that the value is managed by the application.
1172  * @brief Increments the played count to content meta handle.
1173  * @details You can increase the played(opened) count of the content file.
1174  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1175  *
1176  * @param [in] media The handle to media info
1177  *
1178  * @return 0 on success,
1179  *         otherwise a negative error value
1180  *
1181  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1182  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1183  *
1184  * @post media_info_update_to_db()
1185  */
1186 int media_info_increase_played_count(media_info_h media) TIZEN_DEPRECATED_API;
1187
1188 /**
1189  * @deprecated Deprecated since 4.0. \n
1190  *        This function does not guarantee independence of the played time value between applications. It is recommended that the value is managed by the application.
1191  * @brief Sets the played time to content meta handle.
1192  * @details You can set the latest played(opened) time of the content file. the latest played time to be set the current time on the system.
1193  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1194  *
1195  * @param [in] media The handle to media info
1196  *
1197  * @return 0 on success,
1198  *         otherwise a negative error value
1199  *
1200  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1201  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1202  *
1203  * @post media_info_update_to_db()
1204  */
1205 int media_info_set_played_time(media_info_h media) TIZEN_DEPRECATED_API;
1206
1207 /**
1208  * @deprecated Deprecated since 4.0. Redundant, use media_info_move_to_db() instead.
1209  * @brief Sets the file name including the extension of the content file.
1210  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1211  *
1212  * @param[in] media        The media info handle
1213  * @param[in] display_name The file name including the extension of the content file.
1214  *
1215  * @return @c 0 on success,
1216  *         otherwise a negative error value
1217  *
1218  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1219  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1220  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1221  *
1222  * @post media_info_update_to_db().
1223  *
1224  */
1225 int media_info_set_display_name(media_info_h media, const char *display_name) TIZEN_DEPRECATED_API;
1226
1227 /**
1228  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1229  * @brief Sets the description of media info.
1230  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1231  *
1232  * @param[in] media       The media info handle
1233  * @param[in] description The description of the media info
1234  *
1235  * @return @c 0 on success,
1236  *         otherwise a negative error value
1237  *
1238  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1239  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1240  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1241  *
1242  * @post media_info_update_to_db().
1243  *
1244  */
1245 int media_info_set_description(media_info_h media, const char *description) TIZEN_DEPRECATED_API;
1246
1247 /**
1248  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1249  * @brief Sets the longitude of media info.
1250  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1251  *
1252  * @param[in] media     The media info handle
1253  * @param[in] longitude The longitude of the media info
1254  *
1255  * @return @c 0 on success,
1256  *         otherwise a negative error value
1257  *
1258  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1259  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1260  *
1261  * @post media_info_update_to_db().
1262  */
1263 int media_info_set_longitude(media_info_h media, double longitude) TIZEN_DEPRECATED_API;
1264
1265 /**
1266  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1267  * @brief Sets the latitude of media info.
1268  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1269  *
1270  * @param[in] media    The media info handle
1271  * @param[in] latitude The latitude of the media info
1272  *
1273  * @return @c 0 on success,
1274  *         otherwise a negative error value
1275  *
1276  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1277  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1278  *
1279  * @post media_info_update_to_db().
1280  */
1281 int media_info_set_latitude(media_info_h media, double latitude) TIZEN_DEPRECATED_API;
1282
1283 /**
1284  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1285  * @brief Sets the altitude of media info.
1286  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1287  *
1288  * @param[in] media    The media info handle
1289  * @param[in] altitude The altitude of the media info
1290  *
1291  * @return @c 0 on success,
1292  *         otherwise a negative error value
1293  *
1294  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1295  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1296  *
1297  * @post media_info_update_to_db().
1298  */
1299 int media_info_set_altitude(media_info_h media, double altitude) TIZEN_DEPRECATED_API;
1300
1301 /**
1302  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1303  * @brief Sets the weather of media info.
1304  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1305  *
1306  * @param[in] media   The media info handle
1307  * @param[in] weather The weather of the media info
1308  *
1309  * @return @c 0 on success,
1310  *         otherwise a negative error value
1311  *
1312  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1313  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1314  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1315  *
1316  * @post media_info_update_to_db().
1317  *
1318  */
1319 int media_info_set_weather(media_info_h media, const char *weather) TIZEN_DEPRECATED_API;
1320
1321 /**
1322  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1323  * @brief Sets the rating of media info.
1324  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1325  *
1326  * @param[in] media  The media info handle
1327  * @param[in] rating The rating of the media info
1328  *
1329  * @return @c 0 on success,
1330  *         otherwise a negative error value
1331  *
1332  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1333  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1334  *
1335  * @post media_info_update_to_db().
1336  */
1337 int media_info_set_rating(media_info_h media, int rating) TIZEN_DEPRECATED_API;
1338
1339 /**
1340  * @brief Sets the favorite of media info.
1341  * @details This function can mark favorite of the media. If set to @c true, this fuction record the time of the change moment. \n
1342  *                So, If you use it in order parameter, you can sort the order of the time was a favorite. \n
1343  *                Or, if you use it in condition parameter, you can get the result of the favorite media.
1344  *
1345  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1346  *
1347  * @param[in] media    The media info handle
1348  * @param[in] favorite Set @c true to set the media info as favorite,
1349  *                     otherwise set @c false to not set the media info as favorite
1350  *
1351  * @return @c 0 on success,
1352  *         otherwise a negative error value
1353  *
1354  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1355  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1356  */
1357 int media_info_set_favorite(media_info_h media, bool favorite);
1358
1359 /**
1360  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1361  * @brief Sets the author of media info.
1362  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1363  *
1364  * @param[in] media  The media info handle
1365  * @param[in] author The author of the media info
1366  *
1367  * @return @c 0 on success,
1368  *         otherwise a negative error value
1369  *
1370  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1371  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1372  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1373  */
1374 int media_info_set_author(media_info_h media, const char *author) TIZEN_DEPRECATED_API;
1375
1376 /**
1377  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1378  * @brief Sets the provider of media info.
1379  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1380  *
1381  * @param[in] media    The media info handle
1382  * @param[in] provider The provider of the media info
1383  *
1384  * @return @c 0 on success,
1385  *         otherwise a negative error value
1386  *
1387  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1388  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1389  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1390  */
1391 int media_info_set_provider(media_info_h media, const char *provider) TIZEN_DEPRECATED_API;
1392
1393 /**
1394  * @deprecated Deprecated since 4.0. Redundant, use media_info_move_to_db() instead.
1395  * @brief Sets the content name of media info.
1396  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1397  *
1398  * @param[in] media        The media info handle
1399  * @param[in] content_name The content name of the media info
1400  *
1401  * @return @c 0 on success,
1402  *         otherwise a negative error value
1403  *
1404  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1405  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1406  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1407  *
1408  * @post media_info_update_to_db()
1409  */
1410 int media_info_set_content_name(media_info_h media, const char *content_name) TIZEN_DEPRECATED_API;
1411
1412 /**
1413  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1414  * @brief Sets the category of media info.
1415  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1416  *
1417  * @param[in] media    The media info handle
1418  * @param[in] category The category of the media info
1419  *
1420  * @return @c 0 on success,
1421  *         otherwise a negative error value
1422  *
1423  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1424  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1425  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1426  *
1427  * @post media_info_update_to_db()
1428  */
1429 int media_info_set_category(media_info_h media, const char *category) TIZEN_DEPRECATED_API;
1430
1431 /**
1432  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1433  * @brief Sets the location tag of media info.
1434  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1435  *
1436  * @param[in] media        The media info handle
1437  * @param[in] location_tag The location of the media info
1438  *
1439  * @return @c 0 on success,
1440  *         otherwise a negative error value
1441  *
1442  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1443  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1444  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1445  *
1446  * @post media_info_update_to_db()
1447  */
1448 int media_info_set_location_tag(media_info_h media, const char *location_tag) TIZEN_DEPRECATED_API;
1449
1450 /**
1451  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1452  * @brief Sets the age rating of media info.
1453  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1454  *
1455  * @param[in] media      The media info handle
1456  * @param[in] age_rating The age rating of the media info
1457  *
1458  * @return @c 0 on success,
1459  *         otherwise a negative error value
1460  *
1461  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1462  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1463  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1464  *
1465  * @post media_info_update_to_db()
1466  */
1467 int media_info_set_age_rating(media_info_h media, const char *age_rating) TIZEN_DEPRECATED_API;
1468
1469 /**
1470  * @deprecated Deprecated since 4.0. Use media_tag_insert_to_db() instead.
1471  * @brief Sets the keyword of media info.
1472  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1473  *
1474  * @param[in] media   The media info handle
1475  * @param[in] keyword The keyword of the media info
1476  *
1477  * @return @c 0 on success,
1478  *         otherwise a negative error value
1479  *
1480  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1481  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1482  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1483  *
1484  * @post media_info_update_to_db()
1485  */
1486 int media_info_set_keyword(media_info_h media, const char *keyword) TIZEN_DEPRECATED_API;
1487
1488 /**
1489  * @brief Updates the media info to the media database.
1490  *
1491  * @details The function updates the given media info in the media database.
1492  *
1493  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1494  * @privlevel public
1495  * @privilege %http://tizen.org/privilege/content.write
1496  *
1497  * @remarks The function should be called after any change in media, to be updated to the media
1498  *          database. For example, after using media_info_set_favorite()
1499  *          for setting the name of the media, the media_info_update_to_db() function should be called so as to update
1500  *          the given media info attributes in the media database.
1501  *
1502  * @param[in] media The media info handle
1503  *
1504  * @return @c 0 on success,
1505  *         otherwise a negative error value
1506  *
1507  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1508  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1509  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1510  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1511  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1512  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1513  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1514  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1515  *
1516  * @pre This function requires opened connection to content service by media_content_connect().
1517  *
1518  * @see media_content_connect()
1519  * @see media_info_set_favorite()
1520  * @see media_info_set_provider()
1521  * @see media_info_set_category()
1522  * @see media_info_set_location_tag()
1523  * @see media_info_set_age_rating()
1524  */
1525 int media_info_update_to_db(media_info_h media);
1526
1527 /**
1528  * @deprecated Deprecated since 4.0. Use media_content_scan_file() instead.
1529  * @brief Refreshes the media metadata to the media database.
1530  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1531  *
1532  * @privlevel public
1533  * @privilege %http://tizen.org/privilege/content.write \n
1534  *                   %http://tizen.org/privilege/mediastorage \n
1535  *                   %http://tizen.org/privilege/externalstorage
1536  *
1537  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1538  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1539  *                   Or if you want to access only external storage by using  this API, you should add privilege http://tizen.org/privilege/externalstorage. \n
1540  *                   If you can access both storage, you should add all privilege.
1541  *
1542  * @param[in] media_id The ID of the media info
1543  *
1544  * @return @c 0 on success,
1545  *         otherwise a negative error value
1546  *
1547  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1548  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1549  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1550  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1551  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1552  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1553  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1554  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1555  *
1556  * @pre This function requires opened connection to content service by media_content_connect().
1557  *
1558  * @see media_content_connect()
1559  */
1560 int media_info_refresh_metadata_to_db(const char *media_id) TIZEN_DEPRECATED_API;
1561
1562 /**
1563  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1564  * @brief Sets the added time of media info.
1565  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1566  *
1567  * @param[in] media      The media info handle
1568  * @param[in] added_time The added time of the media info
1569  *
1570  * @return @c 0 on success,
1571  *         otherwise a negative error value
1572  *
1573  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1574  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1575  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1576  *
1577  * @post media_info_update_to_db()
1578  */
1579 int media_info_set_added_time(media_info_h media, time_t added_time) TIZEN_DEPRECATED_API;
1580
1581 /**
1582  * @brief Moves the media info to the given destination path in the media database.
1583  * @details After moving or renaming a file in the filesystem, call this function to update the database. \n
1584  *               If the source path and destination path are the same, then this API does nothing.
1585  *               If you want to refresh media information, you should use media_content_scan_file() API.
1586  *
1587  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1588  *
1589  * @privlevel public
1590  * @privilege %http://tizen.org/privilege/content.write \n
1591  *                   %http://tizen.org/privilege/mediastorage \n
1592  *                   %http://tizen.org/privilege/externalstorage
1593  *
1594  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1595  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1596  *                   Or if you want to access only external storage by using this API, you should add privilege http://tizen.org/privilege/externalstorage. \n
1597  *                   If you can access both storage, you should add all privilege. \n
1598  *                   This API does not support USB storage.
1599  *
1600  * @param[in] media    The media info handle
1601  * @param[in] dst_path The path of destination
1602  *
1603  * @return @c 0 on success,
1604  *         otherwise a negative error value
1605  *
1606  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1607  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
1608  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1609  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1610  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1611  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1612  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1613  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1614  *
1615  * @pre This function requires opened connection to content service by media_content_connect().
1616  *
1617  * @see media_content_connect()
1618  * @see media_content_scan_folder()
1619  */
1620 int media_info_move_to_db(media_info_h media, const char* dst_path);
1621
1622 /**
1623  * @brief Creates a thumbnail file for the given media, asynchronously.
1624  * @details This function creates an thumbnail file for given media item and calls @a callback for completion of creating the thumbnail.
1625  *          If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function. \n
1626  *          Since 3.0, a thumbnail is not automatically extracted during media scanning. \n
1627  *          Therefore, if there exists no thumbnail for the given media, you MUST call this function to create a thumbnail.
1628  *
1629  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1630  *
1631  * @privlevel public
1632  * @privilege %http://tizen.org/privilege/content.write \n
1633  *                   %http://tizen.org/privilege/mediastorage \n
1634  *                   %http://tizen.org/privilege/externalstorage
1635  *
1636  * @remarks If you want to destroy media handle before callback invoked, you must cancel thumbnail request by using media_info_cancel_thumbnail() \n
1637  *          Since 3.0, if creation of a thumbnail is failed, empty string will be passed through media_thumbnail_completed_cb().
1638  *          Items in external storage except MMC not supported.
1639  *
1640  * @param[in] media     The media info handle
1641  * @param[in] callback  The callback function to be invoked
1642  * @param[in] user_data The user data to be passed to the callback function
1643  *
1644  * @return @c 0 on success,
1645  *         otherwise a negative error value
1646  *
1647  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1648  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1649  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1650  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1651  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1652  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1653  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1654  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1655  *
1656  * @pre This function requires opened connection to content service by media_content_connect().
1657  *
1658  * @see media_content_connect()
1659  */
1660 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
1661
1662 /**
1663  * @brief Cancels the creation of thumbnail file for the given media.
1664  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1665  *
1666  * @privlevel public
1667  * @privilege %http://tizen.org/privilege/content.write
1668  *
1669  * @remarks If you request cancel for the already thumbnail created media, this API return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1670  *
1671  * @param[in] media The media info handle
1672  *
1673  * @return @c 0 on success,
1674  *         otherwise a negative error value
1675  *
1676  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1677  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1678  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1679  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1680  *
1681  * @pre This function requires opened connection to content service by media_content_connect().
1682  * @see media_content_connect()
1683  */
1684 int media_info_cancel_thumbnail(media_info_h media);
1685
1686 /**
1687  * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1688  * @brief Starts face detection for the given image, asynchronously.
1689  * @details This function detects faces for given image item and calls the given callback function when the detection is completed. \n
1690  *          The given callback function is called when the detection is completed. \n
1691  *          To obtain the detected faces, call the media_info_foreach_face_from_db() function.
1692  *
1693  * @since_tizen 3.0
1694  *
1695  * @privlevel public
1696  * @privilege %http://tizen.org/privilege/content.write \n
1697  *                   %http://tizen.org/privilege/mediastorage \n
1698  *                   %http://tizen.org/privilege/externalstorage
1699  *
1700  * @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
1701  *          If face detection fails, the @a face_count argument in media_face_detection_completed_cb() will be set to 0.
1702  *          Media items in external storage are not supported, with the exception of MMC items.
1703  *
1704  * @param[in] media     The media info handle
1705  * @param[in] callback  The callback function to be invoked when detection is completed
1706  * @param[in] user_data The user data to be passed to the callback function
1707  *
1708  * @return @c 0 on success,
1709  *         otherwise a negative error value
1710  *
1711  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1712  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1713  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1714  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1715  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1716  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1717  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1718  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1719  * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED     Not supported
1720  *
1721  * @pre This function requires opened connection to content service by media_content_connect().
1722  *
1723  * @see media_content_connect()
1724  * @see media_info_cancel_face_detection()
1725  */
1726 int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data);
1727
1728 /**
1729  * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1730  * @brief Cancels face detection of image for the given media.
1731  * @details This function cancels face detection for given media item. \n
1732  *          If you cancel face detection request before callback is invoked, the callback registered by media_info_start_face_detection() API will not be invoked.
1733  *
1734  * @since_tizen 3.0
1735  *
1736  * @privlevel public
1737  * @privilege %http://tizen.org/privilege/content.write
1738  *
1739  * @remarks If face detection is already done when you request the cancellation, this API return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1740  *
1741  * @param[in] media The media info handle
1742  *
1743  * @return @c 0 on success,
1744  *         otherwise a negative error value
1745  *
1746  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1747  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1748  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1749  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1750  *
1751  * @pre This function requires opened connection to content service by media_content_connect().
1752  *
1753  * @see media_content_connect()
1754  * @see media_info_start_face_detection()
1755  */
1756 int media_info_cancel_face_detection(media_info_h media);
1757
1758 /**
1759  * @deprecated Deprecated since 4.0. Use media_info_insert_to_db() instead.
1760  * @brief Creates the media info handle.
1761  * @details If the information about the file that is already known, you can use this API to generate empty handler.
1762  * @since_tizen 3.0
1763  *
1764  *
1765  * @privilege %http://tizen.org/privilege/mediastorage \n
1766  *                      %http://tizen.org/privilege/externalstorage
1767  *
1768  * @remarks If you want to access only internal storage with this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1769  *                   Or if you want to access only external storage with this API, you should add privilege http://tizen.org/privilege/externalstorage. \n
1770  *                   If you can access both storage, you must add all privilege.
1771  *
1772  * @param[in] path The path to create the media info handle
1773  * @param[out] media The media info handle
1774  *
1775  * @return @c 0 on success,
1776  *           otherwise a negative error value
1777  *
1778  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1779  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1780  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
1781  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1782  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION       Invalid operation
1783  *
1784  * @see media_info_destroy()
1785  */
1786 int media_info_create(const char *path, media_info_h *media) TIZEN_DEPRECATED_API;
1787
1788 /**
1789  * @deprecated Deprecated since 4.0. Use media_info_insert_to_db() instead.
1790  * @brief Inserts media info to database with media info data.
1791  * @since_tizen 3.0
1792  *
1793  * @remarks You must release @a info using media_info_destroy().
1794  *
1795  * @privlevel public
1796  * @privilege %http://tizen.org/privilege/content.write
1797  *
1798  * @param[in] media The media info handle to be inserted
1799  *
1800  * @return @c 0 on success,
1801  *           otherwise a negative error value
1802  *
1803  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1804  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1805  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED                DB operation failed
1806  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1807  */
1808 int media_info_insert_to_db_with_data(media_info_h media) TIZEN_DEPRECATED_API;
1809
1810 /**
1811  * @deprecated Deprecated since 4.0.
1812  * @brief Sets the title of media info handle.
1813  * @since_tizen 3.0
1814  *
1815  * @param[in] media The media info handle
1816  * @param[in] title The title of media info handle
1817  *
1818  * @return @c 0 on success,
1819  *           otherwise a negative error value
1820  *
1821  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1822  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1823  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1824  */
1825 int media_info_set_title(media_info_h media, const char *title) TIZEN_DEPRECATED_API;
1826
1827 /**
1828  * @deprecated Deprecated since 4.0.
1829  * @brief Sets the album of media info handle.
1830  * @since_tizen 3.0
1831  *
1832  * @param[in] media The media info handle
1833  * @param[in] album The album of media info handle
1834  *
1835  * @return @c 0 on success,
1836  *           otherwise a negative error value
1837  *
1838  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1839  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1840  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1841  */
1842 int media_info_set_album(media_info_h media, const char *album) TIZEN_DEPRECATED_API;
1843
1844 /**
1845  * @deprecated Deprecated since 4.0.
1846  * @brief Sets the artist of media info handle.
1847  * @since_tizen 3.0
1848  *
1849  * @param[in] media The media info handle
1850  * @param[in] artist The artist of media info handle
1851  *
1852  * @return @c 0 on success,
1853  *           otherwise a negative error value
1854  *
1855  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1856  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1857  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1858  */
1859 int media_info_set_artist(media_info_h media, const char *artist) TIZEN_DEPRECATED_API;
1860
1861 /**
1862  * @deprecated Deprecated since 4.0.
1863  * @brief Sets the genre of media info handle.
1864  * @since_tizen 3.0
1865  *
1866  * @param[in] media The media info handle
1867  * @param[in] genre The genre of media info handle
1868  *
1869  * @return @c 0 on success,
1870  *           otherwise a negative error value
1871  *
1872  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1873  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1874  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1875  */
1876 int media_info_set_genre(media_info_h media, const char *genre) TIZEN_DEPRECATED_API;
1877
1878 /**
1879  * @deprecated Deprecated since 4.0.
1880  * @brief Sets the recorded date of media info handle.
1881  * @since_tizen 3.0
1882  *
1883  * @param[in] media The media info handle
1884  * @param[in] recorded_date The recorded date of media info handle
1885  *
1886  * @return @c 0 on success,
1887  *           otherwise a negative error value
1888  *
1889  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1890  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1891  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1892  */
1893 int media_info_set_recorded_date(media_info_h media, const char *recorded_date) TIZEN_DEPRECATED_API;
1894
1895 /**
1896  * @}
1897  */
1898
1899 #ifdef __cplusplus
1900 }
1901 #endif /* __cplusplus */
1902
1903 #endif /* __TIZEN_MEDIA_INFORMATION_H__ */