plv player sdk doc
|
Typedefs | |
typedef void * | PLVLivePlayerPtr |
live player object type. | |
typedef bool(* | OnLivePlayerVideoFrameHandler) (PLVVideoFrame *frame, void *data) |
player video frame. | |
typedef void(* | OnLivePlayerStateHandler) (int state, void *data) |
player media state. | |
typedef void(* | OnLivePlayerPropertyHandler) (int property, int format, const char *value, void *data) |
player media property value. | |
typedef void(* | OnLivePlayerAudioPlayErrorHandler) (void *data) |
the player play audio error. | |
typedef void(* | OnLivePlayerChannelStateHandler) (int state, void *data) |
channel live state. | |
typedef void(* | OnLivePlayerChannelInfoHandler) (const PLVChannelInfo *info, void *data) |
channel info. | |
Functions | |
PLAYERSDK_API PLVLivePlayerPtr PLAYERSDK_CALL | PLVLivePlayerCreate (void *window) |
Creates the PLVLivePlayerPtr object and returns the pointer. | |
PLAYERSDK_API void PLAYERSDK_CALL | PLVLivePlayerDestroy (PLVLivePlayerPtr player) |
Destory the PLVLivePlayerPtr object. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetVideoFrameHandler (PLVLivePlayerPtr player, OnLivePlayerVideoFrameHandler lockHandler, OnLivePlayerVideoFrameHandler unlockHandler, void *data) |
for video frame callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetStateHandler (PLVLivePlayerPtr player, OnLivePlayerStateHandler handler, void *data) |
for state change callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetPropertyHandler (PLVLivePlayerPtr player, OnLivePlayerPropertyHandler handler, void *data) |
for property change callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetAudioPlayErrorHandler (PLVLivePlayerPtr player, OnLivePlayerAudioPlayErrorHandler handler, void *data) |
for audio play error callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetChannelStateHandler (PLVLivePlayerPtr player, OnLivePlayerChannelStateHandler handler, void *data) |
for channel state change callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetChannelInfoHandler (PLVLivePlayerPtr player, OnLivePlayerChannelInfoHandler handler, void *data) |
for channel info callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetOSDConfig (PLVLivePlayerPtr player, bool enable, const PLVOsdConfigInfo *config) |
set the video OSD config info | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerGetOSDConfig (PLVLivePlayerPtr player, PLVOsdConfigInfo *config) |
get the video OSD config info. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetLogoText (PLVLivePlayerPtr player, bool enable, const PLVLogoTextInfo *config) |
set the video Logo text info | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerGetLogoText (PLVLivePlayerPtr player, PLVLogoTextInfo *config) |
get the video Logo text info. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetCacheConfig (PLVLivePlayerPtr player, int cacheMs, bool speedTrackingEnable, bool seekTrackingEnable) |
set player cache config. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerGetCacheConfig (PLVLivePlayerPtr player, int *cacheMs, bool *speedTrackingEnable, bool *seekTrackingEnable) |
get player cache config. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetLine (PLVLivePlayerPtr player, int lineIndex) |
set live play line, you can get line info after channel info callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetQuality (PLVLivePlayerPtr player, int qualityIndex) |
set live play quality, you can get quality info after channel info callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetPlayMode (PLVLivePlayerPtr player, int playMode) |
set live play mode, you can get mode info after channel info callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetToken (PLVLivePlayerPtr player, const char *token) |
reserved | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerPlay (PLVLivePlayerPtr player, const char *channelId) |
play the channel living.Always asynchronously. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerPause (PLVLivePlayerPtr player, bool pause) |
pause or resume the video. | |
PLAYERSDK_API bool PLAYERSDK_CALL | PLVLivePlayerIsPause (PLVLivePlayerPtr player) |
the video play state or pause. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerStop (PLVLivePlayerPtr player) |
stop the play. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerMute (PLVLivePlayerPtr player, bool mute) |
set the video mute state. | |
PLAYERSDK_API bool PLAYERSDK_CALL | PLVLivePlayerIsMute (PLVLivePlayerPtr player) |
the video mute state. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetVolume (PLVLivePlayerPtr player, int volume) |
set the video volume. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetVolumeMax (PLVLivePlayerPtr player, int volume) |
set the video volume gain. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerGetVolume (PLVLivePlayerPtr player) |
the video volume. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerScreenshot (PLVLivePlayerPtr player, const char *filename) |
screenshot the play video picture. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerGetCurrentAudioDevice (PLVLivePlayerPtr player, char deviceId[PLV_MAX_DEVICE_ID_LENGTH]) |
the current audio device id. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVLivePlayerSetCurrentAudioDevice (PLVLivePlayerPtr player, const char deviceId[PLV_MAX_DEVICE_ID_LENGTH]) |
set the current audio device. | |
typedef void(* OnLivePlayerAudioPlayErrorHandler) (void *data) |
the player play audio error.
[out] | data | user context data. |
Definition at line 37 of file plv-player-live.h.
typedef void(* OnLivePlayerChannelInfoHandler) (const PLVChannelInfo *info, void *data) |
channel info.
[out] | info | the channel info. |
[out] | data | user context data. |
Definition at line 52 of file plv-player-live.h.
typedef void(* OnLivePlayerChannelStateHandler) (int state, void *data) |
channel live state.
[out] | state | the channel state. |
[out] | data | user context data. |
Definition at line 44 of file plv-player-live.h.
typedef void(* OnLivePlayerPropertyHandler) (int property, int format, const char *value, void *data) |
player media property value.
[out] | property | the property type. |
[out] | format | the value type. |
[out] | value | property value. |
[out] | data | user context data. |
Definition at line 31 of file plv-player-live.h.
typedef void(* OnLivePlayerStateHandler) (int state, void *data) |
player media state.
[out] | state | the player state. |
[out] | data | user context data. |
Definition at line 22 of file plv-player-live.h.
typedef bool(* OnLivePlayerVideoFrameHandler) (PLVVideoFrame *frame, void *data) |
player video frame.
[out] | frame | video frame. |
[out] | data | user context data. |
Definition at line 15 of file plv-player-live.h.
typedef void* PLVLivePlayerPtr |
live player object type.
Definition at line 8 of file plv-player-live.h.
PLAYERSDK_API PLVLivePlayerPtr PLAYERSDK_CALL PLVLivePlayerCreate | ( | void * | window | ) |
Creates the PLVLivePlayerPtr object and returns the pointer.
window | for the window handler. |
PLAYERSDK_API void PLAYERSDK_CALL PLVLivePlayerDestroy | ( | PLVLivePlayerPtr | player | ) |
Destory the PLVLivePlayerPtr object.
player | the player object, for PLVLivePlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetCacheConfig | ( | PLVLivePlayerPtr | player, |
int * | cacheMs, | ||
bool * | speedTrackingEnable, | ||
bool * | seekTrackingEnable ) |
get player cache config.
player | the player object, for PLVLivePlayerCreate return. |
cacheMs[out] | the cache duration(ms) of the player |
speedTrackingEnable[out] | Whether frame tracking through control play speed |
seekTrackingEnable[out] | Whether seek forword when cache buffer too large |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetCurrentAudioDevice | ( | PLVLivePlayerPtr | player, |
char | deviceId[PLV_MAX_DEVICE_ID_LENGTH] ) |
the current audio device id.
player | the player object, for PLVLivePlayerCreate return. |
[out] | deviceId | audio device id. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetLogoText | ( | PLVLivePlayerPtr | player, |
PLVLogoTextInfo * | config ) |
get the video Logo text info.
player | the player object, for PLVLivePlayerCreate return. |
[out] | config | Logo info. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetOSDConfig | ( | PLVLivePlayerPtr | player, |
PLVOsdConfigInfo * | config ) |
get the video OSD config info.
player | the player object, for PLVLivePlayerCreate return. |
[out] | config | OSD info. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetVolume | ( | PLVLivePlayerPtr | player | ) |
the video volume.
player | the player object, for PLVLivePlayerCreate return. |
PLAYERSDK_API bool PLAYERSDK_CALL PLVLivePlayerIsMute | ( | PLVLivePlayerPtr | player | ) |
the video mute state.
player | the player object, for PLVLivePlayerCreate return. |
PLAYERSDK_API bool PLAYERSDK_CALL PLVLivePlayerIsPause | ( | PLVLivePlayerPtr | player | ) |
the video play state or pause.
player | the player object, for PLVLivePlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerMute | ( | PLVLivePlayerPtr | player, |
bool | mute ) |
set the video mute state.
player | the player object, for PLVLivePlayerCreate return. |
mute | play state. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerPause | ( | PLVLivePlayerPtr | player, |
bool | pause ) |
pause or resume the video.
player | the player object, for PLVLivePlayerCreate return. |
pause | play state. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerPlay | ( | PLVLivePlayerPtr | player, |
const char * | channelId ) |
play the channel living.Always asynchronously.
player | the player object, for PLVLivePlayerCreate return. |
channelId | channel Id. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerScreenshot | ( | PLVLivePlayerPtr | player, |
const char * | filename ) |
screenshot the play video picture.
player | the player object, for PLVLivePlayerCreate return. |
filename | png/jpg file, use UTF8. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetAudioPlayErrorHandler | ( | PLVLivePlayerPtr | player, |
OnLivePlayerAudioPlayErrorHandler | handler, | ||
void * | data ) |
for audio play error callback.
player | the player object, for PLVLivePlayerCreate return. |
handler | callback function. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetCacheConfig | ( | PLVLivePlayerPtr | player, |
int | cacheMs, | ||
bool | speedTrackingEnable, | ||
bool | seekTrackingEnable ) |
set player cache config.
player | the player object, for PLVLivePlayerCreate return. |
cacheMs | the cache duration(ms) of the player, Default 2000ms. |
speedTrackingEnable | Whether frame tracking through control play speed, Default true |
seekTrackingEnable | Whether seek forword when cache buffer too large, Default true |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetChannelInfoHandler | ( | PLVLivePlayerPtr | player, |
OnLivePlayerChannelInfoHandler | handler, | ||
void * | data ) |
for channel info callback.
player | the player object, for PLVLivePlayerCreate return. |
handler | callback function. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetChannelStateHandler | ( | PLVLivePlayerPtr | player, |
OnLivePlayerChannelStateHandler | handler, | ||
void * | data ) |
for channel state change callback.
player | the player object, for PLVLivePlayerCreate return. |
handler | callback function. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetCurrentAudioDevice | ( | PLVLivePlayerPtr | player, |
const char | deviceId[PLV_MAX_DEVICE_ID_LENGTH] ) |
set the current audio device.
player | the player object, for PLVLivePlayerCreate return. |
deviceId | audio device id. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetLine | ( | PLVLivePlayerPtr | player, |
int | lineIndex ) |
set live play line, you can get line info after channel info callback.
player | the player object, for PLVLivePlayerCreate return. |
lineIndex | line index, Default 0. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetLogoText | ( | PLVLivePlayerPtr | player, |
bool | enable, | ||
const PLVLogoTextInfo * | config ) |
set the video Logo text info
player | the player object, for PLVLivePlayerCreate return. |
enable | use or not logo text. |
config | Logo info. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetOSDConfig | ( | PLVLivePlayerPtr | player, |
bool | enable, | ||
const PLVOsdConfigInfo * | config ) |
set the video OSD config info
player | the player object, for PLVLivePlayerCreate return. |
enable | use or not OSD. |
config | OSD info. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetPlayMode | ( | PLVLivePlayerPtr | player, |
int | playMode ) |
set live play mode, you can get mode info after channel info callback.
player | the player object, for PLVLivePlayerCreate return. |
playMode | play mode. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetPropertyHandler | ( | PLVLivePlayerPtr | player, |
OnLivePlayerPropertyHandler | handler, | ||
void * | data ) |
for property change callback.
player | the player object, for PLVLivePlayerCreate return. |
handler | callback function. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetQuality | ( | PLVLivePlayerPtr | player, |
int | qualityIndex ) |
set live play quality, you can get quality info after channel info callback.
player | the player object, for PLVLivePlayerCreate return. |
qualityIndex | quality index, Default 0. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetStateHandler | ( | PLVLivePlayerPtr | player, |
OnLivePlayerStateHandler | handler, | ||
void * | data ) |
for state change callback.
player | the player object, for PLVLivePlayerCreate return. |
handler | callback function. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetToken | ( | PLVLivePlayerPtr | player, |
const char * | token ) |
reserved
player | the player object, for PLVLivePlayerCreate return. |
token | play token |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVideoFrameHandler | ( | PLVLivePlayerPtr | player, |
OnLivePlayerVideoFrameHandler | lockHandler, | ||
OnLivePlayerVideoFrameHandler | unlockHandler, | ||
void * | data ) |
for video frame callback.
player | the player object, for PLVLivePlayerCreate return. |
lockHandler | callback function for lock buffer. |
unlockHandler | callback function for unlock buffer. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVolume | ( | PLVLivePlayerPtr | player, |
int | volume ) |
set the video volume.
player | the player object, for PLVLivePlayerCreate return. |
volume | <0-100> if 0 will mute. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVolumeMax | ( | PLVLivePlayerPtr | player, |
int | volume ) |
set the video volume gain.
player | the player object, for PLVLivePlayerCreate return. |
volume | <100-1000> if big 1000 will return failure. |
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerStop | ( | PLVLivePlayerPtr | player | ) |
stop the play.
player | the player object, for PLVLivePlayerCreate return. |