9d00fa4dfcef1ceb1dc1dbedbffd015620567d82
[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. \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 the media ID.
510  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
511  * @remarks The @a media_id should be released using free().
512  *
513  * @param[in] media The handle to the media info
514  * @param[out] media_id The media ID
515  *
516  * @return @c 0 on success,
517  *         otherwise a negative error value
518  *
519  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
520  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
521  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
522  */
523 int media_info_get_media_id(media_info_h media, char **media_id);
524
525 /**
526  * @brief Gets the full path of the content file.
527  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
528  *
529  * @remarks The @a path should be released using free().
530  *
531  * @param[in] media The handle to the media info
532  * @param[out] path The full path of the content file
533  *
534  * @return @c 0 on success,
535  *         otherwise a negative error value
536  *
537  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
538  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
539  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
540  *
541  */
542 int media_info_get_file_path(media_info_h media, char **path);
543
544 /**
545  * @brief Gets the file name including the extension of the content file.
546  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
547  *
548  * @remarks The @a name should be released using free().
549  *
550  * @param[in] media The handle to the media info
551  * @param[out] name The file name including the extension of the content file
552  *
553  * @return @c 0 on success,
554  *         otherwise a negative error value
555  *
556  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
557  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
558  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
559  */
560 int media_info_get_display_name(media_info_h media, char **name);
561
562 /**
563  * @brief Gets the content type of the content file.
564  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
565  *
566  * @param[in] media The handle to the media info
567  * @param[out] type The content type of the content file (#media_content_type_e)
568  *
569  * @return @c 0 on success,
570  *         otherwise a negative error value
571  *
572  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
573  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
574  *
575  * @see #media_content_type_e
576  */
577 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
578
579 /**
580  * @brief Gets the MIME type of the content file.
581  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
582  *
583  * @remarks The @a mime_type should be released using free().
584  *
585  * @param[in] media The handle to the media info
586  * @param[out] mime_type The MIME type of the content file
587  *
588  * @return @c 0 on success,
589  *         otherwise a negative error value
590  *
591  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
592  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
593  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
594  */
595 int media_info_get_mime_type(media_info_h media, char **mime_type);
596
597 /**
598  * @brief Gets the content file size.
599  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
600  *
601  * @param[in] media The handle to the media info
602  * @param[out] size The content file size
603  *
604  * @return @c 0 on success,
605  *         otherwise a negative error value
606  *
607  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
608  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
609  */
610 int media_info_get_size(media_info_h media, unsigned long long *size);
611
612 /**
613  * @brief Gets the added time of the content file.
614  * @details The added time refers to the time that content file was first added to media database.
615  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
616  *
617  * @param[in] media The handle to the media info
618  * @param[out] added_time The added time to the media database
619  *
620  * @return @c 0 on success,
621  *         otherwise a negative error value
622  *
623  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
624  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
625  */
626 int media_info_get_added_time(media_info_h media, time_t *added_time);
627
628 /**
629  * @brief Gets the modified time of the content file.
630  * @details The modified time refers to the last modification time provided by the file system.
631  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
632  *
633  * @param[in] media The handle to the media info
634  * @param[out] time The last modification time of the content file
635  *
636  * @return @c 0 on success,
637  *         otherwise a negative error value
638  *
639  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
640  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
641  */
642 int media_info_get_modified_time(media_info_h media, time_t *time);
643
644 /**
645  * @brief Gets the timeline of content file.
646  * @details If the content file has the creation time information (like Content recorded date or Image creation date), that value is timeline. \n
647  *               Otherwise, timeline value is the same as modified time.
648  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
649  *
650  * @param[in] media The handle to the media info
651  * @param[out] time The timeline of content file
652  *
653  * @return @c 0 on success,
654  *         otherwise a negative error value
655  *
656  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
657  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
658  */
659 int media_info_get_timeline(media_info_h media, time_t *time);
660
661 /**
662  * @brief Gets the thumbnail path of content file.
663  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
664  *
665  * @remarks The @a path should be released using free(). \n
666  *                   If the thumbnail extraction for the given media has not been requested yet, this function returns NULL. \n
667  *                   To create a thumbnail, you should use media_info_generate_thumbnail() function. \n
668  *                   This function returns an empty string if media_info_generate_thumbnail() has failed to create a thumbnail for the given media.
669  *
670  * @param[in] media The handle to the media info
671  * @param[out] path The thumbnail path
672  *
673  * @return @c 0 on success,
674  *         otherwise a negative error value
675  *
676  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
677  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
678  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
679  */
680 int media_info_get_thumbnail_path(media_info_h media, char **path);
681
682 /**
683  * @brief Gets the description of content file.
684  * @details If the value is an empty string, the method returns "Unknown". \n
685  *                Since 3.0, if the media info has no description, the method returns empty string.
686  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
687  *
688  * @remarks The @a description should be released using free().
689  *
690  * @param[in] media The handle to the media info
691  * @param[out] description The description of the content file
692  *
693  * @return @c 0 on success,
694  *         otherwise a negative error value
695  *
696  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
697  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
698  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
699  */
700 int media_info_get_description(media_info_h media, char **description);
701
702 /**
703  * @brief Gets the longitude of content file.
704  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
705  *
706  * @param[in] media The handle to the media info
707  * @param[out] longitude The longitude of the content file
708  *
709  * @return @c 0 on success,
710  *         otherwise a negative error value
711  *
712  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
713  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
714  */
715 int media_info_get_longitude(media_info_h media, double *longitude);
716
717 /**
718  * @brief Gets the latitude of content file.
719  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
720  *
721  * @param[in] media The handle to the media info
722  * @param[out] latitude The latitude of the content file
723  *
724  * @return @c 0 on success,
725  *         otherwise a negative error value
726  *
727  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
728  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
729  *
730  */
731 int media_info_get_latitude(media_info_h media, double* latitude);
732
733 /**
734  * @brief Gets the altitude of content file.
735  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
736  *
737  * @param[in] media The handle to the media info
738  * @param[out] altitude The altitude of the content file
739  *
740  * @return @c 0 on success,
741  *         otherwise a negative error value
742  *
743  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
744  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
745  */
746 int media_info_get_altitude(media_info_h media, double* altitude);
747
748 /**
749  * @brief Gets the rating of content file.
750  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
751  *
752  * @param[in] media The handle to the media info
753  * @param[out] rating The rating of the content file
754  *
755  * @return @c 0 on success,
756  *         otherwise a negative error value
757  *
758  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
759  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
760  */
761 int media_info_get_rating(media_info_h media, int *rating);
762
763 /**
764  * @brief Gets the favorite status of content file which User set.
765  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
766  *
767  * @param[in] media The handle to the media info
768  * @param[out] favorite @c true if content file is set as favorite,
769  *                       otherwise @c false if content file is not set as favorite
770  *
771  * @return @c 0 on success,
772  *         otherwise a negative error value
773  *
774  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
775  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
776  *
777  * @see media_info_set_favorite()
778  */
779 int media_info_get_favorite(media_info_h media, bool* favorite);
780
781 /**
782  * @brief Gets the title of content file.
783  * @details If the content file does not have a title, this method returns the filename without the extension.
784  *
785  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
786  *
787  * @remarks The @a title should be released using free().
788  *
789  * @param[in] media The handle to the media info
790  * @param[out] title The title of the content file
791  *
792  * @return @c 0 on success,
793  *         otherwise a negative error value
794  *
795  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
796  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
797  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
798  */
799 int media_info_get_title(media_info_h media, char **title);
800
801 /**
802  * @deprecated Deprecated since 5.0.
803  * @brief Gets the storage id of content file.
804  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
805  *
806  * @remarks The @a storage_id should be released using free().
807  *
808  * @param[in] media The handle to the media info
809  * @param[out] storage_id The ID of the media storage
810  *
811  * @return @c 0 on success,
812  *         otherwise a negative error value
813  *
814  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
815  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
816  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
817  */
818 int media_info_get_storage_id(media_info_h media, char **storage_id) TIZEN_DEPRECATED_API;
819
820 /**
821  * @brief Checks whether the media is protected via DRM.
822  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
823  *
824  * @param[in] media The handle to the media info
825  * @param[out] is_drm @c true if media is DRM media,
826  *                    otherwise @c false if media is not DRM media
827  *
828  * @return @c 0 on success,
829  *         otherwise a negative error value
830  *
831  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
832  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
833  */
834 int media_info_is_drm(media_info_h media, bool *is_drm);
835
836 /**
837  * @brief Checks whether the content file is 360 content.
838  * @since_tizen 3.0
839  *
840  * @param[in] media The handle to the media info
841  * @param[out] is_360 @c true if media is 360 content,
842  *                    otherwise @c false if media is not 360 content
843  *
844  * @return @c 0 on success,
845  *         otherwise a negative error value
846  *
847  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
848  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
849  */
850 int media_info_is_360_content(media_info_h media, bool *is_360);
851
852 /**
853  * @deprecated Deprecated since 5.0. Use storage_get_type_dev() instead.
854  * @brief Gets the storage type of content file.
855  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
856  *
857  * @param[in] media The handle to the media info
858  * @param[out] storage_type The storage type of the content file
859  *
860  * @return @c 0 on success,
861  *         otherwise a negative error value
862  *
863  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
864  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
865  */
866 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type) TIZEN_DEPRECATED_API;
867
868 /**
869  * @brief Gets the media info from the media database.
870  *
871  * @details This function creates a new media handle from the media database by the given @a media_id.
872  *          Media info will be created and filled with information.
873  *
874  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
875  *
876  * @remarks The @a media should be released using media_info_destroy().
877  *
878  * @param[in] media_id The media ID
879  * @param[out] media The handle to the media info
880  *
881  * @return @c 0 on success,
882  *         otherwise a negative error value
883  *
884  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
885  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
886  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
887  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
888  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
889  *
890  * @pre This function requires opened connection to content service by media_content_connect().
891  *
892  * @see media_content_connect()
893  * @see media_info_destroy()
894  */
895 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
896
897 /**
898  * @brief Gets the media info from the media database using path.
899  *
900  * @details This function creates a new media handle filled with information from the database by the given @a media_path.
901  *
902  * @since_tizen 6.5
903  *
904  * @remarks The @a media should be released using media_info_destroy().\n
905  *          If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
906  *          If you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
907  *          If you want to access storages of both types, you must add all privileges. \n
908  *
909  * @param[in] media_path The media path
910  * @param[out] media The handle to the media info
911  *
912  * @return @c 0 on success,
913  *         otherwise a negative error value
914  *
915  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
916  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
917  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
918  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
919  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
920  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
921  *
922  * @pre This function requires opened connection to content service by media_content_connect().
923  *
924  * @see media_content_connect()
925  * @see media_info_destroy()
926  */
927 int media_info_get_media_from_db_by_path(const char *media_path, media_info_h *media);
928
929 /**
930  * @brief Sets the favorite of media info.
931  * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n
932  *                So, If you use it in order parameter, you can sort the order of the time was a favorite. \n
933  *                Or, if you use it in condition parameter, you can get the result of the favorite media.
934  *
935  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
936  *
937  * @param[in] media The handle to the media info
938  * @param[in] favorite Set @c true to set the media info as favorite,
939  *                     otherwise set @c false to not set the media info as favorite
940  *
941  * @return @c 0 on success,
942  *         otherwise a negative error value
943  *
944  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
945  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
946  */
947 int media_info_set_favorite(media_info_h media, bool favorite);
948
949 /**
950  * @brief Updates the media info to the media database.
951  *
952  * @details The function updates the given media info in the media database.
953  *
954  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
955  * @privlevel public
956  * @privilege %http://tizen.org/privilege/content.write
957  *
958  * @remarks The function should be called after any change in media, to be updated to the media
959  *          database. For example, after using media_info_set_favorite()
960  *          for setting the name of the media, the media_info_update_to_db() function should be called so as to update
961  *          the given media info attributes in the media database.
962  *
963  * @param[in] media The handle to the media info
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  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
971  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
972  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
973  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
974  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
975  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
976  *
977  * @pre This function requires opened connection to content service by media_content_connect().
978  *
979  * @see media_content_connect()
980  * @see media_info_set_favorite()
981  */
982 int media_info_update_to_db(media_info_h media);
983
984 /**
985  * @brief Moves the media info to the given destination path in the media database.
986  * @details After moving or renaming a file in the filesystem, call this function to update the database. \n
987  *               If the source path and destination path are the same, then this function does nothing.
988  *               If you want to refresh media information, you should use media_content_scan_file() function.
989  *
990  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
991  *
992  * @privlevel public
993  * @privilege %http://tizen.org/privilege/content.write \n
994  *                   %http://tizen.org/privilege/mediastorage \n
995  *                   %http://tizen.org/privilege/externalstorage
996  *
997  * @remarks You must add privilege %http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
998  *                   If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
999  *                   Or if you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
1000  *                   If you can access both storage, you should add all privilege. \n
1001  *                   Since 4.0, this function does not allow symbolic links. \n
1002  *                   This function does not support USB storage before 5.0. Since 5.0, USB storage is supported. \n
1003  *                   Since 5.0, the thumbnail is removed if it exists.
1004  *
1005  * @param[in] media The handle to the media info
1006  * @param[in] dst_path The path of destination
1007  *
1008  * @return @c 0 on success,
1009  *         otherwise a negative error value
1010  *
1011  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1012  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
1013  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1014  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1015  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1016  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1017  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1018  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1019  *
1020  * @pre This function requires opened connection to content service by media_content_connect().
1021  *
1022  * @see media_content_connect()
1023  * @see media_content_scan_folder()
1024  * @see media_info_generate_thumbnail()
1025  */
1026 int media_info_move_to_db(media_info_h media, const char* dst_path);
1027
1028 /**
1029  * @deprecated Deprecated since 5.0. Use media_info_generate_thumbnail() instead.
1030  * @brief Creates a thumbnail file for the given media, asynchronously.
1031  * @details This function creates an thumbnail file for given media item and calls @a callback for completion of creating the thumbnail.
1032  *          If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function. \n
1033  *          Since 3.0, a thumbnail is not automatically extracted during media scanning. \n
1034  *          Therefore, if there exists no thumbnail for the given media, you MUST call this function to create a thumbnail.
1035  *
1036  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1037  *
1038  * @privlevel public
1039  * @privilege %http://tizen.org/privilege/content.write \n
1040  *                   %http://tizen.org/privilege/mediastorage \n
1041  *                   %http://tizen.org/privilege/externalstorage
1042  *
1043  * @remarks If you want to destroy media handle before callback invoked, you must cancel thumbnail request by using media_info_cancel_thumbnail() \n
1044  *          Since 3.0, if creation of a thumbnail is failed, empty string will be passed through media_thumbnail_completed_cb().
1045  *          Items in external storage except MMC not supported.
1046  *
1047  * @param[in] media The handle to the media info
1048  * @param[in] callback The callback function to be invoked
1049  * @param[in] user_data The user data to be passed to the callback function
1050  *
1051  * @return @c 0 on success,
1052  *         otherwise a negative error value
1053  *
1054  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1055  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1056  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1057  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1058  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1059  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1060  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1061  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1062  *
1063  * @pre This function requires opened connection to content service by media_content_connect().
1064  *
1065  * @see media_content_connect()
1066  */
1067 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data) TIZEN_DEPRECATED_API;
1068
1069 /**
1070  * @deprecated Deprecated since 5.0.
1071  * @brief Cancels the creation of thumbnail file for the given media.
1072  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1073  *
1074  * @privlevel public
1075  * @privilege %http://tizen.org/privilege/content.write
1076  *
1077  * @remarks If you request cancel for the already thumbnail created media, this function returns #MEDIA_CONTENT_ERROR_INVALID_OPERATION
1078  *
1079  * @param[in] media The handle to the media info
1080  *
1081  * @return @c 0 on success,
1082  *         otherwise a negative error value
1083  *
1084  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1085  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1086  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1087  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1088  *
1089  * @pre This function requires opened connection to content service by media_content_connect().
1090  * @see media_content_connect()
1091  */
1092 int media_info_cancel_thumbnail(media_info_h media) TIZEN_DEPRECATED_API;
1093
1094 /**
1095  * @brief Generates a thumbnail file for the given media, synchronously.
1096  *
1097  * @since_tizen 5.0
1098  *
1099  * @privlevel public
1100  * @privilege %http://tizen.org/privilege/content.write
1101  *
1102  * @remarks %http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
1103  *          %http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
1104  *          Items in external storage are not supported, with the exception of MMC.
1105  *
1106  * @param[in] media The handle to the media info
1107  *
1108  * @return @c 0 on success,
1109  *         otherwise a negative error value
1110  *
1111  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1112  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1113  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1114  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1115  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1116  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1117  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1118  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1119  *
1120  * @pre This function requires opened connection to content service by media_content_connect().
1121  *
1122  * @see media_content_connect()
1123  * @see media_info_get_thumbnail_path()
1124  */
1125 int media_info_generate_thumbnail(media_info_h media);
1126
1127 /**
1128  * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1129  * @brief Starts face detection for the given image, asynchronously.
1130  * @details This function detects faces for given image item and calls the given callback function when the detection is completed. \n
1131  *          The given callback function is called when the detection is completed. \n
1132  *          To obtain the detected faces, call the media_info_foreach_face_from_db() function. \n
1133  *          Supported image formats are jpg, png, and bmp.
1134  *
1135  * @since_tizen 3.0
1136  *
1137  * @privlevel public
1138  * @privilege %http://tizen.org/privilege/content.write \n
1139  *                   %http://tizen.org/privilege/mediastorage \n
1140  *                   %http://tizen.org/privilege/externalstorage
1141  *
1142  * @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
1143  *          If the face detection fails, the @a face_count argument in media_face_detection_completed_cb() will be set to 0. \n
1144  *          The face detection of media items in external storage except MMC is not supported. \n
1145  *          Since 5.5, if the format of media data is unsupported, this function returns an error and the callback will not be invoked.
1146  *
1147  * @param[in] media The handle to the media info
1148  * @param[in] callback The callback function to be invoked when detection is completed
1149  * @param[in] user_data The user data to be passed to the callback function
1150  *
1151  * @return @c 0 on success,
1152  *         otherwise a negative error value
1153  *
1154  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1155  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1156  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1157  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1158  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1159  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1160  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1161  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1162  * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED     Not supported
1163  *
1164  * @pre This function requires opened connection to content service by media_content_connect().
1165  *
1166  * @see media_content_connect()
1167  * @see media_info_cancel_face_detection()
1168  */
1169 int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data);
1170
1171 /**
1172  * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1173  * @brief Cancels face detection of image for the given media.
1174  * @details This function cancels face detection for given media item. \n
1175  *          If you cancel face detection request before callback is invoked, the callback registered by media_info_start_face_detection() function will not be invoked.
1176  *
1177  * @since_tizen 3.0
1178  *
1179  * @privlevel public
1180  * @privilege %http://tizen.org/privilege/content.write
1181  *
1182  * @remarks If face detection is already done when you request the cancellation, this function returns #MEDIA_CONTENT_ERROR_INVALID_OPERATION
1183  *
1184  * @param[in] media The handle to the media info
1185  *
1186  * @return @c 0 on success,
1187  *         otherwise a negative error value
1188  *
1189  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1190  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1191  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1192  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1193  *
1194  * @pre This function requires opened connection to content service by media_content_connect().
1195  *
1196  * @see media_content_connect()
1197  * @see media_info_start_face_detection()
1198  */
1199 int media_info_cancel_face_detection(media_info_h media);
1200
1201 /**
1202  * @}
1203  */
1204
1205 #ifdef __cplusplus
1206 }
1207 #endif /* __cplusplus */
1208
1209 #endif /* __TIZEN_CONTENT_MEDIA_INFO_H__ */