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 * @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
36 * @brief Inserts media file into the media database.
37 * @details This function inserts an media item into the content storage.
38 * Normally, inserting a media file in database is done automatically by media server, without calling this function.
39 * This function is only called when media server is busy and user needs to get quick result of inserting
40 * e.g. Taking a photo while media server is busy and user want to see the quick snapshot of the photo taken.
41 * @remark The handle must be released with media_info_destroy() by you.
43 * @param[in] path The path to the media file
44 * @param[out] info The handle to the media info
45 * @return 0 on success, otherwise a negative error value.
46 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
47 * @pre This function requires opened connection to content service by media_content_connect().
48 * @see media_content_connect()
50 int media_info_insert_to_db (const char *path, media_info_h *info);
53 * @brief Insert media files into the media database, asynchronously.
54 * @details This function insert an media items into the content storage.
55 * Normally, inserting a media file in database is done automatically by media server, without calling this function.
56 * This function invokes media_insert_completed_cb callback function.
57 * #media_insert_completed_cb will be called when insertion to media database is finished.
59 * @param[in] path_array The path array to the media files
60 * @param[in] array_length The length of array
61 * @param[in] callback The callback to invoke when media items inserted completely
62 * @param[in] user_data The user data to be passed to the callback function
63 * @return 0 on success, otherwise a negative error value.
64 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
65 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
66 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
67 * @pre This function requires opened connection to content service by media_content_connect().
68 * @see media_content_connect()
69 * @see media_insert_completed_cb()
71 int media_info_insert_batch_to_db(const char **path_array,unsigned int array_length, media_insert_completed_cb callback, void *user_data);
74 * @brief Insert the burst shot images into the media database, asynchronously.
75 * @details This function insert the busrt images into the content storage.
76 * #media_insert_burst_shot_completed_cb will be called when insertion to media database is finished.
78 * @param[in] path_array The path array to the burst shot images
79 * @param[in] array_length The length of array
80 * @param[in] callback The callback to invoke when the images inserted completely
81 * @param[in] user_data The user data to be passed to the callback function
82 * @return 0 on success, otherwise a negative error value.
83 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
84 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
85 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
86 * @pre This function requires opened connection to content service by media_content_connect().
87 * @see media_content_connect()
88 * @see media_insert_burst_shot_completed_cb()
90 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);
93 * @brief Deletes media file from the media database.
94 * @details This function deletes an media item from the content storage.
95 * Normally, deleting a media file in database is done automatically by media server, without calling this function.
96 * This function is only called when media server is busy and user needs to get quick result of deleting
98 * @param[in] media_id The ID to the media file
99 * @return 0 on success, otherwise a negative error value.
100 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
101 * @pre This function requires opened connection to content service by media_content_connect().
102 * @see media_content_connect()
104 int media_info_delete_from_db(const char *media_id);
107 * @brief Deletes media files from the media database. The media files to delete can be specified as a condition in a filter.
108 * @details This function deletes the media items from the content storage.
109 * Normally, deleting media files in database are done automatically by media server, without calling this function.
110 * This function is only called when media server is busy and user needs to get quick result of deleting
112 * @param[in] filter The handle to filter
113 * @return 0 on success, otherwise a negative error value.
114 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
115 * @pre This function requires opened connection to content service by media_content_connect().
116 * @see media_content_connect()
118 int media_info_delete_batch_from_db(filter_h filter);
122 * @brief Destroys the media info.
123 * @details The function frees all resources related to the media info handle. This handle
124 * no longer can be used to perform any operation. New media info handle has to
125 * be created before next usage.
127 * @param[in] media The handle to media info
128 * @return 0 on success, otherwise a negative error value.
129 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
130 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
131 * @pre Get copy of media_info handle by calling media_info_clone()
132 * @see media_info_clone()
134 int media_info_destroy(media_info_h media);
137 * @brief Clones the media info handle.
139 * @details This function copies the media info handle from a source to destination.
140 * There is no media_info_create() function. The media_info_h is created internally and
141 * available through media info foreach function such as media_info_foreach_media_from_db().
142 * To use this handle outside of these foreach functions, use this function.
143 * @remark The destination handle must be released with media_info_destroy() by you.
145 * @param[out] dst A destination handle to media info
146 * @param[in] src The source handle to media info
147 * @return 0 on success, otherwise a negative error value.
148 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
149 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
150 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
151 * @see media_info_destroy()
152 * @see media_album_foreach_media_from_db()
153 * @see media_playlist_foreach_media_from_db()
154 * @see media_group_foreach_media_from_db
155 * @see media_tag_foreach_media_from_db()
156 * @see media_info_foreach_media_from_db()
157 * @see media_folder_foreach_media_from_db()
160 int media_info_clone(media_info_h *dst, media_info_h src);
163 * @brief Gets the number of media info for the passed @a filter from the media database.
165 * @param[in] filter The handle to filter.
166 * @param[out] media_count The count of media tag
167 * @return 0 on success, otherwise a negative error value.
168 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
169 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
170 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
171 * @pre This function requires opened connection to content service by media_content_connect().
172 * @see media_content_connect()
175 int media_info_get_media_count_from_db(filter_h filter, int *media_count);
178 * @brief Iterates through media info from the media database.
179 * @details This function gets all media info handles meeting the given @a filter. The @a callback function will be invoked for every retrieved media info.
180 * If NULL is passed to the @a filter, no filtering is applied.
181 * @param[in] filter The handle to media info filter
182 * @param[in] callback The callback function to invoke
183 * @param[in] user_data The user data to be passed to the callback function
184 * @return 0 on success, otherwise a negative error value.
185 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
186 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
187 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
188 * @pre This function requires opened connection to content service by media_content_connect().
189 * @post This function invokes media_info_cb().
190 * @see media_content_connect()
191 * @see #media_info_cb
192 * @see media_info_filter_create()
195 int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, void *user_data);
198 * @brief Gets the number of media tag for the passed @a filter in the given @a media ID from the media database.
200 * @param[in] media_id The ID of media info
201 * @param[in] filter The handle to media filter
202 * @param[out] tag_count The count of media tag
203 * @return 0 on success, otherwise a negative error value.
204 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
205 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
206 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
207 * @pre This function requires opened connection to content service by media_content_connect().
208 * @see media_content_connect()
211 int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count);
214 * @brief Iterates through the media tag in the given @a media @a info from the media database.
215 * @details This function gets all media tag associated with the given @a media and calls registered callback function for every retrieved media tag.
216 * @param[in] media_id The ID of media info
217 * @param[in] filter The handle to media filter
218 * @param[in] callback The callback function to invoke
219 * @param[in] user_data The user data to be passed to the callback function
220 * @return 0 on success, otherwise a negative error value.
221 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
222 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
223 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
224 * @pre This function requires opened connection to content service by media_content_connect().
225 * @post This function invokes media_tag_cb().
226 * @see media_content_connect()
229 int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data);
232 * @brief Gets the number of bookmark for the passed @a filter in the given @a media ID from the media database.
234 * @param[in] media_id The ID of media info
235 * @param[in] filter The handle to media filter
236 * @param[out] bookmark_count The count of media tag
237 * @return 0 on success, otherwise a negative error value.
238 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
239 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
240 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
241 * @pre This function requires opened connection to content service by media_content_connect().
242 * @see media_content_connect()
245 int media_info_get_bookmark_count_from_db(const char *media_id, filter_h filter, int *bookmark_count);
248 * @brief Iterates through the media bookmark in the given @a media @a info from the media database.
249 * @details This function gets all media bookmark associated with the given @a media and calls registered callback function for every retrieved media bookmark.
250 * @param[in] media_id The ID of media info
251 * @param[in] filter The handle to media filter
252 * @param[in] callback The callback function to invoke
253 * @param[in] user_data The user data to be passed to the callback function
254 * @return 0 on success, otherwise a negative error value.
255 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
256 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
257 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
258 * @pre This function requires opened connection to content service by media_content_connect().
259 * @post This function invokes media_bookmark_cb().
260 * @see media_content_connect()
261 * @see #media_bookmark_cb
263 int media_info_foreach_bookmark_from_db (const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
266 * @brief Gets image metadata for a given media info.
267 * @details This function returns an image metadata handle retrieved from the media info.
269 * @remark The @a image handle must be released with image_meta_destroy() by you.
271 * @param [in] media The handle to media info
272 * @param[out] image A handle to image meta
273 * @return 0 on success, otherwise a negative error value.
274 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
275 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
276 * @see image_meta_destroy()
278 int media_info_get_image(media_info_h media, image_meta_h *image);
281 * @brief Gets video metadata for a given media info.
282 * @details This function returns a video metadata handle retrieved from the media info handle.
284 * @remark The @a video handle must be released with video_meta_destroy() by you.
286 * @param [in] media The handle to media info
287 * @param[out] video A handle to the video meta
288 * @return 0 on success, otherwise a negative error value.
289 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
290 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
291 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
292 * @see video_meta_destroy()
295 int media_info_get_video(media_info_h media, video_meta_h *video);
298 * @brief Gets audio metadata for a given media info.
299 * @details This function returns an audio metadata handle retrieved from the media info handle.
301 * @remark The @a audio handle must be released with audio_meta_destroy() by you.
303 * @param [in] media The handle to media info
304 * @param[out] audio A handle to the audio meta
305 * @return 0 on success, otherwise a negative error value.
306 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
307 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
308 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
309 * @see audio_meta_destroy()
311 int media_info_get_audio(media_info_h media, audio_meta_h *audio);
314 * @brief Gets ID to media info.
317 * @param [in] media_id The ID if media info
318 * @param [out] media_id The ID of media tag
319 * @return 0 on success, otherwise a negative error value.
320 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
321 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
323 int media_info_get_media_id(media_info_h media, char **media_id);
326 * @brief Gets path to media info.
328 * @remarks @a path must be released with free() by you.
330 * @param[in] media The handle to media info
331 * @param[out] path The path of media info
332 * @return 0 on success, otherwise a negative error value.
333 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
334 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
335 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
338 int media_info_get_file_path(media_info_h media, char **path);
341 * @brief Gets name to media info.
343 * @remarks @a name must be released with free() by you.
345 * @param[in] media The handle to media info
346 * @param[out] name The name of media info
347 * @return 0 on success, otherwise a negative error value.
348 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
349 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
350 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
353 int media_info_get_display_name(media_info_h media, char **name);
356 * @brief Gets media info's content type.
358 * @param[in] media The handle to media info
359 * @param[out] type The type of media content(#media_content_type_e)
360 * @return 0 on success, otherwise a negative error value.
361 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
362 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
365 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
368 * @brief Gets name to media info.
370 * @remarks @a mime_type must be released with free() by you.
372 * @param[in] media The handle to media info
373 * @param[out] mime_type The mime type of media info
374 * @return 0 on success, otherwise a negative error value.
375 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
376 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
377 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
380 int media_info_get_mime_type(media_info_h media, char **mime_type);
383 * @brief Gets media file's size.
385 * @param[in] media The handle to media info
386 * @param[out] size The type of media content
387 * @return 0 on success, otherwise a negative error value.
388 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
389 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
392 int media_info_get_size(media_info_h media, unsigned long long *size);
395 * @brief Gets added time.
397 * @param[in] media The handle to media info
398 * @param[out] added_time The added time to DB
399 * @return 0 on success, otherwise a negative error value.
400 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
401 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
404 int media_info_get_added_time(media_info_h media, time_t *added_time);
407 * @brief Gets media info's date of modification.
409 * @param[in] media The handle to media info
410 * @param[out] time The date of modification of File. Get from File
411 * @return 0 on success, otherwise a negative error value.
412 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
413 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
416 int media_info_get_modified_time(media_info_h media, time_t *time);
419 * @brief Gets the thumbnail to media info.
421 * @remarks @a path must be released with free() by you.
423 * @param[in] media The handle to media info
424 * @param[out] path The path to thumbnail of media info
425 * @return 0 on success, otherwise a negative error value.
426 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
427 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
428 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
431 int media_info_get_thumbnail_path(media_info_h media, char **path);
434 * @brief Gets the description to media info.
436 * @remarks @a description must be released with free() by you.
438 * @param[in] media The handle to media info
439 * @param[out] description The description of media info
440 * @return 0 on success, otherwise a negative error value.
441 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
442 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
443 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
446 int media_info_get_description(media_info_h media, char **description);
449 * @brief Gets media info's longitude.
451 * @param[in] media The handle to media info
452 * @param[out] longitude The longitude of media info
453 * @return 0 on success, otherwise a negative error value.
454 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
455 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
458 int media_info_get_longitude(media_info_h media, double* longitude);
461 * @brief Gets media info's latitude.
463 * @param[in] media The handle to media info
464 * @param[out] latitude The latitude of media info
465 * @return 0 on success, otherwise a negative error value.
466 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
467 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
470 int media_info_get_latitude(media_info_h media, double* latitude);
473 * @brief Gets media info's altitude of modification.
475 * @param[in] media The handle to media info
476 * @param[out] altitude The altitude of media info
477 * @return 0 on success, otherwise a negative error value.
478 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
479 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
482 int media_info_get_altitude(media_info_h media, double* altitude);
485 * @brief Gets media info's rating.
487 * @param[in] media The handle to media info
488 * @param[out] rating The rating of media info
489 * @return 0 on success, otherwise a negative error value.
490 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
491 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
494 int media_info_get_rating(media_info_h media, int *rating);
497 * @brief Gets the given media info's favorite status.
499 * @param [in] media The handle to media info
500 * @param [out] favorite The media favorite status(non zero if favorite, 0 if not favorite)
501 * @return 0 on success, otherwise a negative error value.
502 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
503 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
506 int media_info_get_favorite(media_info_h media, bool* favorite);
509 * @brief Gets the author to media info.
511 * @remarks @a author must be released with free() by you.
513 * @param[in] media The handle to media info
514 * @param[out] author The author of media info
515 * @return 0 on success, otherwise a negative error value.
516 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
517 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
518 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
521 int media_info_get_author(media_info_h media, char **author);
524 * @brief Gets the provider to media info.
526 * @remarks @a provider must be released with free() by you.
528 * @param[in] media The handle to media info
529 * @param[out] provider The provider of media info
530 * @return 0 on success, otherwise a negative error value.
531 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
532 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
533 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
536 int media_info_get_provider(media_info_h media, char **provider);
539 * @brief Gets the content name to media info.
541 * @remarks @a content_name must be released with free() by you.
543 * @param[in] media The handle to media info
544 * @param[out] content_name The content name of media info
545 * @return 0 on success, otherwise a negative error value.
546 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
547 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
548 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
551 int media_info_get_content_name(media_info_h media, char **content_name);
554 * @brief Gets the provider to media info.
556 * @remarks @a category must be released with free() by you.
558 * @param[in] media The handle to media info
559 * @param[out] category The category of media info
560 * @return 0 on success, otherwise a negative error value.
561 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
562 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
563 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
566 int media_info_get_category(media_info_h media, char **category);
569 * @brief Gets the location_tag to media info.
571 * @remarks @a location_tag must be released with free() by you.
573 * @param[in] media The handle to media info
574 * @param[out] location_tag The location of media info
575 * @return 0 on success, otherwise a negative error value.
576 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
577 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
578 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
581 int media_info_get_location_tag(media_info_h media, char **location_tag);
584 * @brief Gets the age_rating to media info.
586 * @remarks @a age_rating must be released with free() by you.
588 * @param[in] media The handle to media info
589 * @param[out] age_rating The age rating of media info
590 * @return 0 on success, otherwise a negative error value.
591 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
592 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
593 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
596 int media_info_get_age_rating(media_info_h media, char **age_rating);
599 * @brief Gets the keyword to media info.
601 * @remarks @a keyword must be released with free() by you.
603 * @param[in] media The handle to media info
604 * @param[out] keyword The keyword of media info
605 * @return 0 on success, otherwise a negative error value.
606 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
607 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
608 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
611 int media_info_get_keyword(media_info_h media, char **keyword);
614 * @brief Checks whether the media is protected via drm.
616 * @param[in] media The handle to media info
617 * @param[out] is_drm /@a true if the drm media,
618 * /@a false if not drm.
619 * @return 0 on success, otherwise a negative error value.
620 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
621 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
624 int media_info_is_drm(media_info_h media, bool *is_drm);
627 * @brief Gets media info's storage_type.
629 * @param[in] media The handle to media info
630 * @param[out] storage_type The storage type of media info
631 * @return 0 on success, otherwise a negative error value.
632 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
633 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
636 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type);
639 * @brief Gets the media info from the media database.
641 * @details This function creates a new media handle from the media database by the given media_id.
642 * media info will be created, which is filled with info information.
644 * @remarks @a media must be released with media_tag_destroy() by you.
646 * @param[in] media_id The ID of media info
647 * @param[out] media The media handle associated with the media ID
648 * @return 0 on success, otherwise a negative error value.
649 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
650 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
651 * @pre This function requires opened connection to content service by media_content_connect().
652 * @see media_content_connect()
653 * @see media_info_destroy()
656 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
659 * @brief Sets display name to media info.
661 * @param[in] media The handle to media info
662 * @param[in] display_name The display name of media info
663 * @return 0 on success, otherwise a negative error value.
664 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
665 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
666 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
667 * @post media_info_update_to_db()
670 int media_info_set_display_name(media_info_h media, const char *display_name);
673 * @brief Sets description to media info.
675 * @param[in] media The handle to media info
676 * @param[in] description The description of media info
677 * @return 0 on success, otherwise a negative error value.
678 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
679 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
680 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
681 * @post media_info_update_to_db()
684 int media_info_set_description(media_info_h media, const char *description);
687 * @brief Sets longitude to media info.
689 * @param[in] media The handle to media info
690 * @param[in] longitude The longitude of media info
691 * @return 0 on success, otherwise a negative error value.
692 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
693 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
694 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
695 * @post media_info_update_to_db()
698 int media_info_set_longitude(media_info_h media, double longitude);
701 * @brief Sets latitude to media info.
703 * @param[in] media The handle to media info
704 * @param[in] latitude The latitude of media info
705 * @return 0 on success, otherwise a negative error value.
706 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
707 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
708 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
709 * @post media_info_update_to_db()
712 int media_info_set_latitude(media_info_h media, double latitude);
715 * @brief Sets altitude to media info.
717 * @param[in] media The handle to media info
718 * @param[in] altitude The altitude of media info
719 * @return 0 on success, otherwise a negative error value.
720 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
721 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
722 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
723 * @post media_info_update_to_db()
726 int media_info_set_altitude(media_info_h media, double altitude);
729 * @brief Sets rating to media info.
731 * @param[in] media The handle to media info
732 * @param[in] rating The rating of media info
733 * @return 0 on success, otherwise a negative error value.
734 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
735 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
736 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
737 * @post media_info_update_to_db()
740 int media_info_set_rating(media_info_h media, int rating);
743 * @brief Sets favorite to media info.
745 * @param[in] media The handle to media info
746 * @param[in] favorite The favorite of media info
747 * @return 0 on success, otherwise a negative error value.
748 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
749 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
750 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
753 int media_info_set_favorite(media_info_h media, bool favorite);
756 * @brief Sets author to media info.
758 * @param[in] media The handle to media info
759 * @param[in] author The author of media info
760 * @return 0 on success, otherwise a negative error value.
761 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
762 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
763 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
766 int media_info_set_author(media_info_h media, const char *author);
769 * @brief Sets provider to media info.
771 * @param[in] media The handle to media info
772 * @param[in] provider The provider of media info
773 * @return 0 on success, otherwise a negative error value.
774 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
775 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
776 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
779 int media_info_set_provider(media_info_h media, const char *provider);
782 * @brief Sets content name to media info.
784 * @param[in] media The handle to media info
785 * @param[in] content_name The content name of media info
786 * @return 0 on success, otherwise a negative error value.
787 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
788 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
789 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
790 * @post media_info_update_to_db()
793 int media_info_set_content_name(media_info_h media, const char *content_name);
796 * @brief Sets category to media info.
798 * @param[in] media The handle to media info
799 * @param[in] category The category of media info
800 * @return 0 on success, otherwise a negative error value.
801 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
802 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
803 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
804 * @post media_info_update_to_db()
807 int media_info_set_category(media_info_h media, const char *category);
810 * @brief Sets location tag to media info.
812 * @param[in] media The handle to media info
813 * @param[in] location_tag The location of media info
814 * @return 0 on success, otherwise a negative error value.
815 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
816 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
817 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
818 * @post media_info_update_to_db()
821 int media_info_set_location_tag(media_info_h media, const char *location_tag);
824 * @brief Sets age rating to media info.
826 * @param[in] media The handle to media info
827 * @param[in] age_rating The age rating of media info
828 * @return 0 on success, otherwise a negative error value.
829 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
830 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
831 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
832 * @post media_info_update_to_db()
835 int media_info_set_age_rating(media_info_h media, const char *age_rating);
838 * @brief Sets keyword to media info.
840 * @param[in] media The handle to media info
841 * @param[in] keyword The keyword of media info
842 * @return 0 on success, otherwise a negative error value.
843 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
844 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
845 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
846 * @post media_info_update_to_db()
849 int media_info_set_keyword(media_info_h media, const char *keyword);
852 * @brief Updates the media info to the media database.
854 * @details The function updates the given media info in the media database. The function should be called after any change in media, to be updated to the media
855 * database. For example, after using media_info_set_display_name() for setting the name of the media, media_info_update_to_db() function should be called so as to update
856 * the given media info attibutes in the media database.
858 * @param[in] media The handle to media info
859 * @return 0 on success, otherwise a negative error value.
860 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
861 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
862 * @pre This function requires opened connection to content service by media_content_connect().
863 * @see media_content_connect()
864 * @see media_info_set_display_name()
865 * @see media_info_set_description()
866 * @see media_info_set_longitude()
867 * @see media_info_set_latitude()
868 * @see media_info_set_altitude()
869 * @see media_info_set_rating()
870 * @see media_info_set_favorite()
871 * @see media_info_set_author()
872 * @see media_info_set_provider()
873 * @see media_info_set_content_name()
874 * @see media_info_set_category()
875 * @see media_info_set_location_tag()
876 * @see media_info_set_age_rating()
879 int media_info_update_to_db(media_info_h media);
882 * @brief Refresh the metadata of media to media database.
884 * @param[in] media_id The ID of media info
885 * @return 0 on success, otherwise a negative error value.
886 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
887 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
888 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
889 * @pre This function requires opened connection to content service by media_content_connect().
890 * @see media_content_connect()
893 int media_info_refresh_metadata_to_db(const char *media_id);
896 * @brief Sets added_time to media info.
898 * @param[in] media The handle to media info
899 * @param[in] added_time The added time of media info
900 * @return 0 on success, otherwise a negative error value.
901 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
902 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
903 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
904 * @post media_info_update_to_db()
907 int media_info_set_added_time(media_info_h media, time_t added_time);
910 * @brief Moves the media info to the given destination path in the media database.
912 * @param[in] media The handle to media info
913 * @param[in] dst_path The path of destination
914 * @return 0 on success, otherwise a negative error value.
915 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
916 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
917 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
918 * @pre This function requires opened connection to content service by media_content_connect().
919 * @see media_content_connect()
922 int media_info_move_to_db(media_info_h media, const char* dst_path);
925 * @brief Creates a thumbnail image for given the media, asynchronously.
926 * @details This function creates an thumbnail image for given media item and and calls registered callback function for completion of creating the thumbnail.
927 * If there already exist a thumbnail for given media, then the path of thumbnail will be return in callback function.
929 * @param[in] media The handle to media info
930 * @param[in] callback The callback function to invoke
931 * @param[in] user_data The user data to be passed to the callback function
932 * @return 0 on success, otherwise a negative error value.
933 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
934 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter ( Especially, if the request is duplicated, this error returns. )
935 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
936 * @pre This function requires opened connection to content service by media_content_connect().
937 * @see media_content_connect()
939 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
943 * @brief Cancel to creates a thumbnail image for given the media.
945 * @param[in] media The handle to media info
946 * @return 0 on success, otherwise a negative error value.
947 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
948 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
949 * @pre This function requires opened connection to content service by media_content_connect().
950 * @see media_content_connect()
952 int media_info_cancel_thumbnail(media_info_h media);
961 #endif /* __cplusplus */
963 #endif /* __TIZEN_MEDIA_INFORMATION_H__ */