Tizen Native API
5.0
|
The Media Storage Information API provides functions to manage storage information on the media items.
#include <media_content.h>
A Storage allows you to manage external storage.
The system generates the storage id when the external storage is added. And the system manages the media information in each of the storage by using storage id.
So you can get the information from the storage that you want to view.
Functions | |
int | media_storage_get_storage_info_from_db (const char *storage_id, media_storage_h *storage) TIZEN_DEPRECATED_API |
Gets media storage from database. | |
int | media_storage_get_storage_count_from_db (filter_h filter, int *storage_count) TIZEN_DEPRECATED_API |
Gets the count of media storage for the passed filter from the media database. | |
int | media_storage_foreach_storage_from_db (filter_h filter, media_storage_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Iterates through media storage from the media database. | |
int | media_storage_get_media_count_from_db (const char *storage_id, filter_h filter, int *media_count) TIZEN_DEPRECATED_API |
Gets the count of media files for the passed filter in the given storage_id from the media database. | |
int | media_storage_foreach_media_from_db (const char *storage_id, filter_h filter, media_info_cb callback, void *user_data) TIZEN_DEPRECATED_API |
Iterates through the media files with an optional filter in the given storage_id from the media database. | |
int | media_storage_destroy (media_storage_h storage) TIZEN_DEPRECATED_API |
Destroys media storage handle. | |
int | media_storage_clone (media_storage_h *dst, media_storage_h src) TIZEN_DEPRECATED_API |
Clones the media storage handle. | |
int | media_storage_get_id (media_storage_h storage, char **storage_id) TIZEN_DEPRECATED_API |
Gets the storage id of media storage. | |
int | media_storage_get_name (media_storage_h storage, char **storage_name) TIZEN_DEPRECATED_API |
Gets the storage name of media storage. | |
int | media_storage_get_path (media_storage_h storage, char **storage_path) TIZEN_DEPRECATED_API |
Gets the storage path of media storage. | |
int | media_storage_get_type (media_storage_h storage, media_content_storage_e *storage_type) TIZEN_DEPRECATED_API |
Gets the storage type of media storage. | |
Typedefs | |
typedef void * | media_storage_h |
The structure type for the Media storage handle. | |
typedef bool(* | media_storage_cb )(media_storage_h storage, void *user_data) |
Called for every storage in the obtained list of storages. |
typedef bool(* media_storage_cb)(media_storage_h storage, void *user_data) |
Called for every storage in the obtained list of storages.
Iterates over a media storage list.
[in] | storage | The handle of the media storage |
[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_storage_h |
int media_storage_clone | ( | media_storage_h * | dst, |
media_storage_h | src | ||
) |
Clones the media storage handle.
This function copies the media storage handle from a source to the destination. There is no media_storage_create() function. The media_storage_h is created internally and available through media storage foreach function such as media_storage_foreach_storage_from_db(). To use this handle outside of these foreach functions, use this function.
[out] | dst | The destination handle to the media storage |
[in] | src | The source handle to the media storage |
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 |
int media_storage_destroy | ( | media_storage_h | storage | ) |
Destroys media storage handle.
The function frees all resources related to the media storage handle. This handle can no longer be used to perform any operations. New media storage handle has to be created before the next usage.
[in] | storage | The media storage handle |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
int media_storage_foreach_media_from_db | ( | const char * | storage_id, |
filter_h | filter, | ||
media_info_cb | callback, | ||
void * | user_data | ||
) |
Iterates through the media files with an optional filter in the given storage_id from the media database.
This function gets all media files associated with the given storage and meeting desired filter option and calls callback for every retrieved media item. If NULL
is passed to the filter, no filtering is applied.
[in] | storage_id | The ID of the media storage |
[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_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_DB_FAILED | DB Operation failed |
MEDIA_CONTENT_ERROR_DB_BUSY | DB Operation busy |
int media_storage_foreach_storage_from_db | ( | filter_h | filter, |
media_storage_cb | callback, | ||
void * | user_data | ||
) |
Iterates through media storage from the media database.
This function gets all media storage handles meeting the given filter. The callback function will be invoked for every retrieved media storage. If NULL
is passed to the filter, then no filtering is applied.
[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_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_DB_FAILED | DB Operation failed |
MEDIA_CONTENT_ERROR_DB_BUSY | DB Operation busy |
int media_storage_get_id | ( | media_storage_h | storage, |
char ** | storage_id | ||
) |
Gets the storage id of media storage.
[in] | storage | The media storage handle |
[out] | storage_id | The ID of the media storage |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int media_storage_get_media_count_from_db | ( | const char * | storage_id, |
filter_h | filter, | ||
int * | media_count | ||
) |
Gets the count of media files for the passed filter in the given storage_id from the media database.
[in] | storage_id | The ID of the media storage |
[in] | filter | The handle to the media filter |
[out] | media_count | The count of media storage items |
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_DB_BUSY | DB Operation busy |
int media_storage_get_name | ( | media_storage_h | storage, |
char ** | storage_name | ||
) |
Gets the storage name of media storage.
[in] | storage | The media storage handle |
[out] | storage_name | The storage name of the media storage |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int media_storage_get_path | ( | media_storage_h | storage, |
char ** | storage_path | ||
) |
Gets the storage path of media storage.
[in] | storage | The media storage handle |
[out] | storage_path | The storage path of the media storage |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
int media_storage_get_storage_count_from_db | ( | filter_h | filter, |
int * | storage_count | ||
) |
Gets the count of media storage for the passed filter from the media database.
[in] | filter | The handle to the media filter |
[out] | storage_count | The count of storage |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_INVALID_OPERATION | Invalid operation |
MEDIA_CONTENT_ERROR_DB_FAILED | DB Operation failed |
MEDIA_CONTENT_ERROR_DB_BUSY | DB Operation busy |
int media_storage_get_storage_info_from_db | ( | const char * | storage_id, |
media_storage_h * | storage | ||
) |
Gets media storage from database.
[in] | storage_id | The ID of the media storage |
[out] | storage | The media storage handle |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |
MEDIA_CONTENT_ERROR_OUT_OF_MEMORY | Out of memory |
MEDIA_CONTENT_ERROR_DB_FAILED | DB Operation failed |
MEDIA_CONTENT_ERROR_DB_BUSY | DB Operation busy |
int media_storage_get_type | ( | media_storage_h | storage, |
media_content_storage_e * | storage_type | ||
) |
Gets the storage type of media storage.
[in] | storage | The media storage handle |
[out] | storage_type | The storage type of the media storage |
0
on success, otherwise a negative error valueMEDIA_CONTENT_ERROR_NONE | Successful |
MEDIA_CONTENT_ERROR_INVALID_PARAMETER | Invalid parameter |