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