plv player sdk doc
|
Typedefs | |
typedef void * | PLVPlayerPtr |
player object type. | |
typedef bool(* | OnPlayerVideoFrameHandler) (const char *vid, PLVVideoFrame *frame, void *data) |
player video frame. | |
typedef void(* | OnPlayerStateHandler) (const char *vid, int state, void *data) |
player media state. | |
typedef void(* | OnPlayerPropertyHandler) (const char *vid, int property, int format, const char *value, void *data) |
player media property value. | |
typedef void(* | OnPlayerRateChangeHandler) (const char *vid, int inputRate, int realRate, void *data) |
the player rate change. | |
typedef void(* | OnPlayerProgressHandler) (const char *vid, int millisecond, void *data) |
the player play media progress. | |
typedef void(* | OnPlayerAudioDeviceHandler) (int audioDeviceCount, void *data) |
the player audio device list change. | |
Functions | |
PLAYERSDK_API PLVPlayerPtr PLAYERSDK_CALL | PLVPlayerCreate (void *window) |
Creates the PLVPlayerPtr object and returns the pointer. | |
PLAYERSDK_API void PLAYERSDK_CALL | PLVPlayerDestroy (PLVPlayerPtr player) |
Destory the PLVPlayerPtr object. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetVideoFrameHandler (PLVPlayerPtr player, OnPlayerVideoFrameHandler lockHandler, OnPlayerVideoFrameHandler unlockHandler, void *data) |
for video frame callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetStateHandler (PLVPlayerPtr player, OnPlayerStateHandler handler, void *data) |
for state change callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetPropertyHandler (PLVPlayerPtr player, OnPlayerPropertyHandler handler, void *data) |
for property change callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetRateChangeHandler (PLVPlayerPtr player, OnPlayerRateChangeHandler handler, void *data) |
for current bit chanage callback, the input rate is VIDEO_RATE_AUTO will callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetProgressHandler (PLVPlayerPtr player, OnPlayerProgressHandler handler, void *data) |
for play progress callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetAudioDeviceHandler (PLVPlayerPtr player, OnPlayerAudioDeviceHandler handler, void *data) |
for play audio device list callback. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerResetHandler (PLVPlayerPtr player) |
for reset all handler. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetOSDConfig (PLVPlayerPtr player, bool enable, const PLVOsdConfigInfo *config) |
set the video OSD config info | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerGetOSDConfig (PLVPlayerPtr player, PLVOsdConfigInfo &config) |
get the video OSD config info. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetLogoText (PLVPlayerPtr player, bool enable, const PLVLogoTextInfo *config) |
set the video Logo text info | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerGetLogoText (PLVPlayerPtr player, PLVLogoTextInfo &config) |
get the video Logo text info. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetCacheConfig (PLVPlayerPtr player, bool enable, int maxCacheBytes, int maxCacheSeconds) |
set the video cache config info. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerGetCacheConfig (PLVPlayerPtr player, int *maxCacheBytes, int *maxCacheSeconds) |
get the video cache config info. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetInfo (PLVPlayerPtr player, const char *vid, const char *path, int rate) |
set the video info before play. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerPlay (PLVPlayerPtr player, const char *token, int seekMillisecond, bool autoDownRate, bool traceVideo, bool sync) |
play the video. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerPlayLocal (PLVPlayerPtr player, int seekMillisecond, bool autoDownRate) |
play local video, must set the video path. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerLoadLocal (PLVPlayerPtr player, int seekMillisecond, bool autoDownRate) |
load local video, no play, must set the video path. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerPause (PLVPlayerPtr player, bool pause) |
pause the video. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerStop (PLVPlayerPtr player) |
stop the video. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetMute (PLVPlayerPtr player, bool mute) |
set the video mute state. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetSeek (PLVPlayerPtr player, int millisecond) |
seek the play pos. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSeekToEnd (PLVPlayerPtr player) |
stop in end frame. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetVolume (PLVPlayerPtr player, int volume) |
set the video volume. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetVolumeMax (PLVPlayerPtr player, int volume) |
set the video volume gain. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerScreenshot (PLVPlayerPtr player, const char *filename) |
screenshot the play video picture. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetSpeed (PLVPlayerPtr player, double speed) |
Slow down or speed up playback by the factor given as parameter. | |
PLAYERSDK_API bool PLAYERSDK_CALL | PLVPlayerIsMute (PLVPlayerPtr player) |
the video mute state. | |
PLAYERSDK_API bool PLAYERSDK_CALL | PLVPlayerIsValid (PLVPlayerPtr player) |
the video have load or idle. | |
PLAYERSDK_API bool PLAYERSDK_CALL | PLVPlayerIsPause (PLVPlayerPtr player) |
the video play state or pause. | |
PLAYERSDK_API bool PLAYERSDK_CALL | PLVPlayerIsPlaying (PLVPlayerPtr player) |
the video playing or idle. | |
PLAYERSDK_API bool PLAYERSDK_CALL | PLVPlayerIsLoaded (PLVPlayerPtr player) |
the video have load or idle. | |
PLAYERSDK_API bool PLAYERSDK_CALL | PLVPlayerIsLoading (PLVPlayerPtr player) |
the video is loading or idle. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerGetCurrentRateCount (PLVPlayerPtr player) |
the video have rate count. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerGetCurrentRate (PLVPlayerPtr player) |
the video current rate. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerGetVolume (PLVPlayerPtr player) |
the video volume. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerGetDuration (PLVPlayerPtr player) |
the video duration. | |
PLAYERSDK_API double PLAYERSDK_CALL | PLVPlayerGetSpeed (PLVPlayerPtr player) |
the video speed. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerGetAudioDeviceCount (PLVPlayerPtr player) |
get audio device count. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerGetAudioDeviceInfo (PLVPlayerPtr player, int index, char deviceId[PLV_MAX_DEVICE_ID_LENGTH], char deviceName[PLV_MAX_DEVICE_ID_LENGTH]) |
the audio device info. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerGetCurrentAudioDevice (PLVPlayerPtr player, char deviceId[PLV_MAX_DEVICE_ID_LENGTH]) |
the current audio device id. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerSetCurrentAudioDevice (PLVPlayerPtr player, const char deviceId[PLV_MAX_DEVICE_ID_LENGTH]) |
set the current audio device. | |
PLAYERSDK_API int PLAYERSDK_CALL | PLVPlayerReloadAudioDevice (PLVPlayerPtr player) |
reload the audio device. | |
typedef void(* OnPlayerAudioDeviceHandler) (int audioDeviceCount, void *data) |
the player audio device list change.
[out] | audioDeviceCount | audio device count. |
[out] | data | user context data. |
Definition at line 385 of file plv-player-core.h.
typedef void(* OnPlayerProgressHandler) (const char *vid, int millisecond, void *data) |
the player play media progress.
[out] | vid | video id. |
[out] | millisecond | time pos. |
[out] | data | user context data. |
Definition at line 378 of file plv-player-core.h.
typedef void(* OnPlayerPropertyHandler) (const char *vid, int property, int format, const char *value, void *data) |
player media property value.
[out] | vid | the video id. |
[out] | property | the property type. |
[out] | format | the value type. |
[out] | value | property value. |
[out] | data | user context data. |
Definition at line 360 of file plv-player-core.h.
typedef void(* OnPlayerRateChangeHandler) (const char *vid, int inputRate, int realRate, void *data) |
the player rate change.
[out] | vid | video id. |
[out] | inputRate | user input rate. |
[out] | realRate | actual real rate. |
[out] | data | user context data. |
Definition at line 369 of file plv-player-core.h.
typedef void(* OnPlayerStateHandler) (const char *vid, int state, void *data) |
player media state.
[out] | vid | the video id. |
[out] | state | the player state. |
[out] | data | user context data. |
Definition at line 351 of file plv-player-core.h.
typedef bool(* OnPlayerVideoFrameHandler) (const char *vid, PLVVideoFrame *frame, void *data) |
player video frame.
[out] | vid | the video id. |
[out] | frame | video frame. |
[out] | data | user context data. |
Definition at line 344 of file plv-player-core.h.
typedef void* PLVPlayerPtr |
player object type.
Definition at line 337 of file plv-player-core.h.
PLAYERSDK_API PLVPlayerPtr PLAYERSDK_CALL PLVPlayerCreate | ( | void * | window | ) |
Creates the PLVPlayerPtr object and returns the pointer.
window | for the window handler. |
PLAYERSDK_API void PLAYERSDK_CALL PLVPlayerDestroy | ( | PLVPlayerPtr | player | ) |
Destory the PLVPlayerPtr object.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetAudioDeviceCount | ( | PLVPlayerPtr | player | ) |
get audio device count.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetAudioDeviceInfo | ( | PLVPlayerPtr | player, |
int | index, | ||
char | deviceId[PLV_MAX_DEVICE_ID_LENGTH], | ||
char | deviceName[PLV_MAX_DEVICE_ID_LENGTH] ) |
the audio device info.
player | the player object, for PLVPlayerCreate return. |
index | audio device index. | |
[out] | deviceId | audio device id. |
[out] | deviceName | audio device name. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCacheConfig | ( | PLVPlayerPtr | player, |
int * | maxCacheBytes, | ||
int * | maxCacheSeconds ) |
get the video cache config info.
player | the player object, for PLVPlayerCreate return. |
[out] | maxCacheBytes | cache bytes. |
[out] | maxCacheSeconds | cache seconds. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentAudioDevice | ( | PLVPlayerPtr | player, |
char | deviceId[PLV_MAX_DEVICE_ID_LENGTH] ) |
the current audio device id.
player | the player object, for PLVPlayerCreate return. |
[out] | deviceId | audio device id. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentRate | ( | PLVPlayerPtr | player | ) |
the video current rate.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentRateCount | ( | PLVPlayerPtr | player | ) |
the video have rate count.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetDuration | ( | PLVPlayerPtr | player | ) |
the video duration.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetLogoText | ( | PLVPlayerPtr | player, |
PLVLogoTextInfo & | config ) |
get the video Logo text info.
player | the player object, for PLVPlayerCreate return. |
[out] | config | Logo info. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetOSDConfig | ( | PLVPlayerPtr | player, |
PLVOsdConfigInfo & | config ) |
get the video OSD config info.
player | the player object, for PLVPlayerCreate return. |
[out] | config | OSD info. |
PLAYERSDK_API double PLAYERSDK_CALL PLVPlayerGetSpeed | ( | PLVPlayerPtr | player | ) |
the video speed.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetVolume | ( | PLVPlayerPtr | player | ) |
the video volume.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsLoaded | ( | PLVPlayerPtr | player | ) |
the video have load or idle.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsLoading | ( | PLVPlayerPtr | player | ) |
the video is loading or idle.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsMute | ( | PLVPlayerPtr | player | ) |
the video mute state.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsPause | ( | PLVPlayerPtr | player | ) |
the video play state or pause.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsPlaying | ( | PLVPlayerPtr | player | ) |
the video playing or idle.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsValid | ( | PLVPlayerPtr | player | ) |
the video have load or idle.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerLoadLocal | ( | PLVPlayerPtr | player, |
int | seekMillisecond, | ||
bool | autoDownRate ) |
load local video, no play, must set the video path.
player | the player object, for PLVPlayerCreate return. |
seekMillisecond | play in time pos. |
autoDownRate | if false will no exist the rate return error. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPause | ( | PLVPlayerPtr | player, |
bool | pause ) |
pause the video.
player | the player object, for PLVPlayerCreate return. |
pause | play state. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPlay | ( | PLVPlayerPtr | player, |
const char * | token, | ||
int | seekMillisecond, | ||
bool | autoDownRate, | ||
bool | traceVideo, | ||
bool | sync ) |
play the video.
player | the player object, for PLVPlayerCreate return. |
token | play encryption video mute use it. |
seekMillisecond | play in time pos. |
autoDownRate | if false will no exist the rate return error. |
traceVideo | true only when in trace video. |
sync | use sync or asynchronous. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPlayLocal | ( | PLVPlayerPtr | player, |
int | seekMillisecond, | ||
bool | autoDownRate ) |
play local video, must set the video path.
player | the player object, for PLVPlayerCreate return. |
seekMillisecond | play in time pos. |
autoDownRate | if false will no exist the rate return error. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerReloadAudioDevice | ( | PLVPlayerPtr | player | ) |
reload the audio device.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerResetHandler | ( | PLVPlayerPtr | player | ) |
for reset all handler.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerScreenshot | ( | PLVPlayerPtr | player, |
const char * | filename ) |
screenshot the play video picture.
player | the player object, for PLVPlayerCreate return. |
filename | png/jpg file, use UTF8. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSeekToEnd | ( | PLVPlayerPtr | player | ) |
stop in end frame.
player | the player object, for PLVPlayerCreate return. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetAudioDeviceHandler | ( | PLVPlayerPtr | player, |
OnPlayerAudioDeviceHandler | handler, | ||
void * | data ) |
for play audio device list callback.
player | the player object, for PLVPlayerCreate return. |
handler | callback function. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetCacheConfig | ( | PLVPlayerPtr | player, |
bool | enable, | ||
int | maxCacheBytes, | ||
int | maxCacheSeconds ) |
set the video cache config info.
player | the player object, for PLVPlayerCreate return. |
enable | use or not cache, decide whether to use network cache settings (default: auto). |
maxCacheBytes | default 100 * 1024 * 1024, Set these limits higher if you get a packet queue overflow warning, and you think normal playback would be possible with a larger packet queue. |
maxCacheSeconds | default 30, The main purpose of this option is to limit the readhead for local playback, since a large readahead value is not overly useful in this case. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetCurrentAudioDevice | ( | PLVPlayerPtr | player, |
const char | deviceId[PLV_MAX_DEVICE_ID_LENGTH] ) |
set the current audio device.
player | the player object, for PLVPlayerCreate return. |
deviceId | audio device id. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetInfo | ( | PLVPlayerPtr | player, |
const char * | vid, | ||
const char * | path, | ||
int | rate ) |
set the video info before play.
player | the player object, for PLVPlayerCreate return. |
vid | video id. |
path | if play local video, mute set it, use UTF8. |
rate | the video rate. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetLogoText | ( | PLVPlayerPtr | player, |
bool | enable, | ||
const PLVLogoTextInfo * | config ) |
set the video Logo text info
player | the player object, for PLVPlayerCreate return. |
enable | use or not logo text. |
config | Logo info. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetMute | ( | PLVPlayerPtr | player, |
bool | mute ) |
set the video mute state.
player | the player object, for PLVPlayerCreate return. |
mute | play state. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetOSDConfig | ( | PLVPlayerPtr | player, |
bool | enable, | ||
const PLVOsdConfigInfo * | config ) |
set the video OSD config info
player | the player object, for PLVPlayerCreate return. |
enable | use or not OSD. |
config | OSD info. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetProgressHandler | ( | PLVPlayerPtr | player, |
OnPlayerProgressHandler | handler, | ||
void * | data ) |
for play progress callback.
player | the player object, for PLVPlayerCreate return. |
handler | callback function. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetPropertyHandler | ( | PLVPlayerPtr | player, |
OnPlayerPropertyHandler | handler, | ||
void * | data ) |
for property change callback.
player | the player object, for PLVPlayerCreate return. |
handler | callback function. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetRateChangeHandler | ( | PLVPlayerPtr | player, |
OnPlayerRateChangeHandler | handler, | ||
void * | data ) |
for current bit chanage callback, the input rate is VIDEO_RATE_AUTO will callback.
player | the player object, for PLVPlayerCreate return. |
handler | callback function. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSeek | ( | PLVPlayerPtr | player, |
int | millisecond ) |
seek the play pos.
player | the player object, for PLVPlayerCreate return. |
millisecond | set time pos. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSpeed | ( | PLVPlayerPtr | player, |
double | speed ) |
Slow down or speed up playback by the factor given as parameter.
player | the player object, for PLVPlayerCreate return. |
speed | <0.01 - 100> 1.0 normal. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetStateHandler | ( | PLVPlayerPtr | player, |
OnPlayerStateHandler | handler, | ||
void * | data ) |
for state change callback.
player | the player object, for PLVPlayerCreate return. |
handler | callback function. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVideoFrameHandler | ( | PLVPlayerPtr | player, |
OnPlayerVideoFrameHandler | lockHandler, | ||
OnPlayerVideoFrameHandler | unlockHandler, | ||
void * | data ) |
for video frame callback.
player | the player object, for PLVPlayerCreate return. |
lockHandler | callback function for lock buffer. |
unlockHandler | callback function for unlock buffer. |
data | user context data. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVolume | ( | PLVPlayerPtr | player, |
int | volume ) |
set the video volume.
player | the player object, for PLVPlayerCreate return. |
volume | <0-100> if 0 will mute. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVolumeMax | ( | PLVPlayerPtr | player, |
int | volume ) |
set the video volume gain.
player | the player object, for PLVPlayerCreate return. |
volume | <100-1000> if big 1000 will return failure. |
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerStop | ( | PLVPlayerPtr | player | ) |
stop the video.
player | the player object, for PLVPlayerCreate return. |