Tizen Native API
|
Functions | |
int | media_content_connect (void) |
Connects to the media content service. | |
int | media_content_disconnect (void) |
Disconnects from the media content service. | |
int | media_content_scan_file (const char *path) |
Requests to scan a media file. | |
int | media_content_scan_folder (const char *path, bool is_recursive, media_scan_completed_cb callback, void *user_data) |
Requests to scan a media folder, asynchronously. | |
int | media_content_set_db_updated_cb (media_content_db_update_cb callback, void *user_data) |
Subscribes notifications of the media DB change. | |
int | media_content_unset_db_updated_cb (void) |
Unsubscribes notifications of the media DB change. | |
Typedefs | |
typedef void(* | media_scan_completed_cb )(media_content_error_e error, void *user_data) |
Called when the media scanning is finished. | |
typedef void(* | media_content_db_update_cb )(media_content_error_e error, int pid, media_content_db_update_item_type_e update_item, media_content_db_update_type_e update_type, media_content_type_e media_type, char *uuid, char *path, char *mime_type, void *user_data) |
Called when the notification of the media DB change is subscribed. |
The Media Content API provides functions, enumerations used in the entire Content Service.
#include <media_content.h>
The Media Content API provides functions and enumerations used in the entire Content Service.
The information about media items i.e. image, audio and video, are managed in the content database and operations that involve database requires an active connection with the media content service.
The API provides functions for connecting (media_content_connect()) and disconnecting (media_content_disconnect()) from the media content service.
The API consists of Media Folder,Media Tag,Media Filter, Media Information API and others.
API | Description |
---|---|
Media Folder | Provide information about folders (e.g. path, name, modification date) stored on the device. Provide information about the media items present in the folders. |
Media Tag | Provide information about media tags. Provide functions to insert or delete tag from database. Provide functions to add and remove media item from tags in the database. |
Media Filter | Provide functions for creating and destroying media filters. Provide functions to get filter properties |
Media Information | Provide generic information about media content items (i.e. image, audio, video and others). Provide details about audio files (e.g. name, author, genre etc) present in the device. Provide details about image files (e.g. width, height, orientation etc) present in the device. Provide details about video files (e.g. width, height, duration etc) present in the device . |
Media Playlist | Provide information about the media playlist. |
Media Album | Provide information about the media album. |
Media Group | Provide information about the media group(e.g. media artist, composer, genre, year). |
Media Bookmark | Provide information about the media bookmark. |
typedef void(* media_content_db_update_cb)(media_content_error_e error, int pid, media_content_db_update_item_type_e update_item, media_content_db_update_type_e update_type, media_content_type_e media_type, char *uuid, char *path, char *mime_type, void *user_data) |
Called when the notification of the media DB change is subscribed.
[in] | error | The error code |
[in] | pid | The PID which publishes notification |
[in] | update_item | The update item of notification |
[in] | update_type | The update type of notification |
[in] | media_type | The type of the media content (media_content_type_e) |
[in] | uuid | The UUID of media or directory, which is updated |
[in] | path | The path of the media or directory |
[in] | mime_type | The mime type of the media info |
[in] | user_data | The user data passed from the foreach function |
typedef void(* media_scan_completed_cb)(media_content_error_e error, void *user_data) |
Called when the media scanning is finished.
[in] | error | The error code |
[in] | user_data | The user data passed from the foreach function |
Enumeration for collations.
Enumeration for a media content error.
enum media_content_type_e |
enum media_group_e |
Enumeration for a media group.
int media_content_connect | ( | void | ) |
Connects to the media content service.
Any media content related function call should be invoked after this function call.
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_DB_FAILED | DB operation failed |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_content_disconnect | ( | void | ) |
Disconnects from the media content service.
This function closes connection to the media content service. Any further media content related operation cannot be performed after this function is called.
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_DB_FAILED | DB operation failed |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_content_scan_file | ( | const char * | path | ) |
Requests to scan a media file.
This function requests to scan a media file to the media server. If media file is not registered to DB yet, that media file information will be added to the media DB. If it is already registered to the DB, then this tries to refresh information. If requested file does not exist on file system, information of the media file will be removed from the media DB.
[in] | path | The file path |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_content_scan_folder | ( | const char * | path, |
bool | is_recursive, | ||
media_scan_completed_cb | callback, | ||
void * | user_data | ||
) |
Requests to scan a media folder, asynchronously.
This function requests to scan a media folder to the media server with given completed callback function. media_scan_completed_cb() function will be called when the scanning is finished. The sub folders are also scanned, if there are sub folders in that folder.
If any folder must not be scanned, a blank file ".scan_ignore" has to be created in that folder.
[in] | path | The folder path |
[in] | is_recursive | Set true to scan recursively subdirectories, otherwise false to scan only the current directory |
[in] | callback | The callback to be invoked when the scanning is finished |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_content_set_db_updated_cb | ( | media_content_db_update_cb | callback, |
void * | user_data | ||
) |
Subscribes notifications of the media DB change.
This function subscribes notifications of the media DB change which are published by the media server or other apps. media_content_db_update_cb() function will be called when notification of the media DB change is subscribed.
[in] | callback | The callback to be invoked when the scanning is finished |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_content_unset_db_updated_cb | ( | void | ) |
Unsubscribes notifications of the media DB change.
This function unsubscribes notifications of the media DB change which are published by the media server or other apps.
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |