12 #ifndef _H_OPENNETSTREAMINTERFACE_H_
13 #define _H_OPENNETSTREAMINTERFACE_H_
18 #if defined (_WIN32) || defined(_WIN64)
20 #ifdef OPENNETSTREAM_EXPORTS
21 # define OPENSDK_API __declspec(dllexport)
23 # define OPENSDK_API __declspec(dllimport)
25 #elif defined (OS_POSIX) || defined (__APPLE__) || defined(ANDROID) || defined (__linux__)
30 #if defined(__linux__)
31 typedef unsigned int HWND;
37 # error os not support!
70 typedef void (CALLBACK *
OpenSDK_MessageHandler)(
const char* szSessionId,
unsigned int iMsgType,
unsigned int iErrorCode,
const char *pMessageInfo,
void *pUser);
270 OPENSDK_API
OPENSDK_RESULT CALLBACK
OpenSDK_StartSearchEx(
const char* szSessionId,
const char* szDevSerial,
const int iChannelNo,
const char* szStartTime,
const char* szStopTime);
288 OPENSDK_API
OPENSDK_RESULT CALLBACK
OpenSDK_StartPlayBackEx(
const char* szSessionId, HWND hPlayWnd,
const char* szDevSerial,
const int iChannelNo,
const char* szSafeKey,
const char* szStartTime,
const char* szStopTime);
443 OPENSDK_API
int CALLBACK
OpenSDK_Mid_Login(
char** szAccessToken,
int* iAccessTokenLen );
767 OPENSDK_API
OPENSDK_RESULT CALLBACK
OpenSDK_Data_GetAlarmListEx(
const char* szDevSerial,
const int iChannelNo,
const char* szStartTime,
const char* szEndTime,
AlarmType iAlarmType,
int iStatus,
int iPageStart,
int iPageSize,
void** pBuf,
int* iLength);
780 OPENSDK_API
int CALLBACK
OpenSDK_DecryptPicture(
const char* szAccessToken,
const char* szPicURL,
const char* szSerail,
const char* szSafeKey,
void** pPicBuf,
int* iPicLen);
1094 #include "backward/OpenNetStreamInterfaceBackward.h"
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_StopVoiceTalk(const char *szSessionId)
结束语音对讲
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetAlarmListEx(const char *szDevSerial, const int iChannelNo, const char *szStartTime, const char *szEndTime, AlarmType iAlarmType, int iStatus, int iPageStart, int iPageSize, void **pBuf, int *iLength)
获取告警列表
OPENSDK_API void CALLBACK OpenSDK_Logout()
注销接口, 同OpenSDK_Mid_Login接口配对使用
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_CloseSound(const char *szSessionId)
关闭声音
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Init(const char *szAppId)
初始化库, 默认国内版本使用的接口
OPENSDK_API void CALLBACK OpenSDK_SetLoginParams(LoginParamKey iKey, const char *szValue)
设置登入传入参数
DataType
音视频流数据类型
Definition: OpenNetStreamDefine.h:207
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_StartVoiceTalkEx(const char *szSessionId, const char *szDevSerial, const int iChannelNo)
开启语音对讲, 不支持多个设备同时对接 异步接口,返回值只是表示操作成功,不代表对讲开启成功 如果接口返...
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_StartPlayWithStreamType(const char *szSessionId, HWND hPlayWnd, const char *szDevSerial, const int iChannelNo, const char *szSafeKey, const int iStreamType)
针对摄像头进行预览, 指定主\子码流 异步接口,返回值只是表示操作成功,不代表播放成功 如果接口返回-1...
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_SetDeviceDDNSAutoMapping(const char *szDevSerial)
This API is used to set device DDNS auto mapping mode by single device.
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_ShareDeviceDDNSInfo(const char *szDevSerial, const char *szAccount)
This API is used to Share DDNS information to other account by single device.
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetDeviceInfo(const char *szAccessToken, const char *szDeviceSerial, void **pBuf, int *iLength)
获取单个设备信息
OPENSDK_API void CALLBACK OpenSDK_SetPlatformAddr(const char *szPlatform)
设置平台地址,海外平台地址重定向后, 通过调用此接口重新设置平台地址.
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Push_SetTransparentChannelCallBack(OpenSDK_Push_MessageHandler pHandle, void *pUser)
设置设备透明通道推送
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetSharedDevList(int iPageStart, int iPageSize, void **pBuf, int *iLength)
获取他人分享的摄像头列表
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_StopPlayBackEx(const char *szSessionId)
停止回放 异步接口,返回值只是表示操作成功,不代表停止播放成功 如果接口返回-1, 结果根据消息回调函数msg...
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_DevDefenceEx(const char *szSessionId, const char *szDevSerial, const int iChannelNo, DefenceType enType, DefenceStatus enStatus, DefenceActor enActor)
按监控点ID进行布撤防, 针对NVR的通道进行布撤防,需要NVR和IPC支持之间协议支持。 异步接口,返回值只是表...
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_PTZCtrlEx(const char *szSessionId, const char *szDevSerial, const int iChannelNo, PTZCommand enCommand, PTZAction enAction, int iSpeed)
云台控制 异步接口,返回值只是表示操作成功,不代表云台控制成功 如果接口返回-1, 结果根据消息回调函数msg...
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_GetDeviceDDNSList(int iPageStart, int iPageSize, void **pBuf, int *iBufLen)
This API is used to turn page to get the DDNS information of all the devices in the account...
ConfigKey
配置类型
Definition: OpenNetStreamDefine.h:227
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_OpenSound(const char *szSessionId)
打开声音
DefenceStatus
布撤防状态
Definition: OpenNetStreamDefine.h:189
int OPENSDK_RESULT
opensdk返回值,0表示成功,非0表示失败
Definition: OpenNetStreamDefine.h:18
void(CALLBACK * OpenSDK_Push_MessageHandler)(const char *szDesc, const char *szContent, const char *szDetail, void *pUser)
告警消息推送回调函数
Definition: OpenNetStreamInterFace.h:908
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_CapturePicture(const char *szSessionId, const char *szFileName)
截屏,StartRealPlay成功(回调函数中收到MsgId == INS_PLAY_START)情况下使用
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_GetLastErrorCode()
获取错误码接口
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_FreeSession(const char *szSessionId)
销毁SDK操作句柄
void(CALLBACK * OpenSDK_DataCallBack)(DataType enType, char *const pData, int iLen, void *pUser)
数据回调格式
Definition: OpenNetStreamInterFace.h:188
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_PlayBackPause(const char *szSessionId)
暂停回放
PTZAction
云台操作命令 一般情况下,鼠标按下代表开始,鼠标松开代表停止
Definition: OpenNetStreamDefine.h:167
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_GetShareDeviceDDNSList(int iPageStart, int iPageSize, void **pBuf, int *iBufLen)
This API is used to turn page to get the DDNS information of all the shared devices in the current ac...
void(CALLBACK * OpenSDK_MessageHandler)(const char *szSessionId, unsigned int iMsgType, unsigned int iErrorCode, const char *pMessageInfo, void *pUser)
信息回调
Definition: OpenNetStreamInterFace.h:70
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetDevListEx(int iPageStart, int iPageSize, void **pBuf, int *iLength)
获取摄像头列表
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_InitLib(const char *szAuthAddr, const char *szPlatform, const char *szAppId)
初始化库, 支持配置平台地址
OPENSDK_API int CALLBACK OpenSDK_Mid_Login(char **szAccessToken, int *iAccessTokenLen)
登陆接口
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_StopRealPlayEx(const char *szSessionId)
停止播放播放 异步接口,返回值只是表示操作成功,不代表停止播放成功 如果接口返回-1, 结果根据消息回调函...
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_SetAlarmRead(const char *szAccessToken, const char *szAlarmId)
设置告警已读
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_SetDeviceDDNSDomain(const char *szDevSerial, const char *szDomain)
This API is used to set the device DDNS domain, including the shared device's DDNS domain...
OPENSDK_API int CALLBACK OpenSDK_Mid_Device_Add(const char *szAccessToken)
设备添加
OPENSDK_API void CALLBACK OpenSDK_SetConfigInfo(ConfigKey iKey, const int iValue)
全局配置信息, 根据ConfigKey进行配置
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_SetDeviceDDNSManualMapping(const char *szDevSerial, const int iCmdPort, const int iHttpPort)
This API is used to set device DDNS manual mapping mode by single device.
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Push_SetAlarmCallBack(OpenSDK_Push_MessageHandler pHandle, void *pUser)
设置告警推送回调
OPENSDK_API int CALLBACK OpenSDK_DecryptPicture(const char *szAccessToken, const char *szPicURL, const char *szSerail, const char *szSafeKey, void **pPicBuf, int *iPicLen)
解密告警图片(建议加密的图片才调用,非加密图片直接下载,可以通过url里面isEncrypted=1来区分) ...
DefenceType
布撤防告警类型
Definition: OpenNetStreamDefine.h:176
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_SetAppID(const char *szAppId)
设置
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_StartPlayBackEx(const char *szSessionId, HWND hPlayWnd, const char *szDevSerial, const int iChannelNo, const char *szSafeKey, const char *szStartTime, const char *szStopTime)
开始回放 异步接口,返回值只是表示操作成功,不代表播放成功 如果接口返回-1, 结果根据消息回调函数msgid判...
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Push_SetDeviceStatusCallBack(OpenSDK_Push_MessageHandler pHandle, void *pUser)
设置设备下线状态推送
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_Free(void *pBuf)
销毁SDK分配的内存
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_SetAccessToken(const char *szAccessToken)
设置AccessToken
LoginParamKey
登录相关参数类型
Definition: OpenNetStreamDefine.h:216
AlarmType
开放SDK告警类型定义
Definition: OpenNetStreamDefine.h:74
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_GetOSDTime(const char *szSessionId, STREAM_TIME *pTime)
获取OSD时间
PTZCommand
云台控制命令
Definition: OpenNetStreamDefine.h:142
DefenceActor
Definition: OpenNetStreamDefine.h:197
OPENSDK_API void CALLBACK OpenSDK_SetSessionConfig(const char *szSessionId, ConfigKey iKey, const int iValue)
针对Session设置配置信息, 根据ConfigKey进行配置, 取流之前调用
OPENSDK_API unsigned short CALLBACK OpenSDK_GetVolume(const char *szSessionId)
获取音量
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_SetVolume(const char *szSessionId, unsigned short uVolume)
设置音量
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_StartSearchEx(const char *szSessionId, const char *szDevSerial, const int iChannelNo, const char *szStartTime, const char *szStopTime)
录像搜索,包含云存储和设备SD卡录像, 如果关联NVR优先搜索NVR录像 异步接口,返回值只是表示操作成功,不代...
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_PlayBackResume(const char *szSessionId)
恢复回放
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_FiniLib()
反初始化库
OPENSDK_API const char *CALLBACK OpenSDK_GetLastErrorDesc()
错误码描述
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_SetDataCallBack(const char *szSessionId, OpenSDK_DataCallBack pDataCallBack, void *pUser)
设置数据回调
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_AllocSessionEx(OpenSDK_MessageHandler pHandle, void *pUser, char **pSession, int *iSessionLen)
申请一个会话Id
OPENSDK_API int CALLBACK OpenSDK_Mid_Device_Oper(const char *szAccessToken, const char *szDeviceId)
设备操作
OPENSDK_API const char *CALLBACK OpenSDK_GetLoginResponseParams(LoginParamKey iKey)
获取登入后返回参数
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_DeleteDevice(const char *szAccessToken, const char *szDeviceId)
删除设备
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Data_GetDevDetailInfo(const char *szDevSerial, const int iChannelNo, const bool bUpdate, void **pDevDetailInfo, int *iLength)
获取设备详细信息, 包括预览能力级, PTZ, 对讲能力级等.
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Push_StartRecvEx(const char *szPushSecret)
开启接收推送, 不推荐应用在服务器端上
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_GetDeviceDDNSInfo(const char *szDevSerial, const char *szDomain, void **pBuf, int *iBufLen)
This API is used to get the device DDNS information, including the shared device DDNS information...
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_GetAreaList(void **pBuf, int *iBufLen)
Get area list of all the nations. use in register.
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_Push_StopRecv()
关闭接收推送
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_SetVideoLevel(const char *szDevSerial, const int iChannelNo, const int iVideoLevel)
设置或者切换清晰度, 根据OpenSDK_Data_GetDevDetailInfo接口返回信息videoQualityInfos来判断是否支持对应...
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_StartRealPlayEx(const char *szSessionId, HWND hPlayWnd, const char *szDevSerial, const int iChannelNo, const char *szSafeKey)
针对摄像头进行预览 异步接口,返回值只是表示操作成功,不代表播放成功 如果接口返回-1, 结果根据消息回调函数msgid判断, 若msgid=INS_PLAY_START, 表示成功, 若msgid=INS_PLAY_EXCEPTION, 表示失败