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