Fix typo
[platform/core/api/media-content.git] / include_product / media_info.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18 #ifndef __TIZEN_CONTENT_MEDIA_INFO_H__
19 #define __TIZEN_CONTENT_MEDIA_INFO_H__
20
21 #include <media_content_type.h>
22
23
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 /**
30  * @file media_info.h
31  * @brief This file contains the media info function and related functions to proceed with it. \n
32  *        You can use the functions to insert, delete, count and get list of content files from media database. \n
33  *        You can get properties of content file such as size, mime_type, modified_time etc. And you can set properties such as 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 supported 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 supported 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 content file does not have a title, this method returns the filename without the extension.
928  *
929  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
930  *
931  * @remarks The @a title should be released using free().
932  *
933  * @param[in] media The handle to the media info
934  * @param[out] title The title of the content file
935  *
936  * @return @c 0 on success,
937  *         otherwise a negative error value
938  *
939  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
940  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
941  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
942  */
943 int media_info_get_title(media_info_h media, char **title);
944
945 /**
946  * @deprecated Deprecated since 4.0.
947  * @brief Gets the category of content file which User set.
948  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
949  *
950  * @remarks The @a category should be released using free().
951  *
952  * @param[in] media The handle to the media info
953  * @param[out] category The category of the content file
954  *
955  * @return @c 0 on success,
956  *         otherwise a negative error value
957  *
958  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
959  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
960  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
961  *
962  */
963 int media_info_get_category(media_info_h media, char **category) TIZEN_DEPRECATED_API;
964
965 /**
966  * @deprecated Deprecated since 4.0.
967  * @brief Gets the location tag of content file which User set.
968  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
969  *
970  * @remarks The @a location_tag should be released using free().
971  *
972  * @param[in] media The handle to the media info
973  * @param[out] location_tag The location of the content file
974  *
975  * @return @c 0 on success,
976  *         otherwise a negative error value
977  *
978  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
979  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
980  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
981  *
982  */
983 int media_info_get_location_tag(media_info_h media, char **location_tag) TIZEN_DEPRECATED_API;
984
985 /**
986  * @deprecated Deprecated since 4.0.
987  * @brief Gets the age_rating of content file which User set.
988  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
989  *
990  * @remarks The @a age_rating should be released using free().
991  *
992  * @param[in] media The handle to the media info
993  * @param[out] age_rating The age rating of the content file
994  *
995  * @return @c 0 on success,
996  *         otherwise a negative error value
997  *
998  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
999  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1000  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1001  *
1002  */
1003 int media_info_get_age_rating(media_info_h media, char **age_rating) TIZEN_DEPRECATED_API;
1004
1005 /**
1006  * @deprecated Deprecated since 4.0. Use media_tag_insert_to_db() instead.
1007  * @brief Gets the keyword of content file which User set.
1008  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1009  *
1010  * @remarks The @a keyword should be released using free().
1011  *
1012  * @param[in] media The handle to the media info
1013  * @param[out] keyword The keyword 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  *
1022  */
1023 int media_info_get_keyword(media_info_h media, char **keyword) TIZEN_DEPRECATED_API;
1024
1025 /**
1026  * @brief Gets the storage id of content file.
1027  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1028  *
1029  * @remarks The @a storage_id should be released using free().
1030  *
1031  * @param[in] media The handle to the media info
1032  * @param[out] storage_id The ID of the media storage
1033  *
1034  * @return @c 0 on success,
1035  *         otherwise a negative error value
1036  *
1037  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1038  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1039  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1040  */
1041 int media_info_get_storage_id(media_info_h media, char **storage_id);
1042
1043 /**
1044  * @brief Checks whether the media is protected via DRM.
1045  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1046  *
1047  * @param[in] media The handle to the media info
1048  * @param[out] is_drm @c true if media is DRM media,
1049  *                    otherwise @c false if media is not DRM media
1050  *
1051  * @return @c 0 on success,
1052  *         otherwise a negative error value
1053  *
1054  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1055  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1056  */
1057 int media_info_is_drm(media_info_h media, bool *is_drm);
1058
1059 /**
1060  * @brief Checks whether the content file is 360 content.
1061  * @since_tizen 3.0
1062  *
1063  * @param[in] media The handle to the media info
1064  * @param[out] is_360 @c true if media is 360 content,
1065  *                    otherwise @c false if media is not 360 content
1066  *
1067  * @return @c 0 on success,
1068  *         otherwise a negative error value
1069  *
1070  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1071  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1072  */
1073 int media_info_is_360_content(media_info_h media, bool *is_360);
1074
1075 /**
1076  * @brief Gets the storage type of content file.
1077  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1078  *
1079  * @param[in] media The handle to the media info
1080  * @param[out] storage_type The storage type of the content file
1081  *
1082  * @return @c 0 on success,
1083  *         otherwise a negative error value
1084  *
1085  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1086  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1087  */
1088 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type);
1089
1090 /**
1091  * @deprecated Deprecated since 4.0. \n
1092  *        This function does not guarantee independence of the played count value between applications. It is recommended that the value is managed by the application.
1093  * @brief Gets number which represents how many times given content has been played.
1094  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1095  *
1096  * @param[in] media The handle to the media info
1097  * @param[out] played_count The counter of content played
1098  *
1099  * @return 0 on success,
1100  *         otherwise a negative error value
1101  *
1102  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1103  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1104  */
1105 int media_info_get_played_count(media_info_h media, int *played_count) TIZEN_DEPRECATED_API;
1106
1107 /**
1108  * @deprecated Deprecated since 4.0. \n
1109  *        This function does not guarantee independence of the played time value between applications. It is recommended that the value is managed by the application.
1110  * @brief Gets the content's played time parameter.
1111  * @details Function returns content's elapsed playback time parameter as period
1112  *          starting from the beginning of the track.
1113  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1114  *
1115  * @param[in] media The handle to the media info
1116  * @param[out] played_time The elapsed time of the content
1117  *
1118  * @return 0 on success,
1119  *         otherwise a negative error value
1120  *
1121  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1122  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1123  */
1124 int media_info_get_played_time(media_info_h media, time_t *played_time) TIZEN_DEPRECATED_API;
1125
1126 /**
1127  * @brief Gets the media info from the media database.
1128  *
1129  * @details This function creates a new media handle from the media database by the given @a media_id.
1130  *          Media info will be created and filled with information.
1131  *
1132  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1133  *
1134  * @remarks The @a media should be released using media_info_destroy().
1135  *
1136  * @param[in] media_id The media ID
1137  * @param[out] media The handle to the media info
1138  *
1139  * @return @c 0 on success,
1140  *         otherwise a negative error value
1141  *
1142  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1143  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1144  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1145  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1146  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1147  *
1148  * @pre This function requires opened connection to content service by media_content_connect().
1149  *
1150  * @see media_content_connect()
1151  * @see media_info_destroy()
1152  */
1153 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
1154
1155 /**
1156  * @deprecated Deprecated since 4.0. \n
1157  *        This function does not guarantee independence of the played count value between applications. It is recommended that the value is managed by the application.
1158  * @brief Increments the played count to content meta handle.
1159  * @details You can increase the played(opened) count of the content file.
1160  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1161  *
1162  * @param[in] media The handle to the media info
1163  *
1164  * @return 0 on success,
1165  *         otherwise a negative error value
1166  *
1167  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1168  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1169  *
1170  * @post media_info_update_to_db()
1171  */
1172 int media_info_increase_played_count(media_info_h media) TIZEN_DEPRECATED_API;
1173
1174 /**
1175  * @deprecated Deprecated since 4.0. \n
1176  *        This function does not guarantee independence of the played time value between applications. It is recommended that the value is managed by the application.
1177  * @brief Sets the played time to content meta handle.
1178  * @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.
1179  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
1180  *
1181  * @param[in] media The handle to the media info
1182  *
1183  * @return 0 on success,
1184  *         otherwise a negative error value
1185  *
1186  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1187  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1188  *
1189  * @post media_info_update_to_db()
1190  */
1191 int media_info_set_played_time(media_info_h media) TIZEN_DEPRECATED_API;
1192
1193 /**
1194  * @deprecated Deprecated since 4.0. Redundant, use media_info_move_to_db() instead.
1195  * @brief Sets the file name including the extension of the content file.
1196  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1197  *
1198  * @param[in] media The handle to the media info
1199  * @param[in] display_name The file name including the extension of the content file.
1200  *
1201  * @return @c 0 on success,
1202  *         otherwise a negative error value
1203  *
1204  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1205  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1206  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1207  *
1208  * @post media_info_update_to_db().
1209  *
1210  */
1211 int media_info_set_display_name(media_info_h media, const char *display_name) TIZEN_DEPRECATED_API;
1212
1213 /**
1214  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1215  * @brief Sets the description of media info.
1216  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1217  *
1218  * @param[in] media The handle to the media info
1219  * @param[in] description The description of the media info
1220  *
1221  * @return @c 0 on success,
1222  *         otherwise a negative error value
1223  *
1224  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1225  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1226  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1227  *
1228  * @post media_info_update_to_db().
1229  *
1230  */
1231 int media_info_set_description(media_info_h media, const char *description) TIZEN_DEPRECATED_API;
1232
1233 /**
1234  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1235  * @brief Sets the longitude of media info.
1236  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1237  *
1238  * @param[in] media The handle to the media info
1239  * @param[in] longitude The longitude of the media info
1240  *
1241  * @return @c 0 on success,
1242  *         otherwise a negative error value
1243  *
1244  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1245  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1246  *
1247  * @post media_info_update_to_db().
1248  */
1249 int media_info_set_longitude(media_info_h media, double longitude) TIZEN_DEPRECATED_API;
1250
1251 /**
1252  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1253  * @brief Sets the latitude of media info.
1254  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1255  *
1256  * @param[in] media The handle to the media info
1257  * @param[in] latitude The latitude of the media info
1258  *
1259  * @return @c 0 on success,
1260  *         otherwise a negative error value
1261  *
1262  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1263  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1264  *
1265  * @post media_info_update_to_db().
1266  */
1267 int media_info_set_latitude(media_info_h media, double latitude) TIZEN_DEPRECATED_API;
1268
1269 /**
1270  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1271  * @brief Sets the altitude of media info.
1272  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1273  *
1274  * @param[in] media The handle to the media info
1275  * @param[in] altitude The altitude of the media info
1276  *
1277  * @return @c 0 on success,
1278  *         otherwise a negative error value
1279  *
1280  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1281  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1282  *
1283  * @post media_info_update_to_db().
1284  */
1285 int media_info_set_altitude(media_info_h media, double altitude) TIZEN_DEPRECATED_API;
1286
1287 /**
1288  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1289  * @brief Sets the weather of media info.
1290  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1291  *
1292  * @param[in] media The handle to the media info
1293  * @param[in] weather The weather of the media info
1294  *
1295  * @return @c 0 on success,
1296  *         otherwise a negative error value
1297  *
1298  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1299  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1300  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1301  *
1302  * @post media_info_update_to_db().
1303  *
1304  */
1305 int media_info_set_weather(media_info_h media, const char *weather) TIZEN_DEPRECATED_API;
1306
1307 /**
1308  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1309  * @brief Sets the rating of media info.
1310  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1311  *
1312  * @param[in] media The handle to the media info
1313  * @param[in] rating The rating of the media info
1314  *
1315  * @return @c 0 on success,
1316  *         otherwise a negative error value
1317  *
1318  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1319  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1320  *
1321  * @post media_info_update_to_db().
1322  */
1323 int media_info_set_rating(media_info_h media, int rating) TIZEN_DEPRECATED_API;
1324
1325 /**
1326  * @brief Sets the favorite of media info.
1327  * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n
1328  *                So, If you use it in order parameter, you can sort the order of the time was a favorite. \n
1329  *                Or, if you use it in condition parameter, you can get the result of the favorite media.
1330  *
1331  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1332  *
1333  * @param[in] media The handle to the media info
1334  * @param[in] favorite Set @c true to set the media info as favorite,
1335  *                     otherwise set @c false to not set the media info as favorite
1336  *
1337  * @return @c 0 on success,
1338  *         otherwise a negative error value
1339  *
1340  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1341  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1342  */
1343 int media_info_set_favorite(media_info_h media, bool favorite);
1344
1345 /**
1346  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1347  * @brief Sets the author of media info.
1348  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1349  *
1350  * @param[in] media The handle to the media info
1351  * @param[in] author The author of the media info
1352  *
1353  * @return @c 0 on success,
1354  *         otherwise a negative error value
1355  *
1356  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1357  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1358  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1359  */
1360 int media_info_set_author(media_info_h media, const char *author) TIZEN_DEPRECATED_API;
1361
1362 /**
1363  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1364  * @brief Sets the provider of media info.
1365  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1366  *
1367  * @param[in] media The handle to the media info
1368  * @param[in] provider The provider of the media info
1369  *
1370  * @return @c 0 on success,
1371  *         otherwise a negative error value
1372  *
1373  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1374  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1375  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1376  */
1377 int media_info_set_provider(media_info_h media, const char *provider) TIZEN_DEPRECATED_API;
1378
1379 /**
1380  * @deprecated Deprecated since 4.0. Redundant, use media_info_move_to_db() instead.
1381  * @brief Sets the content name of media info.
1382  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1383  *
1384  * @param[in] media The handle to the media info
1385  * @param[in] content_name The content name of the media info
1386  *
1387  * @return @c 0 on success,
1388  *         otherwise a negative error value
1389  *
1390  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1391  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1392  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1393  *
1394  * @post media_info_update_to_db()
1395  */
1396 int media_info_set_content_name(media_info_h media, const char *content_name) TIZEN_DEPRECATED_API;
1397
1398 /**
1399  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1400  * @brief Sets the category of media info.
1401  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1402  *
1403  * @param[in] media The handle to the media info
1404  * @param[in] category The category of the media info
1405  *
1406  * @return @c 0 on success,
1407  *         otherwise a negative error value
1408  *
1409  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1410  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1411  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1412  *
1413  * @post media_info_update_to_db()
1414  */
1415 int media_info_set_category(media_info_h media, const char *category) TIZEN_DEPRECATED_API;
1416
1417 /**
1418  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1419  * @brief Sets the location tag of media info.
1420  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1421  *
1422  * @param[in] media The handle to the media info
1423  * @param[in] location_tag The location 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  *
1432  * @post media_info_update_to_db()
1433  */
1434 int media_info_set_location_tag(media_info_h media, const char *location_tag) TIZEN_DEPRECATED_API;
1435
1436 /**
1437  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1438  * @brief Sets the age rating of media info.
1439  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1440  *
1441  * @param[in] media The handle to the media info
1442  * @param[in] age_rating The age rating 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  *
1451  * @post media_info_update_to_db()
1452  */
1453 int media_info_set_age_rating(media_info_h media, const char *age_rating) TIZEN_DEPRECATED_API;
1454
1455 /**
1456  * @deprecated Deprecated since 4.0. Use media_tag_insert_to_db() instead.
1457  * @brief Sets the keyword of media info.
1458  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1459  *
1460  * @param[in] media The handle to the media info
1461  * @param[in] keyword The keyword 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  *
1470  * @post media_info_update_to_db()
1471  */
1472 int media_info_set_keyword(media_info_h media, const char *keyword) TIZEN_DEPRECATED_API;
1473
1474 /**
1475  * @brief Updates the media info to the media database.
1476  *
1477  * @details The function updates the given media info in the media database.
1478  *
1479  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1480  * @privlevel public
1481  * @privilege %http://tizen.org/privilege/content.write
1482  *
1483  * @remarks The function should be called after any change in media, to be updated to the media
1484  *          database. For example, after using media_info_set_favorite()
1485  *          for setting the name of the media, the media_info_update_to_db() function should be called so as to update
1486  *          the given media info attributes in the media database.
1487  *
1488  * @param[in] media The handle to the media info
1489  *
1490  * @return @c 0 on success,
1491  *         otherwise a negative error value
1492  *
1493  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1494  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1495  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1496  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1497  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1498  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1499  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1500  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1501  *
1502  * @pre This function requires opened connection to content service by media_content_connect().
1503  *
1504  * @see media_content_connect()
1505  * @see media_info_set_favorite()
1506  */
1507 int media_info_update_to_db(media_info_h media);
1508
1509 /**
1510  * @deprecated Deprecated since 4.0. Use media_content_scan_file() instead.
1511  * @brief Refreshes the media metadata to the media database.
1512  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1513  *
1514  * @privlevel public
1515  * @privilege %http://tizen.org/privilege/content.write \n
1516  *                   %http://tizen.org/privilege/mediastorage \n
1517  *                   %http://tizen.org/privilege/externalstorage
1518  *
1519  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1520  *                   If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n
1521  *                   Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n
1522  *                   If you can access both storage, you should add all privilege.
1523  *
1524  * @param[in] media_id The media ID
1525  *
1526  * @return @c 0 on success,
1527  *         otherwise a negative error value
1528  *
1529  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1530  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1531  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1532  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1533  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1534  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1535  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1536  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1537  *
1538  * @pre This function requires opened connection to content service by media_content_connect().
1539  *
1540  * @see media_content_connect()
1541  */
1542 int media_info_refresh_metadata_to_db(const char *media_id) TIZEN_DEPRECATED_API;
1543
1544 /**
1545  * @deprecated Deprecated since 4.0. This data cannot be saved to the file.
1546  * @brief Sets the added time of media info.
1547  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1548  *
1549  * @param[in] media The handle to the media info
1550  * @param[in] added_time The added time of the media info
1551  *
1552  * @return @c 0 on success,
1553  *         otherwise a negative error value
1554  *
1555  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1556  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1557  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1558  *
1559  * @post media_info_update_to_db()
1560  */
1561 int media_info_set_added_time(media_info_h media, time_t added_time) TIZEN_DEPRECATED_API;
1562
1563 /**
1564  * @brief Moves the media info to the given destination path in the media database.
1565  * @details After moving or renaming a file in the filesystem, call this function to update the database. \n
1566  *               If the source path and destination path are the same, then this function does nothing.
1567  *               If you want to refresh media information, you should use media_content_scan_file() function.
1568  *
1569  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1570  *
1571  * @privlevel public
1572  * @privilege %http://tizen.org/privilege/content.write \n
1573  *                   %http://tizen.org/privilege/mediastorage \n
1574  *                   %http://tizen.org/privilege/externalstorage
1575  *
1576  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1577  *                   If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n
1578  *                   Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n
1579  *                   If you can access both storage, you should add all privilege. \n
1580  *                   This function does not support USB storage.
1581  *
1582  * @param[in] media The handle to the media info
1583  * @param[in] dst_path The path of destination
1584  *
1585  * @return @c 0 on success,
1586  *         otherwise a negative error value
1587  *
1588  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1589  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
1590  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1591  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1592  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1593  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1594  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1595  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1596  *
1597  * @pre This function requires opened connection to content service by media_content_connect().
1598  *
1599  * @see media_content_connect()
1600  * @see media_content_scan_folder()
1601  */
1602 int media_info_move_to_db(media_info_h media, const char* dst_path);
1603
1604 /**
1605  * @brief Creates a thumbnail file for the given media, asynchronously.
1606  * @details This function creates an thumbnail file for given media item and calls @a callback for completion of creating the thumbnail.
1607  *          If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function. \n
1608  *          Since 3.0, a thumbnail is not automatically extracted during media scanning. \n
1609  *          Therefore, if there exists no thumbnail for the given media, you MUST call this function to create a thumbnail.
1610  *
1611  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1612  *
1613  * @privlevel public
1614  * @privilege %http://tizen.org/privilege/content.write \n
1615  *                   %http://tizen.org/privilege/mediastorage \n
1616  *                   %http://tizen.org/privilege/externalstorage
1617  *
1618  * @remarks If you want to destroy media handle before callback invoked, you must cancel thumbnail request by using media_info_cancel_thumbnail() \n
1619  *          Since 3.0, if creation of a thumbnail is failed, empty string will be passed through media_thumbnail_completed_cb().
1620  *          Items in external storage except MMC not supported.
1621  *
1622  * @param[in] media The handle to the media info
1623  * @param[in] callback The callback function to be invoked
1624  * @param[in] user_data The user data to be passed to the callback function
1625  *
1626  * @return @c 0 on success,
1627  *         otherwise a negative error value
1628  *
1629  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1630  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1631  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1632  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1633  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1634  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1635  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1636  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1637  *
1638  * @pre This function requires opened connection to content service by media_content_connect().
1639  *
1640  * @see media_content_connect()
1641  */
1642 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
1643
1644 /**
1645  * @brief Cancels the creation of thumbnail file for the given media.
1646  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1647  *
1648  * @privlevel public
1649  * @privilege %http://tizen.org/privilege/content.write
1650  *
1651  * @remarks If you request cancel for the already thumbnail created media, this function return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1652  *
1653  * @param[in] media The handle to the media info
1654  *
1655  * @return @c 0 on success,
1656  *         otherwise a negative error value
1657  *
1658  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1659  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1660  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1661  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1662  *
1663  * @pre This function requires opened connection to content service by media_content_connect().
1664  * @see media_content_connect()
1665  */
1666 int media_info_cancel_thumbnail(media_info_h media);
1667
1668 /**
1669  * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1670  * @brief Starts face detection for the given image, asynchronously.
1671  * @details This function detects faces for given image item and calls the given callback function when the detection is completed. \n
1672  *          The given callback function is called when the detection is completed. \n
1673  *          To obtain the detected faces, call the media_info_foreach_face_from_db() function.
1674  *
1675  * @since_tizen 3.0
1676  *
1677  * @privlevel public
1678  * @privilege %http://tizen.org/privilege/content.write \n
1679  *                   %http://tizen.org/privilege/mediastorage \n
1680  *                   %http://tizen.org/privilege/externalstorage
1681  *
1682  * @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
1683  *          If face detection fails, the @a face_count argument in media_face_detection_completed_cb() will be set to 0.
1684  *          Media items in external storage are not supported, with the exception of MMC items.
1685  *
1686  * @param[in] media The handle to the media info
1687  * @param[in] callback The callback function to be invoked when detection is completed
1688  * @param[in] user_data The user data to be passed to the callback function
1689  *
1690  * @return @c 0 on success,
1691  *         otherwise a negative error value
1692  *
1693  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1694  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1695  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1696  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1697  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1698  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1699  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1700  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1701  * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED     Not supported
1702  *
1703  * @pre This function requires opened connection to content service by media_content_connect().
1704  *
1705  * @see media_content_connect()
1706  * @see media_info_cancel_face_detection()
1707  */
1708 int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data);
1709
1710 /**
1711  * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1712  * @brief Cancels face detection of image for the given media.
1713  * @details This function cancels face detection for given media item. \n
1714  *          If you cancel face detection request before callback is invoked, the callback registered by media_info_start_face_detection() function will not be invoked.
1715  *
1716  * @since_tizen 3.0
1717  *
1718  * @privlevel public
1719  * @privilege %http://tizen.org/privilege/content.write
1720  *
1721  * @remarks If face detection is already done when you request the cancellation, this function return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1722  *
1723  * @param[in] media The handle to the media info
1724  *
1725  * @return @c 0 on success,
1726  *         otherwise a negative error value
1727  *
1728  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1729  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1730  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1731  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1732  *
1733  * @pre This function requires opened connection to content service by media_content_connect().
1734  *
1735  * @see media_content_connect()
1736  * @see media_info_start_face_detection()
1737  */
1738 int media_info_cancel_face_detection(media_info_h media);
1739
1740 /**
1741  * @deprecated Deprecated since 4.0. Use media_info_insert_to_db() instead.
1742  * @brief Creates the media info handle.
1743  * @details If the information about the file that is already known, you can use this function to generate empty handler.
1744  * @since_tizen 3.0
1745  *
1746  *
1747  * @privilege %http://tizen.org/privilege/mediastorage \n
1748  *               %http://tizen.org/privilege/externalstorage
1749  *
1750  * @remarks The @a media should be released using media_info_destroy().
1751  * @remarks If you want to access only internal storage with this function, you should add privilege http://tizen.org/privilege/mediastorage. \n
1752  *                   Or if you want to access only external storage with this function, you should add privilege http://tizen.org/privilege/externalstorage. \n
1753  *                   If you can access both storage, you must add all privilege.
1754  *
1755  * @param[in] path The path to create the media info handle
1756  * @param[out] media The handle to the media info
1757  *
1758  * @return @c 0 on success,
1759  *           otherwise a negative error value
1760  *
1761  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1762  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1763  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
1764  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1765  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1766  *
1767  * @see media_info_destroy()
1768  */
1769 int media_info_create(const char *path, media_info_h *media) TIZEN_DEPRECATED_API;
1770
1771 /**
1772  * @deprecated Deprecated since 4.0. Use media_info_insert_to_db() instead.
1773  * @brief Inserts media info to database with media info data.
1774  * @since_tizen 3.0
1775  *
1776  * @privlevel public
1777  * @privilege %http://tizen.org/privilege/content.write
1778  *
1779  * @remarks The @a media should be released using media_info_destroy().
1780  *
1781  * @param[in] media The handle to the media info
1782  *
1783  * @return @c 0 on success,
1784  *           otherwise a negative error value
1785  *
1786  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1787  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1788  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
1789  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1790  */
1791 int media_info_insert_to_db_with_data(media_info_h media) TIZEN_DEPRECATED_API;
1792
1793 /**
1794  * @deprecated Deprecated since 4.0.
1795  * @brief Sets the title of media info handle.
1796  * @since_tizen 3.0
1797  *
1798  * @param[in] media The handle to the media info
1799  * @param[in] title The title of media info handle
1800  *
1801  * @return @c 0 on success,
1802  *           otherwise a negative error value
1803  *
1804  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1805  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1806  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1807  */
1808 int media_info_set_title(media_info_h media, const char *title) TIZEN_DEPRECATED_API;
1809
1810 /**
1811  * @deprecated Deprecated since 4.0.
1812  * @brief Sets the album of media info handle.
1813  * @since_tizen 3.0
1814  *
1815  * @param[in] media The handle to the media info
1816  * @param[in] album The album of the media
1817  *
1818  * @return @c 0 on success,
1819  *           otherwise a negative error value
1820  *
1821  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1822  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1823  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1824  */
1825 int media_info_set_album(media_info_h media, const char *album) TIZEN_DEPRECATED_API;
1826
1827 /**
1828  * @deprecated Deprecated since 4.0.
1829  * @brief Sets the artist of media info handle.
1830  * @since_tizen 3.0
1831  *
1832  * @param[in] media The handle to the media info
1833  * @param[in] artist The artist of media info handle
1834  *
1835  * @return @c 0 on success,
1836  *           otherwise a negative error value
1837  *
1838  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1839  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1840  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1841  */
1842 int media_info_set_artist(media_info_h media, const char *artist) TIZEN_DEPRECATED_API;
1843
1844 /**
1845  * @deprecated Deprecated since 4.0.
1846  * @brief Sets the genre of media info handle.
1847  * @since_tizen 3.0
1848  *
1849  * @param[in] media The handle to the media info
1850  * @param[in] genre The genre of media info handle
1851  *
1852  * @return @c 0 on success,
1853  *           otherwise a negative error value
1854  *
1855  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1856  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1857  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1858  */
1859 int media_info_set_genre(media_info_h media, const char *genre) TIZEN_DEPRECATED_API;
1860
1861 /**
1862  * @deprecated Deprecated since 4.0.
1863  * @brief Sets the recorded date of media info handle.
1864  * @since_tizen 3.0
1865  *
1866  * @param[in] media The handle to the media info
1867  * @param[in] recorded_date The recorded date of media info handle
1868  *
1869  * @return @c 0 on success,
1870  *           otherwise a negative error value
1871  *
1872  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1873  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1874  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1875  */
1876 int media_info_set_recorded_date(media_info_h media, const char *recorded_date) TIZEN_DEPRECATED_API;
1877
1878 /**
1879  * @}
1880  */
1881
1882 #ifdef __cplusplus
1883 }
1884 #endif /* __cplusplus */
1885
1886 #endif /* __TIZEN_CONTENT_MEDIA_INFO_H__ */