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
229
235
244
250
268 userId(0),
269 secretKey(0),
270 appId(0),
271 appSecret(0),
272 subAccount(false)
273 {}
274 const char* userId;
278 const char* secretKey;
279 const char* appId;
283 const char* appSecret;
285};
286
328
329
333 text(0),
334 textSize(16),
335 textColor(0),
336 borderSize(1),
337 borderColor(0),
338 alignX(1),
339 alignY(-1)
340 {
341 }
342 const char* text;
344 const char* textColor;
346 const char* borderColor;
349};
350
361 vids(NULL),
362 page(1),
363 pageSize(10)
364 {
365 }
367 const char* vids;
368 int page;
370};
371
375 encrypt(false),
376 cateId(0),
377 status(0),
378 duration(0),
379 ratesNum(0),
381 vid(NULL),
382 title(NULL),
383 thumbnailURL(NULL),
384 coverURL(NULL),
385 rates(NULL)
386 {
387 }
401 double duration;
402 struct Rate {
403 int64_t filesize;
404 int rate;
406 int fps;
408 int width;
409 };
412 const char* vid;
413 const char* title;
414 const char* thumbnailURL;
415 const char* coverURL;
416};
417
433
436 uint8_t* data[8];
437 uint32_t linesize[8];
438 uint64_t timestamp;
439 uint32_t width;
440 uint32_t height;
441 uint32_t format;
442};
443
446 const char **qualitys;
447 int64_t qualityNum;
449};
450
454 : textFont("sans-serif"),
455 textSize(38),
456 textColor("#FFFFFFFF"),
457 borderSize(2),
458 borderColor("#FF000000"),
459 backgroundColor("#00000000"),
460 alignX(0),
461 alignY(1),
462 posY(100),
463 scaleByWindow(true),
464 visible(true)
465 {
466 }
467 const char *textFont;
469 const char *textColor;
471 const char *borderColor;
472 const char *backgroundColor;
473 int alignX;
474 int alignY;
475 int posY;
477 bool visible;
478};
479
489
490#ifdef __cplusplus
491}
492#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_SUBTITLE_START
current subtitle start 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_SUBTITLE_TEXT
current subtitle content. MEDIA_FORMAT_STRING.
@ MEDIA_PROPERTY_POSTION
the media play pos.
@ MEDIA_PROPERTY_SUBTITLE_STOP
current subtitle stop time. millisecond. MEDIA_FORMAT_INT64.
@ 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.
int alignY
[-1 0 1] vertical position top-center-bottom, default 1.
const char * borderColor
border color ARGB, default #FF000000.
int textSize
font size, [1, 255], default 38.
int posY
[0-150] vertical position adjustment, only valid when alignY = 1, default 100.
bool scaleByWindow
whether to scale subtitles with window size, default true.
const char * textColor
font color ARGB, default #FFFFFFFF.
int alignX
[-1 0 1] horizontal position left-center-right, default 0.
bool visible
is the subtitle visible, default true.
int borderSize
border size, [0, 55], 0 disables borders, default 2.
const char * backgroundColor
background color ARGB, default #00000000.
const char * textFont
font name, default sans-serif.
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.