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