Tizen Native API
|
Functions | |
int | media_info_insert_to_db (const char *path, media_info_h *info) |
Inserts a media file into the media database. | |
int | media_info_insert_batch_to_db (const char **path_array, unsigned int array_length, media_insert_completed_cb callback, void *user_data) |
Inserts media files into the media database, asynchronously. | |
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) |
Inserts the burst shot images into the media database, asynchronously. | |
int | media_info_delete_from_db (const char *media_id) |
Deletes a media file from the media database. | |
int | media_info_delete_batch_from_db (filter_h filter) |
Deletes media files from the media database. The media files for deletion can be specified as a condition in a filter. | |
int | media_info_destroy (media_info_h media) |
Destroys media info. | |
int | media_info_clone (media_info_h *dst, media_info_h src) |
Clones the media info handle. | |
int | media_info_get_media_count_from_db (filter_h filter, int *media_count) |
Gets the count of media info for the passed filter from the media database. | |
int | media_info_foreach_media_from_db (filter_h filter, media_info_cb callback, void *user_data) |
Iterates through media info from the media database. | |
int | media_info_get_tag_count_from_db (const char *media_id, filter_h filter, int *tag_count) |
Gets the count of media tags for the passed filter in the given media_id from the media database. | |
int | media_info_foreach_tag_from_db (const char *media_id, filter_h filter, media_tag_cb callback, void *user_data) |
Iterates through the media tag in the given media info from the media database. | |
int | media_info_get_bookmark_count_from_db (const char *media_id, filter_h filter, int *bookmark_count) |
Gets the number of bookmarks for the passed filter in the given media ID from the media database. | |
int | media_info_foreach_bookmark_from_db (const char *media_id, filter_h filter, media_bookmark_cb callback, void *user_data) |
Iterates through the media bookmark in the given media info from the media database. | |
int | media_info_get_image (media_info_h media, image_meta_h *image) |
Gets the image metadata for a given media info. | |
int | media_info_get_video (media_info_h media, video_meta_h *video) |
Gets a video metadata for a given media info. | |
int | media_info_get_audio (media_info_h media, audio_meta_h *audio) |
Gets an audio metadata for a given media info. | |
int | media_info_get_media_id (media_info_h media, char **media_id) |
Gets the tag ID for the media info. | |
int | media_info_get_file_path (media_info_h media, char **path) |
Gets the path to the media info. | |
int | media_info_get_display_name (media_info_h media, char **name) |
Gets the name of the media info. | |
int | media_info_get_media_type (media_info_h media, media_content_type_e *type) |
Gets the content type of the media info. | |
int | media_info_get_mime_type (media_info_h media, char **mime_type) |
Gets the MIME type from the media info. | |
int | media_info_get_size (media_info_h media, unsigned long long *size) |
Gets the media file size. | |
int | media_info_get_added_time (media_info_h media, time_t *added_time) |
Gets the addition time of the media. | |
int | media_info_get_modified_time (media_info_h media, time_t *time) |
Gets the date of modification of media info. | |
int | media_info_get_timeline (media_info_h media, time_t *time) |
Gets the timeline of media info. | |
int | media_info_get_thumbnail_path (media_info_h media, char **path) |
Gets the thumbnail of media info. | |
int | media_info_get_description (media_info_h media, char **description) |
Gets the description of media info. | |
int | media_info_get_longitude (media_info_h media, double *longitude) |
Gets the longitude of media info. | |
int | media_info_get_latitude (media_info_h media, double *latitude) |
Gets the latitude of media info. | |
int | media_info_get_altitude (media_info_h media, double *altitude) |
Gets the altitude of media info. | |
int | media_info_get_weather (media_info_h media, char **weather) |
Gets the weather of media info. | |
int | media_info_get_rating (media_info_h media, int *rating) |
Gets the rating of media info. | |
int | media_info_get_favorite (media_info_h media, bool *favorite) |
Gets the favorite status of media info. | |
int | media_info_get_author (media_info_h media, char **author) |
Gets the author of media info. | |
int | media_info_get_provider (media_info_h media, char **provider) |
Gets the provider of media info. | |
int | media_info_get_content_name (media_info_h media, char **content_name) |
Gets the content name of media info. | |
int | media_info_get_title (media_info_h media, char **title) |
Gets the title of media info. | |
int | media_info_get_category (media_info_h media, char **category) |
Gets the category of media info. | |
int | media_info_get_location_tag (media_info_h media, char **location_tag) |
Gets the location tag of media info. | |
int | media_info_get_age_rating (media_info_h media, char **age_rating) |
Gets the age_rating of media info. | |
int | media_info_get_keyword (media_info_h media, char **keyword) |
Gets the keyword of media info. | |
int | media_info_is_drm (media_info_h media, bool *is_drm) |
Checks whether the media is protected via DRM. | |
int | media_info_get_storage_type (media_info_h media, media_content_storage_e *storage_type) |
Gets the storage type of media info. | |
int | media_info_get_media_from_db (const char *media_id, media_info_h *media) |
Gets the media info from the media database. | |
int | media_info_set_display_name (media_info_h media, const char *display_name) |
Sets the display name of media info. | |
int | media_info_set_description (media_info_h media, const char *description) |
Sets the description of media info. | |
int | media_info_set_longitude (media_info_h media, double longitude) |
Sets the longitude of media info. | |
int | media_info_set_latitude (media_info_h media, double latitude) |
Sets the latitude of media info. | |
int | media_info_set_altitude (media_info_h media, double altitude) |
Sets the altitude of media info. | |
int | media_info_set_weather (media_info_h media, const char *weather) |
Sets the weather of media info. | |
int | media_info_set_rating (media_info_h media, int rating) |
Sets the rating of media info. | |
int | media_info_set_favorite (media_info_h media, bool favorite) |
Sets the favorite of media info. | |
int | media_info_set_author (media_info_h media, const char *author) |
Sets the author of media info. | |
int | media_info_set_provider (media_info_h media, const char *provider) |
Sets the provider of media info. | |
int | media_info_set_content_name (media_info_h media, const char *content_name) |
Sets the content name of media info. | |
int | media_info_set_category (media_info_h media, const char *category) |
Sets the category of media info. | |
int | media_info_set_location_tag (media_info_h media, const char *location_tag) |
Sets the location tag of media info. | |
int | media_info_set_age_rating (media_info_h media, const char *age_rating) |
Sets the age rating of media info. | |
int | media_info_set_keyword (media_info_h media, const char *keyword) |
Sets the keyword of media info. | |
int | media_info_update_to_db (media_info_h media) |
Updates the media info to the media database. | |
int | media_info_refresh_metadata_to_db (const char *media_id) |
Refreshes the media metadata to the media database. | |
int | media_info_set_added_time (media_info_h media, time_t added_time) |
Sets the added time of media info. | |
int | media_info_move_to_db (media_info_h media, const char *dst_path) |
Moves the media info to the given destination path in the media database. | |
int | media_info_create_thumbnail (media_info_h media, media_thumbnail_completed_cb callback, void *user_data) |
Creates a thumbnail image for the given media, asynchronously. | |
int | media_info_cancel_thumbnail (media_info_h media) |
Cancels the creation of image's thumbnail for the given media. | |
Typedefs | |
typedef struct media_info_s * | media_info_h |
The structure type for the Media info handle. | |
typedef bool(* | media_info_cb )(media_info_h media, void *user_data) |
Called for every available media info. | |
typedef void(* | media_insert_completed_cb )(media_content_error_e error, void *user_data) |
Called when media items are inserted completely. | |
typedef void(* | media_insert_burst_shot_completed_cb )(media_content_error_e error, void *user_data) |
Called when the burst shot is inserted completely. | |
typedef void(* | media_thumbnail_completed_cb )(media_content_error_e error, const char *path, void *user_data) |
Called when creating a thumbnail image. |
The Media Information API provides functions to get information about media items stored on an internal and external storage.
#include <media_content.h>
The Media Information API provides functions to get basic information e.g. path, date, type etc about media items (media_info_h) present in the device. Media Information (media_info_h) is a generalization of media content of any type (audio, image, video and others).
Received information about media items can be the processed using dedicated APIs:
API | Description |
---|---|
Media Information | Provides details about all items present in the device. Provide functions to get information (e.g. title, size, mime type etc) about the files. |
Audio Metadata | Provides details about audio items present in the device. Provide functions to get information (e.g. genre, album, year, bitrate etc) about the audio files. |
Image Metadata | Provides details about image items present in the device. Provide functions to get information (e.g. longitude, description, date etc) about the image files. |
Video Metadata | Provides details about video items present in the device. Provide functions to get information (e.g. title, duration, date etc) about the video files. |
Video and Audio information can be further processed with respect to its properties i.e. playlist, album, using their respective APIs.
FOREACH | CALLBACK | DESCRIPTION |
---|---|---|
media_info_foreach_media_from_db() | media_info_cb() | Iterates through items |
media_info_foreach_tag_from_db() | media_tag_cb() | Iterate through tags |
media_info_foreach_bookmark_from_db() | media_bookmark_cb() | Iterate through bookmark |
typedef bool(* media_info_cb)(media_info_h media, void *user_data) |
Called for every available media info.
Iterates over a list of media info.
[in] | media | The handle to the media info |
[in] | user_data | The user data passed from the foreach function |
true
to continue with the next iteration of the loop, otherwise false
to break out of the looptypedef void(* media_insert_burst_shot_completed_cb)(media_content_error_e error, void *user_data) |
Called when the burst shot is inserted completely.
[in] | media | The handle to the media info |
[in] | user_data | The user data passed from the foreach function |
typedef void(* media_insert_completed_cb)(media_content_error_e error, void *user_data) |
Called when media items are inserted completely.
[in] | media | The handle to the media info |
[in] | user_data | The user data passed from the foreach function |
typedef void(* media_thumbnail_completed_cb)(media_content_error_e error, const char *path, void *user_data) |
Called when creating a thumbnail image.
This callback is called for completion of generating the thumbnail image.
[in] | error | The error code |
[in] | path | The path of the thumbnail which is generated |
[in] | user_data | The user data passed from the foreach function |
Enumeration for orientation types.
int media_info_cancel_thumbnail | ( | media_info_h | media | ) |
Cancels the creation of image's thumbnail for the given media.
[in] | media | The media info handle |
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_info_clone | ( | media_info_h * | dst, |
media_info_h | src | ||
) |
Clones the media info handle.
This function copies the media info handle from a source to the destination. There is no media_info_create() function. The media_info_h is created internally and available through media info foreach function such as media_info_foreach_media_from_db(). To use this handle outside of these foreach functions, use this function.
[out] | dst | The destination handle to the media info |
[in] | src | The source handle to media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_create_thumbnail | ( | media_info_h | media, |
media_thumbnail_completed_cb | callback, | ||
void * | user_data | ||
) |
Creates a thumbnail image for the given media, asynchronously.
This function creates an thumbnail image for given media item and calls registered callback function for completion of creating the thumbnail. If a thumbnail already exists for the given media, then the path of thumbnail will be returned in callback function.
[in] | media | The media info handle |
[in] | callback | The callback function to be invoked |
[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_INVALID_PARAMETER | Invalid parameter (Especially, if the request is duplicated, this error returns.) |
MEDIA_CONTENT_ERROR_DB_FAILED | DB operation failed |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_delete_batch_from_db | ( | filter_h | filter | ) |
Deletes media files from the media database. The media files for deletion can be specified as a condition in a filter.
This function deletes the media items from the content storage. Normally, deleting media files in the database are done automatically by the media server, without calling this function. This function is only called when the media server is busy and user needs to get quick result of deleting.
[in] | filter | The handle to filter |
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_info_delete_from_db | ( | const char * | media_id | ) |
Deletes a media file from the media database.
This function deletes a media item from the content storage. Normally, deleting a media file in the database is done automatically by the media server, without calling this function. This function is only called when the media server is busy and user needs to get quick result of deleting.
[in] | media_id | The ID to the media file |
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_info_destroy | ( | media_info_h | media | ) |
Destroys media info.
The function frees all resources related to the media info handle. This handle can no longer be used to perform any operation. New media info handle has to be created before the next usage.
[in] | media | The media info handle |
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_info_foreach_bookmark_from_db | ( | const char * | media_id, |
filter_h | filter, | ||
media_bookmark_cb | callback, | ||
void * | user_data | ||
) |
Iterates through the media bookmark in the given media info from the media database.
This function gets all media bookmarks associated with the given media and calls registered callback function for every retrieved media bookmark.
[in] | media_id | The ID of the media info |
[in] | filter | The handle to the media filter |
[in] | callback | The callback function to be invoked |
[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_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_foreach_media_from_db | ( | filter_h | filter, |
media_info_cb | callback, | ||
void * | user_data | ||
) |
Iterates through media info from the media database.
This function gets all media info handles meeting the given filter. The callback function will be invoked for every retrieved media info. If NULL
is passed to the filter, then no filtering is applied.
[in] | filter | The media info handle filter |
[in] | callback | The callback function to be invoked |
[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_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_foreach_tag_from_db | ( | const char * | media_id, |
filter_h | filter, | ||
media_tag_cb | callback, | ||
void * | user_data | ||
) |
Iterates through the media tag in the given media info from the media database.
This function gets all the media tags associated with the given media_id and calls registered callback function for every retrieved media tag.
[in] | media_id | The ID of the media info |
[in] | filter | The handle to the media filter |
[in] | callback | The callback function to be invoked |
[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_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_added_time | ( | media_info_h | media, |
time_t * | added_time | ||
) |
Gets the addition time of the media.
[in] | media | The media info handle |
[out] | added_time | The added time to the DB |
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_info_get_age_rating | ( | media_info_h | media, |
char ** | age_rating | ||
) |
Gets the age_rating of media info.
[in] | media | The media info handle |
[out] | age_rating | The age rating of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_altitude | ( | media_info_h | media, |
double * | altitude | ||
) |
Gets the altitude of media info.
[in] | media | The media info handle |
[out] | altitude | The altitude of the media info |
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_info_get_audio | ( | media_info_h | media, |
audio_meta_h * | audio | ||
) |
Gets an audio metadata for a given media info.
This function returns an audio metadata handle retrieved from the media info handle.
[in] | media | The media info handle |
[out] | audio | A handle to the audio meta |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_author | ( | media_info_h | media, |
char ** | author | ||
) |
Gets the author of media info.
[in] | media | The media info handle |
[out] | author | The author of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_bookmark_count_from_db | ( | const char * | media_id, |
filter_h | filter, | ||
int * | bookmark_count | ||
) |
Gets the number of bookmarks for the passed filter in the given media ID from the media database.
[in] | media_id | The ID of the media info |
[in] | filter | The handle to the media filter |
[out] | bookmark_count | The count of the media tag |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_DB_FAILED | DB operation failed |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_category | ( | media_info_h | media, |
char ** | category | ||
) |
Gets the category of media info.
[in] | media | The media info handle |
[out] | category | The category of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_content_name | ( | media_info_h | media, |
char ** | content_name | ||
) |
Gets the content name of media info.
[in] | media | The media info handle |
[out] | content_name | The content name of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_description | ( | media_info_h | media, |
char ** | description | ||
) |
Gets the description of media info.
[in] | media | The media info handle |
[out] | description | The description of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_display_name | ( | media_info_h | media, |
char ** | name | ||
) |
Gets the name of the media info.
[in] | media | The media info handle |
[out] | name | The name of media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_favorite | ( | media_info_h | media, |
bool * | favorite | ||
) |
Gets the favorite status of media info.
[in] | media | The media info handle |
[out] | favorite | true if media info is set as favorite, otherwise false if media info is not set as favorite |
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_info_get_file_path | ( | media_info_h | media, |
char ** | path | ||
) |
Gets the path to the media info.
[in] | media | The media info handle |
[out] | path | The path of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_image | ( | media_info_h | media, |
image_meta_h * | image | ||
) |
Gets the image metadata for a given media info.
This function returns an image metadata handle retrieved from the media info.
[in] | media | The media info handle |
[out] | image | A handle to image metadata |
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_info_get_keyword | ( | media_info_h | media, |
char ** | keyword | ||
) |
Gets the keyword of media info.
[in] | media | The media info handle |
[out] | keyword | The keyword of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_latitude | ( | media_info_h | media, |
double * | latitude | ||
) |
Gets the latitude of media info.
[in] | media | The media info handle |
[out] | latitude | The latitude of the media info |
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_info_get_location_tag | ( | media_info_h | media, |
char ** | location_tag | ||
) |
Gets the location tag of media info.
[in] | media | The media info handle |
[out] | location_tag | The location of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_longitude | ( | media_info_h | media, |
double * | longitude | ||
) |
Gets the longitude of media info.
[in] | media | The media info handle |
[out] | longitude | The longitude of the media info |
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_info_get_media_count_from_db | ( | filter_h | filter, |
int * | media_count | ||
) |
Gets the count of media info for the passed filter from the media database.
[in] | filter | The handle to filter |
[out] | media_count | The count of media |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_DB_FAILED | DB operation failed |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_media_from_db | ( | const char * | media_id, |
media_info_h * | media | ||
) |
Gets the media info from the media database.
This function creates a new media handle from the media database by the given media_id. Media info will be created and filled with information.
[in] | media_id | The ID of media info |
[out] | media | The media handle associated with the media ID |
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_info_get_media_id | ( | media_info_h | media, |
char ** | media_id | ||
) |
Gets the tag ID for the media info.
[in] | media | The media info handle |
[out] | media_id | The ID of the media tag |
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_info_get_media_type | ( | media_info_h | media, |
media_content_type_e * | type | ||
) |
Gets the content type of the media info.
[in] | media | The media info handle |
[out] | type | The type of the media content (media_content_type_e) |
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_info_get_mime_type | ( | media_info_h | media, |
char ** | mime_type | ||
) |
Gets the MIME type from the media info.
[in] | media | The media info handle |
[out] | mime_type | The MIME type of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_modified_time | ( | media_info_h | media, |
time_t * | time | ||
) |
Gets the date of modification of media info.
[in] | media | The media info handle |
[out] | time | The date of modification of the file Get from the file. |
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_info_get_provider | ( | media_info_h | media, |
char ** | provider | ||
) |
Gets the provider of media info.
[in] | media | The media info handle |
[out] | provider | The provider of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_rating | ( | media_info_h | media, |
int * | rating | ||
) |
Gets the rating of media info.
[in] | media | The media info handle |
[out] | rating | The rating of the media info |
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_info_get_size | ( | media_info_h | media, |
unsigned long long * | size | ||
) |
Gets the media file size.
[in] | media | The media info handle |
[out] | size | The type of the media content |
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_info_get_storage_type | ( | media_info_h | media, |
media_content_storage_e * | storage_type | ||
) |
Gets the storage type of media info.
[in] | media | The media info handle |
[out] | storage_type | The storage type of the media info |
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_info_get_tag_count_from_db | ( | const char * | media_id, |
filter_h | filter, | ||
int * | tag_count | ||
) |
Gets the count of media tags for the passed filter in the given media_id from the media database.
[in] | media_id | The ID of the media info |
[in] | filter | The handle to the media filter |
[out] | tag_count | The count of the media tag |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_DB_FAILED | DB operation failed |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_thumbnail_path | ( | media_info_h | media, |
char ** | path | ||
) |
Gets the thumbnail of media info.
[in] | media | The media info handle |
[out] | path | The path to the thumbnail of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_timeline | ( | media_info_h | media, |
time_t * | time | ||
) |
Gets the timeline of media info.
[in] | media | The media info handle |
[out] | time | The date of the timeline |
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_info_get_title | ( | media_info_h | media, |
char ** | title | ||
) |
Gets the title of media info.
[in] | media | The media info handle |
[out] | title | The title of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_video | ( | media_info_h | media, |
video_meta_h * | video | ||
) |
Gets a video metadata for a given media info.
This function returns a video metadata handle retrieved from the media info handle.
[in] | media | The media info handle |
[out] | video | A handle to the video meta |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_get_weather | ( | media_info_h | media, |
char ** | weather | ||
) |
Gets the weather of media info.
[in] | media | The media info handle |
[out] | weather | The weather of the media info |
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_info_insert_batch_to_db | ( | const char ** | path_array, |
unsigned int | array_length, | ||
media_insert_completed_cb | callback, | ||
void * | user_data | ||
) |
Inserts media files into the media database, asynchronously.
This function inserts media items into the content storage. Normally, inserting a media file in database is done automatically by the media server, without calling this function. This function invokes media_insert_completed_cb() callback function when insertion to the media database is finished.
[in] | path_array | The path array to the media files |
[in] | array_length | The length of the array |
[in] | callback | The callback to be invoked when media items inserted completely |
[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_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_DB_FAILED | DB operation failed |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
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 | ||
) |
Inserts the burst shot images into the media database, asynchronously.
This function inserts burst images into the content storage. media_insert_burst_shot_completed_cb() will be called when insertion to media database is finished.
[in] | path_array | The path array to the burst shot images |
[in] | array_length | The length of the array |
[in] | callback | The callback to be invoked when the images are inserted completely |
[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_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_DB_FAILED | DB operation failed |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_insert_to_db | ( | const char * | path, |
media_info_h * | info | ||
) |
Inserts a media file into the media database.
This function inserts a media item into the content storage. Normally, inserting a media file in database is done automatically by the media server, without calling this function. This function is only called when the media server is busy and the user needs to get quick result of inserting e.g. Taking a photo while media server is busy and the user wants to see the quick snapshot of the photo taken.
[in] | path | The path to the media file |
[out] | info | The handle to the media info |
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_info_is_drm | ( | media_info_h | media, |
bool * | is_drm | ||
) |
Checks whether the media is protected via DRM.
[in] | media | The media info handle |
[out] | is_drm | true if media is DRM media, otherwise false if media is not DRM media |
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_info_move_to_db | ( | media_info_h | media, |
const char * | dst_path | ||
) |
Moves the media info to the given destination path in the media database.
[in] | media | The media info handle |
[in] | dst_path | The path of destination |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_DB_FAILED | DB operation failed |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_refresh_metadata_to_db | ( | const char * | media_id | ) |
Refreshes the media metadata to the media database.
[in] | media_id | The ID of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_DB_FAILED | DB operation failed |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_added_time | ( | media_info_h | media, |
time_t | added_time | ||
) |
Sets the added time of media info.
[in] | media | The media info handle |
[in] | added_time | The added time of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_age_rating | ( | media_info_h | media, |
const char * | age_rating | ||
) |
Sets the age rating of media info.
[in] | media | The media info handle |
[in] | age_rating | The age rating of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_altitude | ( | media_info_h | media, |
double | altitude | ||
) |
Sets the altitude of media info.
[in] | media | The media info handle |
[in] | altitude | The altitude of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_author | ( | media_info_h | media, |
const char * | author | ||
) |
Sets the author of media info.
[in] | media | The media info handle |
[in] | author | The author of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_category | ( | media_info_h | media, |
const char * | category | ||
) |
Sets the category of media info.
[in] | media | The media info handle |
[in] | category | The category of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_content_name | ( | media_info_h | media, |
const char * | content_name | ||
) |
Sets the content name of media info.
[in] | media | The media info handle |
[in] | content_name | The content name of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_description | ( | media_info_h | media, |
const char * | description | ||
) |
Sets the description of media info.
[in] | media | The media info handle |
[in] | description | The description of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_display_name | ( | media_info_h | media, |
const char * | display_name | ||
) |
Sets the display name of media info.
[in] | media | The media info handle |
[in] | display_name | The display name of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_favorite | ( | media_info_h | media, |
bool | favorite | ||
) |
Sets the favorite of media info.
[in] | media | The media info handle |
[in] | favorite | Set true to set the media info as favorite, otherwise set false to not set the media info as favorite |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_keyword | ( | media_info_h | media, |
const char * | keyword | ||
) |
Sets the keyword of media info.
[in] | media | The media info handle |
[in] | keyword | The keyword of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_latitude | ( | media_info_h | media, |
double | latitude | ||
) |
Sets the latitude of media info.
[in] | media | The media info handle |
[in] | latitude | The latitude of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_location_tag | ( | media_info_h | media, |
const char * | location_tag | ||
) |
Sets the location tag of media info.
[in] | media | The media info handle |
[in] | location_tag | The location of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_longitude | ( | media_info_h | media, |
double | longitude | ||
) |
Sets the longitude of media info.
[in] | media | The media info handle |
[in] | longitude | The longitude of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_provider | ( | media_info_h | media, |
const char * | provider | ||
) |
Sets the provider of media info.
[in] | media | The media info handle |
[in] | provider | The provider of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_rating | ( | media_info_h | media, |
int | rating | ||
) |
Sets the rating of media info.
[in] | media | The media info handle |
[in] | rating | The rating of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_set_weather | ( | media_info_h | media, |
const char * | weather | ||
) |
Sets the weather of media info.
[in] | media | The media info handle |
[in] | weather | The weather of the media info |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_PERMISSION_DENIED | Permission denied |
int media_info_update_to_db | ( | media_info_h | media | ) |
Updates the media info to the media database.
The function updates the given media info in the media database.
[in] | media | The media info handle |
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 |