Tizen Native API
3.0
|
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
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] player The handle to the media player [out] album_art The encoded artwork image [out] size The encoded artwork size
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PLAYER_ERROR_NONE Successful PLAYER_ERROR_INVALID_PARAMETER Invalid parameter PLAYER_ERROR_INVALID_OPERATION Invalid operation PLAYER_ERROR_INVALID_STATE Invalid 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] player The handle to the media player [out] sample_rate The audio sample rate [Hz]
Value can be invalid if there is no audio stream information.[out] channel The audio channel (1: mono, 2: stereo)
Value can be invalid if there is no audio stream information.[out] bit_rate The 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_NONE Successful PLAYER_ERROR_INVALID_PARAMETER Invalid parameter PLAYER_ERROR_INVALID_OPERATION Invalid operation PLAYER_ERROR_INVALID_STATE Invalid 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] player The handle to the media player [out] audio_codec The name of the audio codec
It can beNULL
if there is no audio codec.[out] video_codec The name of the video codec
It can beNULL
if there is no video codec.
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PLAYER_ERROR_NONE Successful PLAYER_ERROR_INVALID_PARAMETER Invalid parameter PLAYER_ERROR_INVALID_OPERATION Invalid operation PLAYER_ERROR_INVALID_STATE Invalid 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] player The handle to the media player [in] key The key attribute name to get [out] value The 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_NONE Successful PLAYER_ERROR_INVALID_PARAMETER Invalid parameter PLAYER_ERROR_OUT_OF_MEMORY Not enough memory is available PLAYER_ERROR_INVALID_OPERATION Invalid operation PLAYER_ERROR_INVALID_STATE Invalid 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] player The handle to the media player [out] duration The duration in milliseconds
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PLAYER_ERROR_NONE Successful PLAYER_ERROR_INVALID_PARAMETER Invalid parameter PLAYER_ERROR_INVALID_OPERATION Invalid operation PLAYER_ERROR_INVALID_STATE Invalid player state
- Precondition:
- The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED.
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] player The handle to the media player [out] width The width of the video
Value can be invalid if there is no video or no display is set.[out] height The 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_NONE Successful PLAYER_ERROR_INVALID_PARAMETER Invalid parameter PLAYER_ERROR_INVALID_OPERATION Invalid operation PLAYER_ERROR_INVALID_STATE Invalid 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] player The handle to the media player [out] fps The frame per second of the video
It can be0
if there is no video stream information.[out] bit_rate The 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_NONE Successful PLAYER_ERROR_INVALID_PARAMETER Invalid parameter PLAYER_ERROR_INVALID_OPERATION Invalid operation PLAYER_ERROR_INVALID_STATE Invalid player state
- Precondition:
- The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED.