plv player sdk doc
Loading...
Searching...
No Matches
plv-player-vod.h
Go to the documentation of this file.
1#pragma once
2#include "plv-player-def.h"
3
5
8typedef void *PLVPlayerPtr;
15typedef bool (*OnPlayerVideoFrameHandler)(const char *vid, PLVVideoFrame *frame, void *data);
22typedef void (*OnPlayerStateHandler)(const char *vid, int state, void *data);
31typedef void (*OnPlayerPropertyHandler)(const char *vid, int property, int format, const char *value, void *data);
39typedef void (*OnPlayerRateChangeHandler)(const char *vid, int inputRate, int realRate, void *data);
47typedef void (*OnPlayerProgressHandler)(const char *vid, int millisecond, void *data);
48
54typedef void (*OnPlayerAudioPlayErrorHandler)(const char *vid, void *data);
55
63PLAYERSDK_API PLVPlayerPtr PLAYERSDK_CALL PLVPlayerCreate(void *window);
68PLAYERSDK_API void PLAYERSDK_CALL PLVPlayerDestroy(PLVPlayerPtr player);
79PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVideoFrameHandler(PLVPlayerPtr player,
80 OnPlayerVideoFrameHandler lockHandler,
81 OnPlayerVideoFrameHandler unlockHandler, void *data);
91PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetStateHandler(PLVPlayerPtr player, OnPlayerStateHandler handler,
92 void *data);
102PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetPropertyHandler(PLVPlayerPtr player, OnPlayerPropertyHandler handler,
103 void *data);
113PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetRateChangeHandler(PLVPlayerPtr player, OnPlayerRateChangeHandler handler,
114 void *data);
124PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetProgressHandler(PLVPlayerPtr player, OnPlayerProgressHandler handler,
125 void *data);
135PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetAudioPlayErrorHandler(PLVPlayerPtr player,
136 OnPlayerAudioPlayErrorHandler handler, void *data);
137
145PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerResetHandler(PLVPlayerPtr player);
155PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetOSDConfig(PLVPlayerPtr player, bool enable,
156 const PLVOsdConfigInfo *config);
165PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetOSDConfig(PLVPlayerPtr player, PLVOsdConfigInfo &config);
175PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetLogoText(PLVPlayerPtr player, bool enable, const PLVLogoTextInfo *config);
184PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetLogoText(PLVPlayerPtr player, PLVLogoTextInfo &config);
197PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetCacheConfig(PLVPlayerPtr player, bool enable, int maxCacheBytes,
198 int maxCacheSeconds);
208PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCacheConfig(PLVPlayerPtr player, int *maxCacheBytes, int *maxCacheSeconds);
220PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetInfo(PLVPlayerPtr player, const char *vid, const char *path, int rate);
234PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPlay(PLVPlayerPtr player, const char *token, int seekMillisecond,
235 bool autoDownRate, bool traceVideo, bool sync);
245PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPlayLocal(PLVPlayerPtr player, int seekMillisecond, bool autoDownRate);
255PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerLoadLocal(PLVPlayerPtr player, int seekMillisecond, bool autoDownRate);
264PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPause(PLVPlayerPtr player, bool pause);
272PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerStop(PLVPlayerPtr player);
281PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetMute(PLVPlayerPtr player, bool mute);
290PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSeek(PLVPlayerPtr player, int millisecond);
298PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSeekToEnd(PLVPlayerPtr player);
307PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVolume(PLVPlayerPtr player, int volume);
316PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVolumeMax(PLVPlayerPtr player, int volume);
326PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerScreenshot(PLVPlayerPtr player, const char *filename);
335PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSpeed(PLVPlayerPtr player, double speed);
343PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsMute(PLVPlayerPtr player);
351PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsValid(PLVPlayerPtr player);
359PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsPause(PLVPlayerPtr player);
367PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsPlaying(PLVPlayerPtr player);
375PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsLoaded(PLVPlayerPtr player);
383PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsLoading(PLVPlayerPtr player);
391PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentRateCount(PLVPlayerPtr player);
399PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentRate(PLVPlayerPtr player);
407PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetVolume(PLVPlayerPtr player);
415PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetDuration(PLVPlayerPtr player);
422PLAYERSDK_API double PLAYERSDK_CALL PLVPlayerGetSpeed(PLVPlayerPtr player);
431PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentAudioDevice(PLVPlayerPtr player,
432 char deviceId[PLV_MAX_DEVICE_ID_LENGTH]);
433
442PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetCurrentAudioDevice(PLVPlayerPtr player,
443 const char deviceId[PLV_MAX_DEVICE_ID_LENGTH]);
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetDuration(PLVPlayerPtr player)
the video duration.
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsLoaded(PLVPlayerPtr player)
the video have load or idle.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetVolume(PLVPlayerPtr player)
the video volume.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentRate(PLVPlayerPtr player)
the video current rate.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetPropertyHandler(PLVPlayerPtr player, OnPlayerPropertyHandler handler, void *data)
for property change callback.
void(* OnPlayerProgressHandler)(const char *vid, int millisecond, void *data)
the player play media progress.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetSpeed(PLVPlayerPtr player, double speed)
Slow down or speed up playback by the factor given as parameter.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPlayLocal(PLVPlayerPtr player, int seekMillisecond, bool autoDownRate)
play local video, must set the video path.
PLAYERSDK_API PLVPlayerPtr PLAYERSDK_CALL PLVPlayerCreate(void *window)
Creates the PLVPlayerPtr object and returns the pointer.
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 PLVPlayerSetSeek(PLVPlayerPtr player, int millisecond)
seek the play pos.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVideoFrameHandler(PLVPlayerPtr player, OnPlayerVideoFrameHandler lockHandler, OnPlayerVideoFrameHandler unlockHandler, void *data)
for video frame callback.
PLAYERSDK_API double PLAYERSDK_CALL PLVPlayerGetSpeed(PLVPlayerPtr player)
the video speed.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetLogoText(PLVPlayerPtr player, bool enable, const PLVLogoTextInfo *config)
set the video Logo text info
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetProgressHandler(PLVPlayerPtr player, OnPlayerProgressHandler handler, void *data)
for play progress callback.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSeekToEnd(PLVPlayerPtr player)
stop in end frame.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetCurrentAudioDevice(PLVPlayerPtr player, char deviceId[PLV_MAX_DEVICE_ID_LENGTH])
the current audio device id.
void(* OnPlayerPropertyHandler)(const char *vid, int property, int format, const char *value, void *data)
player media property value.
void(* OnPlayerRateChangeHandler)(const char *vid, int inputRate, int realRate, void *data)
the player rate change.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetAudioPlayErrorHandler(PLVPlayerPtr player, OnPlayerAudioPlayErrorHandler handler, void *data)
for audio play error callback.
void(* OnPlayerStateHandler)(const char *vid, int state, void *data)
player media state.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVolume(PLVPlayerPtr player, int volume)
set the video volume.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerScreenshot(PLVPlayerPtr player, const char *filename)
screenshot the play video picture.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetMute(PLVPlayerPtr player, bool mute)
set the video mute state.
void(* OnPlayerAudioPlayErrorHandler)(const char *vid, void *data)
the player play audio error.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetOSDConfig(PLVPlayerPtr player, bool enable, const PLVOsdConfigInfo *config)
set the video OSD config info
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsValid(PLVPlayerPtr player)
the video have load or idle.
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsMute(PLVPlayerPtr player)
the video mute state.
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsPlaying(PLVPlayerPtr player)
the video playing or idle.
bool(* OnPlayerVideoFrameHandler)(const char *vid, PLVVideoFrame *frame, void *data)
player video frame.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetOSDConfig(PLVPlayerPtr player, PLVOsdConfigInfo &config)
get the video OSD config info.
PLAYERSDK_API void PLAYERSDK_CALL PLVPlayerDestroy(PLVPlayerPtr player)
Destory the PLVPlayerPtr object.
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 PLVPlayerResetHandler(PLVPlayerPtr player)
for reset all handler.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerGetLogoText(PLVPlayerPtr player, PLVLogoTextInfo &config)
get the video Logo text info.
void * PLVPlayerPtr
VOD player object type.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerStop(PLVPlayerPtr player)
stop the video.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetStateHandler(PLVPlayerPtr player, OnPlayerStateHandler handler, void *data)
for state change callback.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerPause(PLVPlayerPtr player, bool pause)
pause the video.
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 PLVPlayerGetCurrentRateCount(PLVPlayerPtr player)
the video have rate count.
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 PLVPlayerGetCacheConfig(PLVPlayerPtr player, int *maxCacheBytes, int *maxCacheSeconds)
get the video cache config info.
PLAYERSDK_API bool PLAYERSDK_CALL PLVPlayerIsPause(PLVPlayerPtr player)
the video play state or pause.
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 bool PLAYERSDK_CALL PLVPlayerIsLoading(PLVPlayerPtr player)
the video is loading or idle.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerSetVolumeMax(PLVPlayerPtr player, int volume)
set the video volume gain.
PLAYERSDK_API int PLAYERSDK_CALL PLVPlayerLoadLocal(PLVPlayerPtr player, int seekMillisecond, bool autoDownRate)
load local video, no play, must set the video path.
const int PLV_MAX_DEVICE_ID_LENGTH