[ACR-436] Modify getter API return value from "Unknown" to empty string("")
[platform/core/api/media-content.git] / include / media_info.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18 #ifndef __TIZEN_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 shold 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 shold 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 shold 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 tag
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().
716  *
717  * @param[in]  media The media info handle
718  * @param[out] path  The path to the thumbnail of the media info
719  *
720  * @return @c 0 on success,
721  *         otherwise a negative error value
722  *
723  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
724  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
725  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
726  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
727  */
728 int media_info_get_thumbnail_path(media_info_h media, char **path);
729
730 /**
731  * @brief Gets the description of media info.
732  * @details If the value is an empty string, the method returns "Unknown". \n
733  *                Since 3.0, if the media info has no description, the method returns empty string.
734  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
735  *
736  * @remarks You must release @a description using free().
737  *
738  * @param[in]  media       The media info handle
739  * @param[out] description The description of the media info
740  *
741  * @return @c 0 on success,
742  *         otherwise a negative error value
743  *
744  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
745  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
746  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
747  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
748  */
749 int media_info_get_description(media_info_h media, char **description);
750
751 /**
752  * @brief Gets the longitude of media info.
753  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
754  *
755  * @param[in]  media     The media info handle
756  * @param[out] longitude The longitude of the media info
757  *
758  * @return @c 0 on success,
759  *         otherwise a negative error value
760  *
761  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
762  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
763  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
764  */
765 int media_info_get_longitude(media_info_h media, double* longitude);
766
767 /**
768  * @brief Gets the latitude of media info.
769  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
770  *
771  * @param[in]  media    The media info handle
772  * @param[out] latitude The latitude of the media info
773  *
774  * @return @c 0 on success,
775  *         otherwise a negative error value
776  *
777  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
778  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
779  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
780  *
781  */
782 int media_info_get_latitude(media_info_h media, double* latitude);
783
784 /**
785  * @brief Gets the altitude of media info.
786  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
787  *
788  * @param[in]  media    The media info handle
789  * @param[out] altitude The altitude of the media info
790  *
791  * @return @c 0 on success,
792  *         otherwise a negative error value
793  *
794  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
795  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
796  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
797  */
798 int media_info_get_altitude(media_info_h media, double* altitude);
799
800 /**
801  * @brief Gets the weather of media info.
802  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
803  *
804  * @param[in]  media   The media info handle
805  * @param[out] weather The weather of the media info
806  *
807  * @return @c 0 on success,
808  *         otherwise a negative error value
809  *
810  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
811  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
812  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
813  */
814 int media_info_get_weather(media_info_h media, char **weather);
815
816 /**
817  * @brief Gets the rating of media info.
818  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
819  *
820  * @param[in]  media  The media info handle
821  * @param[out] rating The rating of the media info
822  *
823  * @return @c 0 on success,
824  *         otherwise a negative error value
825  *
826  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
827  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
828  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
829  */
830 int media_info_get_rating(media_info_h media, int *rating);
831
832 /**
833  * @brief Gets the favorite status of media info.
834  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
835  *
836  * @param[in]  media     The media info handle
837  * @param[out] favorite  @c true if media info is set as favorite,
838  *                       otherwise @c false if media info is not set as favorite
839  *
840  * @return @c 0 on success,
841  *         otherwise a negative error value
842  *
843  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
844  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
845  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
846  */
847 int media_info_get_favorite(media_info_h media, bool* favorite);
848
849 /**
850  * @brief Gets the author of media info.
851  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
852  *
853  * @remarks You must release @a author using free().
854  *
855  * @param[in]  media  The media info handle
856  * @param[out] author The author of the media info
857  *
858  * @return @c 0 on success,
859  *         otherwise a negative error value
860  *
861  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
862  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
863  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
864  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
865  */
866 int media_info_get_author(media_info_h media, char **author);
867
868 /**
869  * @brief Gets the provider of media info.
870  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
871  *
872  * @remarks You must release @a provider using free().
873  *
874  * @param[in]  media    The media info handle
875  * @param[out] provider The provider of the media info
876  *
877  * @return @c 0 on success,
878  *         otherwise a negative error value
879  *
880  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
881  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
882  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
883  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
884  */
885 int media_info_get_provider(media_info_h media, char **provider);
886
887 /**
888  * @brief Gets the content name of media info.
889  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
890  *
891  * @remarks You must release @a content_name using free().
892  *
893  * @param[in]  media        The media info handle
894  * @param[out] content_name The content name of the media info
895  *
896  * @return @c 0 on success,
897  *         otherwise a negative error value
898  *
899  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
900  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
901  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
902  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
903  */
904 int media_info_get_content_name(media_info_h media, char **content_name);
905
906 /**
907  * @brief Gets the title of media info.
908  * @details If the value is an empty string, the method returns "Unknown". \n
909  *                Since 3.0, if the media info has no title, the method returns empty string.
910  *
911  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
912  *
913  * @remarks You must release @a title using free().
914  *
915  * @param[in]  media  The media info handle
916  * @param[out] title  The title of the media info
917  *
918  * @return @c 0 on success,
919  *         otherwise a negative error value
920  *
921  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
922  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
923  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
924  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
925  */
926 int media_info_get_title(media_info_h media, char **title);
927
928 /**
929  * @brief Gets the category of media info.
930  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
931  *
932  * @remarks You must release @a category using free().
933  *
934  * @param[in]  media    The media info handle
935  * @param[out] category The category of the media info
936  *
937  * @return @c 0 on success,
938  *         otherwise a negative error value
939  *
940  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
941  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
942  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
943  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
944  */
945 int media_info_get_category(media_info_h media, char **category);
946
947 /**
948  * @brief Gets the location tag of media info.
949  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
950  *
951  * @remarks You must release @a location_tag using free().
952  *
953  * @param[in]  media        The media info handle
954  * @param[out] location_tag The location of the media info
955  *
956  * @return @c 0 on success,
957  *         otherwise a negative error value
958  *
959  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
960  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
961  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
962  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
963  */
964 int media_info_get_location_tag(media_info_h media, char **location_tag);
965
966 /**
967  * @brief Gets the age_rating of media info.
968  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
969  *
970  * @remarks You must release @a age_rating using free().
971  *
972  * @param[in]  media      The media info handle
973  * @param[out] age_rating The age rating of the media info
974  *
975  * @return @c 0 on success,
976  *         otherwise a negative error value
977  *
978  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
979  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
980  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
981  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
982  */
983 int media_info_get_age_rating(media_info_h media, char **age_rating);
984
985 /**
986  * @brief Gets the keyword of media info.
987  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
988  *
989  * @remarks You must release @a keyword using free().
990  *
991  * @param[in]  media   The media info handle
992  * @param[out] keyword The keyword of the media info
993  *
994  * @return @c 0 on success,
995  *         otherwise a negative error value
996  *
997  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
998  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
999  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1000  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1001  */
1002 int media_info_get_keyword(media_info_h media, char **keyword);
1003
1004 /**
1005  * @brief Gets the storage id of media info.
1006  * @since_tizen 2.4
1007  *
1008  * @remarks You must release @a storage_id using free().
1009  *
1010  * @param[in]  media   The media info handle
1011  * @param[out] storage_id The storage id of the media info
1012  *
1013  * @return @c 0 on success,
1014  *         otherwise a negative error value
1015  *
1016  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1017  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1018  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1019  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1020  */
1021 int media_info_get_storage_id(media_info_h media, char **storage_id);
1022
1023 /**
1024  * @brief Checks whether the media is protected via DRM.
1025  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1026  *
1027  * @param[in]  media  The media info handle
1028  * @param[out] is_drm @c true if media is DRM media,
1029  *                    otherwise @c false if media is not DRM media
1030  *
1031  * @return @c 0 on success,
1032  *         otherwise a negative error value
1033  *
1034  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1035  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1036  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1037  */
1038 int media_info_is_drm(media_info_h media, bool *is_drm);
1039
1040 /**
1041  * @brief Gets the storage type of media info.
1042  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1043  *
1044  * @param[in]  media        The media info handle
1045  * @param[out] storage_type The storage type of the media info
1046  *
1047  * @return @c 0 on success,
1048  *         otherwise a negative error value
1049  *
1050  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1051  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1052  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1053  */
1054 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type);
1055
1056 /**
1057  * @brief Gets number which represents how many times given content has been played.
1058  * @since_tizen 2.4
1059  *
1060  * @param [in] media The handle to media info
1061  * @param [out] count_played The counter of content played
1062  *
1063  * @return 0 on success,
1064  *         otherwise a negative error value
1065  *
1066  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1067  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1068  */
1069 int media_info_get_played_count(media_info_h media, int *played_count);
1070
1071 /**
1072  * @brief Gets the content's played time parameter.
1073  * @details Function returns content's elapsed playback time parameter as period
1074  *          starting from the beginning of the track.
1075  * @since_tizen 2.4
1076  *
1077  * @param [in] media The handle to media info
1078  * @param [out] played_time The elapsed time of the content
1079  *
1080  * @return 0 on success,
1081  *         otherwise a negative error value
1082  *
1083  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1084  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1085  */
1086 int media_info_get_played_time(media_info_h media, time_t *played_time);
1087
1088 /**
1089  * @brief Gets the media info from the media database.
1090  *
1091  * @details This function creates a new media handle from the media database by the given @a media_id.
1092  *          Media info will be created and filled with information.
1093  *
1094  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1095  *
1096  * @remarks You must release @a media using media_tag_destroy().
1097  *
1098  * @param[in]  media_id The ID of media info
1099  * @param[out] media    The media handle associated with the media ID
1100  *
1101  * @return @c 0 on success,
1102  *         otherwise a negative error value
1103  *
1104  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1105  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1106  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1107  *
1108  * @pre This function requires opened connection to content service by media_content_connect().
1109  *
1110  * @see media_content_connect()
1111  * @see media_info_destroy()
1112  */
1113 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
1114
1115 /**
1116  * @brief Increments the played count to content meta handle.
1117  * @detalis You can increase the played(opened) count of the media file.
1118  * @since_tizen 2.4
1119  *
1120  * @param [in] media The handle to media info
1121  *
1122  * @return 0 on success,
1123  *         otherwise a negative error value
1124  *
1125  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1126  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1127  *
1128  * @post media_info_update_to_db()
1129  */
1130 int media_info_increase_played_count(media_info_h media);
1131
1132 /**
1133  * @brief Sets the played time to content meta handle.
1134  * @detalis 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.
1135  * @since_tizen 2.4
1136  *
1137  * @param [in] media The handle to media info
1138  *
1139  * @return 0 on success,
1140  *         otherwise a negative error value
1141  *
1142  * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1143  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1144  *
1145  * @post media_info_update_to_db()
1146  */
1147 int media_info_set_played_time(media_info_h media);
1148
1149 /**
1150  * @brief Sets the display name of media info.
1151  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1152  *
1153  * @param[in] media        The media info handle
1154  * @param[in] display_name The display name of the media info
1155  *
1156  * @return @c 0 on success,
1157  *         otherwise a negative error value
1158  *
1159  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1160  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1161  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1162  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1163  *
1164  * @post media_info_update_to_db().
1165  *
1166  */
1167 int media_info_set_display_name(media_info_h media, const char *display_name);
1168
1169 /**
1170  * @brief Sets the description of media info.
1171  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1172  *
1173  * @param[in] media       The media info handle
1174  * @param[in] description The description of the media info
1175  *
1176  * @return @c 0 on success,
1177  *         otherwise a negative error value
1178  *
1179  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1180  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1181  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1182  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1183  *
1184  * @post media_info_update_to_db().
1185  *
1186  */
1187 int media_info_set_description(media_info_h media, const char *description);
1188
1189 /**
1190  * @brief Sets the longitude of media info.
1191  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1192  *
1193  * @param[in] media     The media info handle
1194  * @param[in] longitude The longitude of the media info
1195  *
1196  * @return @c 0 on success,
1197  *         otherwise a negative error value
1198  *
1199  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1200  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1201  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1202  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1203  *
1204  * @post media_info_update_to_db().
1205  */
1206 int media_info_set_longitude(media_info_h media, double longitude);
1207
1208 /**
1209  * @brief Sets the latitude of media info.
1210  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1211  *
1212  * @param[in] media    The media info handle
1213  * @param[in] latitude The latitude of the media info
1214  *
1215  * @return @c 0 on success,
1216  *         otherwise a negative error value
1217  *
1218  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1219  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1220  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1221  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1222  *
1223  * @post media_info_update_to_db().
1224  */
1225 int media_info_set_latitude(media_info_h media, double latitude);
1226
1227 /**
1228  * @brief Sets the altitude of media info.
1229  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1230  *
1231  * @param[in] media    The media info handle
1232  * @param[in] altitude The altitude of the media info
1233  *
1234  * @return @c 0 on success,
1235  *         otherwise a negative error value
1236  *
1237  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1238  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1239  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1240  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1241  *
1242  * @post media_info_update_to_db().
1243  */
1244 int media_info_set_altitude(media_info_h media, double altitude);
1245
1246 /**
1247  * @brief Sets the weather of media info.
1248  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1249  *
1250  * @param[in] media   The media info handle
1251  * @param[in] weather The weather of the media info
1252  *
1253  * @return @c 0 on success,
1254  *         otherwise a negative error value
1255  *
1256  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1257  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1258  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1259  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1260  *
1261  * @post media_info_update_to_db().
1262  *
1263  */
1264 int media_info_set_weather(media_info_h media, const char *weather);
1265
1266 /**
1267  * @brief Sets the rating of media info.
1268  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1269  *
1270  * @param[in] media  The media info handle
1271  * @param[in] rating The rating of the media info
1272  *
1273  * @return @c 0 on success,
1274  *         otherwise a negative error value
1275  *
1276  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1277  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1278  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1279  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1280  *
1281  * @post media_info_update_to_db().
1282  */
1283 int media_info_set_rating(media_info_h media, int rating);
1284
1285 /**
1286  * @brief Sets the favorite of media info.
1287  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1288  *
1289  * @param[in] media    The media info handle
1290  * @param[in] favorite Set @c true to set the media info as favorite,
1291  *                     otherwise set @c false to not set the media info as favorite
1292  *
1293  * @return @c 0 on success,
1294  *         otherwise a negative error value
1295  *
1296  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1297  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1298  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1299  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1300  */
1301 int media_info_set_favorite(media_info_h media, bool favorite);
1302
1303 /**
1304  * @brief Sets the author of media info.
1305  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1306  *
1307  * @param[in] media  The media info handle
1308  * @param[in] author The author of the media info
1309  *
1310  * @return @c 0 on success,
1311  *         otherwise a negative error value
1312  *
1313  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1314  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1315  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1316  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1317  */
1318 int media_info_set_author(media_info_h media, const char *author);
1319
1320 /**
1321  * @brief Sets the provider of media info.
1322  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1323  *
1324  * @param[in] media    The media info handle
1325  * @param[in] provider The provider of the media info
1326  *
1327  * @return @c 0 on success,
1328  *         otherwise a negative error value
1329  *
1330  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1331  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1332  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1333  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1334  */
1335 int media_info_set_provider(media_info_h media, const char *provider);
1336
1337 /**
1338  * @brief Sets the content name 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] content_name The content name 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  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1351  *
1352  * @post media_info_update_to_db()
1353  */
1354 int media_info_set_content_name(media_info_h media, const char *content_name);
1355
1356 /**
1357  * @brief Sets the category of media info.
1358  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1359  *
1360  * @param[in] media    The media info handle
1361  * @param[in] category The category of the media info
1362  *
1363  * @return @c 0 on success,
1364  *         otherwise a negative error value
1365  *
1366  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1367  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1368  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1369  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1370  *
1371  * @post media_info_update_to_db()
1372  */
1373 int media_info_set_category(media_info_h media, const char *category);
1374
1375 /**
1376  * @brief Sets the location tag of media info.
1377  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1378  *
1379  * @param[in] media        The media info handle
1380  * @param[in] location_tag The location of the media info
1381  *
1382  * @return @c 0 on success,
1383  *         otherwise a negative error value
1384  *
1385  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1386  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1387  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1388  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1389  *
1390  * @post media_info_update_to_db()
1391  */
1392 int media_info_set_location_tag(media_info_h media, const char *location_tag);
1393
1394 /**
1395  * @brief Sets the age rating of media info.
1396  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1397  *
1398  * @param[in] media      The media info handle
1399  * @param[in] age_rating The age rating of the media info
1400  *
1401  * @return @c 0 on success,
1402  *         otherwise a negative error value
1403  *
1404  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1405  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1406  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1407  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1408  *
1409  * @post media_info_update_to_db()
1410  */
1411 int media_info_set_age_rating(media_info_h media, const char *age_rating);
1412
1413 /**
1414  * @brief Sets the keyword of media info.
1415  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1416  *
1417  * @param[in] media   The media info handle
1418  * @param[in] keyword The keyword of the media info
1419  *
1420  * @return @c 0 on success,
1421  *         otherwise a negative error value
1422  *
1423  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1424  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1425  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1426  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1427  *
1428  * @post media_info_update_to_db()
1429  */
1430 int media_info_set_keyword(media_info_h media, const char *keyword);
1431
1432 /**
1433  * @brief Updates the media info to the media database.
1434  *
1435  * @details The function updates the given media info in the media database.
1436  *
1437  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1438  * @privlevel public
1439  * @privilege %http://tizen.org/privilege/content.write
1440  *
1441  * @remarks The function should be called after any change in media, to be updated to the media
1442  *          database. For example, after using media_info_set_display_name()
1443  *          for setting the name of the media, the media_info_update_to_db() function should be called so as to update
1444  *          the given media info attributes in the media database.
1445  *
1446  * @param[in] media The media info handle
1447  *
1448  * @return @c 0 on success,
1449  *         otherwise a negative error value
1450  *
1451  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1452  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1453  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1454  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1455  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1456  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1457  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1458  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1459  *
1460  * @pre This function requires opened connection to content service by media_content_connect().
1461  *
1462  * @see media_content_connect()
1463  * @see media_info_set_display_name()
1464  * @see media_info_set_description()
1465  * @see media_info_set_longitude()
1466  * @see media_info_set_latitude()
1467  * @see media_info_set_altitude()
1468  * @see media_info_set_rating()
1469  * @see media_info_set_favorite()
1470  * @see media_info_set_author()
1471  * @see media_info_set_provider()
1472  * @see media_info_set_content_name()
1473  * @see media_info_set_category()
1474  * @see media_info_set_location_tag()
1475  * @see media_info_set_age_rating()
1476  */
1477 int media_info_update_to_db(media_info_h media);
1478
1479 /**
1480  * @brief Refreshes the media metadata to the media database.
1481  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1482  *
1483  * @privlevel public
1484  * @privilege %http://tizen.org/privilege/content.write \n
1485  *                   %http://tizen.org/privilege/mediastorage \n
1486  *                   %http://tizen.org/privilege/externalstorage
1487  *
1488  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1489  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1490  *                   Or if you want to access only external storage by using  this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1491  *                   If you can access both storage, you should add all privilege.
1492  *
1493  * @param[in] media_id The ID of the media info
1494  *
1495  * @return @c 0 on success,
1496  *         otherwise a negative error value
1497  *
1498  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1499  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1500  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1501  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1502  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1503  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1504  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1505  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1506  *
1507  * @pre This function requires opened connection to content service by media_content_connect().
1508  *
1509  * @see media_content_connect()
1510  */
1511 int media_info_refresh_metadata_to_db(const char *media_id);
1512
1513 /**
1514  * @brief Sets the added time of media info.
1515  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1516  *
1517  * @param[in] media      The media info handle
1518  * @param[in] added_time The added time of the media info
1519  *
1520  * @return @c 0 on success,
1521  *         otherwise a negative error value
1522  *
1523  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1524  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1525  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1526  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1527  *
1528  * @post media_info_update_to_db()
1529  */
1530 int media_info_set_added_time(media_info_h media, time_t added_time);
1531
1532 /**
1533  * @brief Moves the media info to the given destination path in the media database.
1534  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1535  *
1536  * @privlevel public
1537  * @privilege %http://tizen.org/privilege/content.write \n
1538  *                   %http://tizen.org/privilege/mediastorage \n
1539  *                   %http://tizen.org/privilege/externalstorage
1540  *
1541  * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1542  *                   If you want to access only internal storage by using  this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1543  *                   Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1544  *                   If you can access both storage, you should add all privilege.
1545  *
1546  * @param[in] media    The media info handle
1547  * @param[in] dst_path The path of destination
1548  *
1549  * @return @c 0 on success,
1550  *         otherwise a negative error value
1551  *
1552  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1553  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
1554  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1555  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1556  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1557  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1558  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1559  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1560  *
1561  * @pre This function requires opened connection to content service by media_content_connect().
1562  *
1563  * @see media_content_connect()
1564  */
1565 int media_info_move_to_db(media_info_h media, const char* dst_path);
1566
1567 /**
1568  * @brief Creates a thumbnail image for the given media, asynchronously.
1569  * @details This function creates an thumbnail image for given media item and calls registered callback function for completion of creating the thumbnail.
1570  *          If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function.
1571  *
1572  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1573  *
1574  * @privlevel public
1575  * @privilege %http://tizen.org/privilege/content.write
1576  *
1577  * @remarks If you want to destory media handle before callback invoked, you must cancel thumbnail request by using media_info_cancel_thumbnail()
1578  *
1579  * @param[in] media     The media info handle
1580  * @param[in] callback  The callback function to be invoked
1581  * @param[in] user_data The user data to be passed to the callback function
1582  *
1583  * @return @c 0 on success,
1584  *         otherwise a negative error value
1585  *
1586  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
1587  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1588  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
1589  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1590  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
1591  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
1592  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
1593  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1594  *
1595  * @pre This function requires opened connection to content service by media_content_connect().
1596  *
1597  * @see media_content_connect()
1598  */
1599 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
1600
1601 /**
1602  * @brief Cancels the creation of image's thumbnail for the given media.
1603  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1604  *
1605  * @privlevel public
1606  * @privilege %http://tizen.org/privilege/content.write
1607  *
1608  * @remarks If you request cancel for the alreay thumbnail created media, this API return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1609  *
1610  * @param[in] media The media info handle
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_PERMISSION_DENIED Permission denied
1618  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1619  *
1620  * @pre This function requires opened connection to content service by media_content_connect().
1621  * @see media_content_connect()
1622  */
1623 int media_info_cancel_thumbnail(media_info_h media);
1624
1625 /**
1626 * @brief Creates the media info handle.
1627 * @details If the information about the file that is already known, you can use this API to generate empty handler.
1628 *          And you can add the information to the generated handler using media_info_set_XXX() API.
1629 *          After filling the information to the handler, you can insert into database using media_info_insert_to_db_with_data() API.
1630 * @since_tizen 3.0
1631 *
1632 *
1633 * @privilege %http://tizen.org/privilege/mediastorage \n
1634 *                       %http://tizen.org/privilege/externalstorage
1635 *
1636 * @remarks If you want to access only internal storage with this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1637 *                   Or if you want to access only external storage with this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1638 *                   If you can access both storage, you must add all privilege.
1639 *
1640 * @param[in] path The path to create the media info handle
1641 * @param[out] media The media info handle
1642 *
1643 * @return @c 0 on success,
1644 *           otherwise a negative error value
1645 *
1646 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1647 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1648 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED                 DB operation failed
1649 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1650 *
1651 * @see media_info_insert_to_db_with_data()
1652 * @see media_info_destroy()
1653 */
1654 int media_info_create(const char *path, media_info_h *media);
1655
1656 /**
1657 * @brief Inserts media info to database with media info data.
1658 * @details After filling the information to the generated handler using media_info_create() API, you can insert into database using this API.
1659 * @since_tizen 3.0
1660 *
1661 * @remarks You must create media handle using media_info_create(),
1662 *               and release @a info using media_info_destroy().
1663 *
1664 * @privlevel public
1665 * @privilege %http://tizen.org/privilege/content.write
1666 *
1667 * @param[in] media The media info handle to be inserted
1668 *
1669 * @return @c 0 on success,
1670 *           otherwise a negative error value
1671 *
1672 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1673 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1674 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED                 DB operation failed
1675 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1676 *
1677 * @see media_info_create()
1678 */
1679 int media_info_insert_to_db_with_data(media_info_h media);
1680
1681 /**
1682 * @brief Sets the title of media info handle.
1683 * @since_tizen 3.0
1684 *
1685 * @param[in] media The media info handle
1686 * @param[in] title The title of media info handle
1687 *
1688 * @return @c 0 on success,
1689 *           otherwise a negative error value
1690 *
1691 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1692 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1693 *
1694 * @post media_info_insert_to_db_with_data()
1695 */
1696 int media_info_set_title(media_info_h media, const char *title);
1697
1698 /**
1699 * @brief Sets the album of media info handle.
1700 * @since_tizen 3.0
1701 *
1702 * @param[in] media The media info handle
1703 * @param[in] album The album of media info handle
1704 *
1705 * @return @c 0 on success,
1706 *           otherwise a negative error value
1707 *
1708 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1709 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1710 *
1711 * @post media_info_insert_to_db_with_data()
1712 */
1713 int media_info_set_album(media_info_h media, const char *album);
1714
1715 /**
1716 * @brief Sets the artist of media info handle.
1717 * @since_tizen 3.0
1718 *
1719 * @param[in] media The media info handle
1720 * @param[in] artist The artist of media info handle
1721 *
1722 * @return @c 0 on success,
1723 *           otherwise a negative error value
1724 *
1725 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1726 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1727 *
1728 * @post media_info_insert_to_db_with_data()
1729 */
1730 int media_info_set_artist(media_info_h media, const char *artist);
1731
1732 /**
1733 * @brief Sets the genre of media info handle.
1734 * @since_tizen 3.0
1735 *
1736 * @param[in] media The media info handle
1737 * @param[in] genre The genre of media info handle
1738 *
1739 * @return @c 0 on success,
1740 *           otherwise a negative error value
1741 *
1742 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1743 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1744 *
1745 * @post media_info_insert_to_db_with_data()
1746 */
1747 int media_info_set_genre(media_info_h media, const char *genre);
1748
1749 /**
1750 * @brief Sets the recorded date of media info handle.
1751 * @since_tizen 3.0
1752 *
1753 * @param[in] media The media info handle
1754 * @param[in] recorded_date The recorded date of media info handle
1755 *
1756 * @return @c 0 on success,
1757 *           otherwise a negative error value
1758 *
1759 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1760 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1761 *
1762 * @post media_info_insert_to_db_with_data()
1763 */
1764 int media_info_set_recorded_date(media_info_h media, const char *recorded_date);
1765
1766
1767 /**
1768  * @}
1769  */
1770
1771
1772 #ifdef __cplusplus
1773 }
1774 #endif /* __cplusplus */
1775
1776 #endif /* __TIZEN_MEDIA_INFORMATION_H__ */