2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __TIZEN_MEDIA_INFORMATION_H__
19 #define __TIZEN_MEDIA_INFORMATION_H__
21 #include <media_content_type.h>
27 #endif /* __cplusplus */
31 * @brief This file contains the media info API and related functions to proceed with it. \n
32 * You can use the functions to insert, clone, delete, get the number and content of files from DB. \n
33 * You can get and set properties and parameters such as storage type, provider, and category of media info, \n
34 * handling with thumbnail and updating media info to DB.
39 * @addtogroup CAPI_CONTENT_MEDIA_INFO_MODULE
44 * @brief Inserts a media file into the media database.
45 * @details This function inserts a media item into the content storage.
46 * Normally, inserting a media file in database is done automatically by the media server, without calling this function.
47 * This function is only called when the media server is busy and the user needs to get quick result of inserting
48 * e.g. Taking a photo while media server is busy and the user wants to see the quick snapshot of the photo taken.
50 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
53 * @privilege %http://tizen.org/privilege/content.write \n
54 * %http://tizen.org/privilege/mediastorage \n
55 * %http://tizen.org/privilege/externalstorage
57 * @remarks You must release the handle using media_info_destroy(). \n
58 * You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
59 * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
60 * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
61 * If you can access both storage, you must add all privilege.
63 * @param[in] path The path to the media file
64 * @param[out] info The handle to the media info
66 * @return @c 0 on success,
67 * otherwise a negative error value
69 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
70 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
71 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
72 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
73 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
74 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
75 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
76 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
78 * @pre This function requires opened connection to content service by media_content_connect().
80 * @see media_content_connect()
82 int media_info_insert_to_db(const char *path, media_info_h *info);
85 * @brief Inserts media files into the media database, asynchronously.
86 * @details This function inserts media items into the content storage.
87 * Normally, inserting a media file in database is done automatically by the media server, without calling this function.
88 * This function invokes media_insert_completed_cb() callback function when insertion to the media database is finished.
90 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
93 * @privilege %http://tizen.org/privilege/content.write \n
94 * %http://tizen.org/privilege/mediastorage \n
95 * %http://tizen.org/privilege/externalstorage
97 * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
98 * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
99 * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
100 * If you can access both storage, you must add all privilege.
102 * @param[in] path_array The path array to the media files
103 * @param[in] array_length The length of the array
104 * @param[in] callback The callback to be invoked when media items inserted completely
105 * @param[in] user_data The user data to be passed to the callback function
107 * @return @c 0 on success,
108 * otherwise a negative error value
110 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
111 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
112 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
113 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
114 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
115 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
116 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
117 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
119 * @pre This function requires opened connection to content service by media_content_connect().
121 * @see media_content_connect()
122 * @see media_insert_completed_cb()
124 int media_info_insert_batch_to_db(const char **path_array, unsigned int array_length, media_insert_completed_cb callback, void *user_data);
127 * @brief Inserts the burst shot images into the media database, asynchronously.
128 * @details This function inserts burst images into the content storage.
129 * media_insert_burst_shot_completed_cb() will be called when insertion to media database is finished.
131 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
134 * @privilege %http://tizen.org/privilege/content.write \n
135 * %http://tizen.org/privilege/mediastorage \n
136 * %http://tizen.org/privilege/externalstorage
138 * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
139 * If you want to access only internal storage with this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
140 * Or if you want to access only external storage with this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
141 * If you can access both storage, you must add all privilege.
143 * @param[in] path_array The path array to the burst shot images
144 * @param[in] array_length The length of the array
145 * @param[in] callback The callback to be invoked when the images are inserted completely
146 * @param[in] user_data The user data to be passed to the callback function
148 * @return @c 0 on success,
149 * otherwise a negative error value
151 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
152 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
153 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
154 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
155 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
156 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
157 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
158 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
160 * @pre This function requires opened connection to content service by media_content_connect().
162 * @see media_content_connect()
163 * @see media_insert_burst_shot_completed_cb()
165 int media_info_insert_burst_shot_to_db(const char **path_array, unsigned int array_length, media_insert_burst_shot_completed_cb callback, void *user_data);
168 * @brief Deletes a media file from the media database.
169 * @details This function deletes a media item from the content storage.
170 * Normally, deleting a media file in the database is done automatically by the media server, without calling this function.
171 * This function is only called when the media server is busy and user needs to get quick result of deleting.
173 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
176 * @privilege %http://tizen.org/privilege/content.write
178 * @param[in] media_id The ID to the media file
180 * @return @c 0 on success,
181 * otherwise a negative error value
183 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
184 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
185 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
186 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
187 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
188 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
189 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
191 * @pre This function requires opened connection to content service by media_content_connect().
193 * @see media_content_connect()
195 int media_info_delete_from_db(const char *media_id);
198 * @brief Deletes media files from the media database.
199 * The media files for deletion can be specified as a condition in a filter.
200 * @details This function deletes the media items from the content storage.
201 * Normally, deleting media files in the database are done automatically by the media server, without calling this function.
202 * This function is only called when the media server is busy and user needs to get quick result of deleting.
204 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
207 * @privilege %http://tizen.org/privilege/content.write
209 * @param[in] filter The handle to filter
211 * @return @c 0 on success,
212 * otherwise a negative error value
214 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
215 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
216 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
217 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
218 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
219 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
220 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
222 * @pre This function requires opened connection to content service by media_content_connect().
224 * @see media_content_connect()
226 int media_info_delete_batch_from_db(filter_h filter);
230 * @brief Destroys media info.
231 * @details The function frees all resources related to the media info handle. This handle
232 * can no longer be used to perform any operation. New media info handle has to
233 * be created before the next usage.
235 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
237 * @param[in] media The media info handle
239 * @return @c 0 on success,
240 * otherwise a negative error value
242 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
243 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
244 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
246 * @pre Get copy of media_info handle by calling media_info_clone().
248 * @see media_info_clone()
250 int media_info_destroy(media_info_h media);
253 * @brief Clones the media info handle.
255 * @details This function copies the media info handle from a source to the destination.
256 * There is no media_info_create() function. The media_info_h is created internally and
257 * available through media info foreach function such as media_info_foreach_media_from_db().
258 * To use this handle outside of these foreach functions, use this function.
260 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
262 * @remarks You must release the destination handle using media_info_destroy().
264 * @param[out] dst The destination handle to the media info
265 * @param[in] src The source handle to media info
267 * @return @c 0 on success,
268 * otherwise a negative error value
270 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
271 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
272 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
273 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
275 * @see media_info_destroy()
276 * @see media_album_foreach_media_from_db()
277 * @see media_playlist_foreach_media_from_db()
278 * @see media_group_foreach_media_from_db
279 * @see media_tag_foreach_media_from_db()
280 * @see media_info_foreach_media_from_db()
281 * @see media_folder_foreach_media_from_db()
283 int media_info_clone(media_info_h *dst, media_info_h src);
286 * @brief Gets the count of media info for the passed @a filter from the media database.
287 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
289 * @param[in] filter The handle to filter
290 * @param[out] media_count The count of media
292 * @return @c 0 on success,
293 * otherwise a negative error value
295 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
296 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
297 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
298 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
299 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
301 * @pre This function requires opened connection to content service by media_content_connect().
303 * @see media_content_connect()
305 int media_info_get_media_count_from_db(filter_h filter, int *media_count);
308 * @brief Iterates through media info from the media database.
309 * @details This function gets all media info handles meeting the given @a filter.
310 * The @a callback function will be invoked for every retrieved media info.
311 * If @c NULL is passed to the @a filter, then no filtering is applied.
313 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
315 * @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,
316 * your callback function is invoked as inline function.
317 * So, your callback function is in read state in SQLite. When you are in read state, sometimes you do not update DB.
318 * We do not recommend you call updating DB function in callback of foreach function.
320 * @param[in] filter The media info handle filter
321 * @param[in] callback The callback function to be invoked
322 * @param[in] user_data The user data to be passed to the callback function
324 * @return @c 0 on success,
325 * otherwise a negative error value
327 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
328 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
329 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
330 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
331 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
332 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
334 * @pre This function requires opened connection to content service by media_content_connect().
335 * @post This function invokes media_info_cb().
337 * @see media_content_connect()
338 * @see #media_info_cb
339 * @see media_info_filter_create()
341 int media_info_foreach_media_from_db(filter_h filter, media_info_cb callback, void *user_data);
344 * @brief Gets the count of media tags for the passed @a filter in the given @a media_id from the media database.
345 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
347 * @param[in] media_id The ID of the media info
348 * @param[in] filter The handle to the media filter
349 * @param[out] tag_count The count of the media tag
351 * @return @c 0 on success,
352 * otherwise a negative error value
354 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
355 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
356 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
357 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
358 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
360 * @pre This function requires opened connection to content service by media_content_connect().
362 * @see media_content_connect()
364 int media_info_get_tag_count_from_db(const char *media_id, filter_h filter, int *tag_count);
367 * @brief Iterates through the media tag in the given media info from the media database.
368 * @details This function gets all the media tags associated with the given @a media_id and calls registered callback function for every retrieved media tag.
370 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
372 * @param[in] media_id The ID of the media info
373 * @param[in] filter The handle to the media filter
374 * @param[in] callback The callback function to be invoked
375 * @param[in] user_data The user data to be passed to the callback function
377 * @return @c 0 on success,
378 * otherwise a negative error value
380 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
381 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
382 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
383 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
384 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
385 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
387 * @pre This function requires opened connection to content service by media_content_connect().
388 * @post This function invokes media_tag_cb().
390 * @see media_content_connect()
393 int media_info_foreach_tag_from_db(const char *media_id, filter_h filter, media_tag_cb callback, void *user_data);
396 * @brief Gets the number of bookmarks for the passed @a filter in the given media ID from the media database.
397 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
399 * @param[in] media_id The ID of the media info
400 * @param[in] filter The handle to the media filter
401 * @param[out] bookmark_count The count of the media tag
403 * @return @c 0 on success,
404 * otherwise a negative error value
406 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
407 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
408 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
409 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
410 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
412 * @pre This function requires opened connection to content service by media_content_connect().
414 * @see media_content_connect()
416 int media_info_get_bookmark_count_from_db(const char *media_id, filter_h filter, int *bookmark_count);
419 * @brief Iterates through the media bookmark in the given media info from the media database.
420 * @details This function gets all media bookmarks associated with the given media and calls registered callback function for every retrieved media bookmark.
422 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
424 * @param[in] media_id The ID of the media info
425 * @param[in] filter The handle to the media filter
426 * @param[in] callback The callback function to be invoked
427 * @param[in] user_data The user data to be passed to the callback function
429 * @return @c 0 on success,
430 * otherwise a negative error value
432 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
433 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
434 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
435 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
436 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
437 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
439 * @pre This function requires opened connection to content service by media_content_connect().
440 * @post This function invokes media_bookmark_cb().
442 * @see media_content_connect()
443 * @see media_bookmark_cb()
445 int media_info_foreach_bookmark_from_db(const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data);
448 * @brief Gets the number of face for the passed @a media_id from the media database.
450 * @param[in] media_id media id
451 * @param[in] filter The handle to the media filter
452 * @param[out] face_count The count of media face
453 * @return 0 on success, otherwise a negative error value.
454 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
455 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
456 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
457 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
458 * @pre This function requires opened connection to content service by media_content_connect().
459 * @see media_content_connect()
462 int media_info_get_face_count_from_db(const char *media_id, filter_h filter, int *face_count);
465 * @brief Iterates through the media files with optional @a media_id in the given @a face @a face from the media database.
466 * @details This function gets all media face info associated with the given media id and
467 * meeting desired filter option and calls registered callback function for
468 * every retrieved media face info. If NULL is passed to the @a filter, no filtering is applied.
470 * @param [in] media_id media id
471 * @param[in] filter The handle to the media filter
472 * @param [in] callback The callback function to invoke
473 * @param [in] user_data The user data to be passed to the callback function
474 * @return 0 on success, otherwise a negative error value.
475 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
476 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
477 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
478 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
479 * @pre This function requires opened connection to content service by media_content_connect().
480 * @see media_content_connect()
481 * @see media_filter_create()
484 int media_info_foreach_face_from_db(const char *media_id, filter_h filter, media_face_cb callback, void *user_data);
487 * @brief Gets the image metadata for a given media info.
488 * @details This function returns an image metadata handle retrieved from the media info.
490 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
492 * @remarks You must release the @a image handle using image_meta_destroy().
494 * @param[in] media The media info handle
495 * @param[out] image A handle to image metadata
497 * @return @c 0 on success,
498 * otherwise a negative error value
500 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
501 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
502 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
504 * @see image_meta_destroy()
506 int media_info_get_image(media_info_h media, image_meta_h *image);
509 * @brief Gets a video metadata for a given media info.
510 * @details This function returns a video metadata handle retrieved from the media info handle.
512 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
514 * @remarks You must release the @a video handle using video_meta_destroy().
516 * @param[in] media The media info handle
517 * @param[out] video A handle to the video meta
519 * @return @c 0 on success,
520 * otherwise a negative error value
522 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
523 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
524 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
525 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
527 * @see video_meta_destroy()
529 int media_info_get_video(media_info_h media, video_meta_h *video);
532 * @brief Gets an audio metadata for a given media info.
533 * @details This function returns an audio metadata handle retrieved from the media info handle.
535 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
537 * @remarks You must release the @a audio handle using audio_meta_destroy().
539 * @param[in] media The media info handle
540 * @param[out] audio A handle to the audio meta
542 * @return @c 0 on success,
543 * otherwise a negative error value
545 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
546 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
547 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
548 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
550 * @see audio_meta_destroy()
552 int media_info_get_audio(media_info_h media, audio_meta_h *audio);
555 * @brief Gets the tag ID for the media info.
556 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
558 * @param[in] media The media info handle
559 * @param[out] media_id The ID of the media tag
561 * @return @c 0 on success,
562 * otherwise a negative error value
564 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
565 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
566 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
568 int media_info_get_media_id(media_info_h media, char **media_id);
571 * @brief Gets the path to the media info.
572 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
574 * @remarks You must release @a path using free().
576 * @param[in] media The media info handle
577 * @param[out] path The path of the media info
579 * @return @c 0 on success,
580 * otherwise a negative error value
582 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
583 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
584 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
585 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
588 int media_info_get_file_path(media_info_h media, char **path);
591 * @brief Gets the name of the media info.
592 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
594 * @remarks You must release @a name using free().
596 * @param[in] media The media info handle
597 * @param[out] name The name of media info
599 * @return @c 0 on success,
600 * otherwise a negative error value
602 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
603 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
604 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
605 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
607 int media_info_get_display_name(media_info_h media, char **name);
610 * @brief Gets the content type of the media info.
611 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
613 * @param[in] media The media info handle
614 * @param[out] type The type of the media content (#media_content_type_e)
616 * @return @c 0 on success,
617 * otherwise a negative error value
619 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
620 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
621 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
623 int media_info_get_media_type(media_info_h media, media_content_type_e *type);
626 * @brief Gets the MIME type from the media info.
627 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
629 * @remarks You must release @a mime_type using free().
631 * @param[in] media The media info handle
632 * @param[out] mime_type The MIME type of the media info
634 * @return @c 0 on success,
635 * otherwise a negative error value
637 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
638 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
639 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
640 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
642 int media_info_get_mime_type(media_info_h media, char **mime_type);
645 * @brief Gets the media file size.
646 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
648 * @param[in] media The media info handle
649 * @param[out] size The type of the media content
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
656 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
658 int media_info_get_size(media_info_h media, unsigned long long *size);
661 * @brief Gets the addition time of the media.
662 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
664 * @param[in] media The media info handle
665 * @param[out] added_time The added time to the DB
667 * @return @c 0 on success,
668 * otherwise a negative error value
670 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
671 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
672 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
674 int media_info_get_added_time(media_info_h media, time_t *added_time);
677 * @brief Gets the date of modification of media info.
678 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
680 * @param[in] media The media info handle
681 * @param[out] time The date of modification of the file \n
684 * @return @c 0 on success,
685 * otherwise a negative error value
687 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
688 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
689 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
691 int media_info_get_modified_time(media_info_h media, time_t *time);
694 * @brief Gets the timeline of media info.
695 * @details If the image file has the creation time, the value of the timeline is the creation time.\n
696 * Otherwise, the value of the timeline is the same as modified time.
697 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
699 * @param[in] media The media info handle
700 * @param[out] time The date of the timeline
702 * @return @c 0 on success,
703 * otherwise a negative error value
705 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
706 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
707 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
709 int media_info_get_timeline(media_info_h media, time_t* time);
712 * @brief Gets the thumbnail of media info.
713 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
715 * @remarks You must release @a path using free().
717 * @param[in] media The media info handle
718 * @param[out] path The path to the thumbnail of the media info
720 * @return @c 0 on success,
721 * otherwise a negative error value
723 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
724 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
725 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
726 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
728 int media_info_get_thumbnail_path(media_info_h media, char **path);
731 * @brief Gets the description of media info.
732 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
734 * @remarks You must release @a description using free().
736 * @param[in] media The media info handle
737 * @param[out] description The description of the media info
739 * @return @c 0 on success,
740 * otherwise a negative error value
742 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
743 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
744 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
745 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
747 int media_info_get_description(media_info_h media, char **description);
750 * @brief Gets the longitude of media info.
751 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
753 * @param[in] media The media info handle
754 * @param[out] longitude The longitude of the media info
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
761 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
763 int media_info_get_longitude(media_info_h media, double* longitude);
766 * @brief Gets the latitude of media info.
767 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
769 * @param[in] media The media info handle
770 * @param[out] latitude The latitude of the media info
772 * @return @c 0 on success,
773 * otherwise a negative error value
775 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
776 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
777 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
780 int media_info_get_latitude(media_info_h media, double* latitude);
783 * @brief Gets the altitude of media info.
784 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
786 * @param[in] media The media info handle
787 * @param[out] altitude The altitude of the media info
789 * @return @c 0 on success,
790 * otherwise a negative error value
792 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
793 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
794 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
796 int media_info_get_altitude(media_info_h media, double* altitude);
799 * @brief Gets the weather of media info.
800 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
802 * @param[in] media The media info handle
803 * @param[out] weather The weather of the media info
805 * @return @c 0 on success,
806 * otherwise a negative error value
808 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
809 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
810 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
812 int media_info_get_weather(media_info_h media, char **weather);
815 * @brief Gets the rating of media info.
816 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
818 * @param[in] media The media info handle
819 * @param[out] rating The rating of the media info
821 * @return @c 0 on success,
822 * otherwise a negative error value
824 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
825 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
826 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
828 int media_info_get_rating(media_info_h media, int *rating);
831 * @brief Gets the favorite status of media info.
832 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
834 * @param[in] media The media info handle
835 * @param[out] favorite @c true if media info is set as favorite,
836 * otherwise @c false if media info is not set as favorite
838 * @return @c 0 on success,
839 * otherwise a negative error value
841 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
842 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
843 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
845 int media_info_get_favorite(media_info_h media, bool* favorite);
848 * @brief Gets the author of media info.
849 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
851 * @remarks You must release @a author using free().
853 * @param[in] media The media info handle
854 * @param[out] author The author of the media info
856 * @return @c 0 on success,
857 * otherwise a negative error value
859 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
860 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
861 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
862 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
864 int media_info_get_author(media_info_h media, char **author);
867 * @brief Gets the provider of media info.
868 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
870 * @remarks You must release @a provider using free().
872 * @param[in] media The media info handle
873 * @param[out] provider The provider of the media info
875 * @return @c 0 on success,
876 * otherwise a negative error value
878 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
879 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
880 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
881 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
883 int media_info_get_provider(media_info_h media, char **provider);
886 * @brief Gets the content name of media info.
887 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
889 * @remarks You must release @a content_name using free().
891 * @param[in] media The media info handle
892 * @param[out] content_name The content name of the media info
894 * @return @c 0 on success,
895 * otherwise a negative error value
897 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
898 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
899 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
900 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
902 int media_info_get_content_name(media_info_h media, char **content_name);
905 * @brief Gets the title of media info.
906 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
908 * @remarks You must release @a title using free().
910 * @param[in] media The media info handle
911 * @param[out] title The title of the media info
913 * @return @c 0 on success,
914 * otherwise a negative error value
916 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
917 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
918 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
919 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
921 int media_info_get_title(media_info_h media, char **title);
924 * @brief Gets the category of media info.
925 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
927 * @remarks You must release @a category using free().
929 * @param[in] media The media info handle
930 * @param[out] category The category of the media info
932 * @return @c 0 on success,
933 * otherwise a negative error value
935 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
936 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
937 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
938 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
940 int media_info_get_category(media_info_h media, char **category);
943 * @brief Gets the location tag of media info.
944 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
946 * @remarks You must release @a location_tag using free().
948 * @param[in] media The media info handle
949 * @param[out] location_tag The location of the media info
951 * @return @c 0 on success,
952 * otherwise a negative error value
954 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
955 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
956 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
957 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
959 int media_info_get_location_tag(media_info_h media, char **location_tag);
962 * @brief Gets the age_rating of media info.
963 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
965 * @remarks You must release @a age_rating using free().
967 * @param[in] media The media info handle
968 * @param[out] age_rating The age rating of the media info
970 * @return @c 0 on success,
971 * otherwise a negative error value
973 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
974 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
975 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
976 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
978 int media_info_get_age_rating(media_info_h media, char **age_rating);
981 * @brief Gets the keyword of media info.
982 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
984 * @remarks You must release @a keyword using free().
986 * @param[in] media The media info handle
987 * @param[out] keyword The keyword of the media info
989 * @return @c 0 on success,
990 * otherwise a negative error value
992 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
993 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
994 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
995 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
997 int media_info_get_keyword(media_info_h media, char **keyword);
1000 * @brief Gets the storage id of media info.
1003 * @remarks You must release @a storage_id using free().
1005 * @param[in] media The media info handle
1006 * @param[out] storage_id The storage id of the media info
1008 * @return @c 0 on success,
1009 * otherwise a negative error value
1011 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1012 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1013 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1014 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1016 int media_info_get_storage_id(media_info_h media, char **storage_id);
1019 * @brief Checks whether the media is protected via DRM.
1020 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1022 * @param[in] media The media info handle
1023 * @param[out] is_drm @c true if media is DRM media,
1024 * otherwise @c false if media is not DRM media
1026 * @return @c 0 on success,
1027 * otherwise a negative error value
1029 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1030 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1031 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1033 int media_info_is_drm(media_info_h media, bool *is_drm);
1036 * @brief Gets the storage type of media info.
1037 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1039 * @param[in] media The media info handle
1040 * @param[out] storage_type The storage type of the media info
1042 * @return @c 0 on success,
1043 * otherwise a negative error value
1045 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1046 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1047 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1049 int media_info_get_storage_type(media_info_h media, media_content_storage_e *storage_type);
1052 * @brief Gets number which represents how many times given content has been played.
1055 * @param [in] media The handle to media info
1056 * @param [out] count_played The counter of content played
1058 * @return 0 on success,
1059 * otherwise a negative error value
1061 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1062 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1064 int media_info_get_played_count(media_info_h media, int *played_count);
1067 * @brief Gets the content's played time parameter.
1068 * @details Function returns content's elapsed playback time parameter as period
1069 * starting from the beginning of the track.
1072 * @param [in] media The handle to media info
1073 * @param [out] played_time The elapsed time of the content
1075 * @return 0 on success,
1076 * otherwise a negative error value
1078 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1079 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1081 int media_info_get_played_time(media_info_h media, time_t *played_time);
1084 * @brief Gets the media info from the media database.
1086 * @details This function creates a new media handle from the media database by the given @a media_id.
1087 * Media info will be created and filled with information.
1089 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1091 * @remarks You must release @a media using media_tag_destroy().
1093 * @param[in] media_id The ID of media info
1094 * @param[out] media The media handle associated with the media ID
1096 * @return @c 0 on success,
1097 * otherwise a negative error value
1099 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1100 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1101 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1103 * @pre This function requires opened connection to content service by media_content_connect().
1105 * @see media_content_connect()
1106 * @see media_info_destroy()
1108 int media_info_get_media_from_db(const char *media_id, media_info_h *media);
1111 * @brief Increments the played count to content meta handle.
1112 * @detalis You can increase the played(opened) count of the media file.
1115 * @param [in] media The handle to media info
1117 * @return 0 on success,
1118 * otherwise a negative error value
1120 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1121 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1123 * @post media_info_update_to_db()
1125 int media_info_increase_played_count(media_info_h media);
1128 * @brief Sets the played time to content meta handle.
1129 * @detalis You can set the latest played(opened) time of the media file. the latest played time to be set the current time on the system.
1132 * @param [in] media The handle to media info
1134 * @return 0 on success,
1135 * otherwise a negative error value
1137 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1138 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1140 * @post media_info_update_to_db()
1142 int media_info_set_played_time(media_info_h media);
1145 * @brief Sets the display name of media info.
1146 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1148 * @param[in] media The media info handle
1149 * @param[in] display_name The display name of the media info
1151 * @return @c 0 on success,
1152 * otherwise a negative error value
1154 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1155 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1156 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1157 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1159 * @post media_info_update_to_db().
1162 int media_info_set_display_name(media_info_h media, const char *display_name);
1165 * @brief Sets the description of media info.
1166 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1168 * @param[in] media The media info handle
1169 * @param[in] description The description of the media info
1171 * @return @c 0 on success,
1172 * otherwise a negative error value
1174 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1175 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1176 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1177 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1179 * @post media_info_update_to_db().
1182 int media_info_set_description(media_info_h media, const char *description);
1185 * @brief Sets the longitude of media info.
1186 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1188 * @param[in] media The media info handle
1189 * @param[in] longitude The longitude of the media info
1191 * @return @c 0 on success,
1192 * otherwise a negative error value
1194 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1195 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1196 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1197 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1199 * @post media_info_update_to_db().
1201 int media_info_set_longitude(media_info_h media, double longitude);
1204 * @brief Sets the latitude of media info.
1205 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1207 * @param[in] media The media info handle
1208 * @param[in] latitude The latitude of the media info
1210 * @return @c 0 on success,
1211 * otherwise a negative error value
1213 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1214 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1215 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1216 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1218 * @post media_info_update_to_db().
1220 int media_info_set_latitude(media_info_h media, double latitude);
1223 * @brief Sets the altitude of media info.
1224 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1226 * @param[in] media The media info handle
1227 * @param[in] altitude The altitude of the media info
1229 * @return @c 0 on success,
1230 * otherwise a negative error value
1232 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1233 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1234 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1235 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1237 * @post media_info_update_to_db().
1239 int media_info_set_altitude(media_info_h media, double altitude);
1242 * @brief Sets the weather of media info.
1243 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1245 * @param[in] media The media info handle
1246 * @param[in] weather The weather of the media info
1248 * @return @c 0 on success,
1249 * otherwise a negative error value
1251 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1252 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1253 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1254 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1256 * @post media_info_update_to_db().
1259 int media_info_set_weather(media_info_h media, const char *weather);
1262 * @brief Sets the rating of media info.
1263 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1265 * @param[in] media The media info handle
1266 * @param[in] rating The rating of the media info
1268 * @return @c 0 on success,
1269 * otherwise a negative error value
1271 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1272 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1273 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1274 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1276 * @post media_info_update_to_db().
1278 int media_info_set_rating(media_info_h media, int rating);
1281 * @brief Sets the favorite of media info.
1282 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1284 * @param[in] media The media info handle
1285 * @param[in] favorite Set @c true to set the media info as favorite,
1286 * otherwise set @c false to not set the media info as favorite
1288 * @return @c 0 on success,
1289 * otherwise a negative error value
1291 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1292 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1293 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1294 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1296 int media_info_set_favorite(media_info_h media, bool favorite);
1299 * @brief Sets the author of media info.
1300 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1302 * @param[in] media The media info handle
1303 * @param[in] author The author of the media info
1305 * @return @c 0 on success,
1306 * otherwise a negative error value
1308 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1309 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1310 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1311 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1313 int media_info_set_author(media_info_h media, const char *author);
1316 * @brief Sets the provider of media info.
1317 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1319 * @param[in] media The media info handle
1320 * @param[in] provider The provider of the media info
1322 * @return @c 0 on success,
1323 * otherwise a negative error value
1325 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1326 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1327 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1328 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1330 int media_info_set_provider(media_info_h media, const char *provider);
1333 * @brief Sets the content name of media info.
1334 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1336 * @param[in] media The media info handle
1337 * @param[in] content_name The content name of the media info
1339 * @return @c 0 on success,
1340 * otherwise a negative error value
1342 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1343 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1344 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1345 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1347 * @post media_info_update_to_db()
1349 int media_info_set_content_name(media_info_h media, const char *content_name);
1352 * @brief Sets the category of media info.
1353 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1355 * @param[in] media The media info handle
1356 * @param[in] category The category of the media info
1358 * @return @c 0 on success,
1359 * otherwise a negative error value
1361 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1362 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1363 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1364 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1366 * @post media_info_update_to_db()
1368 int media_info_set_category(media_info_h media, const char *category);
1371 * @brief Sets the location tag of media info.
1372 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1374 * @param[in] media The media info handle
1375 * @param[in] location_tag The location of the media info
1377 * @return @c 0 on success,
1378 * otherwise a negative error value
1380 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1381 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1382 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1383 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1385 * @post media_info_update_to_db()
1387 int media_info_set_location_tag(media_info_h media, const char *location_tag);
1390 * @brief Sets the age rating of media info.
1391 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1393 * @param[in] media The media info handle
1394 * @param[in] age_rating The age rating of the media info
1396 * @return @c 0 on success,
1397 * otherwise a negative error value
1399 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1400 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1401 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1402 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1404 * @post media_info_update_to_db()
1406 int media_info_set_age_rating(media_info_h media, const char *age_rating);
1409 * @brief Sets the keyword of media info.
1410 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1412 * @param[in] media The media info handle
1413 * @param[in] keyword The keyword of the media info
1415 * @return @c 0 on success,
1416 * otherwise a negative error value
1418 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1419 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1420 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1421 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1423 * @post media_info_update_to_db()
1425 int media_info_set_keyword(media_info_h media, const char *keyword);
1428 * @brief Updates the media info to the media database.
1430 * @details The function updates the given media info in the media database.
1432 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1434 * @privilege %http://tizen.org/privilege/content.write
1436 * @remarks The function should be called after any change in media, to be updated to the media
1437 * database. For example, after using media_info_set_display_name()
1438 * for setting the name of the media, the media_info_update_to_db() function should be called so as to update
1439 * the given media info attributes in the media database.
1441 * @param[in] media The media info handle
1443 * @return @c 0 on success,
1444 * otherwise a negative error value
1446 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1447 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1448 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1449 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1450 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1451 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1452 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1453 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1455 * @pre This function requires opened connection to content service by media_content_connect().
1457 * @see media_content_connect()
1458 * @see media_info_set_display_name()
1459 * @see media_info_set_description()
1460 * @see media_info_set_longitude()
1461 * @see media_info_set_latitude()
1462 * @see media_info_set_altitude()
1463 * @see media_info_set_rating()
1464 * @see media_info_set_favorite()
1465 * @see media_info_set_author()
1466 * @see media_info_set_provider()
1467 * @see media_info_set_content_name()
1468 * @see media_info_set_category()
1469 * @see media_info_set_location_tag()
1470 * @see media_info_set_age_rating()
1472 int media_info_update_to_db(media_info_h media);
1475 * @brief Refreshes the media metadata to the media database.
1476 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1479 * @privilege %http://tizen.org/privilege/content.write \n
1480 * %http://tizen.org/privilege/mediastorage \n
1481 * %http://tizen.org/privilege/externalstorage
1483 * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1484 * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1485 * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1486 * If you can access both storage, you should add all privilege.
1488 * @param[in] media_id The ID of the media info
1490 * @return @c 0 on success,
1491 * otherwise a negative error value
1493 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1494 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1495 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1496 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1497 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1498 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1499 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1500 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1502 * @pre This function requires opened connection to content service by media_content_connect().
1504 * @see media_content_connect()
1506 int media_info_refresh_metadata_to_db(const char *media_id);
1509 * @brief Sets the added time of media info.
1510 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1512 * @param[in] media The media info handle
1513 * @param[in] added_time The added time of the media info
1515 * @return @c 0 on success,
1516 * otherwise a negative error value
1518 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1519 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1520 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1521 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1523 * @post media_info_update_to_db()
1525 int media_info_set_added_time(media_info_h media, time_t added_time);
1528 * @brief Moves the media info to the given destination path in the media database.
1529 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1532 * @privilege %http://tizen.org/privilege/content.write \n
1533 * %http://tizen.org/privilege/mediastorage \n
1534 * %http://tizen.org/privilege/externalstorage
1536 * @remarks You must add privilege http://tizen.org/privilege/content.write. And You add more privilege depending on your choice of contents path. \n
1537 * If you want to access only internal storage by using this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1538 * Or if you want to access only external storage by using this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1539 * If you can access both storage, you should add all privilege.
1541 * @param[in] media The media info handle
1542 * @param[in] dst_path The path of destination
1544 * @return @c 0 on success,
1545 * otherwise a negative error value
1547 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1548 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter (Especially, if the request is duplicated, this error returns.)
1549 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1550 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1551 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1552 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1553 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1554 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1556 * @pre This function requires opened connection to content service by media_content_connect().
1558 * @see media_content_connect()
1560 int media_info_move_to_db(media_info_h media, const char* dst_path);
1563 * @brief Creates a thumbnail image for the given media, asynchronously.
1564 * @details This function creates an thumbnail image for given media item and calls registered callback function for completion of creating the thumbnail.
1565 * If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function.
1567 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1570 * @privilege %http://tizen.org/privilege/content.write
1572 * @remarks If you want to destory media handle before callback invoked, you must cancel thumbnail request by using media_info_cancel_thumbnail()
1574 * @param[in] media The media info handle
1575 * @param[in] callback The callback function to be invoked
1576 * @param[in] user_data The user data to be passed to the callback function
1578 * @return @c 0 on success,
1579 * otherwise a negative error value
1581 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1582 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1583 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
1584 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1585 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
1586 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
1587 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
1588 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1590 * @pre This function requires opened connection to content service by media_content_connect().
1592 * @see media_content_connect()
1594 int media_info_create_thumbnail(media_info_h media, media_thumbnail_completed_cb callback, void *user_data);
1597 * @brief Cancels the creation of image's thumbnail for the given media.
1598 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
1601 * @privilege %http://tizen.org/privilege/content.write
1603 * @remarks If you request cancel for the alreay thumbnail created media, this API return MEDIA_CONTENT_ERROR_INVALID_OPERATION
1605 * @param[in] media The media info handle
1607 * @return @c 0 on success,
1608 * otherwise a negative error value
1610 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1611 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1612 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1613 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
1615 * @pre This function requires opened connection to content service by media_content_connect().
1616 * @see media_content_connect()
1618 int media_info_cancel_thumbnail(media_info_h media);
1621 * @brief Creates the media info handle.
1622 * @details If the information about the file that is already known, you can use this API to generate empty handler.
1623 * And you can add the information to the generated handler using media_info_set_XXX() API.
1624 * After filling the information to the handler, you can insert into database using media_info_insert_to_db_with_data() API.
1628 * @privilege %http://tizen.org/privilege/mediastorage \n
1629 * %http://tizen.org/privilege/externalstorage
1631 * @remarks If you want to access only internal storage with this API, you should add privilege http://tizen.org/privilege/mediastorage. \n
1632 * Or if you want to access only external storage with this API, you shold add privilege http://tizen.org/privilege/externalstorage. \n
1633 * If you can access both storage, you must add all privilege.
1635 * @param[in] path The path to create the media info handle
1636 * @param[out] media The media info handle
1638 * @return @c 0 on success,
1639 * otherwise a negative error value
1641 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1642 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1643 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
1644 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1646 * @see media_info_insert_to_db_with_data()
1647 * @see media_info_destroy()
1649 int media_info_create(const char *path, media_info_h *media);
1652 * @brief Inserts media info to database with media info data.
1653 * @details After filling the information to the generated handler using media_info_create() API, you can insert into database using this API.
1656 * @remarks You must create media handle using media_info_create(),
1657 * and release @a info using media_info_destroy().
1660 * @privilege %http://tizen.org/privilege/content.write
1662 * @param[in] media The media info handle to be inserted
1664 * @return @c 0 on success,
1665 * otherwise a negative error value
1667 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1668 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1669 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB operation failed
1670 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
1672 * @see media_info_create()
1674 int media_info_insert_to_db_with_data(media_info_h media);
1677 * @brief Sets the title of media info handle.
1680 * @param[in] media The media info handle
1681 * @param[in] title The title of media info handle
1683 * @return @c 0 on success,
1684 * otherwise a negative error value
1686 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1687 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1689 * @post media_info_insert_to_db_with_data()
1691 int media_info_set_title(media_info_h media, const char *title);
1694 * @brief Sets the album of media info handle.
1697 * @param[in] media The media info handle
1698 * @param[in] album The album of media info handle
1700 * @return @c 0 on success,
1701 * otherwise a negative error value
1703 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1704 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1706 * @post media_info_insert_to_db_with_data()
1708 int media_info_set_album(media_info_h media, const char *album);
1711 * @brief Sets the artist of media info handle.
1714 * @param[in] media The media info handle
1715 * @param[in] artist The artist of media info handle
1717 * @return @c 0 on success,
1718 * otherwise a negative error value
1720 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1721 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1723 * @post media_info_insert_to_db_with_data()
1725 int media_info_set_artist(media_info_h media, const char *artist);
1728 * @brief Sets the genre of media info handle.
1731 * @param[in] media The media info handle
1732 * @param[in] genre The genre of media info handle
1734 * @return @c 0 on success,
1735 * otherwise a negative error value
1737 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1738 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1740 * @post media_info_insert_to_db_with_data()
1742 int media_info_set_genre(media_info_h media, const char *genre);
1745 * @brief Sets the recorded date of media info handle.
1748 * @param[in] media The media info handle
1749 * @param[in] recorded_date The recorded date of media info handle
1751 * @return @c 0 on success,
1752 * otherwise a negative error value
1754 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
1755 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
1757 * @post media_info_insert_to_db_with_data()
1759 int media_info_set_recorded_date(media_info_h media, const char *recorded_date);
1769 #endif /* __cplusplus */
1771 #endif /* __TIZEN_MEDIA_INFORMATION_H__ */