Tizen Native API  5.5
Media Controller Metadata

The Media Controller Metadata API provides functions for media metadata.

Required Header

#include <media_controller_metadata.h>

Overview

The Media Controller Metadata API allows you to get metadata (mc_metadata_get()).
You can copy the metadata by using mc_metadata_clone(). And if you don't use handle anymore, you have to destroy it(mc_metadata_destroy()).

Functions

int mc_metadata_clone (mc_metadata_h src, mc_metadata_h *dst)
 Clones the metadata handle of media.
int mc_metadata_destroy (mc_metadata_h metadata)
 Destroys a media controller metadata handle.
int mc_metadata_get (mc_metadata_h metadata, mc_meta_e attribute, char **value)
 Gets the metadata.
int mc_metadata_encode_season (int season_num, const char *season_title, char **encoded_season)
 Encodes the season metadata of the media.
int mc_metadata_encode_episode (int episode_num, const char *episode_title, char **encoded_episode)
 Encodes the episode metadata of the media.
int mc_metadata_encode_resolution (unsigned int width, unsigned int height, char **encoded_resolution)
 Encodes the resolution metadata of the media.
int mc_metadata_decode_season (const char *encoded_season, int *season_num, char **season_title)
 Decodes the season of the media.
int mc_metadata_decode_episode (const char *encoded_episode, int *episode_num, char **episode_title)
 Decodes the episode of the media.
int mc_metadata_decode_resolution (const char *encoded_resolution, unsigned int *width, unsigned int *height)
 Decodes the resolution of the media.

Function Documentation

int mc_metadata_clone ( mc_metadata_h  src,
mc_metadata_h dst 
)

Clones the metadata handle of media.

This function copies the metadata handle from one to another. The mc_metadata_h is created internally and therefore available through the functions of media controller metadata.

Since :
4.0
Remarks:
The dst should be released using mc_metadata_destroy().
Parameters:
[in]srcThe source handle of the media controller metadata
[out]dstThe destination handle of the media controller metadata
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTROLLER_ERROR_NONESuccessful
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORYOut of memory
See also:
mc_metadata_destroy()
int mc_metadata_decode_episode ( const char *  encoded_episode,
int *  episode_num,
char **  episode_title 
)

Decodes the episode of the media.

You can get various metadata using mc_metadata_get(). If you want to get the proper episode number and episode title,
you should decode the metadata values gotten by mc_metadata_get() with this function.
Otherwise, the values are illegible.

Since :
5.5
Remarks:
The episode_title should be released using free().
Parameters:
[in]encoded_episodeThe encoded episode information
[out]episode_numThe episode number
[out]episode_titleThe episode title
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTROLLER_ERROR_NONESuccessful
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORYOut of memory
Precondition:
Get the encoded episode information by calling mc_metadata_get()
See also:
mc_metadata_get()
mc_metadata_encode_episode()
int mc_metadata_decode_resolution ( const char *  encoded_resolution,
unsigned int *  width,
unsigned int *  height 
)

Decodes the resolution of the media.

You can get various metadata using mc_metadata_get(). If you want to get the proper resolution,
you should decode the metadata values gotten by mc_metadata_get() with this function.
Otherwise, the values are illegible.

Since :
5.5
Parameters:
[in]encoded_resolutionThe encoded resolution information
[out]widthContent width
[out]heightContent height
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTROLLER_ERROR_NONESuccessful
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORYOut of memory
Precondition:
Get the encoded resolution information by calling mc_metadata_get()
See also:
mc_metadata_get()
mc_metadata_encode_resolution()
int mc_metadata_decode_season ( const char *  encoded_season,
int *  season_num,
char **  season_title 
)

Decodes the season of the media.

You can get various metadata using mc_metadata_get(). If you want to get the proper season number and season title,
you should decode the metadata values gotten by mc_metadata_get() with this function.
Otherwise, the values are illegible.

Since :
5.5
Remarks:
The season_title should be released using free().
Parameters:
[in]encoded_seasonThe encoded season information
[out]season_numThe season number
[out]season_titleThe season title
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTROLLER_ERROR_NONESuccessful
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORYOut of memory
Precondition:
Get the encoded season information by calling mc_metadata_get()
See also:
mc_metadata_get()
mc_metadata_encode_season()

Destroys a media controller metadata handle.

This function frees all resources related to the media controller metadata handle. This handle no longer can be used to perform any operations. A new handle has to be created before next usage.

Since :
4.0
Parameters:
[in]metadataThe handle of the media controller metadata
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTROLLER_ERROR_NONESuccessful
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
mc_metadata_clone()
int mc_metadata_encode_episode ( int  episode_num,
const char *  episode_title,
char **  encoded_episode 
)

Encodes the episode metadata of the media.

You can set various metadata with functions such as mc_server_set_metadata() and mc_server_add_item_to_playlist(). If you want to set the episode,
you should encode the episode with this function and then set the encoded data.
Otherwise, the setting function returns an error.
episode_title can be NULL. If it is NULL, the decoded episode title will also be NULL.

Since :
5.5
Remarks:
The encoded_episode should be released using free().
Parameters:
[in]episode_numThe episode number
[in]episode_titleThe episode title
[out]encoded_episodeThe encoded episode information
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTROLLER_ERROR_NONESuccessful
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORYOut of memory
See also:
mc_server_set_metadata()
mc_server_add_item_to_playlist()
mc_metadata_decode_episode()
int mc_metadata_encode_resolution ( unsigned int  width,
unsigned int  height,
char **  encoded_resolution 
)

Encodes the resolution metadata of the media.

You can set various metadata with functions such as mc_server_set_metadata() and mc_server_add_item_to_playlist(). If you want to set the resolution,
you should encode the resolution with this function and then set the encoded data.
Otherwise, the setting function returns an error.

Since :
5.5
Remarks:
The encoded_resolution should be released using free().
Parameters:
[in]widthContent width
[in]heightContent height
[out]encoded_resolutionThe encoded resolution information
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTROLLER_ERROR_NONESuccessful
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORYOut of memory
See also:
mc_server_set_metadata()
mc_server_add_item_to_playlist()
mc_metadata_decode_resolution()
int mc_metadata_encode_season ( int  season_num,
const char *  season_title,
char **  encoded_season 
)

Encodes the season metadata of the media.

You can set various metadata with functions such as mc_server_set_metadata() and mc_server_add_item_to_playlist(). If you want to set the season,
you should encode the season with this function and then set the encoded data.
Otherwise, the setting function returns an error.
season_title can be NULL. If it is NULL, the decoded season title will also be NULL.

Since :
5.5
Remarks:
The encoded_season should be released using free().
Parameters:
[in]season_numThe season number
[in]season_titleThe season title
[out]encoded_seasonThe encoded season information
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTROLLER_ERROR_NONESuccessful
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORYOut of memory
See also:
mc_server_set_metadata()
mc_server_add_item_to_playlist()
mc_metadata_decode_season()
int mc_metadata_get ( mc_metadata_h  metadata,
mc_meta_e  attribute,
char **  value 
)

Gets the metadata.

Since :
4.0
Remarks:
The value should be released using free().
If the attribute value of the metadata is empty, return value is NULL.
Parameters:
[in]metadataThe handle of the media controller metadata
[in]attributeThe key attribute name to get
[out]valueThe value of the attribute
Returns:
0 on success, otherwise a negative error value
Return values:
MEDIA_CONTROLLER_ERROR_NONESuccessful
MEDIA_CONTROLLER_ERROR_INVALID_PARAMETERInvalid parameter
MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORYOut of memory
Precondition:
Sets mc_client_set_metadata_updated_cb() function to get the metadata if you are media controller client.
and also you can use this function when get the metadata when callback function invoked in mc_playlist_foreach_item().
See also:
mc_client_set_metadata_updated_cb()
mc_playlist_foreach_item()