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