Tizen Native API
7.0
|
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] src The source handle of the media controller metadata [out] dst The destination handle of the media controller metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out 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_episode The encoded episode information [out] episode_num The episode number [out] episode_title The episode title
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out of memory
- Precondition:
- Get the encoded episode information by calling mc_metadata_get()
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_resolution The encoded resolution information [out] width Content width [out] height Content height
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out of memory
- Precondition:
- Get the encoded resolution information by calling mc_metadata_get()
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_season The encoded season information [out] season_num The season number [out] season_title The season title
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out of memory
- Precondition:
- Get the encoded season information by calling mc_metadata_get()
int mc_metadata_destroy | ( | mc_metadata_h | metadata | ) |
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] metadata The handle of the media controller metadata
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid 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_num The episode number [in] episode_title The episode title [out] encoded_episode The encoded episode information
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out of memory
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] width Content width [in] height Content height [out] encoded_resolution The encoded resolution information
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out of memory
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_num The season number [in] season_title The season title [out] encoded_season The encoded season information
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out of memory
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] metadata The handle of the media controller metadata [in] attribute The key attribute name to get [out] value The value of the attribute
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
MEDIA_CONTROLLER_ERROR_NONE Successful MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER Invalid parameter MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY Out 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 inmc_playlist_foreach_item()
.