plv player sdk doc
Loading...
Searching...
No Matches
plv-player-live.h
Go to the documentation of this file.
1#pragma once
2#include "plv-player-def.h"
3
5
8typedef void *PLVLivePlayerPtr;
9
15typedef bool (*OnLivePlayerVideoFrameHandler)(PLVVideoFrame *frame, void *data);
16
22typedef void (*OnLivePlayerStateHandler)(int state, void *data);
23
31typedef void (*OnLivePlayerPropertyHandler)(int property, int format, const char *value, void *data);
32
37typedef void (*OnLivePlayerAudioPlayErrorHandler)(void *data);
38
44typedef void (*OnLivePlayerChannelStateHandler)(int state, void *data);
45
52typedef void (*OnLivePlayerChannelInfoHandler)(const PLVChannelInfo *info, void *data);
53
61PLAYERSDK_API PLVLivePlayerPtr PLAYERSDK_CALL PLVLivePlayerCreate(void *window);
62
67PLAYERSDK_API void PLAYERSDK_CALL PLVLivePlayerDestroy(PLVLivePlayerPtr player);
68
79PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVideoFrameHandler(
80 PLVLivePlayerPtr player, OnLivePlayerVideoFrameHandler lockHandler, OnLivePlayerVideoFrameHandler unlockHandler, void *data);
81
91PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetStateHandler(PLVLivePlayerPtr player, OnLivePlayerStateHandler handler, void *data);
92
102PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetPropertyHandler(PLVLivePlayerPtr player, OnLivePlayerPropertyHandler handler, void *data);
103
113PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetAudioPlayErrorHandler(PLVLivePlayerPtr player, OnLivePlayerAudioPlayErrorHandler handler, void *data);
114
124PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetChannelStateHandler(PLVLivePlayerPtr player, OnLivePlayerChannelStateHandler handler, void *data);
125
135PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetChannelInfoHandler(PLVLivePlayerPtr player, OnLivePlayerChannelInfoHandler handler, void *data);
136
146PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetOSDConfig(PLVLivePlayerPtr player, bool enable, const PLVOsdConfigInfo *config);
147
156PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetOSDConfig(PLVLivePlayerPtr player, PLVOsdConfigInfo *config);
157
167PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetLogoText(PLVLivePlayerPtr player, bool enable, const PLVLogoTextInfo *config);
168
177PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetLogoText(PLVLivePlayerPtr player, PLVLogoTextInfo *config);
178
191PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetCacheConfig(
192 PLVLivePlayerPtr player, int cacheMs, bool speedTrackingEnable, bool seekTrackingEnable);
193
204PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetCacheConfig(
205 PLVLivePlayerPtr player, int *cacheMs, bool *speedTrackingEnable, bool *seekTrackingEnable);
206
218PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetLine(PLVLivePlayerPtr player, int lineIndex);
219
230PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetQuality(PLVLivePlayerPtr player, int qualityIndex);
231
242PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetPlayMode(PLVLivePlayerPtr player, int playMode);
243
252PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetToken(PLVLivePlayerPtr player, const char *token);
253
267PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerPlay(PLVLivePlayerPtr player, const char *channelId);
268
278PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerPause(PLVLivePlayerPtr player, bool pause);
279
287PLAYERSDK_API bool PLAYERSDK_CALL PLVLivePlayerIsPause(PLVLivePlayerPtr player);
288
296PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerStop(PLVLivePlayerPtr player);
297
306PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerMute(PLVLivePlayerPtr player, bool mute);
307
315PLAYERSDK_API bool PLAYERSDK_CALL PLVLivePlayerIsMute(PLVLivePlayerPtr player);
316
325PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVolume(PLVLivePlayerPtr player, int volume);
326
335PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVolumeMax(PLVLivePlayerPtr player, int volume);
336
344PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetVolume(PLVLivePlayerPtr player);
345
355PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerScreenshot(PLVLivePlayerPtr player, const char *filename);
356
365PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetCurrentAudioDevice(PLVLivePlayerPtr player, char deviceId[PLV_MAX_DEVICE_ID_LENGTH]);
366
375PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetCurrentAudioDevice(PLVLivePlayerPtr player, const char deviceId[PLV_MAX_DEVICE_ID_LENGTH]);
376
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetChannelStateHandler(PLVLivePlayerPtr player, OnLivePlayerChannelStateHandler handler, void *data)
for channel state change callback.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerPlay(PLVLivePlayerPtr player, const char *channelId)
play the channel living.Always asynchronously.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerMute(PLVLivePlayerPtr player, bool mute)
set the video mute state.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetLogoText(PLVLivePlayerPtr player, PLVLogoTextInfo *config)
get the video Logo text info.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerScreenshot(PLVLivePlayerPtr player, const char *filename)
screenshot the play video picture.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetOSDConfig(PLVLivePlayerPtr player, PLVOsdConfigInfo *config)
get the video OSD config info.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetPlayMode(PLVLivePlayerPtr player, int playMode)
set live play mode, you can get mode info after channel info callback.
void(* OnLivePlayerChannelStateHandler)(int state, void *data)
channel live state.
bool(* OnLivePlayerVideoFrameHandler)(PLVVideoFrame *frame, void *data)
player video frame.
void(* OnLivePlayerPropertyHandler)(int property, int format, const char *value, void *data)
player media property value.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetPropertyHandler(PLVLivePlayerPtr player, OnLivePlayerPropertyHandler handler, void *data)
for property change callback.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetVolume(PLVLivePlayerPtr player)
the video volume.
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 PLVLivePlayerPause(PLVLivePlayerPtr player, bool pause)
pause or resume the video.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVolumeMax(PLVLivePlayerPtr player, int volume)
set the video volume gain.
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 PLVLivePlayerSetCurrentAudioDevice(PLVLivePlayerPtr player, const char deviceId[PLV_MAX_DEVICE_ID_LENGTH])
set the current audio device.
PLAYERSDK_API PLVLivePlayerPtr PLAYERSDK_CALL PLVLivePlayerCreate(void *window)
Creates the PLVLivePlayerPtr object and returns the pointer.
void(* OnLivePlayerChannelInfoHandler)(const PLVChannelInfo *info, void *data)
channel info.
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 PLVLivePlayerSetVideoFrameHandler(PLVLivePlayerPtr player, OnLivePlayerVideoFrameHandler lockHandler, OnLivePlayerVideoFrameHandler unlockHandler, void *data)
for video frame callback.
void(* OnLivePlayerStateHandler)(int state, void *data)
player media state.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetCacheConfig(PLVLivePlayerPtr player, int *cacheMs, bool *speedTrackingEnable, bool *seekTrackingEnable)
get player cache config.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetChannelInfoHandler(PLVLivePlayerPtr player, OnLivePlayerChannelInfoHandler handler, void *data)
for channel info callback.
PLAYERSDK_API void PLAYERSDK_CALL PLVLivePlayerDestroy(PLVLivePlayerPtr player)
Destory the PLVLivePlayerPtr object.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetToken(PLVLivePlayerPtr player, const char *token)
reserved
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetAudioPlayErrorHandler(PLVLivePlayerPtr player, OnLivePlayerAudioPlayErrorHandler handler, void *data)
for audio play error callback.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetStateHandler(PLVLivePlayerPtr player, OnLivePlayerStateHandler handler, void *data)
for state change callback.
PLAYERSDK_API bool PLAYERSDK_CALL PLVLivePlayerIsPause(PLVLivePlayerPtr player)
the video play state or pause.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetOSDConfig(PLVLivePlayerPtr player, bool enable, const PLVOsdConfigInfo *config)
set the video OSD config info
void(* OnLivePlayerAudioPlayErrorHandler)(void *data)
the player play audio error.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVolume(PLVLivePlayerPtr player, int volume)
set the video volume.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetCacheConfig(PLVLivePlayerPtr player, int cacheMs, bool speedTrackingEnable, bool seekTrackingEnable)
set player cache config.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerStop(PLVLivePlayerPtr player)
stop the play.
void * PLVLivePlayerPtr
live player object type.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetLogoText(PLVLivePlayerPtr player, bool enable, const PLVLogoTextInfo *config)
set the video Logo text info
PLAYERSDK_API bool PLAYERSDK_CALL PLVLivePlayerIsMute(PLVLivePlayerPtr player)
the video mute state.
const int PLV_MAX_DEVICE_ID_LENGTH