plv player sdk doc
Loading...
Searching...
No Matches
plv-player-def.h
Go to the documentation of this file.
1#pragma once
2#include <stddef.h>
3#include <stdio.h>
4#include <stdarg.h>
5#include <string.h>
6#include <stdlib.h>
7#include <stdint.h>
8
9#if defined(_WIN32)
10#define WIN32_LEAN_AND_MEAN
11#include <windows.h>
12#define PLAYERSDK_CALL __cdecl
13#if defined(PLAYERSDK_EXPORT)
14#define PLAYERSDK_API extern "C" __declspec(dllexport)
15#else
16#define PLAYERSDK_API extern "C" __declspec(dllimport)
17#endif
18#elif defined(__APPLE__)
19#include <TargetConditionals.h>
20#define PLAYERSDK_API __attribute__((visibility("default"))) extern "C"
21#define PLAYERSDK_CALL
22#elif defined(__ANDROID__) || defined(__linux__)
23#define PLAYERSDK_API extern "C" __attribute__((visibility("default")))
24#define PLAYERSDK_CALL
25#else
26#define PLAYERSDK_API extern "C"
27#define PLAYERSDK_CALL
28#endif
29
30#ifdef __cplusplus
31extern "C" {
32#endif // __cplusplus
33
36
38const int PLV_MAX_NAME_LENGTH = 1024;
39
59
81
91
101
108
114
115#ifdef _WIN32
122
129#endif// end _WIN32
130};
131
145
188
226
232
241
247
265 userId(0),
266 secretKey(0),
267 appId(0),
268 appSecret(0),
269 subAccount(false)
270 {}
271 const char* userId;
275 const char* secretKey;
276 const char* appId;
280 const char* appSecret;
282};
283
325
326
330 text(0),
331 textSize(16),
332 textColor(0),
333 borderSize(1),
334 borderColor(0),
335 alignX(1),
336 alignY(-1)
337 {
338 }
339 const char* text;
341 const char* textColor;
343 const char* borderColor;
346};
347
358 vids(NULL),
359 page(1),
360 pageSize(10)
361 {
362 }
364 const char* vids;
365 int page;
367};
368
372 encrypt(false),
373 cateId(0),
374 status(0),
375 duration(0),
376 ratesNum(0),
378 vid(NULL),
379 title(NULL),
380 thumbnailURL(NULL),
381 coverURL(NULL),
382 rates(NULL)
383 {
384 }
398 double duration;
399 struct Rate {
400 int64_t filesize;
401 int rate;
403 int fps;
405 int width;
406 };
409 const char* vid;
410 const char* title;
411 const char* thumbnailURL;
412 const char* coverURL;
413};
414
430
433 uint8_t* data[8];
434 uint32_t linesize[8];
435 uint64_t timestamp;
436 uint32_t width;
437 uint32_t height;
438 uint32_t format;
439};
440
443 const char **qualitys;
444 int64_t qualityNum;
446};
447
457
458#ifdef __cplusplus
459}
460#endif
PLAYER_MEDIA_FORMAT
@ MEDIA_FORMAT_STRING
string type.
@ MEDIA_FORMAT_INT64
int type.
@ MEDIA_FORMAT_DOUBLE
double type.
LIVE_PLAYER_CHANNEL_STATE
@ CHANNEL_STATE_UNKNOWN
the channel state is unknown.
@ CHANNEL_STATE_LIVE
the channel state is live streaming.
@ CHANNEL_STATE_END
the channel state is end.
@ CHANNEL_STATE_PAUSE
the channel state is pause.
@ CHANNEL_STATE_NONE
none.
SDK_ERROR_TYPE
@ E_MEDIA_UNLOAD
the media is unload.
@ E_STILL_REQUEST
still request the video info.
@ E_CORE_MAX
over this value will be core code error(code - E_CORE_MAX).
@ E_MEDIA_LOADING
the media is loading.
@ E_DOWNLOAD_ERR
download error, will be open file error, or path error.
@ E_NO_SPACE
insufficient free space on hard drive.
@ E_ZIP_ERR
download zip file error or decompression error.
@ E_ABORT_OPERATION
user abort download.
@ E_NO_ERR
success.
@ E_NO_SUPPORT
sdk no support.
@ E_MEDIA_UNLOADING
the media is unloading.
@ E_PARAM_ERR
the param is illegal.
@ E_VID_ERR
the vid format error.
@ E_DOWNLOADING
the object is downloading.
@ E_M3U8_ERR
download m3u8 file error or m3u8 format error.
@ E_CAFILE_ERR
CA certificate file error.
@ E_NO_INIT
sdk no init.
@ E_DELETE_VIDEO
cancel download and delete.
@ E_KEY_ERR
download key file error or key format error.
@ E_MAC_NOT_ALLFILESACCESS
on mac, DetectSoftwareRecording must have AllFilesAccess
@ E_MEDIA_UNINIT
the mdeia not init(no set vid).
@ E_FILE_INCOMPLETE
file incomplete.
@ E_OBJECT_NULL
the object is nullptr.
@ E_NO_FILE
no this file.
@ E_DELETE_ERR
delete file error.
@ E_MIGRATE_ERR
migrate error,maybe the key file not correct.
@ E_OUTFLOW
the media return outflow.
@ E_NO_AUDIO_DEVICE
not audio device.
@ E_HTTP_ERR
http request error.
@ E_PATH_ERR
the path is illegal.
@ E_NO_RATE
the video no this rate.
@ E_NETWORK_ERR
network error.
@ E_VIEWERID_EMPTY
viewerid is empty. in vrm12/vrm13,must set it, empty will play fail.
@ E_INVOKE_ERR
invoke api error.
@ E_TSFILESIZE
ts file size is zero.
@ E_OSDFONT_ERR
not font file.
@ E_HTTP_MAX
over this value will be http error code(code - E_HTTP_MAX).
SOFTWARE_RECORDING_NOTIFY_TYPE
@ SOFTWARE_RECORDING_NONE
@ SOFTWARE_RECORDING_STOP
@ SOFTWARE_RECORDING_START
PLAYER_MEDIA_STATE
@ MEDIA_STATE_LOADED
the player media file is loaded.
@ MEDIA_STATE_PAUSE
pause the media.
@ MEDIA_STATE_FAIL
the media play fail, see log.
@ MEDIA_STATE_PLAY
playing the media.
@ MEDIA_STATE_END_SEEKING
the media is end seeking.
@ MEDIA_STATE_END_CACHE
the media is end cache.
@ MEDIA_STATE_BEGIN_SEEKING
the media is begin seeking.
@ MEDIA_STATE_END
the media is play end.
@ MEDIA_STATE_BEGIN_CACHE
the media is begin cache.
@ MEDIA_STATE_NONE
none
@ MEDIA_STATE_LOADING
the player media file is loading.
DEVICE_CHANGED_TYPE
@ HDMI_DEVICE_UNUSE
@ HDMI_DEVICE_USE
@ DEVICE_CHANGED_NONE
OSD_DISPLAY_TYPE
@ OSD_DISPALY_ROLL
Scroll right to left.
@ OSD_DISPALY_BLINK
Random position flicker.
const int PLV_MAX_NAME_LENGTH
VIDEO_OUTPUT_DEVICE
@ VIDEO_OUTPUT_DIRECT3D
@ VIDEO_OUTPUT_GDI
@ VIDEO_OUTPUT_NONE
@ VIDEO_OUTPUT_GPU
LOG_FILTER_TYPE
@ LOG_FILTER_INFO
@ LOG_FILTER_DEBUG
@ LOG_FILTER_OFF
@ LOG_FILTER_WARN
@ LOG_FILTER_ERROR
@ LOG_FILTER_FATAL
LIVE_PLAYER_PLAY_MODE
@ PLAY_AUDIO_ONLY
play audio only.
@ PLAY_AUDIO_VIDEO
play audio and video.
PLAYER_MEDIA_PROPERTY
@ MEDIA_PROPERTY_VIDEO_BITRATE
the video bitrate. MEDIA_FORMAT_INT64.
@ MEDIA_PROPERTY_DURATION
the media duration. millisecond. MEDIA_FORMAT_INT64.
@ MEDIA_PROPERTY_VIDEO_HEIGHT
the video resolution height. MEDIA_FORMAT_INT64.
@ MEDIA_PROPERTY_AUDIO_CODEC
the audio codec name. MEDIA_FORMAT_STRING.
@ MEDIA_PROPERTY_CACHE_TIME
cache time. millisecond. MEDIA_FORMAT_INT64.
@ MEDIA_PROPERTY_VIDEO_WIDTH
the video resolution width. MEDIA_FORMAT_INT64.
@ MEDIA_PROPERTY_VIDEO_FPS
the video fps. MEDIA_FORMAT_DOUBLE.
@ MEDIA_PROPERTY_HWDEC
the media Hardware coding name. MEDIA_FORMAT_STRING.
@ MEDIA_PROPERTY_NONE
none.
@ MEDIA_PROPERTY_CACHE_SPEED
cache speed bytes, value / 1024 for KB/S, value / (1024*1024) for MB/S. MEDIA_FORMAT_INT64.
@ MEDIA_PROPERTY_POSTION
the media play pos.
@ MEDIA_PROPERTY_AUDIO_BITRATE
the audio bitrate. MEDIA_FORMAT_INT64.
@ MEDIA_PROPERTY_CACHE_PROGRESS
cache progress, percent 100%. MEDIA_FORMAT_STRING.
@ MEDIA_PROPERTY_VIDEO_CODEC
the video codec name. MEDIA_FORMAT_STRING.
const int PLV_MAX_DEVICE_ID_LENGTH
VIDEO_REQUEST_TYPE
@ VIDEO_REQUEST_PAGE
page search.
@ VIDEO_REQUEST_VID
vids search, eg: 1b448be3231361255350f047cd7ed6bb_1,1b448be323b8d9b9489dcd7e8e09f087_1.
@ VIDEO_REQUEST_NONE
search none.
VIDEO_RATE_TYPE
@ VIDEO_RATE_HD
Video ultra clear.
@ VIDEO_RATE_SD
Video high definition.
@ VIDEO_RATE_LD
Video standard definition.
@ VIDEO_RATE_SOURCE
Video Original definition.
@ VIDEO_RATE_AUTO
only in play can use,do not use in download.
SDK_HTTP_REQUEST
@ ONLY_HTTP_REQUEST
@ ONLY_HTTPS_REQUEST
@ FIRST_HTTP_REQUEST
@ FIRST_HTTPS_REQUEST
bool subAccount
use sub account.
const char * appSecret
appSecret of sub account, if use main account, can be empty. get from SDK provider.
const char * userId
the userId of the main account. get from SDK provider.
const char * secretKey
if use subAccount, this can be empty, get from SDK provider.
const char * appId
appId of sub account, if use main account, can be empty. get from SDK provider.
char channelId[PLV_MAX_NAME_LENGTH]
channel id.
int64_t lineNum
lines number.
bool isOnlyAudio
only audio support.
char name[PLV_MAX_NAME_LENGTH]
channel name.
PLVChannelLineInfo * lines
multi lines info.
int64_t qualityNum
multi qualitys number, may be 0.
const char ** qualitys
multi qualitys in line.
const char * text
logo text display, must set. use utf8.
int alignY
[-1 0 1] top center bottom, default -1.
const char * borderColor
border color ARGB, default #FFFFFFFF.
int textSize
font size, [1, 255], default 16.
const char * textColor
font color ARGB, default #FF000000.
int alignX
[-1 0 1] left center right, default 1.
int borderSize
border size, [0, 255], A value of 0 disables borders, default 1.
const char * text
osd text display, must set. use utf8.
int displayDuration
The duration of a single running lantern, in seconds. default 5 seconds.
const char * borderColor
border color ARGB, default #FFFFFFFF.
int fadeDuration
The duration of the gradient animation of the lantern text from display to disappearance,...
int textSize
font size, [1, 255], default 55.
OSD_DISPLAY_TYPE animationEffect
animation effect of running lantern, default OSD_DISPALY_ROLL.
const char * textColor
font color ARGB, default #FF000000.
int displayInterval
The time interval between two running lights, in seconds. default 1 seconds.
int borderSize
border Size, [0, 255], A value of 0 disables borders, default 1.
uint8_t * data[8]
Frame data.
uint32_t width
Frame width.
uint64_t timestamp
timestamp-ns.
uint32_t linesize[8]
Frame data linesize.
uint32_t format
Frame format-only RGBX now.
uint32_t height
Frame height.
int64_t filesize
rate file size.
int rate
rate, see @VIDEO_RATE_TYPE
int bitrate
video bitrate.
Rate * rates
rates list.
const char * coverURL
cover url, first image, big image.
const char * vid
vid, use UTF8.
int status
video status.
const char * title
video title, use UTF8.
double duration
video duration.
const char * thumbnailURL
thumbnail url, first image, small image.
int ratesNum
rates num.
int64_t sourceFilesize
source file size.
bool encrypt
is the video encrypted.
int totalPages
Total pages.
int pageSize
Number of entries per page.
int totalItems
Total items.
int pageNumber
Current number of pages.
VIDEO_REQUEST_TYPE type
search type.
int pageSize
search page size, max:1000.
const char * vids
search vids, max:100, eg: 1b448be3231361255350f047cd7ed6bb_1,1b448be323b8d9b9489dcd7e8e09f087_1.
int page
search page. from 1 first.
VIDEO_REQUEST_TYPE type
search type.