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.
38 * @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
43 * @brief Inserts the content file into the media database.
44 * @details In general, you can use this function to insert content files into the media database. \n
45 * You can use media_content_scan_file()/media_content_scan_folder() function instead of this function. \n
46 * If media information exists in the media database, this function returns information stored in the database.\n
47 * Since 5.5, if media information already exists in the media database,
48 * this function returns the updated latest information. (Media database will be updated if necessary).
53 * @privilege %http://tizen.org/privilege/content.write \n
54 * %http://tizen.org/privilege/mediastorage \n
55 * %http://tizen.org/privilege/externalstorage
57 * @remarks The @a info should be released using media_info_destroy(). \n
58 * 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
59 * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
60 * If you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
61 * If you want to access storages of both types, you must add all privileges. \n
62 * Since 4.0, this function does not accept symbolic links. \n
63 * @remarks Since 4.0, this function is related to the following feature:\n
64 * %http://tizen.org/feature/content.scanning.others\n
65 * If this feature is not supported on the device, #MEDIA_CONTENT_TYPE_OTHERS type files are not scanned.
67 * @param[in] path The path of the content file to add
68 * @param[out] info The handle of the inserted content file
70 * @return @c 0 on success,
71 * otherwise a negative error value
73 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
74 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
75 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
76 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
77 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
78 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
79 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
80 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
81 * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED Not supported
83 * @pre This function requires opened connection to content service by media_content_connect().
85 * @see media_content_connect()
86 * @see media_content_scan_file()
87 * @see media_content_scan_folder()
89 int media_info_insert_to_db(const char *path, media_info_h *info);
92 * @brief Inserts content files into the media database, asynchronously.
93 * @details This function can insert multiple content files into the media database.
98 * @privilege %http://tizen.org/privilege/content.write \n
99 * %http://tizen.org/privilege/mediastorage \n
100 * %http://tizen.org/privilege/externalstorage
102 * @remarks You must add privilege %http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
103 * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
104 * Or if you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
105 * If you can access both storage, you must add all privilege. \n
106 * Since 4.0, This function does not allow a symbolic link. \n
107 * @remarks Since 4.0, this function is related to the following feature:\n
108 * %http://tizen.org/feature/content.scanning.others\n
109 * If this feature is not supported on the device, MEDIA_CONTENT_TYPE_OTHERS type file is not scanned.
111 * @param[in] path_array The path array of the content files to add
112 * @param[in] array_length The length of the array
113 * @param[in] callback The callback function to be invoked when media items inserted completely
114 * @param[in] user_data The user data to be passed to the callback function
116 * @return @c 0 on success,
117 * otherwise a negative error value
119 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
120 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
121 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
122 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
123 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
124 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
125 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
126 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
127 * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED Not supported
129 * @pre This function requires opened connection to content service by media_content_connect().
131 * @see media_content_connect()
132 * @see media_insert_completed_cb()
134 int media_info_insert_batch_to_db(const char **path_array, unsigned int array_length, media_insert_completed_cb callback, void *user_data);
137 * @brief Destroys media info.
138 * @details The function frees all resources related to the media info handle. This handle
139 * can no longer be used to perform any operations. New media info handle has to
140 * be created before the next usage.
144 * @param[in] media The handle to the media info
146 * @return @c 0 on success,
147 * otherwise a negative error value
149 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
150 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
152 * @pre Get copy of media_info handle by calling media_info_clone().
154 * @see media_info_clone()
156 int media_info_destroy(media_info_h media);
159 * @brief Clones the media info handle.
161 * @details This function copies the media info handle from a source to the destination.
162 * To use this handle outside of these foreach functions, use this function.
166 * @remarks The @a dst should be released using media_info_destroy().
168 * @param[out] dst The destination handle to the media info
169 * @param[in] src The source handle to the media info
171 * @return @c 0 on success,
172 * otherwise a negative error value
174 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
175 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
176 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
178 * @see media_info_destroy()
179 * @see media_album_foreach_media_from_db()
180 * @see media_playlist_foreach_media_from_db()
181 * @see media_group_foreach_media_from_db()
182 * @see media_tag_foreach_media_from_db()
183 * @see media_info_foreach_media_from_db()
184 * @see media_info_insert_to_db()
185 * @see media_folder_foreach_media_from_db()
187 int media_info_clone(media_info_h *dst, media_info_h src);
190 * @brief Gets the count of media info for the passed @a filter from the media database.
191 * @details If @c NULL is passed to the @a filter, then no filtering is applied.
196 * @param[in] filter The handle to the media filter
197 * @param[out] media_count The count of media
199 * @return @c 0 on success,
200 * otherwise a negative error value
202 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
203 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
204 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
205 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
207 * @pre This function requires opened connection to content service by media_content_connect().
209 * @see media_content_connect()
210 * @see media_filter_create()
212 int media_info_get_media_count_from_db(filter_h filter, int *media_count);
215 * @brief Iterates through media info from the media database.
216 * @details This function gets all media info handles meeting the given @a filter.
217 * The @a callback function will be invoked for every retrieved media info.
218 * If @c NULL is passed to the @a filter, then no filtering is applied.
222 * @remarks Do not call updating DB function like media_info_update_to_db() in your callback function,
223 * your callback function is invoked as inline function.
224 * So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB.
225 * We do not recommend you call updating DB function in callback of foreach function.
227 * @param[in] filter The handle to the media filter
228 * @param[in] callback The callback function to be invoked
229 * @param[in] user_data The user data to be passed to the callback function
231 * @return @c 0 on success,
232 * otherwise a negative error value
234 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
235 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
236 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
237 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
238 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
240 * @pre This function requires opened connection to content service by media_content_connect().
241 * @post This function invokes media_info_cb().
243 * @see media_content_connect()
244 * @see #media_info_cb
245 * @see media_filter_create()
247 int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, void *user_data);
250 * @deprecated Deprecated since 9.0.
251 * @brief Gets the count of media tags for the passed @a filter in the given @a media_id from the media database.
252 * @details If @c NULL is passed to the @a filter, then no filtering is applied.
256 * @param[in] media_id The media ID
257 * @param[in] filter The handle to the media filter
258 * @param[out] tag_count The count of the media tag
260 * @return @c 0 on success,
261 * otherwise a negative error value
263 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
264 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
265 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
266 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
268 * @pre This function requires opened connection to content service by media_content_connect().
270 * @see media_content_connect()
271 * @see media_filter_create()
273 int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count) TIZEN_DEPRECATED_API;
276 * @deprecated Deprecated since 9.0.
277 * @brief Iterates through the media tag in the given media info from the media database.
278 * @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
279 * If @c NULL is passed to the @a filter, then no filtering is applied.
283 * @param[in] media_id The media ID
284 * @param[in] filter The handle to the media filter
285 * @param[in] callback The callback function to be invoked
286 * @param[in] user_data The user data to be passed to the callback function
288 * @return @c 0 on success,
289 * otherwise a negative error value
291 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
292 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
293 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
294 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
295 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
297 * @pre This function requires opened connection to content service by media_content_connect().
298 * @post This function invokes media_tag_cb().
300 * @see media_content_connect()
302 * @see media_filter_create()
304 int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data) TIZEN_DEPRECATED_API;
307 * @deprecated Deprecated since 9.0.
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) TIZEN_DEPRECATED_API;
333 * @deprecated Deprecated since 9.0.
334 * @brief Iterates through the media bookmark in the given media info from the media database.
335 * @details This function gets all media bookmarks associated with the given media and calls @a callback for every retrieved media bookmark.
336 * If @c NULL is passed to the @a filter, then no filtering is applied.
340 * @param[in] media_id The media ID
341 * @param[in] filter The handle to the media filter
342 * @param[in] callback The callback function to be invoked
343 * @param[in] user_data The user data to be passed to the callback function
345 * @return @c 0 on success,
346 * otherwise a negative error value
348 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
349 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
350 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
351 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
352 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
354 * @pre This function requires opened connection to content service by media_content_connect().
355 * @post This function invokes media_bookmark_cb().
357 * @see media_content_connect()
358 * @see media_bookmark_cb()
359 * @see media_filter_create()
361 int media_info_foreach_bookmark_from_db(const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data) TIZEN_DEPRECATED_API;
364 * @deprecated Deprecated since 8.0.
365 * @brief Gets the number of face for the passed @a media_id from the media database.
366 * @details If @c NULL is passed to the @a filter, then no filtering is applied.
370 * @param[in] media_id The media ID
371 * @param[in] filter The handle to the media filter
372 * @param[out] face_count The count of media face
374 * @return 0 on success, otherwise a negative error value.
376 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
377 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
378 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
380 * @pre This function requires opened connection to content service by media_content_connect().
381 * @see media_content_connect()
382 * @see media_filter_create()
385 int media_info_get_face_count_from_db(const char *media_id, filter_h filter, int *face_count) TIZEN_DEPRECATED_API;
388 * @deprecated Deprecated since 8.0.
389 * @brief Iterates through the media files with optional @a filter in the given @a media_id from the media database.
390 * @details This function gets all media face info associated with the given media id and
391 * meeting desired filter option and calls @a callback for
392 * every retrieved media face info. If NULL is passed to the @a filter, no filtering is applied.
396 * @param[in] media_id The media ID
397 * @param[in] filter The handle to the media filter
398 * @param[in] callback The callback function to invoke
399 * @param[in] user_data The user data to be passed to the callback function
401 * @return 0 on success, otherwise a negative error value.
403 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
404 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
405 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
407 * @pre This function requires opened connection to content service by media_content_connect().
408 * @see media_content_connect()
409 * @see media_filter_create()
412 int media_info_foreach_face_from_db(const char *media_id, filter_h filter, media_face_cb callback, void *user_data) TIZEN_DEPRECATED_API;
415 * @brief Gets the image metadata handle for a given media info.
416 * @details This function returns an image metadata handle retrieved from the media info.
420 * @remarks The @a image should be released using image_meta_destroy().
422 * @param[in] media The handle to the media info
423 * @param[out] image The handle to the image metadata
425 * @return @c 0 on success,
426 * otherwise a negative error value
428 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
429 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
430 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
432 * @see image_meta_destroy()
434 int media_info_get_image(media_info_h media, image_meta_h *image);
437 * @deprecated Deprecated since 9.0.
438 * @brief Gets a video metadata handle for a given media info.
439 * @details This function returns a video metadata handle retrieved from the media info handle.
443 * @remarks The @a video should be released using video_meta_destroy().
445 * @param[in] media The handle to the media info
446 * @param[out] video The handle to the video metadata
448 * @return @c 0 on success,
449 * otherwise a negative error value
451 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
452 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
453 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
455 * @see video_meta_destroy()
457 int media_info_get_video(media_info_h media, video_meta_h *video) TIZEN_DEPRECATED_API;
460 * @brief Gets an audio metadata handle for a given media info.
461 * @details This function returns an audio metadata handle retrieved from the media info handle.
465 * @remarks The @a audio should be released using audio_meta_destroy().
467 * @param[in] media The handle to the media info
468 * @param[out] audio The handle to the audio metadata
470 * @return @c 0 on success,
471 * otherwise a negative error value
473 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
474 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
475 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
477 * @see audio_meta_destroy()
479 int media_info_get_audio(media_info_h media, audio_meta_h *audio);
482 * @brief Gets a book metadata handle for a given media info.
483 * @details This function returns a book metadata handle retrieved from the media info handle. \n
484 * The title and description information of the book can be obtained from @a media.
488 * @remarks The @a book should be released using book_meta_destroy().
490 * @param[in] media The handle to the media info
491 * @param[out] book The handle to the book metadata
493 * @return @c 0 on success,
494 * otherwise a negative error value
496 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
497 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
499 * @see media_info_get_title()
500 * @see media_info_get_description()
501 * @see book_meta_destroy()
503 int media_info_get_book(media_info_h media, book_meta_h *book);
506 * @brief Gets the media ID.
508 * @remarks The @a media_id should be released using free().
510 * @param[in] media The handle to the media info
511 * @param[out] media_id The media ID
513 * @return @c 0 on success,
514 * 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
520 int media_info_get_media_id(media_info_h media, char **media_id);
523 * @brief Gets the full path of the content file.
526 * @remarks The @a path should be released using free().
528 * @param[in] media The handle to the media info
529 * @param[out] path The full path of the content file
531 * @return @c 0 on success,
532 * otherwise a negative error value
534 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
535 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
536 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
539 int media_info_get_file_path(media_info_h media, char **path);
542 * @brief Gets the file name including the extension of the content file.
545 * @remarks The @a name should be released using free().
547 * @param[in] media The handle to the media info
548 * @param[out] name The file name including the extension of the content file
550 * @return @c 0 on success,
551 * otherwise a negative error value
553 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
554 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
555 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
557 int media_info_get_display_name(media_info_h media, char **name);
560 * @brief Gets the content type of the content file.
563 * @param[in] media The handle to the media info
564 * @param[out] type The content type of the content file (#media_content_type_e)
566 * @return @c 0 on success,
567 * otherwise a negative error value
569 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
570 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
572 * @see #media_content_type_e
574 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
577 * @brief Gets the MIME type of the content file.
580 * @remarks The @a mime_type should be released using free().
582 * @param[in] media The handle to the media info
583 * @param[out] mime_type The MIME type of the content file
585 * @return @c 0 on success,
586 * otherwise a negative error value
588 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
589 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
590 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
592 int media_info_get_mime_type(media_info_h media, char **mime_type);
595 * @brief Gets the content file size.
598 * @param[in] media The handle to the media info
599 * @param[out] size The content file size
601 * @return @c 0 on success,
602 * otherwise a negative error value
604 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
605 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
607 int media_info_get_size(media_info_h media, unsigned long long *size);
610 * @brief Gets the added time of the content file.
611 * @details The added time refers to the time that content file was first added to media database.
614 * @param[in] media The handle to the media info
615 * @param[out] added_time The added time to the media database
617 * @return @c 0 on success,
618 * otherwise a negative error value
620 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
621 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
623 int media_info_get_added_time(media_info_h media, time_t *added_time);
626 * @brief Gets the modified time of the content file.
627 * @details The modified time refers to the last modification time provided by the file system.
630 * @param[in] media The handle to the media info
631 * @param[out] time The last modification time of the content file
633 * @return @c 0 on success,
634 * otherwise a negative error value
636 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
637 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
639 int media_info_get_modified_time(media_info_h media, time_t *time);
642 * @deprecated Deprecated since 9.0.
643 * @brief Gets the timeline of content file.
644 * @details If the content file has the creation time information (like Content recorded date or Image creation date), that value is timeline. \n
645 * Otherwise, timeline value is the same as modified time.
648 * @param[in] media The handle to the media info
649 * @param[out] time The timeline of content file
651 * @return @c 0 on success,
652 * otherwise a negative error value
654 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
655 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
657 int media_info_get_timeline(media_info_h media, time_t *time) TIZEN_DEPRECATED_API;
660 * @brief Gets the thumbnail path of content file.
663 * @remarks The @a path should be released using free(). \n
664 * If the thumbnail extraction for the given media has not been requested yet, this function returns NULL. \n
665 * To create a thumbnail, you should use media_info_generate_thumbnail() function. \n
666 * This function returns an empty string if media_info_generate_thumbnail() has failed to create a thumbnail for the given media.
668 * @param[in] media The handle to the media info
669 * @param[out] path The thumbnail path
671 * @return @c 0 on success,
672 * otherwise a negative error value
674 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
675 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
676 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
678 int media_info_get_thumbnail_path(media_info_h media, char **path);
681 * @deprecated Deprecated since 9.0.
682 * @brief Gets the description of content file.
683 * @details If the value is an empty string, the method returns "Unknown". \n
684 * Since 3.0, if the media info has no description, the method returns empty string.
687 * @remarks The @a description should be released using free().
689 * @param[in] media The handle to the media info
690 * @param[out] description The description of the content file
692 * @return @c 0 on success,
693 * otherwise a negative error value
695 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
696 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
697 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
699 int media_info_get_description(media_info_h media, char **description) TIZEN_DEPRECATED_API;
702 * @deprecated Deprecated since 9.0.
703 * @brief Gets the longitude of content file.
706 * @param[in] media The handle to the media info
707 * @param[out] longitude The longitude of the content file
709 * @return @c 0 on success,
710 * otherwise a negative error value
712 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
713 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
715 int media_info_get_longitude(media_info_h media, double *longitude) TIZEN_DEPRECATED_API;
718 * @deprecated Deprecated since 9.0.
719 * @brief Gets the latitude of content file.
722 * @param[in] media The handle to the media info
723 * @param[out] latitude The latitude of the content file
725 * @return @c 0 on success,
726 * otherwise a negative error value
728 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
729 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
732 int media_info_get_latitude(media_info_h media, double* latitude) TIZEN_DEPRECATED_API;
735 * @deprecated Deprecated since 9.0.
736 * @brief Gets the altitude of content file.
739 * @param[in] media The handle to the media info
740 * @param[out] altitude The altitude of the content file
742 * @return @c 0 on success,
743 * otherwise a negative error value
745 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
746 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
748 int media_info_get_altitude(media_info_h media, double* altitude) TIZEN_DEPRECATED_API;
751 * @deprecated Deprecated since 9.0.
752 * @brief Gets the rating of content file.
755 * @param[in] media The handle to the media info
756 * @param[out] rating The rating of the content file
758 * @return @c 0 on success,
759 * otherwise a negative error value
761 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
762 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
764 int media_info_get_rating(media_info_h media, int *rating) TIZEN_DEPRECATED_API;
767 * @deprecated Deprecated since 9.0.
768 * @brief Gets the favorite status of content file which User set.
771 * @param[in] media The handle to the media info
772 * @param[out] favorite @c true if content file is set as favorite,
773 * otherwise @c false if content file is not set as favorite
775 * @return @c 0 on success,
776 * otherwise a negative error value
778 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
779 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
781 * @see media_info_set_favorite()
783 int media_info_get_favorite(media_info_h media, bool* favorite) TIZEN_DEPRECATED_API;
786 * @brief Gets the title of content file.
787 * @details If the content file does not have a title, this method returns the filename without the extension.
791 * @remarks The @a title should be released using free().
793 * @param[in] media The handle to the media info
794 * @param[out] title The title of the content file
796 * @return @c 0 on success,
797 * otherwise a negative error value
799 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
800 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
801 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
803 int media_info_get_title(media_info_h media, char **title);
806 * @deprecated Deprecated since 9.0.
807 * @brief Checks whether the media is protected via DRM.
810 * @param[in] media The handle to the media info
811 * @param[out] is_drm @c true if media is DRM media,
812 * otherwise @c false if media is not DRM media
814 * @return @c 0 on success,
815 * otherwise a negative error value
817 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
818 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
820 int media_info_is_drm(media_info_h media, bool *is_drm) TIZEN_DEPRECATED_API;
823 * @deprecated Deprecated since 9.0.
824 * @brief Checks whether the content file is 360 content.
827 * @param[in] media The handle to the media info
828 * @param[out] is_360 @c true if media is 360 content,
829 * otherwise @c false if media is not 360 content
831 * @return @c 0 on success,
832 * otherwise a negative error value
834 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
835 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
837 int media_info_is_360_content(media_info_h media, bool *is_360) TIZEN_DEPRECATED_API;
840 * @brief Gets the media info from the media database.
842 * @details This function creates a new media handle from the media database by the given @a media_id.
843 * Media info will be created and filled with information.
847 * @remarks The @a media should be released using media_info_destroy().
849 * @param[in] media_id The media ID
850 * @param[out] media The handle to the media info
852 * @return @c 0 on success,
853 * otherwise a negative error value
855 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
856 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
857 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
858 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
859 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
861 * @pre This function requires opened connection to content service by media_content_connect().
863 * @see media_content_connect()
864 * @see media_info_destroy()
866 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
869 * @brief Gets the media info from the media database using path.
871 * @details This function creates a new media handle filled with information from the database by the given @a media_path.
875 * @remarks The @a media should be released using media_info_destroy().\n
876 * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
877 * If you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
878 * If you want to access storages of both types, you must add all privileges. \n
880 * @param[in] media_path The media path
881 * @param[out] media The handle to the media info
883 * @return @c 0 on success,
884 * 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_OUT_OF_MEMORY Out of memory
889 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
890 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
891 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
893 * @pre This function requires opened connection to content service by media_content_connect().
895 * @see media_content_connect()
896 * @see media_info_destroy()
898 int media_info_get_media_from_db_by_path(const char *media_path, media_info_h *media);
901 * @deprecated Deprecated since 9.0.
902 * @brief Sets the favorite of media info.
903 * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n
904 * So, If you use it in order parameter, you can sort the order of the time was a favorite. \n
905 * Or, if you use it in condition parameter, you can get the result of the favorite media.
909 * @param[in] media The handle to the media info
910 * @param[in] favorite Set @c true to set the media info as favorite,
911 * otherwise set @c false to not set the media info as favorite
913 * @return @c 0 on success,
914 * otherwise a negative error value
916 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
917 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
919 int media_info_set_favorite(media_info_h media, bool favorite) TIZEN_DEPRECATED_API;
922 * @deprecated Deprecated since 9.0.
923 * @brief Updates the media info to the media database.
925 * @details The function updates the given media info in the media database.
929 * @privilege %http://tizen.org/privilege/content.write
931 * @remarks The function should be called after any change in media, to be updated to the media
932 * database. For example, after using media_info_set_favorite()
933 * for setting the name of the media, the media_info_update_to_db() function should be called so as to update
934 * the given media info attributes in the media database.
936 * @param[in] media The handle to the media info
938 * @return @c 0 on success,
939 * otherwise a negative error value
941 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
942 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
943 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
944 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
945 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
946 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
947 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
948 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
950 * @pre This function requires opened connection to content service by media_content_connect().
952 * @see media_content_connect()
953 * @see media_info_set_favorite()
955 int media_info_update_to_db(media_info_h media) TIZEN_DEPRECATED_API;
958 * @brief Moves the media info to the given destination path in the media database.
959 * @details After moving or renaming a file in the filesystem, call this function to update the database. \n
960 * If the source path and destination path are the same, then this function does nothing.
961 * If you want to refresh media information, you should use media_content_scan_file() function.
966 * @privilege %http://tizen.org/privilege/content.write \n
967 * %http://tizen.org/privilege/mediastorage \n
968 * %http://tizen.org/privilege/externalstorage
970 * @remarks You must add privilege %http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
971 * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n
972 * Or if you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n
973 * If you can access both storage, you should add all privilege. \n
974 * Since 4.0, this function does not allow symbolic links. \n
975 * This function does not support USB storage before 5.0. Since 5.0, USB storage is supported. \n
976 * Since 5.0, the thumbnail is removed if it exists.
978 * @param[in] media The handle to the media info
979 * @param[in] dst_path The path of destination
981 * @return @c 0 on success,
982 * otherwise a negative error value
984 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
985 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
986 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
987 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
988 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
989 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
990 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
991 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
993 * @pre This function requires opened connection to content service by media_content_connect().
995 * @see media_content_connect()
996 * @see media_content_scan_folder()
997 * @see media_info_generate_thumbnail()
999 int media_info_move_to_db(media_info_h media, const char* dst_path);
1002 * @brief Generates a thumbnail file for the given media, synchronously.
1007 * @privilege %http://tizen.org/privilege/content.write
1009 * @remarks %http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
1010 * %http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
1011 * Items in external storage are not supported, with the exception of MMC.
1013 * @param[in] media The handle to the media info
1015 * @return @c 0 on success,
1016 * otherwise a negative error value
1018 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1019 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1020 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1021 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1022 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1023 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1024 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1025 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1027 * @pre This function requires opened connection to content service by media_content_connect().
1029 * @see media_content_connect()
1030 * @see media_info_get_thumbnail_path()
1032 int media_info_generate_thumbnail(media_info_h media);
1035 * @deprecated Deprecated since 8.0.
1036 * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1037 * @brief Starts face detection for the given image, asynchronously.
1038 * @details This function detects faces for given image item and calls the given callback function when the detection is completed. \n
1039 * The given callback function is called when the detection is completed. \n
1040 * To obtain the detected faces, call the media_info_foreach_face_from_db() function. \n
1041 * Supported image formats are jpg, png, and bmp.
1046 * @privilege %http://tizen.org/privilege/content.write \n
1047 * %http://tizen.org/privilege/mediastorage \n
1048 * %http://tizen.org/privilege/externalstorage
1050 * @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
1051 * If the face detection fails, the @a face_count argument in media_face_detection_completed_cb() will be set to 0. \n
1052 * The face detection of media items in external storage except MMC is not supported. \n
1053 * Since 5.5, if the format of media data is unsupported, this function returns an error and the callback will not be invoked.
1055 * @param[in] media The handle to the media info
1056 * @param[in] callback The callback function to be invoked when detection is completed
1057 * @param[in] user_data The user data to be passed to the callback function
1059 * @return @c 0 on success,
1060 * otherwise a negative error value
1062 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1063 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1064 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1065 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1066 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1067 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1068 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1069 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1070 * @retval #MEDIA_CONTENT_ERROR_NOT_SUPPORTED Not supported
1072 * @pre This function requires opened connection to content service by media_content_connect().
1074 * @see media_content_connect()
1075 * @see media_info_cancel_face_detection()
1077 int media_info_start_face_detection(media_info_h media, media_face_detection_completed_cb callback, void *user_data) TIZEN_DEPRECATED_API;
1080 * @deprecated Deprecated since 8.0.
1081 * @ingroup CAPI_CONTENT_MEDIA_FACE_DETECTION_MODULE
1082 * @brief Cancels face detection of image for the given media.
1083 * @details This function cancels face detection for given media item. \n
1084 * If you cancel face detection request before callback is invoked, the callback registered by media_info_start_face_detection() function will not be invoked.
1089 * @privilege %http://tizen.org/privilege/content.write
1091 * @remarks If face detection is already done when you request the cancellation, this function returns #MEDIA_CONTENT_ERROR_INVALID_OPERATION
1093 * @param[in] media The handle to the media info
1095 * @return @c 0 on success,
1096 * otherwise a negative error value
1098 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1099 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1100 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1101 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1103 * @pre This function requires opened connection to content service by media_content_connect().
1105 * @see media_content_connect()
1106 * @see media_info_start_face_detection()
1108 int media_info_cancel_face_detection(media_info_h media) TIZEN_DEPRECATED_API;
1116 #endif /* __cplusplus */
1118 #endif /* __TIZEN_CONTENT_MEDIA_INFO_H__ */