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 * @brief Gets a video metadata handle for a given media info.
437 * @details This function returns a video metadata handle retrieved from the media info handle.
441 * @remarks The @a video should be released using video_meta_destroy().
443 * @param[in] media The handle to the media info
444 * @param[out] video The handle to the video metadata
446 * @return @c 0 on success,
447 * otherwise a negative error value
449 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
450 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
451 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
453 * @see video_meta_destroy()
455 int media_info_get_video(media_info_h media, video_meta_h *video);
458 * @brief Gets an audio metadata handle for a given media info.
459 * @details This function returns an audio metadata handle retrieved from the media info handle.
463 * @remarks The @a audio should be released using audio_meta_destroy().
465 * @param[in] media The handle to the media info
466 * @param[out] audio The handle to the audio metadata
468 * @return @c 0 on success,
469 * otherwise a negative error value
471 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
472 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
473 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
475 * @see audio_meta_destroy()
477 int media_info_get_audio(media_info_h media, audio_meta_h *audio);
480 * @brief Gets a book metadata handle for a given media info.
481 * @details This function returns a book metadata handle retrieved from the media info handle. \n
482 * The title and description information of the book can be obtained from @a media.
486 * @remarks The @a book should be released using book_meta_destroy().
488 * @param[in] media The handle to the media info
489 * @param[out] book The handle to the book metadata
491 * @return @c 0 on success,
492 * otherwise a negative error value
494 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
495 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
497 * @see media_info_get_title()
498 * @see media_info_get_description()
499 * @see book_meta_destroy()
501 int media_info_get_book(media_info_h media, book_meta_h *book);
504 * @brief Gets the media ID.
506 * @remarks The @a media_id should be released using free().
508 * @param[in] media The handle to the media info
509 * @param[out] media_id The media ID
511 * @return @c 0 on success,
512 * otherwise a negative error value
514 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
515 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
516 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
518 int media_info_get_media_id(media_info_h media, char **media_id);
521 * @brief Gets the full path of the content file.
524 * @remarks The @a path should be released using free().
526 * @param[in] media The handle to the media info
527 * @param[out] path The full path of the content file
529 * @return @c 0 on success,
530 * otherwise a negative error value
532 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
533 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
534 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
537 int media_info_get_file_path(media_info_h media, char **path);
540 * @brief Gets the file name including the extension of the content file.
543 * @remarks The @a name should be released using free().
545 * @param[in] media The handle to the media info
546 * @param[out] name The file name including the extension of the content file
548 * @return @c 0 on success,
549 * otherwise a negative error value
551 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
552 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
553 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
555 int media_info_get_display_name(media_info_h media, char **name);
558 * @brief Gets the content type of the content file.
561 * @param[in] media The handle to the media info
562 * @param[out] type The content type of the content file (#media_content_type_e)
564 * @return @c 0 on success,
565 * otherwise a negative error value
567 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
568 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
570 * @see #media_content_type_e
572 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
575 * @brief Gets the MIME type of the content file.
578 * @remarks The @a mime_type should be released using free().
580 * @param[in] media The handle to the media info
581 * @param[out] mime_type The MIME type of the content file
583 * @return @c 0 on success,
584 * otherwise a negative error value
586 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
587 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
588 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
590 int media_info_get_mime_type(media_info_h media, char **mime_type);
593 * @brief Gets the content file size.
596 * @param[in] media The handle to the media info
597 * @param[out] size The content file size
599 * @return @c 0 on success,
600 * otherwise a negative error value
602 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
603 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
605 int media_info_get_size(media_info_h media, unsigned long long *size);
608 * @brief Gets the added time of the content file.
609 * @details The added time refers to the time that content file was first added to media database.
612 * @param[in] media The handle to the media info
613 * @param[out] added_time The added time to the media database
615 * @return @c 0 on success,
616 * otherwise a negative error value
618 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
619 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
621 int media_info_get_added_time(media_info_h media, time_t *added_time);
624 * @brief Gets the modified time of the content file.
625 * @details The modified time refers to the last modification time provided by the file system.
628 * @param[in] media The handle to the media info
629 * @param[out] time The last modification time of the content file
631 * @return @c 0 on success,
632 * otherwise a negative error value
634 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
635 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
637 int media_info_get_modified_time(media_info_h media, time_t *time);
640 * @deprecated Deprecated since 9.0.
641 * @brief Gets the timeline of content file.
642 * @details If the content file has the creation time information (like Content recorded date or Image creation date), that value is timeline. \n
643 * Otherwise, timeline value is the same as modified time.
646 * @param[in] media The handle to the media info
647 * @param[out] time The timeline of content file
649 * @return @c 0 on success,
650 * otherwise a negative error value
652 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
653 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
655 int media_info_get_timeline(media_info_h media, time_t *time) TIZEN_DEPRECATED_API;
658 * @brief Gets the thumbnail path of content file.
661 * @remarks The @a path should be released using free(). \n
662 * If the thumbnail extraction for the given media has not been requested yet, this function returns NULL. \n
663 * To create a thumbnail, you should use media_info_generate_thumbnail() function. \n
664 * This function returns an empty string if media_info_generate_thumbnail() has failed to create a thumbnail for the given media.
666 * @param[in] media The handle to the media info
667 * @param[out] path The thumbnail path
669 * @return @c 0 on success,
670 * otherwise a negative error value
672 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
673 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
674 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
676 int media_info_get_thumbnail_path(media_info_h media, char **path);
679 * @deprecated Deprecated since 9.0.
680 * @brief Gets the description of content file.
681 * @details If the value is an empty string, the method returns "Unknown". \n
682 * Since 3.0, if the media info has no description, the method returns empty string.
685 * @remarks The @a description should be released using free().
687 * @param[in] media The handle to the media info
688 * @param[out] description The description of the content file
690 * @return @c 0 on success,
691 * otherwise a negative error value
693 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
694 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
695 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
697 int media_info_get_description(media_info_h media, char **description) TIZEN_DEPRECATED_API;
700 * @deprecated Deprecated since 9.0.
701 * @brief Gets the longitude of content file.
704 * @param[in] media The handle to the media info
705 * @param[out] longitude The longitude of the content file
707 * @return @c 0 on success,
708 * otherwise a negative error value
710 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
711 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
713 int media_info_get_longitude(media_info_h media, double *longitude) TIZEN_DEPRECATED_API;
716 * @deprecated Deprecated since 9.0.
717 * @brief Gets the latitude of content file.
720 * @param[in] media The handle to the media info
721 * @param[out] latitude The latitude of the content file
723 * @return @c 0 on success,
724 * otherwise a negative error value
726 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
727 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
730 int media_info_get_latitude(media_info_h media, double* latitude) TIZEN_DEPRECATED_API;
733 * @deprecated Deprecated since 9.0.
734 * @brief Gets the altitude of content file.
737 * @param[in] media The handle to the media info
738 * @param[out] altitude The altitude of the content file
740 * @return @c 0 on success,
741 * otherwise a negative error value
743 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
744 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
746 int media_info_get_altitude(media_info_h media, double* altitude) TIZEN_DEPRECATED_API;
749 * @deprecated Deprecated since 9.0.
750 * @brief Gets the rating of content file.
753 * @param[in] media The handle to the media info
754 * @param[out] rating The rating of the content file
756 * @return @c 0 on success,
757 * otherwise a negative error value
759 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
760 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
762 int media_info_get_rating(media_info_h media, int *rating) TIZEN_DEPRECATED_API;
765 * @deprecated Deprecated since 9.0.
766 * @brief Gets the favorite status of content file which User set.
769 * @param[in] media The handle to the media info
770 * @param[out] favorite @c true if content file is set as favorite,
771 * otherwise @c false if content file is not set as favorite
773 * @return @c 0 on success,
774 * otherwise a negative error value
776 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
777 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
779 * @see media_info_set_favorite()
781 int media_info_get_favorite(media_info_h media, bool* favorite) TIZEN_DEPRECATED_API;
784 * @brief Gets the title of content file.
785 * @details If the content file does not have a title, this method returns the filename without the extension.
789 * @remarks The @a title should be released using free().
791 * @param[in] media The handle to the media info
792 * @param[out] title The title of the content file
794 * @return @c 0 on success,
795 * otherwise a negative error value
797 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
798 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
799 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
801 int media_info_get_title(media_info_h media, char **title);
804 * @deprecated Deprecated since 9.0.
805 * @brief Checks whether the media is protected via DRM.
808 * @param[in] media The handle to the media info
809 * @param[out] is_drm @c true if media is DRM media,
810 * otherwise @c false if media is not DRM media
812 * @return @c 0 on success,
813 * otherwise a negative error value
815 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
816 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
818 int media_info_is_drm(media_info_h media, bool *is_drm) TIZEN_DEPRECATED_API;
821 * @deprecated Deprecated since 9.0.
822 * @brief Checks whether the content file is 360 content.
825 * @param[in] media The handle to the media info
826 * @param[out] is_360 @c true if media is 360 content,
827 * otherwise @c false if media is not 360 content
829 * @return @c 0 on success,
830 * otherwise a negative error value
832 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
833 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
835 int media_info_is_360_content(media_info_h media, bool *is_360) TIZEN_DEPRECATED_API;
838 * @brief Gets the media info from the media database.
840 * @details This function creates a new media handle from the media database by the given @a media_id.
841 * Media info will be created and filled with information.
845 * @remarks The @a media should be released using media_info_destroy().
847 * @param[in] media_id The media ID
848 * @param[out] media The handle to the media info
850 * @return @c 0 on success,
851 * otherwise a negative error value
853 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
854 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
855 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
856 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
857 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
859 * @pre This function requires opened connection to content service by media_content_connect().
861 * @see media_content_connect()
862 * @see media_info_destroy()
864 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
867 * @brief Gets the media info from the media database using path.
869 * @details This function creates a new media handle filled with information from the database by the given @a media_path.
873 * @remarks The @a media should be released using media_info_destroy().\n
874 * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
875 * If you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
876 * If you want to access storages of both types, you must add all privileges. \n
878 * @param[in] media_path The media path
879 * @param[out] media The handle to the media info
881 * @return @c 0 on success,
882 * otherwise a negative error value
884 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
885 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
886 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
887 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
888 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
889 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
891 * @pre This function requires opened connection to content service by media_content_connect().
893 * @see media_content_connect()
894 * @see media_info_destroy()
896 int media_info_get_media_from_db_by_path(const char *media_path, media_info_h *media);
899 * @deprecated Deprecated since 9.0.
900 * @brief Sets the favorite of media info.
901 * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n
902 * So, If you use it in order parameter, you can sort the order of the time was a favorite. \n
903 * Or, if you use it in condition parameter, you can get the result of the favorite media.
907 * @param[in] media The handle to the media info
908 * @param[in] favorite Set @c true to set the media info as favorite,
909 * otherwise set @c false to not set the media info as favorite
911 * @return @c 0 on success,
912 * otherwise a negative error value
914 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
915 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
917 int media_info_set_favorite(media_info_h media, bool favorite) TIZEN_DEPRECATED_API;
920 * @deprecated Deprecated since 9.0.
921 * @brief Updates the media info to the media database.
923 * @details The function updates the given media info in the media database.
927 * @privilege %http://tizen.org/privilege/content.write
929 * @remarks The function should be called after any change in media, to be updated to the media
930 * database. For example, after using media_info_set_favorite()
931 * for setting the name of the media, the media_info_update_to_db() function should be called so as to update
932 * the given media info attributes in the media database.
934 * @param[in] media The handle to the media info
936 * @return @c 0 on success,
937 * otherwise a negative error value
939 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
940 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
941 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
942 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
943 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
944 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
945 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
946 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
948 * @pre This function requires opened connection to content service by media_content_connect().
950 * @see media_content_connect()
951 * @see media_info_set_favorite()
953 int media_info_update_to_db(media_info_h media) TIZEN_DEPRECATED_API;
956 * @brief Moves the media info to the given destination path in the media database.
957 * @details After moving or renaming a file in the filesystem, call this function to update the database. \n
958 * If the source path and destination path are the same, then this function does nothing.
959 * If you want to refresh media information, you should use media_content_scan_file() function.
964 * @privilege %http://tizen.org/privilege/content.write \n
965 * %http://tizen.org/privilege/mediastorage \n
966 * %http://tizen.org/privilege/externalstorage
968 * @remarks You must add privilege %http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
969 * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
970 * Or if you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
971 * If you can access both storage, you should add all privilege. \n
972 * Since 4.0, this function does not allow symbolic links. \n
973 * This function does not support USB storage before 5.0. Since 5.0, USB storage is supported. \n
974 * Since 5.0, the thumbnail is removed if it exists.
976 * @param[in] media The handle to the media info
977 * @param[in] dst_path The path of destination
979 * @return @c 0 on success,
980 * otherwise a negative error value
982 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
983 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
984 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
985 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
986 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
987 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
988 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
989 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
991 * @pre This function requires opened connection to content service by media_content_connect().
993 * @see media_content_connect()
994 * @see media_content_scan_folder()
995 * @see media_info_generate_thumbnail()
997 int media_info_move_to_db(media_info_h media, const char* dst_path);
1000 * @brief Generates a thumbnail file for the given media, synchronously.
1005 * @privilege %http://tizen.org/privilege/content.write
1007 * @remarks %http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
1008 * %http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
1009 * Items in external storage are not supported, with the exception of MMC.
1011 * @param[in] media The handle to the media info
1013 * @return @c 0 on success,
1014 * otherwise a negative error value
1016 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1017 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1018 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1019 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1020 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1021 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1022 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1023 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1025 * @pre This function requires opened connection to content service by media_content_connect().
1027 * @see media_content_connect()
1028 * @see media_info_get_thumbnail_path()
1030 int media_info_generate_thumbnail(media_info_h media);
1033 * @deprecated Deprecated since 8.0.
1034 * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1035 * @brief Starts face detection for the given image, asynchronously.
1036 * @details This function detects faces for given image item and calls the given callback function when the detection is completed. \n
1037 * The given callback function is called when the detection is completed. \n
1038 * To obtain the detected faces, call the media_info_foreach_face_from_db() function. \n
1039 * Supported image formats are jpg, png, and bmp.
1044 * @privilege %http://tizen.org/privilege/content.write \n
1045 * %http://tizen.org/privilege/mediastorage \n
1046 * %http://tizen.org/privilege/externalstorage
1048 * @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
1049 * If the face detection fails, the @a face_count argument in media_face_detection_completed_cb() will be set to 0. \n
1050 * The face detection of media items in external storage except MMC is not supported. \n
1051 * Since 5.5, if the format of media data is unsupported, this function returns an error and the callback will not be invoked.
1053 * @param[in] media The handle to the media info
1054 * @param[in] callback The callback function to be invoked when detection is completed
1055 * @param[in] user_data The user data to be passed to the callback function
1057 * @return @c 0 on success,
1058 * otherwise a negative error value
1060 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1061 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1062 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1063 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1064 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1065 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1066 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1067 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1068 * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED Not supported
1070 * @pre This function requires opened connection to content service by media_content_connect().
1072 * @see media_content_connect()
1073 * @see media_info_cancel_face_detection()
1075 int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data) TIZEN_DEPRECATED_API;
1078 * @deprecated Deprecated since 8.0.
1079 * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1080 * @brief Cancels face detection of image for the given media.
1081 * @details This function cancels face detection for given media item. \n
1082 * If you cancel face detection request before callback is invoked, the callback registered by media_info_start_face_detection() function will not be invoked.
1087 * @privilege %http://tizen.org/privilege/content.write
1089 * @remarks If face detection is already done when you request the cancellation, this function returns #MEDIA_CONTENT_ERROR_INVALID_OPERATION
1091 * @param[in] media The handle to 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_INVALID_PARAMETER Invalid parameter
1098 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1099 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1101 * @pre This function requires opened connection to content service by media_content_connect().
1103 * @see media_content_connect()
1104 * @see media_info_start_face_detection()
1106 int media_info_cancel_face_detection(media_info_h media) TIZEN_DEPRECATED_API;
1114 #endif /* __cplusplus */
1116 #endif /* __TIZEN_CONTENT_MEDIA_INFO_H__ */