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