2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __TIZEN_MEDIA_INFORMATION_H__
19 #define __TIZEN_MEDIA_INFORMATION_H__
21 #include <media_content_type.h>
27 #endif /* __cplusplus */
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.
39 * @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
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.
53 * @privilege %http://tizen.org/privilege/content.write \n
54 * %http://tizen.org/privilege/mediastorage \n
55 * %http://tizen.org/privilege/externalstorage
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.
63 * @param[in] path The path to the media file
64 * @param[out] info The handle to the media info
66 * @return @c 0 on success,
67 * otherwise a negative error value
69 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
70 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
71 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
73 * @pre This function requires opened connection to content service by media_content_connect().
75 * @see media_content_connect()
77 int media_info_insert_to_db (const char *path, media_info_h *info);
80 * @brief Inserts media files into the media database, asynchronously.
81 * @details This function inserts media items into the content storage.
82 * Normally, inserting a media file in database is done automatically by the media server, without calling this function.
83 * This function invokes media_insert_completed_cb() callback function when insertion to the media database is finished.
88 * @privilege %http://tizen.org/privilege/content.write \n
89 * %http://tizen.org/privilege/mediastorage \n
90 * %http://tizen.org/privilege/externalstorage
92 * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
93 * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
94 * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
95 * If you can access both storage, you must add all privilege.
97 * @param[in] path_array The path array to the media files
98 * @param[in] array_length The length of the array
99 * @param[in] callback The callback to be invoked when media items inserted completely
100 * @param[in] user_data The user data to be passed to the callback function
102 * @return @c 0 on success,
103 * otherwise a negative error value
105 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
106 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
107 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
108 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
110 * @pre This function requires opened connection to content service by media_content_connect().
112 * @see media_content_connect()
113 * @see media_insert_completed_cb()
115 int media_info_insert_batch_to_db(const char **path_array,unsigned int array_length, media_insert_completed_cb callback, void *user_data);
118 * @brief Inserts the burst shot images into the media database, asynchronously.
119 * @details This function inserts burst images into the content storage.
120 * media_insert_burst_shot_completed_cb() will be called when insertion to media database is finished.
125 * @privilege %http://tizen.org/privilege/content.write \n
126 * %http://tizen.org/privilege/mediastorage \n
127 * %http://tizen.org/privilege/externalstorage
129 * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
130 * If you want to access only internal storage with this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
131 * Or if you want to access only external storage with this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
132 * If you can access both storage, you must add all privilege.
134 * @param[in] path_array The path array to the burst shot images
135 * @param[in] array_length The length of the array
136 * @param[in] callback The callback to be invoked when the images are inserted completely
137 * @param[in] user_data The user data to be passed to the callback function
139 * @return @c 0 on success,
140 * otherwise a negative error value
142 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
143 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
144 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
145 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
147 * @pre This function requires opened connection to content service by media_content_connect().
149 * @see media_content_connect()
150 * @see media_insert_burst_shot_completed_cb()
152 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);
155 * @brief Deletes a media file from the media database.
156 * @details This function deletes a media item from the content storage.
157 * Normally, deleting a media file in the database is done automatically by the media server, without calling this function.
158 * This function is only called when the media server is busy and user needs to get quick result of deleting.
163 * @privilege %http://tizen.org/privilege/content.write
165 * @param[in] media_id The ID to the media file
167 * @return @c 0 on success,
168 * otherwise a negative error value
170 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
171 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
172 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
174 * @pre This function requires opened connection to content service by media_content_connect().
176 * @see media_content_connect()
178 int media_info_delete_from_db(const char *media_id);
181 * @brief Deletes media files from the media database.
182 * The media files for deletion can be specified as a condition in a filter.
183 * @details This function deletes the media items from the content storage.
184 * Normally, deleting media files in the database are done automatically by the media server, without calling this function.
185 * This function is only called when the media server is busy and user needs to get quick result of deleting.
190 * @privilege %http://tizen.org/privilege/content.write
192 * @param[in] filter The handle to filter
194 * @return @c 0 on success,
195 * otherwise a negative error value
197 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
198 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
199 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
201 * @pre This function requires opened connection to content service by media_content_connect().
203 * @see media_content_connect()
205 int media_info_delete_batch_from_db(filter_h filter);
209 * @brief Destroys media info.
210 * @details The function frees all resources related to the media info handle. This handle
211 * can no longer be used to perform any operation. New media info handle has to
212 * be created before the next usage.
216 * @param[in] media The media info handle
218 * @return @c 0 on success,
219 * otherwise a negative error value
221 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
222 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
223 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
225 * @pre Get copy of media_info handle by calling media_info_clone().
227 * @see media_info_clone()
229 int media_info_destroy(media_info_h media);
232 * @brief Clones the media info handle.
234 * @details This function copies the media info handle from a source to the destination.
235 * There is no media_info_create() function. The media_info_h is created internally and
236 * available through media info foreach function such as media_info_foreach_media_from_db().
237 * To use this handle outside of these foreach functions, use this function.
241 * @remarks You must release the destination handle using media_info_destroy().
243 * @param[out] dst The destination handle to the media info
244 * @param[in] src The source handle to media info
246 * @return @c 0 on success,
247 * otherwise a negative error value
249 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
250 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
251 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
252 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
254 * @see media_info_destroy()
255 * @see media_album_foreach_media_from_db()
256 * @see media_playlist_foreach_media_from_db()
257 * @see media_group_foreach_media_from_db
258 * @see media_tag_foreach_media_from_db()
259 * @see media_info_foreach_media_from_db()
260 * @see media_folder_foreach_media_from_db()
262 int media_info_clone(media_info_h *dst, media_info_h src);
265 * @brief Gets the count of media info for the passed @a filter from the media database.
268 * @param[in] filter The handle to filter
269 * @param[out] media_count The count of media
271 * @return @c 0 on success,
272 * otherwise a negative error value
274 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
275 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
276 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
277 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
279 * @pre This function requires opened connection to content service by media_content_connect().
281 * @see media_content_connect()
283 int media_info_get_media_count_from_db(filter_h filter, int *media_count);
286 * @brief Iterates through media info from the media database.
287 * @details This function gets all media info handles meeting the given @a filter.
288 * The @a callback function will be invoked for every retrieved media info.
289 * If @c NULL is passed to the @a filter, then no filtering is applied.
293 * @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,
294 * your callback function is invoked as inline function.
295 * So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB.
296 * We do not recommend you call updating DB function in callback of foreach function.
298 * @param[in] filter The media info handle filter
299 * @param[in] callback The callback function to be invoked
300 * @param[in] user_data The user data to be passed to the callback function
302 * @return @c 0 on success,
303 * otherwise a negative error value
305 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
306 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
307 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
308 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
310 * @pre This function requires opened connection to content service by media_content_connect().
311 * @post This function invokes media_info_cb().
313 * @see media_content_connect()
314 * @see #media_info_cb
315 * @see media_info_filter_create()
317 int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, void *user_data);
320 * @brief Gets the count of media tags for the passed @a filter in the given @a media_id from the media database.
323 * @param[in] media_id The ID of the media info
324 * @param[in] filter The handle to the media filter
325 * @param[out] tag_count The count of the media tag
327 * @return @c 0 on success,
328 * otherwise a negative error value
330 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
331 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
332 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
333 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
335 * @pre This function requires opened connection to content service by media_content_connect().
337 * @see media_content_connect()
339 int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count);
342 * @brief Iterates through the media tag in the given media info from the media database.
343 * @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.
347 * @param[in] media_id The ID of the media info
348 * @param[in] filter The handle to the media filter
349 * @param[in] callback The callback function to be invoked
350 * @param[in] user_data The user data to be passed to the callback function
352 * @return @c 0 on success,
353 * otherwise a negative error value
355 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
356 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
357 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
358 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
360 * @pre This function requires opened connection to content service by media_content_connect().
361 * @post This function invokes media_tag_cb().
363 * @see media_content_connect()
366 int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data);
369 * @brief Gets the number of bookmarks for the passed @a filter in the given media ID from the media database.
372 * @param[in] media_id The ID of the media info
373 * @param[in] filter The handle to the media filter
374 * @param[out] bookmark_count The count of the media tag
376 * @return @c 0 on success,
377 * otherwise a negative error value
379 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
380 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
381 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
382 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
384 * @pre This function requires opened connection to content service by media_content_connect().
386 * @see media_content_connect()
388 int media_info_get_bookmark_count_from_db(const char *media_id, filter_h filter, int *bookmark_count);
391 * @brief Iterates through the media bookmark in the given media info from the media database.
392 * @details This function gets all media bookmarks associated with the given media and calls registered callback function for every retrieved media bookmark.
396 * @param[in] media_id The ID of the media info
397 * @param[in] filter The handle to the media filter
398 * @param[in] callback The callback function to be invoked
399 * @param[in] user_data The user data to be passed to the callback function
401 * @return @c 0 on success,
402 * otherwise a negative error value
404 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
405 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
406 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
407 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
409 * @pre This function requires opened connection to content service by media_content_connect().
410 * @post This function invokes media_bookmark_cb().
412 * @see media_content_connect()
413 * @see media_bookmark_cb()
415 int media_info_foreach_bookmark_from_db (const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
418 * @brief Gets the image metadata for a given media info.
419 * @details This function returns an image metadata handle retrieved from the media info.
423 * @remarks You must release the @a image handle using image_meta_destroy().
425 * @param[in] media The media info handle
426 * @param[out] image A handle to image metadata
428 * @return @c 0 on success,
429 * otherwise a negative error value
431 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
432 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
433 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
435 * @see image_meta_destroy()
437 int media_info_get_image(media_info_h media, image_meta_h *image);
440 * @brief Gets a video metadata for a given media info.
441 * @details This function returns a video metadata handle retrieved from the media info handle.
445 * @remarks You must release the @a video handle using video_meta_destroy().
447 * @param[in] media The media info handle
448 * @param[out] video A handle to the video meta
450 * @return @c 0 on success,
451 * otherwise a negative error value
453 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
454 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
455 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
456 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
458 * @see video_meta_destroy()
460 int media_info_get_video(media_info_h media, video_meta_h *video);
463 * @brief Gets an audio metadata for a given media info.
464 * @details This function returns an audio metadata handle retrieved from the media info handle.
468 * @remarks You must release the @a audio handle using audio_meta_destroy().
470 * @param[in] media The media info handle
471 * @param[out] audio A handle to the audio meta
473 * @return @c 0 on success,
474 * otherwise a negative error value
476 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
477 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
478 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
479 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
481 * @see audio_meta_destroy()
483 int media_info_get_audio(media_info_h media, audio_meta_h *audio);
486 * @brief Gets the tag ID for the media info.
489 * @param[in] media The media info handle
490 * @param[out] media_id The ID of the media tag
492 * @return @c 0 on success,
493 * otherwise a negative error value
495 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
496 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
497 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
499 int media_info_get_media_id(media_info_h media, char **media_id);
502 * @brief Gets the path to the media info.
505 * @remarks You must release @a path using free().
507 * @param[in] media The media info handle
508 * @param[out] path The path of the media info
510 * @return @c 0 on success,
511 * otherwise a negative error value
513 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
514 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
515 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
516 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
519 int media_info_get_file_path(media_info_h media, char **path);
522 * @brief Gets the name of the media info.
525 * @remarks You must release @a name using free().
527 * @param[in] media The media info handle
528 * @param[out] name The name of media info
530 * @return @c 0 on success,
531 * otherwise a negative error value
533 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
534 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
535 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
536 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
538 int media_info_get_display_name(media_info_h media, char **name);
541 * @brief Gets the content type of the media info.
544 * @param[in] media The media info handle
545 * @param[out] type The type of the media content (#media_content_type_e)
547 * @return @c 0 on success,
548 * otherwise a negative error value
550 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
551 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
552 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
554 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
557 * @brief Gets the MIME type from the media info.
560 * @remarks You must release @a mime_type using free().
562 * @param[in] media The media info handle
563 * @param[out] mime_type The MIME type of the media info
565 * @return @c 0 on success,
566 * otherwise a negative error value
568 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
569 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
570 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
571 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
573 int media_info_get_mime_type(media_info_h media, char **mime_type);
576 * @brief Gets the media file size.
579 * @param[in] media The media info handle
580 * @param[out] size The type of the media content
582 * @return @c 0 on success,
583 * otherwise a negative error value
585 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
586 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
587 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
589 int media_info_get_size(media_info_h media, unsigned long long *size);
592 * @brief Gets the addition time of the media.
595 * @param[in] media The media info handle
596 * @param[out] added_time The added time to the DB
598 * @return @c 0 on success,
599 * otherwise a negative error value
601 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
602 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
603 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
605 int media_info_get_added_time(media_info_h media, time_t *added_time);
608 * @brief Gets the date of modification of media info.
611 * @param[in] media The media info handle
612 * @param[out] time The date of modification of the file \n
615 * @return @c 0 on success,
616 * otherwise a negative error value
618 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
619 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
620 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
622 int media_info_get_modified_time(media_info_h media, time_t *time);
625 * @brief Gets media info's timeline.
627 * @param[in] media The handle to media info
628 * @param[out] time The date of timeline.
629 * @return 0 on success, otherwise a negative error value.
630 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
631 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
634 int media_info_get_timeline(media_info_h media, time_t* time);
637 * @brief Gets the thumbnail of media info.
640 * @remarks You must release @a path using free().
642 * @param[in] media The media info handle
643 * @param[out] path The path to the thumbnail of the media info
645 * @return @c 0 on success,
646 * otherwise a negative error value
648 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
649 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
650 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
651 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
653 int media_info_get_thumbnail_path(media_info_h media, char **path);
656 * @brief Gets the description of media info.
659 * @remarks You must release @a description using free().
661 * @param[in] media The media info handle
662 * @param[out] description The description of the media info
664 * @return @c 0 on success,
665 * otherwise a negative error value
667 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
668 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
669 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
670 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
672 int media_info_get_description(media_info_h media, char **description);
675 * @brief Gets the longitude of media info.
678 * @param[in] media The media info handle
679 * @param[out] longitude The longitude of the media info
681 * @return @c 0 on success,
682 * otherwise a negative error value
684 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
685 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
686 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
688 int media_info_get_longitude(media_info_h media, double* longitude);
691 * @brief Gets the latitude of media info.
694 * @param[in] media The media info handle
695 * @param[out] latitude The latitude of the media info
697 * @return @c 0 on success,
698 * otherwise a negative error value
700 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
701 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
702 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
705 int media_info_get_latitude(media_info_h media, double* latitude);
708 * @brief Gets the altitude of media info.
711 * @param[in] media The media info handle
712 * @param[out] altitude The altitude of the media info
714 * @return @c 0 on success,
715 * otherwise a negative error value
717 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
718 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
719 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
721 int media_info_get_altitude(media_info_h media, double* altitude);
724 * @brief Gets media info's weather.
726 * @param[in] media The handle to media info
727 * @param[out] weater The weather of media info
728 * @return 0 on success, otherwise a negative error value.
729 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
730 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
733 int media_info_get_weather(media_info_h media, char **weather);
736 * @brief Gets the rating of media info.
739 * @param[in] media The media info handle
740 * @param[out] rating The rating of the media info
742 * @return @c 0 on success,
743 * otherwise a negative error value
745 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
746 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
747 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
749 int media_info_get_rating(media_info_h media, int *rating);
752 * @brief Gets the favorite status of media info.
755 * @param[in] media The media info handle
756 * @param[out] favorite @c true if media info is set as favorite,
757 * otherwise @c false if media info is not set as favorite
759 * @return @c 0 on success,
760 * otherwise a negative error value
762 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
763 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
764 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
766 int media_info_get_favorite(media_info_h media, bool* favorite);
769 * @brief Gets the author of media info.
772 * @remarks You must release @a author using free().
774 * @param[in] media The media info handle
775 * @param[out] author The author of the media info
777 * @return @c 0 on success,
778 * otherwise a negative error value
780 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
781 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
782 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
783 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
785 int media_info_get_author(media_info_h media, char **author);
788 * @brief Gets the provider of media info.
791 * @remarks You must release @a provider using free().
793 * @param[in] media The media info handle
794 * @param[out] provider The provider of the media info
796 * @return @c 0 on success,
797 * otherwise a negative error value
799 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
800 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
801 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
802 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
804 int media_info_get_provider(media_info_h media, char **provider);
807 * @brief Gets the content name of media info.
810 * @remarks You must release @a content_name using free().
812 * @param[in] media The media info handle
813 * @param[out] content_name The content name of the media info
815 * @return @c 0 on success,
816 * otherwise a negative error value
818 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
819 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
820 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
821 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
823 int media_info_get_content_name(media_info_h media, char **content_name);
826 * @brief Gets the title of media info.
829 * @remarks You must release @a title using free().
831 * @param[in] media The media info handle
832 * @param[out] title The title of the media info
834 * @return @c 0 on success,
835 * otherwise a negative error value
837 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
838 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
839 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
840 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
842 int media_info_get_title(media_info_h media, char **title);
845 * @brief Gets the category of media info.
848 * @remarks You must release @a category using free().
850 * @param[in] media The media info handle
851 * @param[out] category The category of the media info
853 * @return @c 0 on success,
854 * otherwise a negative error value
856 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
857 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
858 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
859 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
861 int media_info_get_category(media_info_h media, char **category);
864 * @brief Gets the location tag of media info.
867 * @remarks You must release @a location_tag using free().
869 * @param[in] media The media info handle
870 * @param[out] location_tag The location of the media info
872 * @return @c 0 on success,
873 * otherwise a negative error value
875 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
876 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
877 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
878 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
880 int media_info_get_location_tag(media_info_h media, char **location_tag);
883 * @brief Gets the age_rating of media info.
886 * @remarks You must release @a age_rating using free().
888 * @param[in] media The media info handle
889 * @param[out] age_rating The age rating of the media info
891 * @return @c 0 on success,
892 * otherwise a negative error value
894 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
895 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
896 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
897 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
899 int media_info_get_age_rating(media_info_h media, char **age_rating);
902 * @brief Gets the keyword of media info.
905 * @remarks You must release @a keyword using free().
907 * @param[in] media The media info handle
908 * @param[out] keyword The keyword of the media info
910 * @return @c 0 on success,
911 * otherwise a negative error value
913 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
914 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
915 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
916 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
918 int media_info_get_keyword(media_info_h media, char **keyword);
921 * @brief Checks whether the media is protected via DRM.
924 * @param[in] media The media info handle
925 * @param[out] is_drm @c true if media is DRM media,
926 * otherwise @c false if media is not DRM media
928 * @return @c 0 on success,
929 * otherwise a negative error value
931 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
932 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
933 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
935 int media_info_is_drm(media_info_h media, bool *is_drm);
938 * @brief Gets the storage type of media info.
941 * @param[in] media The media info handle
942 * @param[out] storage_type The storage type of the media info
944 * @return @c 0 on success,
945 * otherwise a negative error value
947 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
948 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
949 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
951 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type);
954 * @brief Gets number which represents how many times given content has been played.
957 * @param [in] media The handle to media info
958 * @param [out] count_played The counter of content played
960 * @return 0 on success,
961 * otherwise a negative error value
963 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
964 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
966 int media_info_get_played_count(media_info_h media, int *played_count);
969 * @brief Gets the content's played time parameter.
970 * @details Function returns content's elapsed playback time parameter as period
971 * starting from the beginning of the track.
974 * @param [in] media The handle to media info
975 * @param [out] played_time The elapsed time of the content
977 * @return 0 on success,
978 * otherwise a negative error value
980 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
981 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
983 int media_info_get_played_time(media_info_h media, time_t *played_time);
986 * @brief Gets the media info from the media database.
988 * @details This function creates a new media handle from the media database by the given @a media_id.
989 * Media info will be created and filled with information.
993 * @remarks You must release @a media using media_tag_destroy().
995 * @param[in] media_id The ID of media info
996 * @param[out] media The media handle associated with the media ID
998 * @return @c 0 on success,
999 * otherwise a negative error value
1001 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1002 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1003 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1005 * @pre This function requires opened connection to content service by media_content_connect().
1007 * @see media_content_connect()
1008 * @see media_info_destroy()
1010 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
1013 * @brief Increments the played count to content meta handle.
1014 * @detalis You can increase the played(opened) count of the media file.
1017 * @param [in] media The handle to media info
1019 * @return 0 on success,
1020 * otherwise a negative error value
1022 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1023 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1025 * @post media_info_update_to_db()
1027 int media_info_increase_played_count(media_info_h media);
1030 * @brief Sets the played time to content meta handle.
1031 * @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.
1034 * @param [in] media The handle to media info
1036 * @return 0 on success,
1037 * otherwise a negative error value
1039 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1040 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1042 * @post media_info_update_to_db()
1044 int media_info_set_played_time(media_info_h media);
1047 * @brief Sets the display name of media info.
1050 * @param[in] media The media info handle
1051 * @param[in] display_name The display name of the media info
1053 * @return @c 0 on success,
1054 * otherwise a negative error value
1056 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1057 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1058 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1059 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1061 * @post media_info_update_to_db().
1064 int media_info_set_display_name(media_info_h media, const char *display_name);
1067 * @brief Sets the description of media info.
1070 * @param[in] media The media info handle
1071 * @param[in] description The description of the media info
1073 * @return @c 0 on success,
1074 * otherwise a negative error value
1076 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1077 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1078 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1079 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1081 * @post media_info_update_to_db().
1084 int media_info_set_description(media_info_h media, const char *description);
1087 * @brief Sets the longitude of media info.
1090 * @param[in] media The media info handle
1091 * @param[in] longitude The longitude of the media info
1093 * @return @c 0 on success,
1094 * otherwise a negative error value
1096 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1097 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1098 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1099 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1101 * @post media_info_update_to_db().
1103 int media_info_set_longitude(media_info_h media, double longitude);
1106 * @brief Sets the latitude of media info.
1109 * @param[in] media The media info handle
1110 * @param[in] latitude The latitude of the media info
1112 * @return @c 0 on success,
1113 * otherwise a negative error value
1115 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1116 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1117 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1118 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1120 * @post media_info_update_to_db().
1122 int media_info_set_latitude(media_info_h media, double latitude);
1125 * @brief Sets the altitude of media info.
1128 * @param[in] media The media info handle
1129 * @param[in] altitude The altitude of the media info
1131 * @return @c 0 on success,
1132 * otherwise a negative error value
1134 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1135 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1136 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1137 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1139 * @post media_info_update_to_db().
1141 int media_info_set_altitude(media_info_h media, double altitude);
1144 * @brief Sets weather to media info.
1146 * @param[in] media The handle to media info
1147 * @param[in] weather The weather of media info
1148 * @return 0 on success, otherwise a negative error value.
1149 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1150 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1151 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1152 * @post media_info_update_to_db()
1155 int media_info_set_weather(media_info_h media, const char *weather);
1158 * @brief Sets the rating of media info.
1161 * @param[in] media The media info handle
1162 * @param[in] rating The rating of the media info
1164 * @return @c 0 on success,
1165 * otherwise a negative error value
1167 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1168 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1169 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1170 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1172 * @post media_info_update_to_db().
1174 int media_info_set_rating(media_info_h media, int rating);
1177 * @brief Sets the favorite of media info.
1180 * @param[in] media The media info handle
1181 * @param[in] favorite Set @c true to set the media info as favorite,
1182 * otherwise set @c false to not set the media info as favorite
1184 * @return @c 0 on success,
1185 * otherwise a negative error value
1187 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1188 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1189 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1190 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1192 int media_info_set_favorite(media_info_h media, bool favorite);
1195 * @brief Sets the author of media info.
1198 * @param[in] media The media info handle
1199 * @param[in] author The author of the media info
1201 * @return @c 0 on success,
1202 * otherwise a negative error value
1204 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1205 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1206 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1207 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1209 int media_info_set_author(media_info_h media, const char *author);
1212 * @brief Sets the provider of media info.
1215 * @param[in] media The media info handle
1216 * @param[in] provider The provider of the media info
1218 * @return @c 0 on success,
1219 * otherwise a negative error value
1221 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1222 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1223 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1224 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1226 int media_info_set_provider(media_info_h media, const char *provider);
1229 * @brief Sets the content name of media info.
1232 * @param[in] media The media info handle
1233 * @param[in] content_name The content name of the media info
1235 * @return @c 0 on success,
1236 * otherwise a negative error value
1238 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1239 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1240 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1241 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1243 * @post media_info_update_to_db()
1245 int media_info_set_content_name(media_info_h media, const char *content_name);
1248 * @brief Sets the category of media info.
1251 * @param[in] media The media info handle
1252 * @param[in] category The category of the media info
1254 * @return @c 0 on success,
1255 * otherwise a negative error value
1257 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1258 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1259 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1260 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1262 * @post media_info_update_to_db()
1264 int media_info_set_category(media_info_h media, const char *category);
1267 * @brief Sets the location tag of media info.
1270 * @param[in] media The media info handle
1271 * @param[in] location_tag The location of the media info
1273 * @return @c 0 on success,
1274 * otherwise a negative error value
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
1281 * @post media_info_update_to_db()
1283 int media_info_set_location_tag(media_info_h media, const char *location_tag);
1286 * @brief Sets the age rating of media info.
1289 * @param[in] media The media info handle
1290 * @param[in] age_rating The age rating of the media info
1292 * @return @c 0 on success,
1293 * otherwise a negative error value
1295 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1296 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1297 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1298 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1300 * @post media_info_update_to_db()
1302 int media_info_set_age_rating(media_info_h media, const char *age_rating);
1305 * @brief Sets the keyword of media info.
1308 * @param[in] media The media info handle
1309 * @param[in] keyword The keyword of the media info
1311 * @return @c 0 on success,
1312 * otherwise a negative error value
1314 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1315 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1316 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1317 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1319 * @post media_info_update_to_db()
1321 int media_info_set_keyword(media_info_h media, const char *keyword);
1324 * @brief Updates the media info to the media database.
1326 * @details The function updates the given media info in the media database.
1330 * @privilege %http://tizen.org/privilege/content.write
1332 * @remarks The function should be called after any change in media, to be updated to the media
1333 * database. For example, after using media_info_set_display_name()
1334 * for setting the name of the media, the media_info_update_to_db() function should be called so as to update
1335 * the given media info attributes in the media database.
1337 * @param[in] media The media info handle
1339 * @return @c 0 on success,
1340 * otherwise a negative error value
1342 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1343 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1344 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1346 * @pre This function requires opened connection to content service by media_content_connect().
1348 * @see media_content_connect()
1349 * @see media_info_set_display_name()
1350 * @see media_info_set_description()
1351 * @see media_info_set_longitude()
1352 * @see media_info_set_latitude()
1353 * @see media_info_set_altitude()
1354 * @see media_info_set_rating()
1355 * @see media_info_set_favorite()
1356 * @see media_info_set_author()
1357 * @see media_info_set_provider()
1358 * @see media_info_set_content_name()
1359 * @see media_info_set_category()
1360 * @see media_info_set_location_tag()
1361 * @see media_info_set_age_rating()
1363 int media_info_update_to_db(media_info_h media);
1366 * @brief Refreshes the media metadata to the media database.
1370 * @privilege %http://tizen.org/privilege/content.write \n
1371 * %http://tizen.org/privilege/mediastorage \n
1372 * %http://tizen.org/privilege/externalstorage
1374 * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1375 * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1376 * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1377 * If you can access both storage, you should add all privilege.
1379 * @param[in] media_id The ID of the media info
1381 * @return @c 0 on success,
1382 * otherwise a negative error value
1384 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1385 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1386 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
1387 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1389 * @pre This function requires opened connection to content service by media_content_connect().
1391 * @see media_content_connect()
1393 int media_info_refresh_metadata_to_db(const char *media_id);
1396 * @brief Sets the added time of media info.
1399 * @param[in] media The media info handle
1400 * @param[in] added_time The added time of the media info
1402 * @return @c 0 on success,
1403 * otherwise a negative error value
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
1410 * @post media_info_update_to_db()
1412 int media_info_set_added_time(media_info_h media, time_t added_time);
1415 * @brief Moves the media info to the given destination path in the media database.
1419 * @privilege %http://tizen.org/privilege/content.write \n
1420 * %http://tizen.org/privilege/mediastorage \n
1421 * %http://tizen.org/privilege/externalstorage
1423 * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1424 * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1425 * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1426 * If you can access both storage, you should add all privilege.
1428 * @param[in] media The media info handle
1429 * @param[in] dst_path The path of destination
1431 * @return @c 0 on success,
1432 * otherwise a negative error value
1434 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1435 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1436 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
1437 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1439 * @pre This function requires opened connection to content service by media_content_connect().
1441 * @see media_content_connect()
1443 int media_info_move_to_db(media_info_h media, const char* dst_path);
1446 * @brief Creates a thumbnail image for the given media, asynchronously.
1447 * @details This function creates an thumbnail image for given media item and calls registered callback function for completion of creating the thumbnail.
1448 * If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function.
1453 * @privilege %http://tizen.org/privilege/content.write
1455 * @param[in] media The media info handle
1456 * @param[in] callback The callback function to be invoked
1457 * @param[in] user_data The user data to be passed to the callback function
1459 * @return @c 0 on success,
1460 * otherwise a negative error value
1462 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1463 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
1464 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
1465 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1467 * @pre This function requires opened connection to content service by media_content_connect().
1469 * @see media_content_connect()
1471 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
1474 * @brief Cancels the creation of image's thumbnail for the given media.
1478 * @privilege %http://tizen.org/privilege/content.write
1480 * @param[in] media The media info handle
1482 * @return @c 0 on success,
1483 * otherwise a negative error value
1485 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1486 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1487 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1489 * @pre This function requires opened connection to content service by media_content_connect().
1490 * @see media_content_connect()
1492 int media_info_cancel_thumbnail(media_info_h media);
1501 #endif /* __cplusplus */
1503 #endif /* __TIZEN_MEDIA_INFORMATION_H__ */