Function:
int CA_Initalize(void**handle,const char* dbg_log_path,const char*productname);
Parameters:
Handle:[out] return api library handle.
Dbg_log_path:[in] log file path name, set NULL to use default log path (%appdata%\[productname]\log.txt), set an invalid path to ignore the log file creating.
Productname:[in] your program name.
1=OK,0=failed.
You must call this function before all other functions
Function:
void CA_Release(void**handle);
Parameters:
Handle:[in] api library handle
Release api library
Function:
int CA_GetCaptureDevices(void*handle, DEV_NAME*pdevs,int*numofdevs);
Parameters:
Handle:[in] api library handle.
Pdevs:[out] return device info.
Numofdevs:[int,out] indicate pdevs list size and return number of capture devices.
1=OK,0=failed.
Get a list of available capture devices
Function:
int CA_GetCaptureDeviceCapacity(void*handle,DEV_NAME*dev, DEV_CAPACITY*cap, int*numofcap);
Parameters:
Handle:[in] api library handle.
Dev:[in] which device do you want to get capacity
Cap:[out] indicate device capacity.
Numofcap:[in,out] indicate cap memory buffer and return the number of capacity.
1=OK,0=failed.
Get device capacity list.
Function:
int CA_GetCurrentDeviceCapacity(void*handle,DEV_CAPACITY*cap);
Parameters:
Handle:[in] api library handle.
Cap:[out] indicate device capacity.
1=OK,0=failed.
Get current device capacity. Please call this function after starting the play.
Function:
int CA_OpenDevice(void*handle,HWND hVideo, HWND hmsg, int bkeepaspect, int vrender,DEV_NAME*dev,DEV_CAPACITY*cap,int bitrate);
Parameters:
Handle:[in] api library handle.
hVideo:[in] Image display window, which can be a top window or a child window.
Hmsg:[in] Receive various events in playback and recording.
Message Param1 Param2 Mark
9900 char int The remaining space of the disk is insufficient. Parameter 1 is the drive letter and parameter 2 is the remaining space.
9901 0 int An error occurred while recording, parameter 2 is the error number
1 = "AV write file error";
2 = "No found audio error";
3 = "Demux TS error";
4 = "Demux ts buffer error.";
5 = "Reach to maximum of fat32 disk space.";
6 = "Encode video stream too slow,please drop down fps";
7 = "File error";
8 = "There are no enough free space on hard disk.";
9 = "start record failed.maybe invalid parament";
other = "unknow error.";
9150 int Int/char* Gif recording, when parameter 1 is 0, it indicates that recording is in progress (parameter 2 is int for the number of recorded frames), and parameter 1 is 1 for recording end (parameter 2 is char* string indicating information)
6666 0 0 Received video data from the device
9214 0 0 Device accidental pull-out notification
Bkeepaspect:[in] Keep the ratio when playing images.
Vrender:[in] video render index. Can be set:
RENDER_VMR9,RENDER_YUV,RENDER_VMR7,RENDER_D3D
Dev:[in] which device do you want to open.
Cap:[in] which device's capacity do you want to open, if set NULL will use device default capacity.
Bitirate:[in] only valid when open HDML-BOX,PRO,EVO device.
1=OK,0=failed.
Using this function to open the device and start previewing.
Function:
int CA_CloseDevice(void*handle);
Parameters:
Handle:[in] api library handle.
1=OK,0=failed.
Using this function to stop preview and close device.
Function:
void CA_UpdateVideoSize(void*handle);
Parameters:
Handle:[in] api library handle.
Refresh preview window size.
Function:
void CA_AdjustVolume(void*handle,int v);
Parameters:
Handle:[in] api library handle.
V:[in] volume ,0~100. -255 means silent, 255 means unmute
After starting the preview, you can use this function.
Function:
int CA_StartRecord(void*handle,const char*mp4path, int w, int h, int fps, int bitrate,int format);
Parameters:
Handle:[in] api library handle.
Mp4path:[in] the file to out put mp4 file.
W:[in] encode picture width.
H:[in] encode picture height.
Fps:[in] encode frame rate.
Bitrate:[in] encode bitrate.
Format:[in] the mp4 format
0: MP4(H264+AAC),1: MP4(H264+AC3),2:MP4(H264+MP3),3:TS(H264+AAC).
1=OK,0=failed.
Using this function to record a mp4 file. Need to be called after the preview starts. Recording parameters are not related to device capabilities, and the image or frame rate can be zoomed in and out internally.
Function:
int CA_PauseRecord(void*handle,int bpause);
Parameters:
Handle:[in] api library handle.
Bpause:[in] 1: indicate pause,0: indicate unpause.
1=OK,0=failed.
Using this function to pause the recording.
Function:
int CA_StopRecord(void*handle);
Parameters:
Handle:[in] api library handle.
1=OK,0=failed.
Stop the recording.
Function:
int CA_SetEncodeH264Parament(void*handle, int iEngine,int speed);
Parameters:
Handle:[in] api library handle.
iEngine:[in] code of encording engine, please use CA_GetEncodeH264EngineList get code.
Speed:[in] only valid when iEngine=0. Set encode speed. 0=high ~ 5=low
1=OK,0=failed.
Set encode engine and speed before start recording.
Function:
int CA_GetEncodeH264Parament(void*handle, int*iEngine,int*speed);
Parameters:
Handle:[in] api library handle.
iEngine:[out] return engine code.
Speed:[out] return encode speed.
1=OK,0=failed.
Get the encoding engine and speed currently in use.
Function:
int CA_GetEncodeH264EngineList(void*handle,char**names,int*iEngines);
Parameters:
Handle:[in] api library handle.
Names:[out] return engine name list.
iEngines:[out] return engine code list.
1=OK,0=failed.
Get the available encoding engine in the current system.
Function:
int CA_ScreenShot_bmp(void*handle, const char*fpath);
Parameters:
Handle:[in] api library handle.
Fpath:[in] Image file storage path. The suffix name can be bmp, jpg, png.
1=OK,0=failed.
Using this function to cut a picture when previewing.
Function:
int CA_ScreenShot_gif(void*handle, int w, int h, int keepasp,int fps,const char*fpath);
Parameters:
Handle:[in] api library handle.
W:[in] picture width. Maximum value 720.
H:[in] picture height. Maximum value 480.
Keepasp:[in] 1=keep aspect rate, Will override the height value.
Fps:[in] frame rate(1~20), recormmed 10.
Fpath:[in] gif saving path.
1=OK,0=failed.
Using this function to capture a gif
Function:
int CA_ScreenShot_gif_stop(void*handle);
Parameters:
Handle:[in] api library handle.
1=OK,0=failed.
Stop gif capture, If you do not call this function within 30 seconds after starting gif recording, it will automatically stop gif recording.
Function:
int CA_CheckState(void*handle,int*ispreview,int*ispictshow, int*isrecord,int*isgif);
Parameters:
Handle:[in] api library handle.
Ispreview:[out] if none NULL, Check if the device has opened.
Ispictshow:[out] if none NULL, check if the preview started.
Isrecord:[out] if none NULL, check if the recording has started.
Isgif:[out] if none NULL, check if the gif recording has started.
1=OK,0=failed.
Check various states during playback and recording.
Function:
int CA_QueryDeviceLost(void*handle,int*lost);
Parameters:
Handle:[in] api library handle.
Lost:[out] indicate if the device has lost.
1=OK,0=failed.
Check if the playback device has been accidentally removed, This function must be called after the 9214 message is received.
Function:
int CA_StartUSBDeviceListen(void*handle,HWND hwnd);
Parameters:
Handle:[in] api library handle.
Hwnd:[in] Receive plug-and-play messages from USB devices.
1=OK,0=failed.
Enable detection of plug-and-play messages for receiving USB devices.
Function:
int CA_StartVBS(void*handle,int nPort);
Parameters:
Handle:[in] api library handle.
nPort:[in] http port number.
1=OK,0=failed.
Open VBS system service.
Function:
int CA_StopVBS(void*handle);
Parameters:
Handle:[in] api library handle.
1=OK,0=failed.
Close VBS system service.
Function:
int CA_IsVBSRunning(void*handle);
Parameters:
Handle:[in]api library handle.
1=VBS is running
Using this function to check if the VBS server is running.
Function:
int CA_GetVBSLinks(char*playback_url, char*preview_url, int nport);
Parameters:
Playback:[out] the url of playback link.
Preview:[out] the url of preview link.
Nport:[in] vbs port number.
1=VBS is running.
Using this function to get VBS URL links.
Function:
int CA_CheckIsRegistered(void*handle);
Parameters:
Handle:[in] api library handle
1=VBS is running
Check if SDK is already registered
Function:
int CA_Register(void*handle, const char*code, const char*name, const char*email);
Parameters:
Handle:[in] api library handle.
Code:[in] code string.
Name:[in] name string.
Email:[in] email string.
1=OK,0=failed.
Use this function to register the SDK.
Function:
int CA_ClearRegisterCode(void*handle);
Parameters:
Handle:[in] api library handle.
1=OK,0=failed.
Using this function to clear register code.