Tizen Native API  3.0
Stream Information

The Stream Information API provides functions to get audio and video stream information, such as codec type, video width or height, bit rate, and so on.

Required Header

#include <player.h>

Overview

The Player stream information API allows you to get media stream information, including:

  • Content metadata, such as the tile, artist, album title and genre.
  • Audio stream information, such as audio codec type, sample rate, channels, and bit rate.
  • Video stream information, such as video codec type, video width and height.

Functions

int player_get_content_info (player_h player, player_content_info_e key, char **value)
 Gets the media content information.
int player_get_codec_info (player_h player, char **audio_codec, char **video_codec)
 Gets the audio and video codec information.
int player_get_audio_stream_info (player_h player, int *sample_rate, int *channel, int *bit_rate)
 Gets the audio stream information.
int player_get_video_stream_info (player_h player, int *fps, int *bit_rate)
 Gets the video stream information.
int player_get_video_size (player_h player, int *width, int *height)
 Gets the video display's height and width.
int player_get_album_art (player_h player, void **album_art, int *size)
 Gets the album art in the media resource.
int player_get_duration (player_h player, int *duration)
 Gets the total running time of the associated media.

Enumeration Type Documentation

Enumeration for media stream content information.

Since :
2.3.1
Enumerator:
PLAYER_CONTENT_INFO_ALBUM 

Album

PLAYER_CONTENT_INFO_ARTIST 

Artist

PLAYER_CONTENT_INFO_AUTHOR 

Author

PLAYER_CONTENT_INFO_GENRE 

Genre

PLAYER_CONTENT_INFO_TITLE 

Title

PLAYER_CONTENT_INFO_YEAR 

Year


Function Documentation

int player_get_album_art ( player_h  player,
void **  album_art,
int *  size 
)

Gets the album art in the media resource.

Since :
2.3.1
Remarks:
You must not release album_art. It will be released by framework when the player is destroyed.
Parameters:
[in]playerThe handle to the media player
[out]album_artThe encoded artwork image
[out]sizeThe encoded artwork size
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED.
int player_get_audio_stream_info ( player_h  player,
int *  sample_rate,
int *  channel,
int *  bit_rate 
)

Gets the audio stream information.

Since :
2.3.1
Remarks:
The playback type should be local playback or HTTP streaming playback.
Parameters:
[in]playerThe handle to the media player
[out]sample_rateThe audio sample rate [Hz]
Value can be invalid if there is no audio stream information.
[out]channelThe audio channel (1: mono, 2: stereo)
Value can be invalid if there is no audio stream information.
[out]bit_rateThe audio bit rate [Hz]
Value can be invalid if there is no audio stream information.
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED.
int player_get_codec_info ( player_h  player,
char **  audio_codec,
char **  video_codec 
)

Gets the audio and video codec information.

Since :
2.3.1
Remarks:
You must release audio_codec and video_codec using free().
The playback type should be local playback or HTTP streaming playback.
Parameters:
[in]playerThe handle to the media player
[out]audio_codecThe name of the audio codec
It can be NULL if there is no audio codec.
[out]video_codecThe name of the video codec
It can be NULL if there is no video codec.
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED.
int player_get_content_info ( player_h  player,
player_content_info_e  key,
char **  value 
)

Gets the media content information.

Since :
2.3.1
Remarks:
You must release value using free().
The playback type should be local playback or HTTP streaming playback.
Parameters:
[in]playerThe handle to the media player
[in]keyThe key attribute name to get
[out]valueThe value of the key attribute
It can be an empty string if there is no content information.
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_OUT_OF_MEMORYNot enough memory is available
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED.
int player_get_duration ( player_h  player,
int *  duration 
)

Gets the total running time of the associated media.

Since :
2.3.1
Remarks:
The media source is associated with the player, using either player_set_uri() or player_set_memory_buffer().
The playback type should be local playback or HTTP streaming playback.
Parameters:
[in]playerThe handle to the media player
[out]durationThe duration in milliseconds
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED.
See also:
player_set_uri()
player_set_memory_buffer()
int player_get_video_size ( player_h  player,
int *  width,
int *  height 
)

Gets the video display's height and width.

Since :
2.3.1
Remarks:
The playback type should be local playback or HTTP streaming playback.
Parameters:
[in]playerThe handle to the media player
[out]widthThe width of the video
Value can be invalid if there is no video or no display is set.
[out]heightThe height of the video
Value can be invalid value if there is no video or no display is set.
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED.
int player_get_video_stream_info ( player_h  player,
int *  fps,
int *  bit_rate 
)

Gets the video stream information.

Since :
2.3.1
Remarks:
The playback type should be local playback or HTTP streaming playback.
Parameters:
[in]playerThe handle to the media player
[out]fpsThe frame per second of the video
It can be 0 if there is no video stream information.
[out]bit_rateThe video bit rate [Hz]
It can be an invalid value if there is no video stream information.
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED.