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