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_CONTENT_MEDIA_INFO_H__
19 #define __TIZEN_CONTENT_MEDIA_INFO_H__
21 #include <media_content_type.h>
27 #endif /* __cplusplus */
31 * @brief This file contains the media info function and related functions to proceed with it. \n
32 * You can use the functions to insert, delete, count and get list of content files from media database. \n
33 * You can get properties of content file such as size, mime_type, modified_time etc. And you can set properties such as favorite etc. \n
34 * And you can get bookmark, face, tag info related the content file.
39 * @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
44 * @brief Inserts the content file into the media database.
45 * @details In general, you can use this function to insert content files into the media database. \n
46 * You can use media_content_scan_file()/media_content_scan_folder() function instead of this function. \n
47 * If media information exists in the media database, this function returns information stored in the database.\n
48 * Since 5.5, if media information already exists in the media database,
49 * this function returns the updated latest information. (Media database will be updated if necessary).
54 * @privilege %http://tizen.org/privilege/content.write \n
55 * %http://tizen.org/privilege/mediastorage \n
56 * %http://tizen.org/privilege/externalstorage
58 * @remarks The @a info should be released using media_info_destroy(). \n
59 * You must add the privilege %http://tizen.org/privilege/content.write. You need to add more privileges depending on your choice of contents path. \n
60 * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
61 * If you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
62 * If you want to access storages of both types, you must add all privileges. \n
63 * Since 4.0, this function does not accept symbolic links. \n
64 * @remarks Since 4.0, this function is related to the following feature:\n
65 * %http://tizen.org/feature/content.scanning.others\n
66 * If this feature is not supported on the device, #MEDIA_CONTENT_TYPE_OTHERS type files are not scanned.
68 * @param[in] path The path of the content file to add
69 * @param[out] info The handle of the inserted content file
71 * @return @c 0 on success,
72 * otherwise a negative error value
74 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
75 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
76 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
77 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
78 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
79 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
80 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
81 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
82 * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED Not supported
84 * @pre This function requires opened connection to content service by media_content_connect().
86 * @see media_content_connect()
87 * @see media_content_scan_file()
88 * @see media_content_scan_folder()
90 int media_info_insert_to_db(const char *path, media_info_h *info);
93 * @brief Inserts content files into the media database, asynchronously.
94 * @details This function can insert multiple content files into the media database.
99 * @privilege %http://tizen.org/privilege/content.write \n
100 * %http://tizen.org/privilege/mediastorage \n
101 * %http://tizen.org/privilege/externalstorage
103 * @remarks You must add privilege %http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
104 * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
105 * Or if you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
106 * If you can access both storage, you must add all privilege. \n
107 * Since 4.0, This function does not allow a symbolic link. \n
108 * @remarks Since 4.0, this function is related to the following feature:\n
109 * %http://tizen.org/feature/content.scanning.others\n
110 * If this feature is not supported on the device, MEDIA_CONTENT_TYPE_OTHERS type file is not scanned.
112 * @param[in] path_array The path array of the content files to add
113 * @param[in] array_length The length of the array
114 * @param[in] callback The callback function to be invoked when media items inserted completely
115 * @param[in] user_data The user data to be passed to the callback function
117 * @return @c 0 on success,
118 * otherwise a negative error value
120 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
121 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
122 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
123 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
124 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
125 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
126 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
127 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
128 * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED Not supported
130 * @pre This function requires opened connection to content service by media_content_connect().
132 * @see media_content_connect()
133 * @see media_insert_completed_cb()
135 int media_info_insert_batch_to_db(const char **path_array, unsigned int array_length, media_insert_completed_cb callback, void *user_data);
138 * @brief Destroys media info.
139 * @details The function frees all resources related to the media info handle. This handle
140 * can no longer be used to perform any operations. New media info handle has to
141 * be created before the next usage.
145 * @param[in] media The handle to the media info
147 * @return @c 0 on success,
148 * otherwise a negative error value
150 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
151 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
153 * @pre Get copy of media_info handle by calling media_info_clone().
155 * @see media_info_clone()
157 int media_info_destroy(media_info_h media);
160 * @brief Clones the media info handle.
162 * @details This function copies the media info handle from a source to the destination.
163 * To use this handle outside of these foreach functions, use this function.
167 * @remarks The @a dst should be released using media_info_destroy().
169 * @param[out] dst The destination handle to the media info
170 * @param[in] src The source handle to the media info
172 * @return @c 0 on success,
173 * otherwise a negative error value
175 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
176 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
177 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
179 * @see media_info_destroy()
180 * @see media_album_foreach_media_from_db()
181 * @see media_playlist_foreach_media_from_db()
182 * @see media_group_foreach_media_from_db()
183 * @see media_tag_foreach_media_from_db()
184 * @see media_info_foreach_media_from_db()
185 * @see media_info_insert_to_db()
186 * @see media_folder_foreach_media_from_db()
188 int media_info_clone(media_info_h *dst, media_info_h src);
191 * @brief Gets the count of media info for the passed @a filter from the media database.
192 * @details If @c NULL is passed to the @a filter, then no filtering is applied.
197 * @param[in] filter The handle to the media filter
198 * @param[out] media_count The count of media
200 * @return @c 0 on success,
201 * otherwise a negative error value
203 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
204 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
205 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
206 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
208 * @pre This function requires opened connection to content service by media_content_connect().
210 * @see media_content_connect()
211 * @see media_filter_create()
213 int media_info_get_media_count_from_db(filter_h filter, int *media_count);
216 * @brief Iterates through media info from the media database.
217 * @details This function gets all media info handles meeting the given @a filter.
218 * The @a callback function will be invoked for every retrieved media info.
219 * If @c NULL is passed to the @a filter, then no filtering is applied.
223 * @remarks Do not call updating DB function like media_info_update_to_db() in your callback function,
224 * your callback function is invoked as inline function.
225 * So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB.
226 * We do not recommend you call updating DB function in callback of foreach function.
228 * @param[in] filter The handle to the media filter
229 * @param[in] callback The callback function to be invoked
230 * @param[in] user_data The user data to be passed to the callback function
232 * @return @c 0 on success,
233 * otherwise a negative error value
235 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
236 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
237 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
238 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
239 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
241 * @pre This function requires opened connection to content service by media_content_connect().
242 * @post This function invokes media_info_cb().
244 * @see media_content_connect()
245 * @see #media_info_cb
246 * @see media_filter_create()
248 int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, void *user_data);
251 * @deprecated Deprecated since 9.0.
252 * @brief Gets the count of media tags for the passed @a filter in the given @a media_id from the media database.
253 * @details If @c NULL is passed to the @a filter, then no filtering is applied.
257 * @param[in] media_id The media ID
258 * @param[in] filter The handle to the media filter
259 * @param[out] tag_count The count of the media tag
261 * @return @c 0 on success,
262 * otherwise a negative error value
264 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
265 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
266 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
267 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
269 * @pre This function requires opened connection to content service by media_content_connect().
271 * @see media_content_connect()
272 * @see media_filter_create()
274 int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count) TIZEN_DEPRECATED_API;
277 * @deprecated Deprecated since 9.0.
278 * @brief Iterates through the media tag in the given media info from the media database.
279 * @details This function gets all the media tags associated with the given @a media_id and calls @a callback for every retrieved media tag. \n
280 * If @c NULL is passed to the @a filter, then no filtering is applied.
284 * @param[in] media_id The media ID
285 * @param[in] filter The handle to the media filter
286 * @param[in] callback The callback function to be invoked
287 * @param[in] user_data The user data to be passed to the callback function
289 * @return @c 0 on success,
290 * otherwise a negative error value
292 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
293 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
294 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
295 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
296 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
298 * @pre This function requires opened connection to content service by media_content_connect().
299 * @post This function invokes media_tag_cb().
301 * @see media_content_connect()
303 * @see media_filter_create()
305 int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data) TIZEN_DEPRECATED_API;
308 * @brief Gets the number of bookmarks for the passed @a filter in the given media ID from the media database.
309 * @details If @c NULL is passed to the @a filter, then no filtering is applied.
313 * @param[in] media_id The media ID
314 * @param[in] filter The handle to the media filter
315 * @param[out] bookmark_count The count of the media bookmark
317 * @return @c 0 on success,
318 * otherwise a negative error value
320 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
321 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
322 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
323 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
325 * @pre This function requires opened connection to content service by media_content_connect().
327 * @see media_content_connect()
328 * @see media_filter_create()
330 int media_info_get_bookmark_count_from_db(const char *media_id, filter_h filter, int *bookmark_count);
333 * @brief Iterates through the media bookmark in the given media info from the media database.
334 * @details This function gets all media bookmarks associated with the given media and calls @a callback for every retrieved media bookmark.
335 * If @c NULL is passed to the @a filter, then no filtering is applied.
339 * @param[in] media_id The media ID
340 * @param[in] filter The handle to the media filter
341 * @param[in] callback The callback function to be invoked
342 * @param[in] user_data The user data to be passed to the callback function
344 * @return @c 0 on success,
345 * otherwise a negative error value
347 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
348 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
349 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
350 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
351 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
353 * @pre This function requires opened connection to content service by media_content_connect().
354 * @post This function invokes media_bookmark_cb().
356 * @see media_content_connect()
357 * @see media_bookmark_cb()
358 * @see media_filter_create()
360 int media_info_foreach_bookmark_from_db(const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
363 * @deprecated Deprecated since 8.0.
364 * @brief Gets the number of face for the passed @a media_id from the media database.
365 * @details If @c NULL is passed to the @a filter, then no filtering is applied.
369 * @param[in] media_id The media ID
370 * @param[in] filter The handle to the media filter
371 * @param[out] face_count The count of media face
373 * @return 0 on success, otherwise a negative error value.
375 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
376 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
377 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
379 * @pre This function requires opened connection to content service by media_content_connect().
380 * @see media_content_connect()
381 * @see media_filter_create()
384 int media_info_get_face_count_from_db(const char *media_id, filter_h filter, int *face_count) TIZEN_DEPRECATED_API;
387 * @deprecated Deprecated since 8.0.
388 * @brief Iterates through the media files with optional @a filter in the given @a media_id from the media database.
389 * @details This function gets all media face info associated with the given media id and
390 * meeting desired filter option and calls @a callback for
391 * every retrieved media face info. If NULL is passed to the @a filter, no filtering is applied.
395 * @param[in] media_id The media ID
396 * @param[in] filter The handle to the media filter
397 * @param[in] callback The callback function to invoke
398 * @param[in] user_data The user data to be passed to the callback function
400 * @return 0 on success, otherwise a negative error value.
402 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
403 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
404 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
406 * @pre This function requires opened connection to content service by media_content_connect().
407 * @see media_content_connect()
408 * @see media_filter_create()
411 int media_info_foreach_face_from_db(const char *media_id, filter_h filter, media_face_cb callback, void *user_data) TIZEN_DEPRECATED_API;
414 * @brief Gets the image metadata handle for a given media info.
415 * @details This function returns an image metadata handle retrieved from the media info.
419 * @remarks The @a image should be released using image_meta_destroy().
421 * @param[in] media The handle to the media info
422 * @param[out] image The handle to the image metadata
424 * @return @c 0 on success,
425 * otherwise a negative error value
427 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
428 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
429 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
431 * @see image_meta_destroy()
433 int media_info_get_image(media_info_h media, image_meta_h *image);
436 * @deprecated Deprecated since 9.0.
437 * @brief Gets a video metadata handle for a given media info.
438 * @details This function returns a video metadata handle retrieved from the media info handle.
442 * @remarks The @a video should be released using video_meta_destroy().
444 * @param[in] media The handle to the media info
445 * @param[out] video The handle to the video metadata
447 * @return @c 0 on success,
448 * otherwise a negative error value
450 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
451 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
452 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
454 * @see video_meta_destroy()
456 int media_info_get_video(media_info_h media, video_meta_h *video) TIZEN_DEPRECATED_API;
459 * @brief Gets an audio metadata handle for a given media info.
460 * @details This function returns an audio metadata handle retrieved from the media info handle.
464 * @remarks The @a audio should be released using audio_meta_destroy().
466 * @param[in] media The handle to the media info
467 * @param[out] audio The handle to the audio metadata
469 * @return @c 0 on success,
470 * otherwise a negative error value
472 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
473 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
474 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
476 * @see audio_meta_destroy()
478 int media_info_get_audio(media_info_h media, audio_meta_h *audio);
481 * @brief Gets a book metadata handle for a given media info.
482 * @details This function returns a book metadata handle retrieved from the media info handle. \n
483 * The title and description information of the book can be obtained from @a media.
487 * @remarks The @a book should be released using book_meta_destroy().
489 * @param[in] media The handle to the media info
490 * @param[out] book The handle to the book metadata
492 * @return @c 0 on success,
493 * otherwise a negative error value
495 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
496 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
498 * @see media_info_get_title()
499 * @see media_info_get_description()
500 * @see book_meta_destroy()
502 int media_info_get_book(media_info_h media, book_meta_h *book);
505 * @brief Gets the media ID.
507 * @remarks The @a media_id should be released using free().
509 * @param[in] media The handle to the media info
510 * @param[out] media_id The media ID
512 * @return @c 0 on success,
513 * otherwise a negative error value
515 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
516 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
517 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
519 int media_info_get_media_id(media_info_h media, char **media_id);
522 * @brief Gets the full path of the content file.
525 * @remarks The @a path should be released using free().
527 * @param[in] media The handle to the media info
528 * @param[out] path The full path of the content file
530 * @return @c 0 on success,
531 * otherwise a negative error value
533 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
534 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
535 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
538 int media_info_get_file_path(media_info_h media, char **path);
541 * @brief Gets the file name including the extension of the content file.
544 * @remarks The @a name should be released using free().
546 * @param[in] media The handle to the media info
547 * @param[out] name The file name including the extension of the content file
549 * @return @c 0 on success,
550 * otherwise a negative error value
552 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
553 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
554 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
556 int media_info_get_display_name(media_info_h media, char **name);
559 * @brief Gets the content type of the content file.
562 * @param[in] media The handle to the media info
563 * @param[out] type The content type of the content file (#media_content_type_e)
565 * @return @c 0 on success,
566 * otherwise a negative error value
568 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
569 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
571 * @see #media_content_type_e
573 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
576 * @brief Gets the MIME type of the content file.
579 * @remarks The @a mime_type should be released using free().
581 * @param[in] media The handle to the media info
582 * @param[out] mime_type The MIME type of the content file
584 * @return @c 0 on success,
585 * otherwise a negative error value
587 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
588 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
589 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
591 int media_info_get_mime_type(media_info_h media, char **mime_type);
594 * @brief Gets the content file size.
597 * @param[in] media The handle to the media info
598 * @param[out] size The content file size
600 * @return @c 0 on success,
601 * otherwise a negative error value
603 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
604 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
606 int media_info_get_size(media_info_h media, unsigned long long *size);
609 * @brief Gets the added time of the content file.
610 * @details The added time refers to the time that content file was first added to media database.
613 * @param[in] media The handle to the media info
614 * @param[out] added_time The added time to the media database
616 * @return @c 0 on success,
617 * otherwise a negative error value
619 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
620 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
622 int media_info_get_added_time(media_info_h media, time_t *added_time);
625 * @brief Gets the modified time of the content file.
626 * @details The modified time refers to the last modification time provided by the file system.
629 * @param[in] media The handle to the media info
630 * @param[out] time The last modification time of the content file
632 * @return @c 0 on success,
633 * otherwise a negative error value
635 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
636 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
638 int media_info_get_modified_time(media_info_h media, time_t *time);
641 * @deprecated Deprecated since 9.0.
642 * @brief Gets the timeline of content file.
643 * @details If the content file has the creation time information (like Content recorded date or Image creation date), that value is timeline. \n
644 * Otherwise, timeline value is the same as modified time.
647 * @param[in] media The handle to the media info
648 * @param[out] time The timeline of content file
650 * @return @c 0 on success,
651 * otherwise a negative error value
653 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
654 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
656 int media_info_get_timeline(media_info_h media, time_t *time) TIZEN_DEPRECATED_API;
659 * @brief Gets the thumbnail path of content file.
662 * @remarks The @a path should be released using free(). \n
663 * If the thumbnail extraction for the given media has not been requested yet, this function returns NULL. \n
664 * To create a thumbnail, you should use media_info_generate_thumbnail() function. \n
665 * This function returns an empty string if media_info_generate_thumbnail() has failed to create a thumbnail for the given media.
667 * @param[in] media The handle to the media info
668 * @param[out] path The thumbnail path
670 * @return @c 0 on success,
671 * otherwise a negative error value
673 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
674 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
675 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
677 int media_info_get_thumbnail_path(media_info_h media, char **path);
680 * @deprecated Deprecated since 9.0.
681 * @brief Gets the description of content file.
682 * @details If the value is an empty string, the method returns "Unknown". \n
683 * Since 3.0, if the media info has no description, the method returns empty string.
686 * @remarks The @a description should be released using free().
688 * @param[in] media The handle to the media info
689 * @param[out] description The description of the content file
691 * @return @c 0 on success,
692 * otherwise a negative error value
694 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
695 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
696 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
698 int media_info_get_description(media_info_h media, char **description) TIZEN_DEPRECATED_API;
701 * @deprecated Deprecated since 9.0.
702 * @brief Gets the longitude of content file.
705 * @param[in] media The handle to the media info
706 * @param[out] longitude The longitude of the content file
708 * @return @c 0 on success,
709 * otherwise a negative error value
711 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
712 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
714 int media_info_get_longitude(media_info_h media, double *longitude) TIZEN_DEPRECATED_API;
717 * @deprecated Deprecated since 9.0.
718 * @brief Gets the latitude of content file.
721 * @param[in] media The handle to the media info
722 * @param[out] latitude The latitude of the content file
724 * @return @c 0 on success,
725 * otherwise a negative error value
727 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
728 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
731 int media_info_get_latitude(media_info_h media, double* latitude) TIZEN_DEPRECATED_API;
734 * @deprecated Deprecated since 9.0.
735 * @brief Gets the altitude of content file.
738 * @param[in] media The handle to the media info
739 * @param[out] altitude The altitude of the content file
741 * @return @c 0 on success,
742 * otherwise a negative error value
744 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
745 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
747 int media_info_get_altitude(media_info_h media, double* altitude) TIZEN_DEPRECATED_API;
750 * @deprecated Deprecated since 9.0.
751 * @brief Gets the rating of content file.
754 * @param[in] media The handle to the media info
755 * @param[out] rating The rating of the content file
757 * @return @c 0 on success,
758 * otherwise a negative error value
760 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
761 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
763 int media_info_get_rating(media_info_h media, int *rating) TIZEN_DEPRECATED_API;
766 * @deprecated Deprecated since 9.0.
767 * @brief Gets the favorite status of content file which User set.
770 * @param[in] media The handle to the media info
771 * @param[out] favorite @c true if content file is set as favorite,
772 * otherwise @c false if content file is not set as favorite
774 * @return @c 0 on success,
775 * otherwise a negative error value
777 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
778 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
780 * @see media_info_set_favorite()
782 int media_info_get_favorite(media_info_h media, bool* favorite) TIZEN_DEPRECATED_API;
785 * @brief Gets the title of content file.
786 * @details If the content file does not have a title, this method returns the filename without the extension.
790 * @remarks The @a title should be released using free().
792 * @param[in] media The handle to the media info
793 * @param[out] title The title of the content file
795 * @return @c 0 on success,
796 * otherwise a negative error value
798 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
799 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
800 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
802 int media_info_get_title(media_info_h media, char **title);
805 * @deprecated Deprecated since 9.0.
806 * @brief Checks whether the media is protected via DRM.
809 * @param[in] media The handle to the media info
810 * @param[out] is_drm @c true if media is DRM media,
811 * otherwise @c false if media is not DRM media
813 * @return @c 0 on success,
814 * otherwise a negative error value
816 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
817 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
819 int media_info_is_drm(media_info_h media, bool *is_drm) TIZEN_DEPRECATED_API;
822 * @deprecated Deprecated since 9.0.
823 * @brief Checks whether the content file is 360 content.
826 * @param[in] media The handle to the media info
827 * @param[out] is_360 @c true if media is 360 content,
828 * otherwise @c false if media is not 360 content
830 * @return @c 0 on success,
831 * otherwise a negative error value
833 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
834 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
836 int media_info_is_360_content(media_info_h media, bool *is_360) TIZEN_DEPRECATED_API;
839 * @brief Gets the media info from the media database.
841 * @details This function creates a new media handle from the media database by the given @a media_id.
842 * Media info will be created and filled with information.
846 * @remarks The @a media should be released using media_info_destroy().
848 * @param[in] media_id The media ID
849 * @param[out] media The handle to the media info
851 * @return @c 0 on success,
852 * otherwise a negative error value
854 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
855 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
856 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
857 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
858 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
860 * @pre This function requires opened connection to content service by media_content_connect().
862 * @see media_content_connect()
863 * @see media_info_destroy()
865 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
868 * @brief Gets the media info from the media database using path.
870 * @details This function creates a new media handle filled with information from the database by the given @a media_path.
874 * @remarks The @a media should be released using media_info_destroy().\n
875 * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
876 * If you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
877 * If you want to access storages of both types, you must add all privileges. \n
879 * @param[in] media_path The media path
880 * @param[out] media The handle to the media info
882 * @return @c 0 on success,
883 * otherwise a negative error value
885 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
886 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
887 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
888 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
889 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
890 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
892 * @pre This function requires opened connection to content service by media_content_connect().
894 * @see media_content_connect()
895 * @see media_info_destroy()
897 int media_info_get_media_from_db_by_path(const char *media_path, media_info_h *media);
900 * @deprecated Deprecated since 9.0.
901 * @brief Sets the favorite of media info.
902 * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n
903 * So, If you use it in order parameter, you can sort the order of the time was a favorite. \n
904 * Or, if you use it in condition parameter, you can get the result of the favorite media.
908 * @param[in] media The handle to the media info
909 * @param[in] favorite Set @c true to set the media info as favorite,
910 * otherwise set @c false to not set the media info as favorite
912 * @return @c 0 on success,
913 * otherwise a negative error value
915 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
916 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
918 int media_info_set_favorite(media_info_h media, bool favorite) TIZEN_DEPRECATED_API;
921 * @deprecated Deprecated since 9.0.
922 * @brief Updates the media info to the media database.
924 * @details The function updates the given media info in the media database.
928 * @privilege %http://tizen.org/privilege/content.write
930 * @remarks The function should be called after any change in media, to be updated to the media
931 * database. For example, after using media_info_set_favorite()
932 * for setting the name of the media, the media_info_update_to_db() function should be called so as to update
933 * the given media info attributes in the media database.
935 * @param[in] media The handle to the media info
937 * @return @c 0 on success,
938 * otherwise a negative error value
940 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
941 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
942 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
943 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
944 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
945 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
946 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
947 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
949 * @pre This function requires opened connection to content service by media_content_connect().
951 * @see media_content_connect()
952 * @see media_info_set_favorite()
954 int media_info_update_to_db(media_info_h media) TIZEN_DEPRECATED_API;
957 * @brief Moves the media info to the given destination path in the media database.
958 * @details After moving or renaming a file in the filesystem, call this function to update the database. \n
959 * If the source path and destination path are the same, then this function does nothing.
960 * If you want to refresh media information, you should use media_content_scan_file() function.
965 * @privilege %http://tizen.org/privilege/content.write \n
966 * %http://tizen.org/privilege/mediastorage \n
967 * %http://tizen.org/privilege/externalstorage
969 * @remarks You must add privilege %http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
970 * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
971 * Or if you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
972 * If you can access both storage, you should add all privilege. \n
973 * Since 4.0, this function does not allow symbolic links. \n
974 * This function does not support USB storage before 5.0. Since 5.0, USB storage is supported. \n
975 * Since 5.0, the thumbnail is removed if it exists.
977 * @param[in] media The handle to the media info
978 * @param[in] dst_path The path of destination
980 * @return @c 0 on success,
981 * otherwise a negative error value
983 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
984 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
985 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
986 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
987 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
988 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
989 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
990 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
992 * @pre This function requires opened connection to content service by media_content_connect().
994 * @see media_content_connect()
995 * @see media_content_scan_folder()
996 * @see media_info_generate_thumbnail()
998 int media_info_move_to_db(media_info_h media, const char* dst_path);
1001 * @brief Generates a thumbnail file for the given media, synchronously.
1006 * @privilege %http://tizen.org/privilege/content.write
1008 * @remarks %http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
1009 * %http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
1010 * Items in external storage are not supported, with the exception of MMC.
1012 * @param[in] media The handle to the media info
1014 * @return @c 0 on success,
1015 * otherwise a negative error value
1017 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1018 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1019 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1020 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1021 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1022 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1023 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1024 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1026 * @pre This function requires opened connection to content service by media_content_connect().
1028 * @see media_content_connect()
1029 * @see media_info_get_thumbnail_path()
1031 int media_info_generate_thumbnail(media_info_h media);
1034 * @deprecated Deprecated since 8.0.
1035 * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1036 * @brief Starts face detection for the given image, asynchronously.
1037 * @details This function detects faces for given image item and calls the given callback function when the detection is completed. \n
1038 * The given callback function is called when the detection is completed. \n
1039 * To obtain the detected faces, call the media_info_foreach_face_from_db() function. \n
1040 * Supported image formats are jpg, png, and bmp.
1045 * @privilege %http://tizen.org/privilege/content.write \n
1046 * %http://tizen.org/privilege/mediastorage \n
1047 * %http://tizen.org/privilege/externalstorage
1049 * @remarks If you want to destroy the media handle before the callback invoked, you must cancel the face detection request using media_info_cancel_face_detection(). \n
1050 * If the face detection fails, the @a face_count argument in media_face_detection_completed_cb() will be set to 0. \n
1051 * The face detection of media items in external storage except MMC is not supported. \n
1052 * Since 5.5, if the format of media data is unsupported, this function returns an error and the callback will not be invoked.
1054 * @param[in] media The handle to the media info
1055 * @param[in] callback The callback function to be invoked when detection is completed
1056 * @param[in] user_data The user data to be passed to the callback function
1058 * @return @c 0 on success,
1059 * otherwise a negative error value
1061 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1062 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1063 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1064 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1065 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1066 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1067 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1068 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1069 * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED Not supported
1071 * @pre This function requires opened connection to content service by media_content_connect().
1073 * @see media_content_connect()
1074 * @see media_info_cancel_face_detection()
1076 int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data) TIZEN_DEPRECATED_API;
1079 * @deprecated Deprecated since 8.0.
1080 * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1081 * @brief Cancels face detection of image for the given media.
1082 * @details This function cancels face detection for given media item. \n
1083 * If you cancel face detection request before callback is invoked, the callback registered by media_info_start_face_detection() function will not be invoked.
1088 * @privilege %http://tizen.org/privilege/content.write
1090 * @remarks If face detection is already done when you request the cancellation, this function returns #MEDIA_CONTENT_ERROR_INVALID_OPERATION
1092 * @param[in] media The handle to the media info
1094 * @return @c 0 on success,
1095 * otherwise a negative error value
1097 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1098 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1099 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1100 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1102 * @pre This function requires opened connection to content service by media_content_connect().
1104 * @see media_content_connect()
1105 * @see media_info_start_face_detection()
1107 int media_info_cancel_face_detection(media_info_h media) TIZEN_DEPRECATED_API;
1115 #endif /* __cplusplus */
1117 #endif /* __TIZEN_CONTENT_MEDIA_INFO_H__ */