Tizen Native API  6.5

The Media Group API provides information related to artist of media group.

Required Header

#include <media_content.h>

Overview

A Media Group represents logical grouping of media files with respect to their group name. It is also used for filtering media items.

The API provides functions to get and search image, video and audio items in media group. For getting the count of media items associated with a given group, call media_group_get_media_count_from_db() function.

Foreach Operations

FOREACH CALLBACK DESCRIPTION
media_group_foreach_group_from_db() media_group_cb() Iterates through group
media_group_foreach_media_from_db() media_info_cb() Iterates through group's items

Functions

int media_group_get_group_count_from_db (filter_h filter, media_group_e group, int *group_count)
 Gets the number of the group for the passed filter from the media database.
int media_group_foreach_group_from_db (filter_h filter, media_group_e group, media_group_cb callback, void *user_data)
 Iterates through the media group with an optional filter from the media database.
int media_group_get_media_count_from_db (const char *group_name, media_group_e group, filter_h filter, int *media_count)
 Gets the count of the media info for the given media group present in the media database.
int media_group_foreach_media_from_db (const char *group_name, media_group_e group, filter_h filter, media_info_cb callback, void *user_data)
 Iterates through the media files with an optional filter in the given group from the media database.

Typedefs

typedef bool(* media_group_cb )(const char *group_name, void *user_data)
 Called for every group in the obtained list of groups.

Typedef Documentation

typedef bool(* media_group_cb)(const char *group_name, void *user_data)

Called for every group in the obtained list of groups.

Iterates over a media group list.

Since :
2.3
Remarks:
You should not free group_name returned by this function.
The callback is called in the main loop.
Parameters:
[in]group_nameThe name of the media group
[in]user_dataThe 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_group_foreach_group_from_db() will invoke this function.
See also:
media_group_foreach_group_from_db()

Function Documentation

int media_group_foreach_group_from_db ( filter_h  filter,
media_group_e  group,
media_group_cb  callback,
void *  user_data 
)

Iterates through the media group with an optional filter from the media database.

This function gets names of media group meeting the given filter. The callback function will be invoked for every retrieved media group. If NULL is passed to the filter, no filtering is applied.

Since :
2.3
Parameters:
[in]filterThe handle to the media filter
[in]groupThe type of the media group
[in]callbackThe callback function to be invoked
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_OUT_OF_MEMORYOut of memory
MEDIA_CONTENT_ERROR_DB_FAILEDDB Operation failed
MEDIA_CONTENT_ERROR_DB_BUSYDB Operation busy
Precondition:
This function requires opened connection to content service by media_content_connect().
Postcondition:
This function invokes media_group_cb().
See also:
media_group_cb
media_content_connect()
media_filter_create()
int media_group_foreach_media_from_db ( const char *  group_name,
media_group_e  group,
filter_h  filter,
media_info_cb  callback,
void *  user_data 
)

Iterates through the media files with an optional filter in the given group from the media database.

This function gets all media files associated with the given group and meeting desired filter option and calls callback for every retrieved media info. If NULL is passed to the filter, no filtering is applied.

Since :
2.3
Parameters:
[in]group_nameThe name of the media group
[in]groupThe type of the media group
[in]filterThe handle to the media filter
[in]callbackThe callback function to be invoked
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_OUT_OF_MEMORYOut of memory
MEDIA_CONTENT_ERROR_DB_FAILEDDB Operation failed
MEDIA_CONTENT_ERROR_DB_BUSYDB Operation busy
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()
int media_group_get_group_count_from_db ( filter_h  filter,
media_group_e  group,
int *  group_count 
)

Gets the number of the group for the passed filter from the media database.

Since :
2.3
Parameters:
[in]filterThe handle to the media filter
[in]groupThe type of the media group
[out]group_countThe count of the media group
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_DB_FAILEDDB Operation failed
MEDIA_CONTENT_ERROR_DB_BUSYDB Operation busy
Precondition:
This function requires opened connection to content service by media_content_connect().
See also:
media_content_connect()
int media_group_get_media_count_from_db ( const char *  group_name,
media_group_e  group,
filter_h  filter,
int *  media_count 
)

Gets the count of the media info for the given media group present in the media database.

Since :
2.3
Parameters:
[in]group_nameThe name of the media group
[in]groupThe type of the media group
[in]filterThe handle to the media filter
[out]media_countThe count of the media
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTENT_ERROR_NONESuccessful
MEDIA_CONTENT_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTENT_ERROR_OUT_OF_MEMORYOut of memory
MEDIA_CONTENT_ERROR_DB_FAILEDDB Operation failed
MEDIA_CONTENT_ERROR_DB_BUSYDB Operation busy
Precondition:
This function requires opened connection to content service by media_content_connect().
See also:
media_content_connect()