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
56
78
88
98
105
111
112#ifdef _WIN32
119
126#endif// end _WIN32
127};
128
142
184
222
242 userId(0),
243 secretKey(0),
244 appId(0),
245 appSecret(0),
246 subAccount(false)
247 {}
248 const char* userId;
252 const char* secretKey;
253 const char* appId;
257 const char* appSecret;
259};
260
302
303
307 text(0),
308 textSize(16),
309 textColor(0),
310 borderSize(1),
311 borderColor(0),
312 alignX(1),
313 alignY(-1)
314 {
315 }
316 const char* text;
318 const char* textColor;
320 const char* borderColor;
323};
324
335 vids(NULL),
336 page(1),
337 pageSize(10)
338 {
339 }
341 const char* vids;
342 int page;
344};
345
349 encrypt(false),
350 cateId(0),
351 status(0),
352 duration(0),
353 ratesNum(0),
355 vid(NULL),
356 title(NULL),
357 thumbnailURL(NULL),
358 coverURL(NULL),
359 rates(NULL)
360 {
361 }
375 double duration;
376 struct Rate {
377 int64_t filesize;
378 int rate;
380 int fps;
382 int width;
383 };
386 const char* vid;
387 const char* title;
388 const char* thumbnailURL;
389 const char* coverURL;
390};
391
407
410 uint8_t* data[8];
411 uint32_t linesize[8];
412 uint64_t timestamp;
413 uint32_t width;
414 uint32_t height;
415 uint32_t format;
416};
417
418#ifdef __cplusplus
419}
420#endif
421
PLAYER_MEDIA_FORMAT
@ MEDIA_FORMAT_STRING
string type.
@ MEDIA_FORMAT_INT64
int type.
@ MEDIA_FORMAT_DOUBLE
double type.
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_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.
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
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.
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.