Add some deprecated APIs for web API
[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 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 5.0. Use media_content_scan_file() instead.
136  * @brief Deletes the media information from the media database.
137  * @details This function only remove media information in the media database. \n
138  *               You can use media_content_scan_file()/media_content_scan_folder() function instead of this function if a file is removed from the file system.
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
144  *
145  * @param[in] media_id The media ID. It can get from media info handle.
146  *
147  * @return @c 0 on success,
148  *         otherwise a negative error value
149  *
150  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
151  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
152  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
153  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
154  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
155  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
156  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
157  *
158  * @pre This function requires opened connection to content service by media_content_connect().
159  *
160  * @see media_content_connect()
161  * @see media_content_scan_file()
162  * @see media_content_scan_folder()
163  */
164 int media_info_delete_from_db(const char *media_id) TIZEN_DEPRECATED_API;
165
166
167 /**
168  * @brief Destroys media info.
169  * @details The function frees all resources related to the media info handle. This handle
170  *          can no longer be used to perform any operations. New media info handle has to
171  *          be created before the next usage.
172  *
173  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
174  *
175  * @param[in] media The handle to the media info
176  *
177  * @return @c 0 on success,
178  *         otherwise a negative error value
179  *
180  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
181  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
182  *
183  * @pre Get copy of media_info handle by calling media_info_clone().
184  *
185  * @see media_info_clone()
186  */
187 int media_info_destroy(media_info_h media);
188
189 /**
190  * @brief Clones the media info handle.
191  *
192  * @details This function copies the media info handle from a source to the destination.
193  *          To use this handle outside of these foreach functions, use this function.
194  *
195  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
196  *
197  * @remarks The @a dst should be released using media_info_destroy().
198  *
199  * @param[out] dst The destination handle to the media info
200  * @param[in] src The source handle to the media info
201  *
202  * @return @c 0 on success,
203  *         otherwise a negative error value
204  *
205  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
206  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
207  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
208  *
209  * @see media_info_destroy()
210  * @see media_album_foreach_media_from_db()
211  * @see media_playlist_foreach_media_from_db()
212  * @see media_group_foreach_media_from_db()
213  * @see media_tag_foreach_media_from_db()
214  * @see media_info_foreach_media_from_db()
215  * @see media_info_insert_to_db()
216  * @see media_folder_foreach_media_from_db()
217  */
218 int media_info_clone(media_info_h *dst, media_info_h src);
219
220 /**
221  * @brief Gets the count of media info for the passed @a filter from the media database.
222  * @details If @c NULL is passed to the @a filter, then no filtering is applied.
223  *
224  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
225  *
226  *
227  * @param[in] filter The handle to the media filter
228  * @param[out] media_count The count of media
229  *
230  * @return @c 0 on success,
231  *         otherwise a negative error value
232  *
233  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
234  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
235  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
236  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
237  *
238  * @pre This function requires opened connection to content service by media_content_connect().
239  *
240  * @see media_content_connect()
241  * @see media_filter_create()
242  */
243 int media_info_get_media_count_from_db(filter_h filter, int *media_count);
244
245 /**
246  * @brief Iterates through media info from the media database.
247  * @details This function gets all media info handles meeting the given @a filter.
248  *          The @a callback function will be invoked for every retrieved media info.
249  *          If @c NULL is passed to the @a filter, then no filtering is applied.
250  *
251  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
252  *
253  * @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,
254  *                   your callback function is invoked as inline function.
255  *                   So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB.
256  *                   We do not recommend you call updating DB function in callback of foreach function.
257  *
258  * @param[in] filter The handle to the media filter
259  * @param[in] callback The callback function to be invoked
260  * @param[in] user_data The user data to be passed to the callback function
261  *
262  * @return @c 0 on success,
263  *         otherwise a negative error value
264  *
265  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
266  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
267  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
268  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
269  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
270  *
271  * @pre  This function requires opened connection to content service by media_content_connect().
272  * @post This function invokes media_info_cb().
273  *
274  * @see media_content_connect()
275  * @see #media_info_cb
276  * @see media_filter_create()
277  */
278 int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, void *user_data);
279
280 /**
281  * @brief Gets the count of media tags for the passed @a filter in the given @a media_id from the media database.
282  * @details If @c NULL is passed to the @a filter, then no filtering is applied.
283  *
284  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
285  *
286  * @param[in] media_id The media ID
287  * @param[in] filter The handle to the media filter
288  * @param[out] tag_count The count of the media tag
289  *
290  * @return @c 0 on success,
291  *         otherwise a negative error value
292  *
293  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
294  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
295  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
296  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
297  *
298  * @pre This function requires opened connection to content service by media_content_connect().
299  *
300  * @see media_content_connect()
301  * @see media_filter_create()
302  */
303 int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count);
304
305 /**
306  * @brief Iterates through the media tag in the given media info from the media database.
307  * @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
308  *               If @c NULL is passed to the @a filter, then no filtering is applied.
309  *
310  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
311  *
312  * @param[in] media_id The media ID
313  * @param[in] filter The handle to the media filter
314  * @param[in] callback The callback function to be invoked
315  * @param[in] user_data The user data to be passed to the callback function
316  *
317  * @return @c 0 on success,
318  *         otherwise a negative error value
319  *
320  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
321  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
322  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
323  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
324  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
325  *
326  * @pre  This function requires opened connection to content service by media_content_connect().
327  * @post This function invokes media_tag_cb().
328  *
329  * @see media_content_connect()
330  * @see #media_tag_cb
331  * @see media_filter_create()
332  */
333 int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data);
334
335 /**
336  * @brief Gets the number of bookmarks for the passed @a filter in the given media ID from the media database.
337  * @details If @c NULL is passed to the @a filter, then no filtering is applied.
338  *
339  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
340  *
341  * @param[in] media_id The media ID
342  * @param[in] filter The handle to the media filter
343  * @param[out] bookmark_count The count of the media tag
344  *
345  * @return @c 0 on success,
346  *         otherwise a negative error value
347  *
348  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
349  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
350  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
351  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
352  *
353  * @pre This function requires opened connection to content service by media_content_connect().
354  *
355  * @see media_content_connect()
356  * @see media_filter_create()
357  */
358 int media_info_get_bookmark_count_from_db(const char *media_id, filter_h filter, int *bookmark_count);
359
360 /**
361  * @brief Iterates through the media bookmark in the given media info from the media database.
362  * @details This function gets all media bookmarks associated with the given media and calls @a callback for every retrieved media bookmark.
363  *                If @c NULL is passed to the @a filter, then no filtering is applied.
364  *
365  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
366  *
367  * @param[in] media_id The media ID
368  * @param[in] filter The handle to the media filter
369  * @param[in] callback The callback function to be invoked
370  * @param[in] user_data The user data to be passed to the callback function
371  *
372  * @return @c 0 on success,
373  *         otherwise a negative error value
374  *
375  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
376  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
377  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
378  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
379  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
380  *
381  * @pre  This function requires opened connection to content service by media_content_connect().
382  * @post This function invokes media_bookmark_cb().
383  *
384  * @see media_content_connect()
385  * @see media_bookmark_cb()
386  * @see media_filter_create()
387  */
388 int media_info_foreach_bookmark_from_db(const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
389
390 /**
391  * @brief Gets the number of face for the passed @a media_id from the media database.
392  * @details If @c NULL is passed to the @a filter, then no filtering is applied.
393  *
394  * @since_tizen 3.0
395  *
396  * @param[in] media_id The media ID
397  * @param[in] filter The handle to the media filter
398  * @param[out] face_count The count of media face
399  *
400  * @return 0 on success, otherwise a negative error value.
401  *
402  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
403  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
404  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
405  *
406  * @pre This function requires opened connection to content service by media_content_connect().
407  * @see media_content_connect()
408  * @see media_filter_create()
409  *
410  */
411 int media_info_get_face_count_from_db(const char *media_id, filter_h filter, int *face_count);
412
413 /**
414  * @brief Iterates through the media files with optional @a filter in the given @a media_id from the media database.
415  * @details This function gets all media face info associated with the given media id and
416  * meeting desired filter option and calls @a callback for
417  * every retrieved media face info. If NULL is passed to the @a filter, no filtering is applied.
418  *
419  * @since_tizen 3.0
420  *
421  * @param[in] media_id The media ID
422  * @param[in] filter The handle to the media filter
423  * @param[in] callback The callback function to invoke
424  * @param[in] user_data The user data to be passed to the callback function
425  *
426  * @return 0 on success, otherwise a negative error value.
427  *
428  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
429  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
430  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
431  *
432  * @pre This function requires opened connection to content service by media_content_connect().
433  * @see media_content_connect()
434  * @see media_filter_create()
435  *
436  */
437 int media_info_foreach_face_from_db(const char *media_id, filter_h filter, media_face_cb callback, void *user_data);
438
439 /**
440  * @brief Gets the image metadata handle for a given media info.
441  * @details This function returns an image metadata handle retrieved from the media info.
442  *
443  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
444  *
445  * @remarks The @a image should be released using image_meta_destroy().
446  *
447  * @param[in] media The handle to the media info
448  * @param[out] image The handle to the image metadata
449  *
450  * @return @c 0 on success,
451  *         otherwise a negative error value
452  *
453  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
454  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
455  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
456  *
457  * @see image_meta_destroy()
458  */
459 int media_info_get_image(media_info_h media, image_meta_h *image);
460
461 /**
462  * @brief Gets a video metadata handle for a given media info.
463  * @details This function returns a video metadata handle retrieved from the media info handle.
464  *
465  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
466  *
467  * @remarks The @a video should be released using video_meta_destroy().
468  *
469  * @param[in] media The handle to the media info
470  * @param[out] video The handle to the video metadata
471  *
472  * @return @c 0 on success,
473  *         otherwise a negative error value
474  *
475  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
476  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
477  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
478  *
479  * @see video_meta_destroy()
480  */
481 int media_info_get_video(media_info_h media, video_meta_h *video);
482
483 /**
484  * @brief Gets an audio metadata handle for a given media info.
485  * @details This function returns an audio metadata handle retrieved from the media info handle.
486  *
487  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
488  *
489  * @remarks The @a audio should be released using audio_meta_destroy().
490  *
491  * @param[in] media The handle to the media info
492  * @param[out] audio The handle to the audio metadata
493  *
494  * @return @c 0 on success,
495  *         otherwise a negative error value
496  *
497  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
498  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
499  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
500  *
501  * @see audio_meta_destroy()
502  */
503 int media_info_get_audio(media_info_h media, audio_meta_h *audio);
504
505 /**
506  * @brief Gets the media ID.
507  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
508  * @remarks The @a media_id should be released using free().
509  *
510  * @param[in] media The handle to the media info
511  * @param[out] media_id The media ID
512  *
513  * @return @c 0 on success,
514  *         otherwise a negative error value
515  *
516  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
517  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
518  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
519  */
520 int media_info_get_media_id(media_info_h media, char **media_id);
521
522 /**
523  * @brief Gets the full path of the content file.
524  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
525  *
526  * @remarks The @a path should be released using free().
527  *
528  * @param[in] media The handle to the media info
529  * @param[out] path The full path of the content file
530  *
531  * @return @c 0 on success,
532  *         otherwise a negative error value
533  *
534  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
535  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
536  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
537  *
538  */
539 int media_info_get_file_path(media_info_h media, char **path);
540
541 /**
542  * @brief Gets the file name including the extension of the content file.
543  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
544  *
545  * @remarks The @a name should be released using free().
546  *
547  * @param[in] media The handle to the media info
548  * @param[out] name The file name including the extension of the content file
549  *
550  * @return @c 0 on success,
551  *         otherwise a negative error value
552  *
553  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
554  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
555  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
556  */
557 int media_info_get_display_name(media_info_h media, char **name);
558
559 /**
560  * @brief Gets the content type of the content file.
561  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
562  *
563  * @param[in] media The handle to the media info
564  * @param[out] type The content type of the content file (#media_content_type_e)
565  *
566  * @return @c 0 on success,
567  *         otherwise a negative error value
568  *
569  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
570  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
571  *
572  * @see #media_content_type_e
573  */
574 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
575
576 /**
577  * @brief Gets the MIME type of the content file.
578  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
579  *
580  * @remarks The @a mime_type should be released using free().
581  *
582  * @param[in] media The handle to the media info
583  * @param[out] mime_type The MIME type of the content file
584  *
585  * @return @c 0 on success,
586  *         otherwise a negative error value
587  *
588  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
589  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
590  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
591  */
592 int media_info_get_mime_type(media_info_h media, char **mime_type);
593
594 /**
595  * @brief Gets the content file size.
596  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
597  *
598  * @param[in] media The handle to the media info
599  * @param[out] size The content file size
600  *
601  * @return @c 0 on success,
602  *         otherwise a negative error value
603  *
604  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
605  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
606  */
607 int media_info_get_size(media_info_h media, unsigned long long *size);
608
609 /**
610  * @brief Gets the added time of the content file.
611  * @details The added time refers to the time that content file was first added to media database.
612  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
613  *
614  * @param[in] media The handle to the media info
615  * @param[out] added_time The added time to the media database
616  *
617  * @return @c 0 on success,
618  *         otherwise a negative error value
619  *
620  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
621  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
622  */
623 int media_info_get_added_time(media_info_h media, time_t *added_time);
624
625 /**
626  * @brief Gets the modified time of the content file.
627  * @details The modified time refers to the last modification time provided by the file system.
628  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
629  *
630  * @param[in] media The handle to the media info
631  * @param[out] time The last modification time of the content file
632  *
633  * @return @c 0 on success,
634  *         otherwise a negative error value
635  *
636  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
637  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
638  */
639 int media_info_get_modified_time(media_info_h media, time_t *time);
640
641 /**
642  * @brief Gets the timeline of content file.
643  * @details If the content file has the creation time information (like Content recorded date or Image creation date), that value is timeline. \n
644  *               Otherwise, timeline value is the same as modified time.
645  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
646  *
647  * @param[in] media The handle to the media info
648  * @param[out] time The timeline of content file
649  *
650  * @return @c 0 on success,
651  *         otherwise a negative error value
652  *
653  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
654  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
655  */
656 int media_info_get_timeline(media_info_h media, time_t *time);
657
658 /**
659  * @brief Gets the thumbnail path of content file.
660  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
661  *
662  * @remarks The @a path should be released using free(). \n
663  *                   If the thumbnail extraction for the given media has not been requested yet, this function returns NULL. \n
664  *                   To create a thumbnail, you should use media_info_generate_thumbnail() function. \n
665  *                   This function returns an empty string if media_info_generate_thumbnail() has failed to create a thumbnail for the given media.
666  *
667  * @param[in] media The handle to the media info
668  * @param[out] path The thumbnail path
669  *
670  * @return @c 0 on success,
671  *         otherwise a negative error value
672  *
673  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
674  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
675  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
676  */
677 int media_info_get_thumbnail_path(media_info_h media, char **path);
678
679 /**
680  * @brief Gets the description of content file.
681  * @details If the value is an empty string, the method returns "Unknown". \n
682  *                Since 3.0, if the media info has no description, the method returns empty string.
683  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
684  *
685  * @remarks The @a description should be released using free().
686  *
687  * @param[in] media The handle to the media info
688  * @param[out] description The description of the content file
689  *
690  * @return @c 0 on success,
691  *         otherwise a negative error value
692  *
693  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
694  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
695  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
696  */
697 int media_info_get_description(media_info_h media, char **description);
698
699 /**
700  * @brief Gets the longitude of content file.
701  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
702  *
703  * @param[in] media The handle to the media info
704  * @param[out] longitude The longitude of the content file
705  *
706  * @return @c 0 on success,
707  *         otherwise a negative error value
708  *
709  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
710  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
711  */
712 int media_info_get_longitude(media_info_h media, double *longitude);
713
714 /**
715  * @brief Gets the latitude of content file.
716  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
717  *
718  * @param[in] media The handle to the media info
719  * @param[out] latitude The latitude of the content file
720  *
721  * @return @c 0 on success,
722  *         otherwise a negative error value
723  *
724  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
725  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
726  *
727  */
728 int media_info_get_latitude(media_info_h media, double* latitude);
729
730 /**
731  * @brief Gets the altitude of content file.
732  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
733  *
734  * @param[in] media The handle to the media info
735  * @param[out] altitude The altitude of the content file
736  *
737  * @return @c 0 on success,
738  *         otherwise a negative error value
739  *
740  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
741  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
742  */
743 int media_info_get_altitude(media_info_h media, double* altitude);
744
745 /**
746  * @brief Gets the rating of content file.
747  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
748  *
749  * @param[in] media The handle to the media info
750  * @param[out] rating The rating of the content file
751  *
752  * @return @c 0 on success,
753  *         otherwise a negative error value
754  *
755  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
756  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
757  */
758 int media_info_get_rating(media_info_h media, int *rating);
759
760 /**
761  * @brief Gets the favorite status of content file which User set.
762  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
763  *
764  * @param[in] media The handle to the media info
765  * @param[out] favorite @c true if content file is set as favorite,
766  *                       otherwise @c false if content file is not set as favorite
767  *
768  * @return @c 0 on success,
769  *         otherwise a negative error value
770  *
771  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
772  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
773  *
774  * @see media_info_set_favorite()
775  */
776 int media_info_get_favorite(media_info_h media, bool* favorite);
777
778 /**
779  * @brief Gets the title of content file.
780  * @details If the content file does not have a title, this method returns the filename without the extension.
781  *
782  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
783  *
784  * @remarks The @a title should be released using free().
785  *
786  * @param[in] media The handle to the media info
787  * @param[out] title The title of the content file
788  *
789  * @return @c 0 on success,
790  *         otherwise a negative error value
791  *
792  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
793  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
794  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
795  */
796 int media_info_get_title(media_info_h media, char **title);
797
798 /**
799  * @deprecated Deprecated since 5.0.
800  * @brief Gets the storage id of content file.
801  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
802  *
803  * @remarks The @a storage_id should be released using free().
804  *
805  * @param[in] media The handle to the media info
806  * @param[out] storage_id The ID of the media storage
807  *
808  * @return @c 0 on success,
809  *         otherwise a negative error value
810  *
811  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
812  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
813  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
814  */
815 int media_info_get_storage_id(media_info_h media, char **storage_id) TIZEN_DEPRECATED_API;
816
817 /**
818  * @brief Checks whether the media is protected via DRM.
819  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
820  *
821  * @param[in] media The handle to the media info
822  * @param[out] is_drm @c true if media is DRM media,
823  *                    otherwise @c false if media is not DRM media
824  *
825  * @return @c 0 on success,
826  *         otherwise a negative error value
827  *
828  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
829  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
830  */
831 int media_info_is_drm(media_info_h media, bool *is_drm);
832
833 /**
834  * @brief Checks whether the content file is 360 content.
835  * @since_tizen 3.0
836  *
837  * @param[in] media The handle to the media info
838  * @param[out] is_360 @c true if media is 360 content,
839  *                    otherwise @c false if media is not 360 content
840  *
841  * @return @c 0 on success,
842  *         otherwise a negative error value
843  *
844  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
845  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
846  */
847 int media_info_is_360_content(media_info_h media, bool *is_360);
848
849 /**
850  * @deprecated Deprecated since 5.0. Use storage_get_type_dev() instead.
851  * @brief Gets the storage type of content file.
852  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
853  *
854  * @param[in] media The handle to the media info
855  * @param[out] storage_type The storage type of the content file
856  *
857  * @return @c 0 on success,
858  *         otherwise a negative error value
859  *
860  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
861  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
862  */
863 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type) TIZEN_DEPRECATED_API;
864
865 /**
866  * @brief Gets the media info from the media database.
867  *
868  * @details This function creates a new media handle from the media database by the given @a media_id.
869  *          Media info will be created and filled with information.
870  *
871  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
872  *
873  * @remarks The @a media should be released using media_info_destroy().
874  *
875  * @param[in] media_id The media ID
876  * @param[out] media The handle to the media info
877  *
878  * @return @c 0 on success,
879  *         otherwise a negative error value
880  *
881  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
882  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
883  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
884  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
885  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
886  *
887  * @pre This function requires opened connection to content service by media_content_connect().
888  *
889  * @see media_content_connect()
890  * @see media_info_destroy()
891  */
892 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
893
894 /**
895  * @brief Sets the favorite of media info.
896  * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n
897  *                So, If you use it in order parameter, you can sort the order of the time was a favorite. \n
898  *                Or, if you use it in condition parameter, you can get the result of the favorite media.
899  *
900  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
901  *
902  * @param[in] media The handle to the media info
903  * @param[in] favorite Set @c true to set the media info as favorite,
904  *                     otherwise set @c false to not set the media info as favorite
905  *
906  * @return @c 0 on success,
907  *         otherwise a negative error value
908  *
909  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
910  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
911  */
912 int media_info_set_favorite(media_info_h media, bool favorite);
913
914 /**
915  * @brief Updates the media info to the media database.
916  *
917  * @details The function updates the given media info in the media database.
918  *
919  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
920  * @privlevel public
921  * @privilege %http://tizen.org/privilege/content.write
922  *
923  * @remarks The function should be called after any change in media, to be updated to the media
924  *          database. For example, after using media_info_set_favorite()
925  *          for setting the name of the media, the media_info_update_to_db() function should be called so as to update
926  *          the given media info attributes in the media database.
927  *
928  * @param[in] media The handle to the media info
929  *
930  * @return @c 0 on success,
931  *         otherwise a negative error value
932  *
933  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
934  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
935  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
936  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
937  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
938  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
939  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
940  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
941  *
942  * @pre This function requires opened connection to content service by media_content_connect().
943  *
944  * @see media_content_connect()
945  * @see media_info_set_favorite()
946  */
947 int media_info_update_to_db(media_info_h media);
948
949 /**
950  * @brief Moves the media info to the given destination path in the media database.
951  * @details After moving or renaming a file in the filesystem, call this function to update the database. \n
952  *               If the source path and destination path are the same, then this function does nothing.
953  *               If you want to refresh media information, you should use media_content_scan_file() function.
954  *
955  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
956  *
957  * @privlevel public
958  * @privilege %http://tizen.org/privilege/content.write \n
959  *                   %http://tizen.org/privilege/mediastorage \n
960  *                   %http://tizen.org/privilege/externalstorage
961  *
962  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
963  *                   If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n
964  *                   Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n
965  *                   If you can access both storage, you should add all privilege. \n
966  *                   Since 4.0, this function does not allow symbolic links. \n
967  *                   This function does not support USB storage before 5.0. Since 5.0, USB storage is supported. \n
968  *                   Since 5.0, the thumbnail is removed if it exists.
969  *
970  * @param[in] media The handle to the media info
971  * @param[in] dst_path The path of destination
972  *
973  * @return @c 0 on success,
974  *         otherwise a negative error value
975  *
976  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
977  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
978  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
979  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
980  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
981  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
982  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
983  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
984  *
985  * @pre This function requires opened connection to content service by media_content_connect().
986  *
987  * @see media_content_connect()
988  * @see media_content_scan_folder()
989  * @see media_info_generate_thumbnail()
990  */
991 int media_info_move_to_db(media_info_h media, const char* dst_path);
992
993 /**
994  * @deprecated Deprecated since 5.0. Use media_info_generate_thumbnail() instead.
995  * @brief Creates a thumbnail file for the given media, asynchronously.
996  * @details This function creates an thumbnail file for given media item and calls @a callback for completion of creating the thumbnail.
997  *          If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function. \n
998  *          Since 3.0, a thumbnail is not automatically extracted during media scanning. \n
999  *          Therefore, if there exists no thumbnail for the given media, you MUST call this function to create a thumbnail.
1000  *
1001  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1002  *
1003  * @privlevel public
1004  * @privilege %http://tizen.org/privilege/content.write \n
1005  *                   %http://tizen.org/privilege/mediastorage \n
1006  *                   %http://tizen.org/privilege/externalstorage
1007  *
1008  * @remarks If you want to destroy media handle before callback invoked, you must cancel thumbnail request by using media_info_cancel_thumbnail() \n
1009  *          Since 3.0, if creation of a thumbnail is failed, empty string will be passed through media_thumbnail_completed_cb().
1010  *          Items in external storage except MMC not supported.
1011  *
1012  * @param[in] media The handle to the media info
1013  * @param[in] callback The callback function to be invoked
1014  * @param[in] user_data The user data to be passed to the callback function
1015  *
1016  * @return @c 0 on success,
1017  *         otherwise a negative error value
1018  *
1019  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1020  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1021  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1022  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1023  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1024  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1025  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1026  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1027  *
1028  * @pre This function requires opened connection to content service by media_content_connect().
1029  *
1030  * @see media_content_connect()
1031  */
1032 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data) TIZEN_DEPRECATED_API;
1033
1034 /**
1035  * @deprecated Deprecated since 5.0.
1036  * @brief Cancels the creation of thumbnail file for the given media.
1037  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1038  *
1039  * @privlevel public
1040  * @privilege %http://tizen.org/privilege/content.write
1041  *
1042  * @remarks If you request cancel for the already thumbnail created media, this function return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1043  *
1044  * @param[in] media The handle to the media info
1045  *
1046  * @return @c 0 on success,
1047  *         otherwise a negative error value
1048  *
1049  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1050  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1051  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1052  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1053  *
1054  * @pre This function requires opened connection to content service by media_content_connect().
1055  * @see media_content_connect()
1056  */
1057 int media_info_cancel_thumbnail(media_info_h media) TIZEN_DEPRECATED_API;
1058
1059 /**
1060  * @brief Generates a thumbnail file for the given media, synchronously.
1061  *
1062  * @since_tizen 5.0
1063  *
1064  * @privlevel public
1065  * @privilege %http://tizen.org/privilege/content.write
1066  *
1067  * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
1068  *          http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
1069  *          Items in external storage are not supported, with the exception of MMC.
1070  *
1071  * @param[in] media The handle to the media info
1072  *
1073  * @return @c 0 on success,
1074  *         otherwise a negative error value
1075  *
1076  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1077  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1078  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1079  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1080  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1081  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1082  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1083  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1084  *
1085  * @pre This function requires opened connection to content service by media_content_connect().
1086  *
1087  * @see media_content_connect()
1088  * @see media_info_get_thumbnail_path()
1089  */
1090 int media_info_generate_thumbnail(media_info_h media);
1091
1092 /**
1093  * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1094  * @brief Starts face detection for the given image, asynchronously.
1095  * @details This function detects faces for given image item and calls the given callback function when the detection is completed. \n
1096  *          The given callback function is called when the detection is completed. \n
1097  *          To obtain the detected faces, call the media_info_foreach_face_from_db() function.
1098  *
1099  * @since_tizen 3.0
1100  *
1101  * @privlevel public
1102  * @privilege %http://tizen.org/privilege/content.write \n
1103  *                   %http://tizen.org/privilege/mediastorage \n
1104  *                   %http://tizen.org/privilege/externalstorage
1105  *
1106  * @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
1107  *          If face detection fails, the face_count argument in media_face_detection_completed_cb() will be set to 0.
1108  *          Media items in external storage are not supported, with the exception of MMC items.
1109  *
1110  * @param[in] media The handle to the media info
1111  * @param[in] callback The callback function to be invoked when detection is completed
1112  * @param[in] user_data The user data to be passed to the callback function
1113  *
1114  * @return @c 0 on success,
1115  *         otherwise a negative error value
1116  *
1117  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1118  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1119  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1120  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1121  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1122  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1123  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1124  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1125  * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED     Not supported
1126  *
1127  * @pre This function requires opened connection to content service by media_content_connect().
1128  *
1129  * @see media_content_connect()
1130  * @see media_info_cancel_face_detection()
1131  */
1132 int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data);
1133
1134 /**
1135  * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1136  * @brief Cancels face detection of image for the given media.
1137  * @details This function cancels face detection for given media item. \n
1138  *          If you cancel face detection request before callback is invoked, the callback registered by media_info_start_face_detection() function will not be invoked.
1139  *
1140  * @since_tizen 3.0
1141  *
1142  * @privlevel public
1143  * @privilege %http://tizen.org/privilege/content.write
1144  *
1145  * @remarks If face detection is already done when you request the cancellation, this function return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1146  *
1147  * @param[in] media The handle to the media info
1148  *
1149  * @return @c 0 on success,
1150  *         otherwise a negative error value
1151  *
1152  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1153  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1154  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1155  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1156  *
1157  * @pre This function requires opened connection to content service by media_content_connect().
1158  *
1159  * @see media_content_connect()
1160  * @see media_info_start_face_detection()
1161  */
1162 int media_info_cancel_face_detection(media_info_h media);
1163
1164 /**
1165  * @}
1166  */
1167
1168 #ifdef __cplusplus
1169 }
1170 #endif /* __cplusplus */
1171
1172 #endif /* __TIZEN_CONTENT_MEDIA_INFO_H__ */