plv player sdk doc
载入中...
搜索中...
未找到
plv-player-live-CN.h
浏览该文件的文档.
1#pragma once
2#include "plv-player-def-CN.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(PLVLivePlayerPtr player,
82 void *data);
83
93PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetStateHandler(PLVLivePlayerPtr player, OnLivePlayerStateHandler handler,
94 void *data);
95
105PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetPropertyHandler(PLVLivePlayerPtr player,
106 OnLivePlayerPropertyHandler handler, void *data);
107
117PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetAudioPlayErrorHandler(PLVLivePlayerPtr player,
119 void *data);
120
130PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetChannelStateHandler(PLVLivePlayerPtr player,
132 void *data);
133
143PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetChannelInfoHandler(PLVLivePlayerPtr player,
144 OnLivePlayerChannelInfoHandler handler, void *data);
145
155PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetOSDConfig(PLVLivePlayerPtr player, bool enable,
156 const PLVOsdConfigInfo *config);
157
166PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetOSDConfig(PLVLivePlayerPtr player, PLVOsdConfigInfo *config);
167
177PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetLogoText(PLVLivePlayerPtr player, bool enable,
178 const PLVLogoTextInfo *config);
179
188PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetLogoText(PLVLivePlayerPtr player, PLVLogoTextInfo *config);
189
202PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetCacheConfig(PLVLivePlayerPtr player, int cacheMs,
203 bool speedTrackingEnable, bool seekTrackingEnable);
204
215PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetCacheConfig(PLVLivePlayerPtr player, int *cacheMs,
216 bool *speedTrackingEnable, bool *seekTrackingEnable);
217
229PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetLine(PLVLivePlayerPtr player, int lineIndex);
230
241PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetQuality(PLVLivePlayerPtr player, int qualityIndex);
242
253PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetPlayMode(PLVLivePlayerPtr player, int playMode);
254
263PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetToken(PLVLivePlayerPtr player, const char *token);
264
278PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerPlay(PLVLivePlayerPtr player, const char *channelId);
279
289PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerPause(PLVLivePlayerPtr player, bool pause);
290
298PLAYERSDK_API bool PLAYERSDK_CALL PLVLivePlayerIsPause(PLVLivePlayerPtr player);
299
307PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerStop(PLVLivePlayerPtr player);
308
317PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerMute(PLVLivePlayerPtr player, bool mute);
318
326PLAYERSDK_API bool PLAYERSDK_CALL PLVLivePlayerIsMute(PLVLivePlayerPtr player);
327
336PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVolume(PLVLivePlayerPtr player, int volume);
337
346PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVolumeMax(PLVLivePlayerPtr player, int volume);
347
355PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetVolume(PLVLivePlayerPtr player);
356
366PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerScreenshot(PLVLivePlayerPtr player, const char *filename);
367
376PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetCurrentAudioDevice(PLVLivePlayerPtr player,
377 char deviceId[PLV_MAX_DEVICE_ID_LENGTH]);
378
387PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetCurrentAudioDevice(PLVLivePlayerPtr player, const char deviceId[PLV_MAX_DEVICE_ID_LENGTH]);
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetChannelStateHandler(PLVLivePlayerPtr player, OnLivePlayerChannelStateHandler handler, void *data)
设置频道直播状态改变回调.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerPlay(PLVLivePlayerPtr player, const char *channelId)
播放频道直播,始终采用异步模式,中途可随时停止.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerMute(PLVLivePlayerPtr player, bool mute)
设置是否静音状态.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetLogoText(PLVLivePlayerPtr player, PLVLogoTextInfo *config)
获取 LOGO 信息.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerScreenshot(PLVLivePlayerPtr player, const char *filename)
视频截屏.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetOSDConfig(PLVLivePlayerPtr player, PLVOsdConfigInfo *config)
获取跑马灯信息.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetPlayMode(PLVLivePlayerPtr player, int playMode)
设置播放模式,通过频道信息回调获取频道是否支持音视频播放模式.
void(* OnLivePlayerChannelStateHandler)(int state, void *data)
频道直播状态回调.
bool(* OnLivePlayerVideoFrameHandler)(PLVVideoFrame *frame, void *data)
播放视频帧的回调通知.
void(* OnLivePlayerPropertyHandler)(int property, int format, const char *value, void *data)
播放属性值的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetPropertyHandler(PLVLivePlayerPtr player, OnLivePlayerPropertyHandler handler, void *data)
设置播放属性值的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetVolume(PLVLivePlayerPtr player)
获取当前音量值.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetQuality(PLVLivePlayerPtr player, int qualityIndex)
设置播放清晰度,通过频道信息回调获取频道清晰度信息.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerPause(PLVLivePlayerPtr player, bool pause)
暂停或继续播放.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVolumeMax(PLVLivePlayerPtr player, int volume)
设置声音增益.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetLine(PLVLivePlayerPtr player, int lineIndex)
设置播放线路,通过频道信息回调获取频道线路信息.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetCurrentAudioDevice(PLVLivePlayerPtr player, const char deviceId[PLV_MAX_DEVICE_ID_LENGTH])
设置当前扬声器设备标识.
PLAYERSDK_API PLVLivePlayerPtr PLAYERSDK_CALL PLVLivePlayerCreate(void *window)
创建直播播放对象并返回对象指针.
void(* OnLivePlayerChannelInfoHandler)(const PLVChannelInfo *info, void *data)
频道信息回调.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetCurrentAudioDevice(PLVLivePlayerPtr player, char deviceId[PLV_MAX_DEVICE_ID_LENGTH])
获取当前扬声器设备标识.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVideoFrameHandler(PLVLivePlayerPtr player, OnLivePlayerVideoFrameHandler lockHandler, OnLivePlayerVideoFrameHandler unlockHandler, void *data)
设置播放视频帧的回调通知.
void(* OnLivePlayerStateHandler)(int state, void *data)
播放状态的回调通知.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerGetCacheConfig(PLVLivePlayerPtr player, int *cacheMs, bool *speedTrackingEnable, bool *seekTrackingEnable)
获取播放缓存信息.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetChannelInfoHandler(PLVLivePlayerPtr player, OnLivePlayerChannelInfoHandler handler, void *data)
设置频道信息回调.
PLAYERSDK_API void PLAYERSDK_CALL PLVLivePlayerDestroy(PLVLivePlayerPtr player)
销毁播放对象.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetToken(PLVLivePlayerPtr player, const char *token)
保留接口
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetAudioPlayErrorHandler(PLVLivePlayerPtr player, OnLivePlayerAudioPlayErrorHandler handler, void *data)
设置音频播放错误回调.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetStateHandler(PLVLivePlayerPtr player, OnLivePlayerStateHandler handler, void *data)
设置播放状态的回调通知.
PLAYERSDK_API bool PLAYERSDK_CALL PLVLivePlayerIsPause(PLVLivePlayerPtr player)
判断是否暂停状态.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetOSDConfig(PLVLivePlayerPtr player, bool enable, const PLVOsdConfigInfo *config)
设置跑马灯信息
void(* OnLivePlayerAudioPlayErrorHandler)(void *data)
音频播放错误回调.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetVolume(PLVLivePlayerPtr player, int volume)
设置播放声音.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetCacheConfig(PLVLivePlayerPtr player, int cacheMs, bool speedTrackingEnable, bool seekTrackingEnable)
设置播放缓存信息.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerStop(PLVLivePlayerPtr player)
停止播放.
void * PLVLivePlayerPtr
播放对象, 每一个播放对象同时只能播放一个频道视频, 可以创建多个播放对象.
PLAYERSDK_API int PLAYERSDK_CALL PLVLivePlayerSetLogoText(PLVLivePlayerPtr player, bool enable, const PLVLogoTextInfo *config)
设置 LOGO 信息
PLAYERSDK_API bool PLAYERSDK_CALL PLVLivePlayerIsMute(PLVLivePlayerPtr player)
判断是否静音状态.
const int PLV_MAX_DEVICE_ID_LENGTH