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_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
78 * @pre This function requires opened connection to content service by media_content_connect().
80 * @see media_content_connect()
82 int media_info_insert_to_db (const char *path, media_info_h *info);
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.
93 * @privilege %http://tizen.org/privilege/content.write \n
94 * %http://tizen.org/privilege/mediastorage \n
95 * %http://tizen.org/privilege/externalstorage
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.
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
107 * @return @c 0 on success,
108 * otherwise a negative error value
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
119 * @pre This function requires opened connection to content service by media_content_connect().
121 * @see media_content_connect()
122 * @see media_insert_completed_cb()
124 int media_info_insert_batch_to_db(const char **path_array,unsigned int array_length, media_insert_completed_cb callback, void *user_data);
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.
134 * @privilege %http://tizen.org/privilege/content.write \n
135 * %http://tizen.org/privilege/mediastorage \n
136 * %http://tizen.org/privilege/externalstorage
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.
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
148 * @return @c 0 on success,
149 * otherwise a negative error value
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
160 * @pre This function requires opened connection to content service by media_content_connect().
162 * @see media_content_connect()
163 * @see media_insert_burst_shot_completed_cb()
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);
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.
176 * @privilege %http://tizen.org/privilege/content.write
178 * @param[in] media_id The ID to the media file
180 * @return @c 0 on success,
181 * otherwise a negative error value
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
191 * @pre This function requires opened connection to content service by media_content_connect().
193 * @see media_content_connect()
195 int media_info_delete_from_db(const char *media_id);
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.
207 * @privilege %http://tizen.org/privilege/content.write
209 * @param[in] filter The handle to filter
211 * @return @c 0 on success,
212 * otherwise a negative error value
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
222 * @pre This function requires opened connection to content service by media_content_connect().
224 * @see media_content_connect()
226 int media_info_delete_batch_from_db(filter_h filter);
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.
237 * @param[in] media The media info handle
239 * @return @c 0 on success,
240 * otherwise a negative error value
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
246 * @pre Get copy of media_info handle by calling media_info_clone().
248 * @see media_info_clone()
250 int media_info_destroy(media_info_h media);
253 * @brief Clones the media info handle.
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.
262 * @remarks You must release the destination handle using media_info_destroy().
264 * @param[out] dst The destination handle to the media info
265 * @param[in] src The source handle to media info
267 * @return @c 0 on success,
268 * otherwise a negative error value
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
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()
283 int media_info_clone(media_info_h *dst, media_info_h src);
286 * @brief Gets the count of media info for the passed @a filter from the media database.
289 * @param[in] filter The handle to filter
290 * @param[out] media_count The count of media
292 * @return @c 0 on success,
293 * otherwise a negative error value
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
301 * @pre This function requires opened connection to content service by media_content_connect().
303 * @see media_content_connect()
305 int media_info_get_media_count_from_db(filter_h filter, int *media_count);
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.
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.
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
324 * @return @c 0 on success,
325 * otherwise a negative error value
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
334 * @pre This function requires opened connection to content service by media_content_connect().
335 * @post This function invokes media_info_cb().
337 * @see media_content_connect()
338 * @see #media_info_cb
339 * @see media_info_filter_create()
341 int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, void *user_data);
344 * @brief Gets the count of media tags for the passed @a filter in the given @a media_id from the media database.
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
351 * @return @c 0 on success,
352 * otherwise a negative error value
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
360 * @pre This function requires opened connection to content service by media_content_connect().
362 * @see media_content_connect()
364 int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count);
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.
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
377 * @return @c 0 on success,
378 * otherwise a negative error value
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
387 * @pre This function requires opened connection to content service by media_content_connect().
388 * @post This function invokes media_tag_cb().
390 * @see media_content_connect()
393 int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data);
396 * @brief Gets the number of bookmarks for the passed @a filter in the given media ID from the media database.
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
403 * @return @c 0 on success,
404 * otherwise a negative error value
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
412 * @pre This function requires opened connection to content service by media_content_connect().
414 * @see media_content_connect()
416 int media_info_get_bookmark_count_from_db(const char *media_id, filter_h filter, int *bookmark_count);
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.
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
429 * @return @c 0 on success,
430 * otherwise a negative error value
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
439 * @pre This function requires opened connection to content service by media_content_connect().
440 * @post This function invokes media_bookmark_cb().
442 * @see media_content_connect()
443 * @see media_bookmark_cb()
445 int media_info_foreach_bookmark_from_db (const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
448 * @brief Gets the image metadata for a given media info.
449 * @details This function returns an image metadata handle retrieved from the media info.
453 * @remarks You must release the @a image handle using image_meta_destroy().
455 * @param[in] media The media info handle
456 * @param[out] image A handle to image metadata
458 * @return @c 0 on success,
459 * otherwise a negative error value
461 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
462 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
463 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
465 * @see image_meta_destroy()
467 int media_info_get_image(media_info_h media, image_meta_h *image);
470 * @brief Gets a video metadata for a given media info.
471 * @details This function returns a video metadata handle retrieved from the media info handle.
475 * @remarks You must release the @a video handle using video_meta_destroy().
477 * @param[in] media The media info handle
478 * @param[out] video A handle to the video meta
480 * @return @c 0 on success,
481 * otherwise a negative error value
483 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
484 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
485 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
486 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
488 * @see video_meta_destroy()
490 int media_info_get_video(media_info_h media, video_meta_h *video);
493 * @brief Gets an audio metadata for a given media info.
494 * @details This function returns an audio metadata handle retrieved from the media info handle.
498 * @remarks You must release the @a audio handle using audio_meta_destroy().
500 * @param[in] media The media info handle
501 * @param[out] audio A handle to the audio meta
503 * @return @c 0 on success,
504 * otherwise a negative error value
506 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
507 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
508 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
509 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
511 * @see audio_meta_destroy()
513 int media_info_get_audio(media_info_h media, audio_meta_h *audio);
516 * @brief Gets the tag ID for the media info.
519 * @param[in] media The media info handle
520 * @param[out] media_id The ID of the media tag
522 * @return @c 0 on success,
523 * otherwise a negative error value
525 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
526 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
527 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
529 int media_info_get_media_id(media_info_h media, char **media_id);
532 * @brief Gets the path to the media info.
535 * @remarks You must release @a path using free().
537 * @param[in] media The media info handle
538 * @param[out] path The path of the media info
540 * @return @c 0 on success,
541 * otherwise a negative error value
543 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
544 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
545 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
546 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
549 int media_info_get_file_path(media_info_h media, char **path);
552 * @brief Gets the name of the media info.
555 * @remarks You must release @a name using free().
557 * @param[in] media The media info handle
558 * @param[out] name The name of media info
560 * @return @c 0 on success,
561 * otherwise a negative error value
563 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
564 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
565 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
566 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
568 int media_info_get_display_name(media_info_h media, char **name);
571 * @brief Gets the content type of the media info.
574 * @param[in] media The media info handle
575 * @param[out] type The type of the media content (#media_content_type_e)
577 * @return @c 0 on success,
578 * otherwise a negative error value
580 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
581 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
582 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
584 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
587 * @brief Gets the MIME type from the media info.
590 * @remarks You must release @a mime_type using free().
592 * @param[in] media The media info handle
593 * @param[out] mime_type The MIME type of the media info
595 * @return @c 0 on success,
596 * otherwise a negative error value
598 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
599 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
600 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
601 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
603 int media_info_get_mime_type(media_info_h media, char **mime_type);
606 * @brief Gets the media file size.
609 * @param[in] media The media info handle
610 * @param[out] size The type of the media content
612 * @return @c 0 on success,
613 * otherwise a negative error value
615 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
616 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
617 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
619 int media_info_get_size(media_info_h media, unsigned long long *size);
622 * @brief Gets the addition time of the media.
625 * @param[in] media The media info handle
626 * @param[out] added_time The added time to the DB
628 * @return @c 0 on success,
629 * otherwise a negative error value
631 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
632 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
633 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
635 int media_info_get_added_time(media_info_h media, time_t *added_time);
638 * @brief Gets the date of modification of media info.
641 * @param[in] media The media info handle
642 * @param[out] time The date of modification of the file \n
645 * @return @c 0 on success,
646 * otherwise a negative error value
648 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
649 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
650 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
652 int media_info_get_modified_time(media_info_h media, time_t *time);
655 * @brief Gets the timeline of media info.
656 * @details If the image file has the creation time, the value of the timeline is the creation time.\n
657 * Otherwise, the value of the timeline is the same as modified time.
660 * @param[in] media The media info handle
661 * @param[out] time The date of the timeline
663 * @return @c 0 on success,
664 * otherwise a negative error value
666 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
667 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
668 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
670 int media_info_get_timeline(media_info_h media, time_t* time);
673 * @brief Gets the thumbnail of media info.
676 * @remarks You must release @a path using free().
678 * @param[in] media The media info handle
679 * @param[out] path The path to the thumbnail 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_OUT_OF_MEMORY Out of memory
686 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
687 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
689 int media_info_get_thumbnail_path(media_info_h media, char **path);
692 * @brief Gets the description of media info.
695 * @remarks You must release @a description using free().
697 * @param[in] media The media info handle
698 * @param[out] description The description of the media info
700 * @return @c 0 on success,
701 * otherwise a negative error value
703 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
704 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
705 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
706 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
708 int media_info_get_description(media_info_h media, char **description);
711 * @brief Gets the longitude of media info.
714 * @param[in] media The media info handle
715 * @param[out] longitude The longitude of the media info
717 * @return @c 0 on success,
718 * otherwise a negative error value
720 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
721 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
722 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
724 int media_info_get_longitude(media_info_h media, double* longitude);
727 * @brief Gets the latitude of media info.
730 * @param[in] media The media info handle
731 * @param[out] latitude The latitude of the media info
733 * @return @c 0 on success,
734 * otherwise a negative error value
736 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
737 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
738 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
741 int media_info_get_latitude(media_info_h media, double* latitude);
744 * @brief Gets the altitude of media info.
747 * @param[in] media The media info handle
748 * @param[out] altitude The altitude of the media info
750 * @return @c 0 on success,
751 * otherwise a negative error value
753 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
754 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
755 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
757 int media_info_get_altitude(media_info_h media, double* altitude);
760 * @brief Gets the weather of media info.
763 * @param[in] media The media info handle
764 * @param[out] weather The weather of the media info
766 * @return @c 0 on success,
767 * otherwise a negative error value
769 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
770 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
771 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
773 int media_info_get_weather(media_info_h media, char **weather);
776 * @brief Gets the rating of media info.
779 * @param[in] media The media info handle
780 * @param[out] rating The rating of the media info
782 * @return @c 0 on success,
783 * otherwise a negative error value
785 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
786 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
787 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
789 int media_info_get_rating(media_info_h media, int *rating);
792 * @brief Gets the favorite status of media info.
795 * @param[in] media The media info handle
796 * @param[out] favorite @c true if media info is set as favorite,
797 * otherwise @c false if media info is not set as favorite
799 * @return @c 0 on success,
800 * otherwise a negative error value
802 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
803 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
804 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
806 int media_info_get_favorite(media_info_h media, bool* favorite);
809 * @brief Gets the author of media info.
812 * @remarks You must release @a author using free().
814 * @param[in] media The media info handle
815 * @param[out] author The author of the media info
817 * @return @c 0 on success,
818 * otherwise a negative error value
820 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
821 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
822 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
823 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
825 int media_info_get_author(media_info_h media, char **author);
828 * @brief Gets the provider of media info.
831 * @remarks You must release @a provider using free().
833 * @param[in] media The media info handle
834 * @param[out] provider The provider of the media info
836 * @return @c 0 on success,
837 * otherwise a negative error value
839 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
840 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
841 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
842 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
844 int media_info_get_provider(media_info_h media, char **provider);
847 * @brief Gets the content name of media info.
850 * @remarks You must release @a content_name using free().
852 * @param[in] media The media info handle
853 * @param[out] content_name The content name of the media info
855 * @return @c 0 on success,
856 * otherwise a negative error value
858 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
859 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
860 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
861 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
863 int media_info_get_content_name(media_info_h media, char **content_name);
866 * @brief Gets the title of media info.
869 * @remarks You must release @a title using free().
871 * @param[in] media The media info handle
872 * @param[out] title The title of the media info
874 * @return @c 0 on success,
875 * otherwise a negative error value
877 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
878 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
879 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
880 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
882 int media_info_get_title(media_info_h media, char **title);
885 * @brief Gets the category of media info.
888 * @remarks You must release @a category using free().
890 * @param[in] media The media info handle
891 * @param[out] category The category of the media info
893 * @return @c 0 on success,
894 * otherwise a negative error value
896 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
897 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
898 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
899 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
901 int media_info_get_category(media_info_h media, char **category);
904 * @brief Gets the location tag of media info.
907 * @remarks You must release @a location_tag using free().
909 * @param[in] media The media info handle
910 * @param[out] location_tag The location of the media info
912 * @return @c 0 on success,
913 * otherwise a negative error value
915 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
916 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
917 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
918 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
920 int media_info_get_location_tag(media_info_h media, char **location_tag);
923 * @brief Gets the age_rating of media info.
926 * @remarks You must release @a age_rating using free().
928 * @param[in] media The media info handle
929 * @param[out] age_rating The age rating of the media info
931 * @return @c 0 on success,
932 * otherwise a negative error value
934 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
935 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
936 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
937 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
939 int media_info_get_age_rating(media_info_h media, char **age_rating);
942 * @brief Gets the keyword of media info.
945 * @remarks You must release @a keyword using free().
947 * @param[in] media The media info handle
948 * @param[out] keyword The keyword of the media info
950 * @return @c 0 on success,
951 * otherwise a negative error value
953 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
954 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
955 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
956 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
958 int media_info_get_keyword(media_info_h media, char **keyword);
961 * @brief Checks whether the media is protected via DRM.
964 * @param[in] media The media info handle
965 * @param[out] is_drm @c true if media is DRM media,
966 * otherwise @c false if media is not DRM media
968 * @return @c 0 on success,
969 * otherwise a negative error value
971 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
972 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
973 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
975 int media_info_is_drm(media_info_h media, bool *is_drm);
978 * @brief Gets the storage type of media info.
981 * @param[in] media The media info handle
982 * @param[out] storage_type The storage type of the media info
984 * @return @c 0 on success,
985 * otherwise a negative error value
987 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
988 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
989 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
991 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type);
994 * @brief Gets number which represents how many times given content has been played.
997 * @param [in] media The handle to media info
998 * @param [out] count_played The counter of content played
1000 * @return 0 on success,
1001 * otherwise a negative error value
1003 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1004 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1006 int media_info_get_played_count(media_info_h media, int *played_count);
1009 * @brief Gets the content's played time parameter.
1010 * @details Function returns content's elapsed playback time parameter as period
1011 * starting from the beginning of the track.
1014 * @param [in] media The handle to media info
1015 * @param [out] played_time The elapsed time of the content
1017 * @return 0 on success,
1018 * otherwise a negative error value
1020 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1021 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1023 int media_info_get_played_time(media_info_h media, time_t *played_time);
1026 * @brief Gets the media info from the media database.
1028 * @details This function creates a new media handle from the media database by the given @a media_id.
1029 * Media info will be created and filled with information.
1033 * @remarks You must release @a media using media_tag_destroy().
1035 * @param[in] media_id The ID of media info
1036 * @param[out] media The media handle associated with the media ID
1038 * @return @c 0 on success,
1039 * otherwise a negative error value
1041 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1042 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1043 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1045 * @pre This function requires opened connection to content service by media_content_connect().
1047 * @see media_content_connect()
1048 * @see media_info_destroy()
1050 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
1053 * @brief Increments the played count to content meta handle.
1054 * @detalis You can increase the played(opened) count of the media file.
1057 * @param [in] media The handle to media info
1059 * @return 0 on success,
1060 * otherwise a negative error value
1062 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1063 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1065 * @post media_info_update_to_db()
1067 int media_info_increase_played_count(media_info_h media);
1070 * @brief Sets the played time to content meta handle.
1071 * @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.
1074 * @param [in] media The handle to media info
1076 * @return 0 on success,
1077 * otherwise a negative error value
1079 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1080 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1082 * @post media_info_update_to_db()
1084 int media_info_set_played_time(media_info_h media);
1087 * @brief Sets the display name of media info.
1090 * @param[in] media The media info handle
1091 * @param[in] display_name The display name 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().
1104 int media_info_set_display_name(media_info_h media, const char *display_name);
1107 * @brief Sets the description of media info.
1110 * @param[in] media The media info handle
1111 * @param[in] description The description of the media info
1113 * @return @c 0 on success,
1114 * otherwise a negative error value
1116 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1117 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1118 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1119 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1121 * @post media_info_update_to_db().
1124 int media_info_set_description(media_info_h media, const char *description);
1127 * @brief Sets the longitude of media info.
1130 * @param[in] media The media info handle
1131 * @param[in] longitude The longitude of the media info
1133 * @return @c 0 on success,
1134 * otherwise a negative error value
1136 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1137 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1138 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1139 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1141 * @post media_info_update_to_db().
1143 int media_info_set_longitude(media_info_h media, double longitude);
1146 * @brief Sets the latitude of media info.
1149 * @param[in] media The media info handle
1150 * @param[in] latitude The latitude of the media info
1152 * @return @c 0 on success,
1153 * otherwise a negative error value
1155 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1156 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1157 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1158 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1160 * @post media_info_update_to_db().
1162 int media_info_set_latitude(media_info_h media, double latitude);
1165 * @brief Sets the altitude of media info.
1168 * @param[in] media The media info handle
1169 * @param[in] altitude The altitude of the media info
1171 * @return @c 0 on success,
1172 * otherwise a negative error value
1174 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1175 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1176 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1177 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1179 * @post media_info_update_to_db().
1181 int media_info_set_altitude(media_info_h media, double altitude);
1184 * @brief Sets the weather of media info.
1187 * @param[in] media The media info handle
1188 * @param[in] weather The weather of the media info
1190 * @return @c 0 on success,
1191 * otherwise a negative error value
1193 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1194 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1195 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1196 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1198 * @post media_info_update_to_db().
1201 int media_info_set_weather(media_info_h media, const char *weather);
1204 * @brief Sets the rating of media info.
1207 * @param[in] media The media info handle
1208 * @param[in] rating The rating of the media info
1210 * @return @c 0 on success,
1211 * otherwise a negative error value
1213 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1214 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1215 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1216 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1218 * @post media_info_update_to_db().
1220 int media_info_set_rating(media_info_h media, int rating);
1223 * @brief Sets the favorite of media info.
1226 * @param[in] media The media info handle
1227 * @param[in] favorite Set @c true to set the media info as favorite,
1228 * otherwise set @c false to not set the media info as favorite
1230 * @return @c 0 on success,
1231 * otherwise a negative error value
1233 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1234 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1235 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1236 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1238 int media_info_set_favorite(media_info_h media, bool favorite);
1241 * @brief Sets the author of media info.
1244 * @param[in] media The media info handle
1245 * @param[in] author The author of the media info
1247 * @return @c 0 on success,
1248 * otherwise a negative error value
1250 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1251 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1252 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1253 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1255 int media_info_set_author(media_info_h media, const char *author);
1258 * @brief Sets the provider of media info.
1261 * @param[in] media The media info handle
1262 * @param[in] provider The provider of the media info
1264 * @return @c 0 on success,
1265 * otherwise a negative error value
1267 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1268 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1269 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1270 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1272 int media_info_set_provider(media_info_h media, const char *provider);
1275 * @brief Sets the content name of media info.
1278 * @param[in] media The media info handle
1279 * @param[in] content_name The content name of the media info
1281 * @return @c 0 on success,
1282 * otherwise a negative error value
1284 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1285 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1286 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1287 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1289 * @post media_info_update_to_db()
1291 int media_info_set_content_name(media_info_h media, const char *content_name);
1294 * @brief Sets the category of media info.
1297 * @param[in] media The media info handle
1298 * @param[in] category The category of the media info
1300 * @return @c 0 on success,
1301 * otherwise a negative error value
1303 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1304 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1305 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1306 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1308 * @post media_info_update_to_db()
1310 int media_info_set_category(media_info_h media, const char *category);
1313 * @brief Sets the location tag of media info.
1316 * @param[in] media The media info handle
1317 * @param[in] location_tag The location of the media info
1319 * @return @c 0 on success,
1320 * otherwise a negative error value
1322 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1323 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1324 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1325 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1327 * @post media_info_update_to_db()
1329 int media_info_set_location_tag(media_info_h media, const char *location_tag);
1332 * @brief Sets the age rating of media info.
1335 * @param[in] media The media info handle
1336 * @param[in] age_rating The age rating of the media info
1338 * @return @c 0 on success,
1339 * otherwise a negative error value
1341 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1342 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1343 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1344 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1346 * @post media_info_update_to_db()
1348 int media_info_set_age_rating(media_info_h media, const char *age_rating);
1351 * @brief Sets the keyword of media info.
1354 * @param[in] media The media info handle
1355 * @param[in] keyword The keyword of the media info
1357 * @return @c 0 on success,
1358 * otherwise a negative error value
1360 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1361 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1362 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1363 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1365 * @post media_info_update_to_db()
1367 int media_info_set_keyword(media_info_h media, const char *keyword);
1370 * @brief Updates the media info to the media database.
1372 * @details The function updates the given media info in the media database.
1376 * @privilege %http://tizen.org/privilege/content.write
1378 * @remarks The function should be called after any change in media, to be updated to the media
1379 * database. For example, after using media_info_set_display_name()
1380 * for setting the name of the media, the media_info_update_to_db() function should be called so as to update
1381 * the given media info attributes in the media database.
1383 * @param[in] media The media info handle
1385 * @return @c 0 on success,
1386 * otherwise a negative error value
1388 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1389 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1390 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1391 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1392 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1393 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1394 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1395 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1397 * @pre This function requires opened connection to content service by media_content_connect().
1399 * @see media_content_connect()
1400 * @see media_info_set_display_name()
1401 * @see media_info_set_description()
1402 * @see media_info_set_longitude()
1403 * @see media_info_set_latitude()
1404 * @see media_info_set_altitude()
1405 * @see media_info_set_rating()
1406 * @see media_info_set_favorite()
1407 * @see media_info_set_author()
1408 * @see media_info_set_provider()
1409 * @see media_info_set_content_name()
1410 * @see media_info_set_category()
1411 * @see media_info_set_location_tag()
1412 * @see media_info_set_age_rating()
1414 int media_info_update_to_db(media_info_h media);
1417 * @brief Refreshes the media metadata to the media database.
1421 * @privilege %http://tizen.org/privilege/content.write \n
1422 * %http://tizen.org/privilege/mediastorage \n
1423 * %http://tizen.org/privilege/externalstorage
1425 * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1426 * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1427 * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1428 * If you can access both storage, you should add all privilege.
1430 * @param[in] media_id The ID of the media info
1432 * @return @c 0 on success,
1433 * otherwise a negative error value
1435 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1436 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1437 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1438 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1439 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1440 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1441 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1442 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1444 * @pre This function requires opened connection to content service by media_content_connect().
1446 * @see media_content_connect()
1448 int media_info_refresh_metadata_to_db(const char *media_id);
1451 * @brief Sets the added time of media info.
1454 * @param[in] media The media info handle
1455 * @param[in] added_time The added time of the media info
1457 * @return @c 0 on success,
1458 * otherwise a negative error value
1460 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1461 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1462 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1463 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1465 * @post media_info_update_to_db()
1467 int media_info_set_added_time(media_info_h media, time_t added_time);
1470 * @brief Moves the media info to the given destination path in the media database.
1474 * @privilege %http://tizen.org/privilege/content.write \n
1475 * %http://tizen.org/privilege/mediastorage \n
1476 * %http://tizen.org/privilege/externalstorage
1478 * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1479 * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1480 * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1481 * If you can access both storage, you should add all privilege.
1483 * @param[in] media The media info handle
1484 * @param[in] dst_path The path of destination
1486 * @return @c 0 on success,
1487 * otherwise a negative error value
1489 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1490 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
1491 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1492 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1493 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1494 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1495 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1496 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1498 * @pre This function requires opened connection to content service by media_content_connect().
1500 * @see media_content_connect()
1502 int media_info_move_to_db(media_info_h media, const char* dst_path);
1505 * @brief Creates a thumbnail image for the given media, asynchronously.
1506 * @details This function creates an thumbnail image for given media item and calls registered callback function for completion of creating the thumbnail.
1507 * If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function.
1512 * @privilege %http://tizen.org/privilege/content.write
1514 * @param[in] media The media info handle
1515 * @param[in] callback The callback function to be invoked
1516 * @param[in] user_data The user data to be passed to the callback function
1518 * @return @c 0 on success,
1519 * otherwise a negative error value
1521 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1522 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1523 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1524 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1525 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1526 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1527 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1528 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1530 * @pre This function requires opened connection to content service by media_content_connect().
1532 * @see media_content_connect()
1534 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
1537 * @brief Cancels the creation of image's thumbnail for the given media.
1541 * @privilege %http://tizen.org/privilege/content.write
1543 * @remarks If you request cancel for the alreay thumbnail created media, this API return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1545 * @param[in] media The media info handle
1547 * @return @c 0 on success,
1548 * otherwise a negative error value
1550 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1551 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1552 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1553 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1555 * @pre This function requires opened connection to content service by media_content_connect().
1556 * @see media_content_connect()
1558 int media_info_cancel_thumbnail(media_info_h media);
1567 #endif /* __cplusplus */
1569 #endif /* __TIZEN_MEDIA_INFORMATION_H__ */