Qt_test: : qt_test (QWidget * parent, Qt: : WFlags flags)
: QMainWindow (parent, flags)
{
UI. SetupUi (this);
Connect (UI) pushButton_3, SIGNAL (clicked ()), and this, SLOT (CamerStart ()));//
The connect (UI) pushButton, SIGNAL (clicked ()), and this, SLOT (CamerStop ()));//stop
Connect (UI) pushButton_4, SIGNAL (clicked ()), and this, SLOT (CamerExit ()));//close
HWND HWND=(HWND) UI. Frame - & gt; WinId ();
//initialize
NET_DVR_Init ();
//registered equipment
NET_DVR_DEVICEINFO_V30 StruDeviceInfo;
IUserID=NET_DVR_Login_V30 (" 192.168.1.64 ", 8000, "admin", "liginfo1001", & amp; StruDeviceInfo);
If (IUserID & lt; 0)
{
QDebug () & lt; <" Login error! \ n ";
NET_DVR_Cleanup ();
return;
}
//start preview
NET_DVR_PREVIEWINFO StruPlayInfo={0};
StruPlayInfo. HPlayWnd=HWND;
StruPlayInfo. LChannel=1;
StruPlayInfo. DwStreamType=1;
StruPlayInfo. DwLinkMode=0;
StruPlayInfo. BBlocked=0;
IRealPlayHandle=NET_DVR_RealPlay_V40 (IUserID, & amp; StruPlayInfo, NULL, NULL);
/*
NET_DVR_CLIENTINFO ClientInfo={0};
ClientInfo. HPlayWnd=HWND;
ClientInfo. LChannel=1;
ClientInfo. LLinkMode=0;
ClientInfo. SMultiCastIP=NULL;
IRealPlayHandle=NET_DVR_RealPlay_V30 (IUserID, & amp; ClientInfo g_RealDataCallBack_V30, NULL, 0);
*/
If (IRealPlayHandle<0)
{
QDebug () & lt; <" Play the error! \ n ";
NET_DVR_Logout (IUserID);
NET_DVR_Cleanup ();
return;
}
The else
{
}
}
Drew three button is used to control the UI interface, a frame used to display the image, I get the frame of the handle, and then call NET_DVR_RealPlay_V30, playback, frame listed empty nothing, what reason, novice, never make, my platform is Windows platforms with QT
CodePudding user response:
NET_DVR_RealPlay_V40 try for this?