The Media Storage Information API provides functions to manage storage information on the media items.
Required Header
#include <media_content.h>
Overview
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) |
| Gets media storage from database.
|
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.
|
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.
|
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.
|
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.
|
int | media_storage_destroy (media_storage_h storage) |
| Destroys media storage handle.
|
int | media_storage_clone (media_storage_h *dst, media_storage_h src) |
| Clones the media storage handle.
|
int | media_storage_get_id (media_storage_h storage, char **storage_id) |
| 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) |
| Gets the storage path of media storage.
|
int | media_storage_get_type (media_storage_h storage, media_content_storage_e *storage_type) |
| 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 Documentation
Called for every storage in the obtained list of storages.
Iterates over a media storage list.
- Since :
- 2.4
- Parameters:
-
[in] | storage | The handle of the media storage |
[in] | user_data | The user data passed from the foreach function |
- Returns:
true
to continue with the next iteration of the loop, otherwise false
to break out of the loop
- Precondition:
- media_storage_foreach_storage_from_db() will invoke this function.
- See also:
- media_storage_foreach_storage_from_db()
The structure type for the Media storage handle.
- Since :
- 2.4
Function Documentation
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 operation. New media storage handle has to be created before the next usage.
- Since :
- 2.4
- Parameters:
-
[in] | storage | The media storage handle |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- Precondition:
- Get copy of media_storage_h handle by calling media_storage_clone().
- See also:
- media_storage_clone()
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.
- Since :
- 2.4
- Parameters:
-
[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 |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- Precondition:
- This function requires opened connection to content service by media_content_connect().
- Postcondition:
- This function invokes media_info_cb().
- See also:
- media_info_cb
-
media_content_connect()
-
media_filter_create()
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.
- Since :
- 2.4
- Parameters:
-
[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 |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- Precondition:
- This function requires opened connection to content service by media_content_connect().
- Postcondition:
- This function invokes media_storage_destroy().
- See also:
- media_content_connect()
-
media_storage_destroy()
Gets the storage id of media storage.
- Since :
- 2.4
- Parameters:
-
[in] | storage | The media storage handle |
[out] | storage_id | The ID of the media storage |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Gets the count of media files for the passed filter in the given storage_id from the media database.
- Since :
- 2.4
- Parameters:
-
[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 |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- Precondition:
- This function requires opened connection to content service by media_content_connect().
- See also:
- media_content_connect()
Gets the storage name of media storage.
- Deprecated:
- Deprecated since 4.0.
- Since :
- 2.4
- Parameters:
-
[in] | storage | The media storage handle |
[out] | storage_name | The storage name of the media storage |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Gets the storage path of media storage.
- Since :
- 2.4
- Parameters:
-
[in] | storage | The media storage handle |
[out] | storage_path | The storage path of the media storage |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
Gets the count of media storage for the passed filter from the media database.
- Since :
- 2.4
- Parameters:
-
[in] | filter | The handle to the media filter |
[out] | storage_count | The count of storage |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- Precondition:
- This function requires opened connection to content service by media_content_connect().
- See also:
- media_content_connect()
Gets media storage from database.
- Since :
- 2.4
- Parameters:
-
[in] | storage_id | The ID of the media storage |
[out] | storage | The media storage handle |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
- Precondition:
- This function requires opened connection to content service by media_content_connect().
- See also:
- media_content_connect()
Gets the storage type of media storage.
- Since :
- 2.4
- Parameters:
-
[in] | storage | The media storage handle |
[out] | storage_type | The storage type of the media storage |
- Returns:
0
on success, otherwise a negative error value
- Return values:
-