OpenSDK  V4.2.0
Typedefs | Functions
Allocate session

Typedefs

typedef void(CALLBACK * OpenSDK_MessageHandler) (const char *szSessionId, unsigned int iMsgType, unsigned int iErrorCode, const char *pMessageInfo, void *pUser)
 Message callback. More...
 

Functions

OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_AllocSessionEx (OpenSDK_MessageHandler pHandle, void *pUser, char **pSession, int *iSessionLen)
 Apply a session ID. More...
 
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_FreeSession (const char *szSessionId)
 Destroy SDk handle. More...
 
OPENSDK_API void CALLBACK OpenSDK_SetSessionConfig (const char *szSessionId, ConfigKey iKey, const int iValue)
 Configuring configuration information for Session, configured according to ConfigKey, before calling the stream. More...
 

Detailed Description

Typedef Documentation

typedef void(CALLBACK * OpenSDK_MessageHandler) (const char *szSessionId, unsigned int iMsgType, unsigned int iErrorCode, const char *pMessageInfo, void *pUser)

Message callback.

Parameters
szSessionIdApplied session ID
iMsgTypeMessage No. MessageType
iErrorCodeError code OpenNetStreamError.h
pMessageInfoMessage
pUserUser-defined data
Note
The functions of APIs include live view, playback, recording file search, arm and disarm, PTZ control and two-way audio For example, for the recording file search API, when 'iMsgType == INS_RECORD_FIL', the pMessageInfo format is as below:
1 {
2  "FileSize":10,
3  "FileList": [
4  {
5  "StartTime":"",
6  "EndTime":""
7  }
8  ]
9 }
See also
OpenSDK_AllocSession()

Function Documentation

OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_AllocSessionEx ( OpenSDK_MessageHandler  pHandle,
void *  pUser,
char **  pSession,
int *  iSessionLen 
)

Apply a session ID.

Parameters
[in]pHandleSet callback function, OpenSDK_MessageHandler
[in]pUserUser-defined data will be thrown out at pHandle
[out]pSessionUsed to receive the allocated session ID
[out]iSessionLenLength of pSession
Returns
Return 0 on success, -1 on failure
See also
OpenSDK_FreeSession()
OPENSDK_API OPENSDK_RESULT CALLBACK OpenSDK_FreeSession ( const char *  szSessionId)

Destroy SDk handle.

Parameters
[in]szSessionIdSession ID, create through OpenSDK_AllocSession()
Returns
Return 0 on success, -1 on failure
See also
OpenSDK_AllocSession()
OPENSDK_API void CALLBACK OpenSDK_SetSessionConfig ( const char *  szSessionId,
ConfigKey  iKey,
const int  iValue 
)

Configuring configuration information for Session, configured according to ConfigKey, before calling the stream.

Parameters
[in]iKeyConfigKey, Configuration type
[in]iValueConfiguration value,when key=CONFIG_OPEN_STREAMTRANS, value=1 means The output of the stream data is transferred to the package for video storage
Returns
See also