[ACR-1167] Exception handling when path contains symbolic link
[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_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.
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 content file does not have a title, this method returns the filename without the extension.
931  *
932  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
933  *
934  * @remarks The @a title should be released using free().
935  *
936  * @param[in] media The handle to the media info
937  * @param[out] title The title of the content file
938  *
939  * @return @c 0 on success,
940  *         otherwise a negative error value
941  *
942  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
943  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
944  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
945  */
946 int media_info_get_title(media_info_h media, char **title);
947
948 /**
949  * @deprecated Deprecated since 4.0.
950  * @brief Gets the category of content file which User set.
951  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
952  *
953  * @remarks The @a category should be released using free().
954  *
955  * @param[in] media The handle to the media info
956  * @param[out] category The category of the content file
957  *
958  * @return @c 0 on success,
959  *         otherwise a negative error value
960  *
961  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
962  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
963  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
964  *
965  */
966 int media_info_get_category(media_info_h media, char **category) TIZEN_DEPRECATED_API;
967
968 /**
969  * @deprecated Deprecated since 4.0.
970  * @brief Gets the location tag of content file which User set.
971  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
972  *
973  * @remarks The @a location_tag should be released using free().
974  *
975  * @param[in] media The handle to the media info
976  * @param[out] location_tag The location of the content file
977  *
978  * @return @c 0 on success,
979  *         otherwise a negative error value
980  *
981  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
982  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
983  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
984  *
985  */
986 int media_info_get_location_tag(media_info_h media, char **location_tag) TIZEN_DEPRECATED_API;
987
988 /**
989  * @deprecated Deprecated since 4.0.
990  * @brief Gets the age_rating of content file which User set.
991  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
992  *
993  * @remarks The @a age_rating should be released using free().
994  *
995  * @param[in] media The handle to the media info
996  * @param[out] age_rating The age rating of the content file
997  *
998  * @return @c 0 on success,
999  *         otherwise a negative error value
1000  *
1001  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1002  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1003  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1004  *
1005  */
1006 int media_info_get_age_rating(media_info_h media, char **age_rating) TIZEN_DEPRECATED_API;
1007
1008 /**
1009  * @deprecated Deprecated since 4.0. Use media_tag_insert_to_db() instead.
1010  * @brief Gets the keyword of content file which User set.
1011  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1012  *
1013  * @remarks The @a keyword should be released using free().
1014  *
1015  * @param[in] media The handle to the media info
1016  * @param[out] keyword The keyword of the content file
1017  *
1018  * @return @c 0 on success,
1019  *         otherwise a negative error value
1020  *
1021  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1022  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1023  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1024  *
1025  */
1026 int media_info_get_keyword(media_info_h media, char **keyword) TIZEN_DEPRECATED_API;
1027
1028 /**
1029  * @brief Gets the storage id of content file.
1030  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1031  *
1032  * @remarks The @a storage_id should be released using free().
1033  *
1034  * @param[in] media The handle to the media info
1035  * @param[out] storage_id The ID of the media storage
1036  *
1037  * @return @c 0 on success,
1038  *         otherwise a negative error value
1039  *
1040  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1041  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1042  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1043  */
1044 int media_info_get_storage_id(media_info_h media, char **storage_id);
1045
1046 /**
1047  * @brief Checks whether the media is protected via DRM.
1048  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1049  *
1050  * @param[in] media The handle to the media info
1051  * @param[out] is_drm @c true if media is DRM media,
1052  *                    otherwise @c false if media is not DRM media
1053  *
1054  * @return @c 0 on success,
1055  *         otherwise a negative error value
1056  *
1057  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1058  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1059  */
1060 int media_info_is_drm(media_info_h media, bool *is_drm);
1061
1062 /**
1063  * @brief Checks whether the content file is 360 content.
1064  * @since_tizen 3.0
1065  *
1066  * @param[in] media The handle to the media info
1067  * @param[out] is_360 @c true if media is 360 content,
1068  *                    otherwise @c false if media is not 360 content
1069  *
1070  * @return @c 0 on success,
1071  *         otherwise a negative error value
1072  *
1073  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1074  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1075  */
1076 int media_info_is_360_content(media_info_h media, bool *is_360);
1077
1078 /**
1079  * @brief Gets the storage type of content file.
1080  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1081  *
1082  * @param[in] media The handle to the media info
1083  * @param[out] storage_type The storage type of the content file
1084  *
1085  * @return @c 0 on success,
1086  *         otherwise a negative error value
1087  *
1088  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1089  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1090  */
1091 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type);
1092
1093 /**
1094  * @deprecated Deprecated since 4.0. \n
1095  *        This function does not guarantee independence of the played count value between applications. It is recommended that the value is managed by the application.
1096  * @brief Gets number which represents how many times given content has been played.
1097  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1098  *
1099  * @param[in] media The handle to the media info
1100  * @param[out] played_count The counter of content played
1101  *
1102  * @return 0 on success,
1103  *         otherwise a negative error value
1104  *
1105  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1106  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1107  */
1108 int media_info_get_played_count(media_info_h media, int *played_count) TIZEN_DEPRECATED_API;
1109
1110 /**
1111  * @deprecated Deprecated since 4.0. \n
1112  *        This function does not guarantee independence of the played time value between applications. It is recommended that the value is managed by the application.
1113  * @brief Gets the content's played time parameter.
1114  * @details Function returns content's elapsed playback time parameter as period
1115  *          starting from the beginning of the track.
1116  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1117  *
1118  * @param[in] media The handle to the media info
1119  * @param[out] played_time The elapsed time of the content
1120  *
1121  * @return 0 on success,
1122  *         otherwise a negative error value
1123  *
1124  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1125  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1126  */
1127 int media_info_get_played_time(media_info_h media, time_t *played_time) TIZEN_DEPRECATED_API;
1128
1129 /**
1130  * @brief Gets the media info from the media database.
1131  *
1132  * @details This function creates a new media handle from the media database by the given @a media_id.
1133  *          Media info will be created and filled with information.
1134  *
1135  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1136  *
1137  * @remarks The @a media should be released using media_info_destroy().
1138  *
1139  * @param[in] media_id The media ID
1140  * @param[out] media The handle to the media info
1141  *
1142  * @return @c 0 on success,
1143  *         otherwise a negative error value
1144  *
1145  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1146  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1147  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1148  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1149  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1150  *
1151  * @pre This function requires opened connection to content service by media_content_connect().
1152  *
1153  * @see media_content_connect()
1154  * @see media_info_destroy()
1155  */
1156 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
1157
1158 /**
1159  * @deprecated Deprecated since 4.0. \n
1160  *        This function does not guarantee independence of the played count value between applications. It is recommended that the value is managed by the application.
1161  * @brief Increments the played count to content meta handle.
1162  * @details You can increase the played(opened) count of the content file.
1163  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1164  *
1165  * @param[in] media The handle to the media info
1166  *
1167  * @return 0 on success,
1168  *         otherwise a negative error value
1169  *
1170  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1171  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1172  *
1173  * @post media_info_update_to_db()
1174  */
1175 int media_info_increase_played_count(media_info_h media) TIZEN_DEPRECATED_API;
1176
1177 /**
1178  * @deprecated Deprecated since 4.0. \n
1179  *        This function does not guarantee independence of the played time value between applications. It is recommended that the value is managed by the application.
1180  * @brief Sets the played time to content meta handle.
1181  * @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.
1182  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1183  *
1184  * @param[in] media The handle to the media info
1185  *
1186  * @return 0 on success,
1187  *         otherwise a negative error value
1188  *
1189  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1190  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1191  *
1192  * @post media_info_update_to_db()
1193  */
1194 int media_info_set_played_time(media_info_h media) TIZEN_DEPRECATED_API;
1195
1196 /**
1197  * @deprecated Deprecated since 4.0. Redundant, use media_info_move_to_db() instead.
1198  * @brief Sets the file name including the extension of the content file.
1199  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1200  *
1201  * @param[in] media The handle to the media info
1202  * @param[in] display_name The file name including the extension of the content file.
1203  *
1204  * @return @c 0 on success,
1205  *         otherwise a negative error value
1206  *
1207  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1208  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1209  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1210  *
1211  * @post media_info_update_to_db().
1212  *
1213  */
1214 int media_info_set_display_name(media_info_h media, const char *display_name) TIZEN_DEPRECATED_API;
1215
1216 /**
1217  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1218  * @brief Sets the description of media info.
1219  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1220  *
1221  * @param[in] media The handle to the media info
1222  * @param[in] description The description of the media info
1223  *
1224  * @return @c 0 on success,
1225  *         otherwise a negative error value
1226  *
1227  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1228  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1229  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1230  *
1231  * @post media_info_update_to_db().
1232  *
1233  */
1234 int media_info_set_description(media_info_h media, const char *description) TIZEN_DEPRECATED_API;
1235
1236 /**
1237  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1238  * @brief Sets the longitude of media info.
1239  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1240  *
1241  * @param[in] media The handle to the media info
1242  * @param[in] longitude The longitude of the media info
1243  *
1244  * @return @c 0 on success,
1245  *         otherwise a negative error value
1246  *
1247  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1248  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1249  *
1250  * @post media_info_update_to_db().
1251  */
1252 int media_info_set_longitude(media_info_h media, double longitude) TIZEN_DEPRECATED_API;
1253
1254 /**
1255  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1256  * @brief Sets the latitude of media info.
1257  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1258  *
1259  * @param[in] media The handle to the media info
1260  * @param[in] latitude The latitude of the media info
1261  *
1262  * @return @c 0 on success,
1263  *         otherwise a negative error value
1264  *
1265  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1266  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1267  *
1268  * @post media_info_update_to_db().
1269  */
1270 int media_info_set_latitude(media_info_h media, double latitude) TIZEN_DEPRECATED_API;
1271
1272 /**
1273  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1274  * @brief Sets the altitude of media info.
1275  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1276  *
1277  * @param[in] media The handle to the media info
1278  * @param[in] altitude The altitude of the media info
1279  *
1280  * @return @c 0 on success,
1281  *         otherwise a negative error value
1282  *
1283  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1284  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1285  *
1286  * @post media_info_update_to_db().
1287  */
1288 int media_info_set_altitude(media_info_h media, double altitude) TIZEN_DEPRECATED_API;
1289
1290 /**
1291  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1292  * @brief Sets the weather of media info.
1293  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1294  *
1295  * @param[in] media The handle to the media info
1296  * @param[in] weather The weather of the media info
1297  *
1298  * @return @c 0 on success,
1299  *         otherwise a negative error value
1300  *
1301  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1302  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1303  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1304  *
1305  * @post media_info_update_to_db().
1306  *
1307  */
1308 int media_info_set_weather(media_info_h media, const char *weather) TIZEN_DEPRECATED_API;
1309
1310 /**
1311  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1312  * @brief Sets the rating of media info.
1313  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1314  *
1315  * @param[in] media The handle to the media info
1316  * @param[in] rating The rating of the media info
1317  *
1318  * @return @c 0 on success,
1319  *         otherwise a negative error value
1320  *
1321  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1322  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1323  *
1324  * @post media_info_update_to_db().
1325  */
1326 int media_info_set_rating(media_info_h media, int rating) TIZEN_DEPRECATED_API;
1327
1328 /**
1329  * @brief Sets the favorite of media info.
1330  * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n
1331  *                So, If you use it in order parameter, you can sort the order of the time was a favorite. \n
1332  *                Or, if you use it in condition parameter, you can get the result of the favorite media.
1333  *
1334  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1335  *
1336  * @param[in] media The handle to the media info
1337  * @param[in] favorite Set @c true to set the media info as favorite,
1338  *                     otherwise set @c false to not set the media info as favorite
1339  *
1340  * @return @c 0 on success,
1341  *         otherwise a negative error value
1342  *
1343  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1344  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1345  */
1346 int media_info_set_favorite(media_info_h media, bool favorite);
1347
1348 /**
1349  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1350  * @brief Sets the author of media info.
1351  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1352  *
1353  * @param[in] media The handle to the media info
1354  * @param[in] author The author of the media info
1355  *
1356  * @return @c 0 on success,
1357  *         otherwise a negative error value
1358  *
1359  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1360  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1361  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1362  */
1363 int media_info_set_author(media_info_h media, const char *author) TIZEN_DEPRECATED_API;
1364
1365 /**
1366  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1367  * @brief Sets the provider of media info.
1368  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1369  *
1370  * @param[in] media The handle to the media info
1371  * @param[in] provider The provider of the media info
1372  *
1373  * @return @c 0 on success,
1374  *         otherwise a negative error value
1375  *
1376  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1377  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1378  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1379  */
1380 int media_info_set_provider(media_info_h media, const char *provider) TIZEN_DEPRECATED_API;
1381
1382 /**
1383  * @deprecated Deprecated since 4.0. Redundant, use media_info_move_to_db() instead.
1384  * @brief Sets the content name of media info.
1385  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1386  *
1387  * @param[in] media The handle to the media info
1388  * @param[in] content_name The content name of the media info
1389  *
1390  * @return @c 0 on success,
1391  *         otherwise a negative error value
1392  *
1393  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1394  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1395  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1396  *
1397  * @post media_info_update_to_db()
1398  */
1399 int media_info_set_content_name(media_info_h media, const char *content_name) TIZEN_DEPRECATED_API;
1400
1401 /**
1402  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1403  * @brief Sets the category of media info.
1404  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1405  *
1406  * @param[in] media The handle to the media info
1407  * @param[in] category The category of the media info
1408  *
1409  * @return @c 0 on success,
1410  *         otherwise a negative error value
1411  *
1412  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1413  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1414  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1415  *
1416  * @post media_info_update_to_db()
1417  */
1418 int media_info_set_category(media_info_h media, const char *category) TIZEN_DEPRECATED_API;
1419
1420 /**
1421  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1422  * @brief Sets the location tag of media info.
1423  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1424  *
1425  * @param[in] media The handle to the media info
1426  * @param[in] location_tag The location of the media info
1427  *
1428  * @return @c 0 on success,
1429  *         otherwise a negative error value
1430  *
1431  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1432  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1433  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1434  *
1435  * @post media_info_update_to_db()
1436  */
1437 int media_info_set_location_tag(media_info_h media, const char *location_tag) TIZEN_DEPRECATED_API;
1438
1439 /**
1440  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1441  * @brief Sets the age rating of media info.
1442  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1443  *
1444  * @param[in] media The handle to the media info
1445  * @param[in] age_rating The age rating of the media info
1446  *
1447  * @return @c 0 on success,
1448  *         otherwise a negative error value
1449  *
1450  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1451  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1452  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1453  *
1454  * @post media_info_update_to_db()
1455  */
1456 int media_info_set_age_rating(media_info_h media, const char *age_rating) TIZEN_DEPRECATED_API;
1457
1458 /**
1459  * @deprecated Deprecated since 4.0. Use media_tag_insert_to_db() instead.
1460  * @brief Sets the keyword of media info.
1461  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1462  *
1463  * @param[in] media The handle to the media info
1464  * @param[in] keyword The keyword of the media info
1465  *
1466  * @return @c 0 on success,
1467  *         otherwise a negative error value
1468  *
1469  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1470  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1471  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1472  *
1473  * @post media_info_update_to_db()
1474  */
1475 int media_info_set_keyword(media_info_h media, const char *keyword) TIZEN_DEPRECATED_API;
1476
1477 /**
1478  * @brief Updates the media info to the media database.
1479  *
1480  * @details The function updates the given media info in the media database.
1481  *
1482  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1483  * @privlevel public
1484  * @privilege %http://tizen.org/privilege/content.write
1485  *
1486  * @remarks The function should be called after any change in media, to be updated to the media
1487  *          database. For example, after using media_info_set_favorite()
1488  *          for setting the name of the media, the media_info_update_to_db() function should be called so as to update
1489  *          the given media info attributes in the media database.
1490  *
1491  * @param[in] media The handle to the media info
1492  *
1493  * @return @c 0 on success,
1494  *         otherwise a negative error value
1495  *
1496  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1497  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1498  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1499  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1500  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1501  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1502  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1503  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1504  *
1505  * @pre This function requires opened connection to content service by media_content_connect().
1506  *
1507  * @see media_content_connect()
1508  * @see media_info_set_favorite()
1509  */
1510 int media_info_update_to_db(media_info_h media);
1511
1512 /**
1513  * @deprecated Deprecated since 4.0. Use media_content_scan_file() instead.
1514  * @brief Refreshes the media metadata to the media database.
1515  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1516  *
1517  * @privlevel public
1518  * @privilege %http://tizen.org/privilege/content.write \n
1519  *                   %http://tizen.org/privilege/mediastorage \n
1520  *                   %http://tizen.org/privilege/externalstorage
1521  *
1522  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1523  *                   If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n
1524  *                   Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n
1525  *                   If you can access both storage, you should add all privilege.
1526  *
1527  * @param[in] media_id The media ID
1528  *
1529  * @return @c 0 on success,
1530  *         otherwise a negative error value
1531  *
1532  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1533  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1534  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1535  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1536  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1537  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1538  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1539  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1540  *
1541  * @pre This function requires opened connection to content service by media_content_connect().
1542  *
1543  * @see media_content_connect()
1544  */
1545 int media_info_refresh_metadata_to_db(const char *media_id) TIZEN_DEPRECATED_API;
1546
1547 /**
1548  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1549  * @brief Sets the added time of media info.
1550  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1551  *
1552  * @param[in] media The handle to the media info
1553  * @param[in] added_time The added time of the media info
1554  *
1555  * @return @c 0 on success,
1556  *         otherwise a negative error value
1557  *
1558  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1559  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1560  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1561  *
1562  * @post media_info_update_to_db()
1563  */
1564 int media_info_set_added_time(media_info_h media, time_t added_time) TIZEN_DEPRECATED_API;
1565
1566 /**
1567  * @brief Moves the media info to the given destination path in the media database.
1568  * @details After moving or renaming a file in the filesystem, call this function to update the database. \n
1569  *               If the source path and destination path are the same, then this function does nothing.
1570  *               If you want to refresh media information, you should use media_content_scan_file() function.
1571  *
1572  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1573  *
1574  * @privlevel public
1575  * @privilege %http://tizen.org/privilege/content.write \n
1576  *                   %http://tizen.org/privilege/mediastorage \n
1577  *                   %http://tizen.org/privilege/externalstorage
1578  *
1579  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1580  *                   If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n
1581  *                   Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n
1582  *                   If you can access both storage, you should add all privilege. \n
1583  *                   This function does not support USB storage. \n
1584  *                   Since 4.0, This function does not allow a symbolic link.
1585  *
1586  * @param[in] media The handle to the media info
1587  * @param[in] dst_path The path of destination
1588  *
1589  * @return @c 0 on success,
1590  *         otherwise a negative error value
1591  *
1592  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1593  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
1594  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1595  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1596  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1597  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1598  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1599  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1600  *
1601  * @pre This function requires opened connection to content service by media_content_connect().
1602  *
1603  * @see media_content_connect()
1604  * @see media_content_scan_folder()
1605  */
1606 int media_info_move_to_db(media_info_h media, const char* dst_path);
1607
1608 /**
1609  * @brief Creates a thumbnail file for the given media, asynchronously.
1610  * @details This function creates an thumbnail file for given media item and calls @a callback for completion of creating the thumbnail.
1611  *          If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function. \n
1612  *          Since 3.0, a thumbnail is not automatically extracted during media scanning. \n
1613  *          Therefore, if there exists no thumbnail for the given media, you MUST call this function to create a thumbnail.
1614  *
1615  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1616  *
1617  * @privlevel public
1618  * @privilege %http://tizen.org/privilege/content.write \n
1619  *                   %http://tizen.org/privilege/mediastorage \n
1620  *                   %http://tizen.org/privilege/externalstorage
1621  *
1622  * @remarks If you want to destroy media handle before callback invoked, you must cancel thumbnail request by using media_info_cancel_thumbnail() \n
1623  *          Since 3.0, if creation of a thumbnail is failed, empty string will be passed through media_thumbnail_completed_cb().
1624  *          Items in external storage except MMC not supported.
1625  *
1626  * @param[in] media The handle to the media info
1627  * @param[in] callback The callback function to be invoked
1628  * @param[in] user_data The user data to be passed to the callback function
1629  *
1630  * @return @c 0 on success,
1631  *         otherwise a negative error value
1632  *
1633  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1634  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1635  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1636  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1637  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1638  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1639  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1640  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1641  *
1642  * @pre This function requires opened connection to content service by media_content_connect().
1643  *
1644  * @see media_content_connect()
1645  */
1646 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
1647
1648 /**
1649  * @brief Cancels the creation of thumbnail file for the given media.
1650  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1651  *
1652  * @privlevel public
1653  * @privilege %http://tizen.org/privilege/content.write
1654  *
1655  * @remarks If you request cancel for the already thumbnail created media, this function return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1656  *
1657  * @param[in] media The handle to the media info
1658  *
1659  * @return @c 0 on success,
1660  *         otherwise a negative error value
1661  *
1662  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1663  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1664  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1665  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1666  *
1667  * @pre This function requires opened connection to content service by media_content_connect().
1668  * @see media_content_connect()
1669  */
1670 int media_info_cancel_thumbnail(media_info_h media);
1671
1672 /**
1673  * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1674  * @brief Starts face detection for the given image, asynchronously.
1675  * @details This function detects faces for given image item and calls the given callback function when the detection is completed. \n
1676  *          The given callback function is called when the detection is completed. \n
1677  *          To obtain the detected faces, call the media_info_foreach_face_from_db() function.
1678  *
1679  * @since_tizen 3.0
1680  *
1681  * @privlevel public
1682  * @privilege %http://tizen.org/privilege/content.write \n
1683  *                   %http://tizen.org/privilege/mediastorage \n
1684  *                   %http://tizen.org/privilege/externalstorage
1685  *
1686  * @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
1687  *          If face detection fails, the @a face_count argument in media_face_detection_completed_cb() will be set to 0.
1688  *          Media items in external storage are not supported, with the exception of MMC items.
1689  *
1690  * @param[in] media The handle to the media info
1691  * @param[in] callback The callback function to be invoked when detection is completed
1692  * @param[in] user_data The user data to be passed to the callback function
1693  *
1694  * @return @c 0 on success,
1695  *         otherwise a negative error value
1696  *
1697  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1698  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1699  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1700  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1701  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1702  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1703  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1704  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1705  * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED     Not supported
1706  *
1707  * @pre This function requires opened connection to content service by media_content_connect().
1708  *
1709  * @see media_content_connect()
1710  * @see media_info_cancel_face_detection()
1711  */
1712 int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data);
1713
1714 /**
1715  * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1716  * @brief Cancels face detection of image for the given media.
1717  * @details This function cancels face detection for given media item. \n
1718  *          If you cancel face detection request before callback is invoked, the callback registered by media_info_start_face_detection() function will not be invoked.
1719  *
1720  * @since_tizen 3.0
1721  *
1722  * @privlevel public
1723  * @privilege %http://tizen.org/privilege/content.write
1724  *
1725  * @remarks If face detection is already done when you request the cancellation, this function return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1726  *
1727  * @param[in] media The handle to the media info
1728  *
1729  * @return @c 0 on success,
1730  *         otherwise a negative error value
1731  *
1732  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1733  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1734  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1735  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1736  *
1737  * @pre This function requires opened connection to content service by media_content_connect().
1738  *
1739  * @see media_content_connect()
1740  * @see media_info_start_face_detection()
1741  */
1742 int media_info_cancel_face_detection(media_info_h media);
1743
1744 /**
1745  * @deprecated Deprecated since 4.0. Use media_info_insert_to_db() instead.
1746  * @brief Creates the media info handle.
1747  * @details If the information about the file that is already known, you can use this function to generate empty handler.
1748  * @since_tizen 3.0
1749  *
1750  *
1751  * @privilege %http://tizen.org/privilege/mediastorage \n
1752  *               %http://tizen.org/privilege/externalstorage
1753  *
1754  * @remarks The @a media should be released using media_info_destroy().
1755  * @remarks If you want to access only internal storage with this function, you should add privilege http://tizen.org/privilege/mediastorage. \n
1756  *                   Or if you want to access only external storage with this function, you should add privilege http://tizen.org/privilege/externalstorage. \n
1757  *                   If you can access both storage, you must add all privilege.
1758  *
1759  * @param[in] path The path to create the media info handle
1760  * @param[out] media The handle to the media info
1761  *
1762  * @return @c 0 on success,
1763  *           otherwise a negative error value
1764  *
1765  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1766  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1767  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
1768  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1769  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1770  *
1771  * @see media_info_destroy()
1772  */
1773 int media_info_create(const char *path, media_info_h *media) TIZEN_DEPRECATED_API;
1774
1775 /**
1776  * @deprecated Deprecated since 4.0. Use media_info_insert_to_db() instead.
1777  * @brief Inserts media info to database with media info data.
1778  * @since_tizen 3.0
1779  *
1780  * @privlevel public
1781  * @privilege %http://tizen.org/privilege/content.write
1782  *
1783  * @remarks The @a media should be released using media_info_destroy().
1784  *
1785  * @param[in] media The handle to the media info
1786  *
1787  * @return @c 0 on success,
1788  *           otherwise a negative error value
1789  *
1790  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1791  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1792  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
1793  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1794  */
1795 int media_info_insert_to_db_with_data(media_info_h media) TIZEN_DEPRECATED_API;
1796
1797 /**
1798  * @deprecated Deprecated since 4.0.
1799  * @brief Sets the title of media info handle.
1800  * @since_tizen 3.0
1801  *
1802  * @param[in] media The handle to the media info
1803  * @param[in] title The title of media info handle
1804  *
1805  * @return @c 0 on success,
1806  *           otherwise a negative error value
1807  *
1808  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1809  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1810  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1811  */
1812 int media_info_set_title(media_info_h media, const char *title) TIZEN_DEPRECATED_API;
1813
1814 /**
1815  * @deprecated Deprecated since 4.0.
1816  * @brief Sets the album of media info handle.
1817  * @since_tizen 3.0
1818  *
1819  * @param[in] media The handle to the media info
1820  * @param[in] album The album of the media
1821  *
1822  * @return @c 0 on success,
1823  *           otherwise a negative error value
1824  *
1825  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1826  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1827  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1828  */
1829 int media_info_set_album(media_info_h media, const char *album) TIZEN_DEPRECATED_API;
1830
1831 /**
1832  * @deprecated Deprecated since 4.0.
1833  * @brief Sets the artist of media info handle.
1834  * @since_tizen 3.0
1835  *
1836  * @param[in] media The handle to the media info
1837  * @param[in] artist The artist of media info handle
1838  *
1839  * @return @c 0 on success,
1840  *           otherwise a negative error value
1841  *
1842  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1843  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1844  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1845  */
1846 int media_info_set_artist(media_info_h media, const char *artist) TIZEN_DEPRECATED_API;
1847
1848 /**
1849  * @deprecated Deprecated since 4.0.
1850  * @brief Sets the genre of media info handle.
1851  * @since_tizen 3.0
1852  *
1853  * @param[in] media The handle to the media info
1854  * @param[in] genre The genre of media info handle
1855  *
1856  * @return @c 0 on success,
1857  *           otherwise a negative error value
1858  *
1859  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1860  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1861  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1862  */
1863 int media_info_set_genre(media_info_h media, const char *genre) TIZEN_DEPRECATED_API;
1864
1865 /**
1866  * @deprecated Deprecated since 4.0.
1867  * @brief Sets the recorded date of media info handle.
1868  * @since_tizen 3.0
1869  *
1870  * @param[in] media The handle to the media info
1871  * @param[in] recorded_date The recorded date of media info handle
1872  *
1873  * @return @c 0 on success,
1874  *           otherwise a negative error value
1875  *
1876  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1877  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1878  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1879  */
1880 int media_info_set_recorded_date(media_info_h media, const char *recorded_date) TIZEN_DEPRECATED_API;
1881
1882 /**
1883  * @}
1884  */
1885
1886 #ifdef __cplusplus
1887 }
1888 #endif /* __cplusplus */
1889
1890 #endif /* __TIZEN_CONTENT_MEDIA_INFO_H__ */