Home > other >  C # hai kang network hard disk video recorder development monitoring
C # hai kang network hard disk video recorder development monitoring

Time:09-29

Novice one, according to the official website, document when calling preview video preview channel number of equipment, is a video simulation because of 1-4, equipment is 4 road, why now 1-4 are tried, or failed to accept data or the device is not the channel number, ps (equipment is now even two cameras, I now transmit the preview of a window handle, a channel number, will show two pictures)


CHCNetSDK.NET _DVR_PREVIEWINFO lpPreviewInfo=new CHCNetSDK.NET _DVR_PREVIEWINFO ();
LpPreviewInfo. HPlayWnd=RealPlayWnd. Handle;//the preview window
LpPreviewInfo. LChannel=Int16. Parse (textBoxChannel. Text. The Trim ());//te of preforms channel
LpPreviewInfo. DwStreamType=0;//code flow type: 0 - the main stream, 1 - stream, 3, 3-2 - stream stream 4, and so on
LpPreviewInfo. DwLinkMode=0;//connection mode: 0 - TCP, 1 - UDP way, 2 - multicast way, 3 - RTP, 4 - RTP/RTSP, 5 - RSTP/HTTP
LpPreviewInfo. BBlocked=true;//0 - a non-blocking stream, 1 - to take flow
LpPreviewInfo. DwDisplayBufNum=15;//play library playout buffer buffer biggest frames

CHCNetSDK. REALDATACALLBACK RealData=https://bbs.csdn.net/topics/new CHCNetSDK. REALDATACALLBACK (REALDATACALLBACK);//preview real-time flow callback function
IntPtr pUser=new IntPtr ();//user data

//open the preview Start live view
M_lRealHandle=CHCNetSDK.NET _DVR_RealPlay_V40 (m_lUserID, ref lpPreviewInfo, null RealData *//* and pUser);
If (m_lRealHandle & lt; 0)
{
ILastErr=CHCNetSDK.NET _DVR_GetLastError ();
STR="NET_DVR_RealPlay_V40 failed, the error code=" + iLastErr;//the preview failed, the output error number
MessageBox. Show (STR);
return;
}
  • Related