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