X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include_product%2Fmedia_info.h;h=15c13a0a099f51b3a401eb724ba85f646ce33d87;hb=6f19706b4d7711bd5f0bbf6bed105b5004b7eaf0;hp=0913f43774afbfbe5de1d3d6b3d5547b07d900ac;hpb=39309a98c307fdfe5b6ab0c6bca210061c8fbf99;p=platform%2Fcore%2Fapi%2Fmedia-content.git diff --git a/include_product/media_info.h b/include_product/media_info.h index 0913f43..15c13a0 100755 --- a/include_product/media_info.h +++ b/include_product/media_info.h @@ -43,7 +43,10 @@ extern "C" { /** * @brief Inserts the content file into the media database. * @details In general, you can use this function to insert content files into the media database. \n - * You can use media_content_scan_file()/media_content_scan_folder() function instead of this function. + * You can use media_content_scan_file()/media_content_scan_folder() function instead of this function. \n + * If media information exists in the media database, this function returns information stored in the database.\n + * Since 5.5, if media information already exists in the media database, + * this function returns the updated latest information. (Media database will be updated if necessary). * * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @@ -53,14 +56,14 @@ extern "C" { * %http://tizen.org/privilege/externalstorage * * @remarks The @a info should be released using media_info_destroy(). \n - * You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n - * If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n - * Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n - * If you can access both storage, you must add all privilege. \n - * Since 4.0, This function does not allow a symbolic link. \n + * 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 + * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n + * If you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n + * If you want to access storages of both types, you must add all privileges. \n + * Since 4.0, this function does not accept symbolic links. \n * @remarks Since 4.0, this function is related to the following feature:\n * %http://tizen.org/feature/content.scanning.others\n - * If this feature is not supported on the device, MEDIA_CONTENT_TYPE_OTHERS type file is not scanned. + * If this feature is not supported on the device, #MEDIA_CONTENT_TYPE_OTHERS type files are not scanned. * * @param[in] path The path of the content file to add * @param[out] info The handle of the inserted content file @@ -97,9 +100,9 @@ int media_info_insert_to_db(const char *path, media_info_h *info); * %http://tizen.org/privilege/mediastorage \n * %http://tizen.org/privilege/externalstorage * - * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n - * If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n - * Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n + * @remarks You must add privilege %http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n + * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n + * Or if you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n * If you can access both storage, you must add all privilege. \n * Since 4.0, This function does not allow a symbolic link. \n * @remarks Since 4.0, this function is related to the following feature:\n @@ -250,7 +253,7 @@ int media_info_get_media_count_from_db(filter_h filter, int *media_count); * * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * - * @remarks Do not call updating DB function like media_info_update_to_db(), media_info_refresh_metadata_to_db(), audio_meta_update_to_db(), image_meta_update_to_db() and video_meta_update_to_db() in your callback function, + * @remarks Do not call updating DB function like media_info_update_to_db() in your callback function, * your callback function is invoked as inline function. * So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB. * We do not recommend you call updating DB function in callback of foreach function. @@ -503,6 +506,30 @@ int media_info_get_video(media_info_h media, video_meta_h *video); int media_info_get_audio(media_info_h media, audio_meta_h *audio); /** + * @brief Gets a book metadata handle for a given media info. + * @details This function returns a book metadata handle retrieved from the media info handle. \n + * The title and description information of the book can be obtained from @a media. + * + * @since_tizen 6.5 + * + * @remarks The @a book should be released using book_meta_destroy(). + * + * @param[in] media The handle to the media info + * @param[out] book The handle to the book metadata + * + * @return @c 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see media_info_get_title() + * @see media_info_get_description() + * @see book_meta_destroy() + */ +int media_info_get_book(media_info_h media, book_meta_h *book); + +/** * @brief Gets the media ID. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks The @a media_id should be released using free(). @@ -892,6 +919,38 @@ int media_info_get_storage_type(media_info_h media, media_content_storage_e *sto int media_info_get_media_from_db(const char *media_id, media_info_h *media); /** + * @brief Gets the media info from the media database using path. + * + * @details This function creates a new media handle filled with information from the database by the given @a media_path. + * + * @since_tizen 6.5 + * + * @remarks The @a media should be released using media_info_destroy().\n + * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n + * If you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n + * If you want to access storages of both types, you must add all privileges. \n + * + * @param[in] media_path The media path + * @param[out] media The handle to the media info + * + * @return @c 0 on success, + * otherwise a negative error value + * + * @retval #MEDIA_CONTENT_ERROR_NONE Successful + * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed + * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy + * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied + * + * @pre This function requires opened connection to content service by media_content_connect(). + * + * @see media_content_connect() + * @see media_info_destroy() + */ +int media_info_get_media_from_db_by_path(const char *media_path, media_info_h *media); + +/** * @brief Sets the favorite of media info. * @details This function can mark favorite of the media. If set to @c true, this function record the time of the change moment. \n * So, If you use it in order parameter, you can sort the order of the time was a favorite. \n @@ -959,9 +1018,9 @@ int media_info_update_to_db(media_info_h media); * %http://tizen.org/privilege/mediastorage \n * %http://tizen.org/privilege/externalstorage * - * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n - * If you want to access only internal storage by using this function, you should add privilege http://tizen.org/privilege/mediastorage. \n - * Or if you want to access only external storage by using this function, you should add privilege http://tizen.org/privilege/externalstorage. \n + * @remarks You must add privilege %http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n + * If you want to access only internal storage by using this function, you should add privilege %http://tizen.org/privilege/mediastorage. \n + * Or if you want to access only external storage by using this function, you should add privilege %http://tizen.org/privilege/externalstorage. \n * If you can access both storage, you should add all privilege. \n * Since 4.0, this function does not allow symbolic links. \n * This function does not support USB storage before 5.0. Since 5.0, USB storage is supported. \n @@ -1039,7 +1098,7 @@ int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb * @privlevel public * @privilege %http://tizen.org/privilege/content.write * - * @remarks If you request cancel for the already thumbnail created media, this function return MEDIA_CONTENT_ERROR_INVALID_OPERATION + * @remarks If you request cancel for the already thumbnail created media, this function returns #MEDIA_CONTENT_ERROR_INVALID_OPERATION * * @param[in] media The handle to the media info * @@ -1064,8 +1123,8 @@ int media_info_cancel_thumbnail(media_info_h media) TIZEN_DEPRECATED_API; * @privlevel public * @privilege %http://tizen.org/privilege/content.write * - * @remarks http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n - * http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n + * @remarks %http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n + * %http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n * Items in external storage are not supported, with the exception of MMC. * * @param[in] media The handle to the media info @@ -1094,7 +1153,8 @@ int media_info_generate_thumbnail(media_info_h media); * @brief Starts face detection for the given image, asynchronously. * @details This function detects faces for given image item and calls the given callback function when the detection is completed. \n * The given callback function is called when the detection is completed. \n - * To obtain the detected faces, call the media_info_foreach_face_from_db() function. + * To obtain the detected faces, call the media_info_foreach_face_from_db() function. \n + * Supported image formats are jpg, png, and bmp. * * @since_tizen 3.0 * @@ -1103,9 +1163,10 @@ int media_info_generate_thumbnail(media_info_h media); * %http://tizen.org/privilege/mediastorage \n * %http://tizen.org/privilege/externalstorage * - * @remarks If you want to destroy the media handle before callback invoked, you must cancel the face detection request by using media_info_cancel_face_detection(). \n - * If face detection fails, the face_count argument in media_face_detection_completed_cb() will be set to 0. - * Media items in external storage are not supported, with the exception of MMC items. + * @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 + * If the face detection fails, the @a face_count argument in media_face_detection_completed_cb() will be set to 0. \n + * The face detection of media items in external storage except MMC is not supported. \n + * Since 5.5, if the format of media data is unsupported, this function returns an error and the callback will not be invoked. * * @param[in] media The handle to the media info * @param[in] callback The callback function to be invoked when detection is completed @@ -1142,7 +1203,7 @@ int media_info_start_face_detection(media_info_h media, media_face_detection_com * @privlevel public * @privilege %http://tizen.org/privilege/content.write * - * @remarks If face detection is already done when you request the cancellation, this function return MEDIA_CONTENT_ERROR_INVALID_OPERATION + * @remarks If face detection is already done when you request the cancellation, this function returns #MEDIA_CONTENT_ERROR_INVALID_OPERATION * * @param[in] media The handle to the media info * @@ -1161,14 +1222,6 @@ int media_info_start_face_detection(media_info_h media, media_face_detection_com */ int media_info_cancel_face_detection(media_info_h media); -int media_info_set_description(media_info_h media, const char *description) TIZEN_DEPRECATED_API; - -int media_info_set_longitude(media_info_h media, double longitude) TIZEN_DEPRECATED_API; - -int media_info_set_latitude(media_info_h media, double latitude) TIZEN_DEPRECATED_API; - -int media_info_set_rating(media_info_h media, int rating) TIZEN_DEPRECATED_API; - /** * @} */