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