
Technical Manual
© 2006-2010 by HIKVISION. All rights reserved.
14
4.2. API of Encoding Card
4.2.1.
int GetLastErrorNum()
Explanation:
Get the last error number when there is exception.
Return value:
The error number is described in ds40xxsdk.h
4.2.2.
int InitDSPs();
Explanation:
This API will initialize all cards. It should be invoked when application starts.
Return value:
If the function succeeds, the return value is the total number of encoding channel.
When it returns 0, if there is compression card in computer, 0 means initialization is failed, if
there is only decoding card, 0 is normal, HW_InitDecDevice() is suggested for initializing
decoding card. DeInitDSPs() is the corresponding API.
4.2.3.
int DeInitDSPs();
Explanation:
To close the functions in every board and must be called before exiting application;
Return value:
0—success; -1 – failed;
4.2.4.
int ChannelOpen(int ChannelNum, STREAM_READ_CALLBACK streamReadCallback);
Parameter:
int ChannelNum:
// channel No. (0-n)
STREAM_READ_CALLBACK StreamReadCallBack: // Data callback function
void StreamReadCallBack(int ChannelNum, void * DataBuf, int FrameType ,
int Length, int FrameNum);
int ChannelNum
//channel num (0-n)
void * DataBuf
//pointer of frame data
int FrameType
//frame type defined in section 3.1
int Length
//frame length
The callback function will return encoded frame and Motion detection Frame.
Explanation:
Open channels and get operation handle. All operations related with this channel need use
this handle;
Return value:
>=0 —success and it is channel handle; -1 – failed;