Ejemplo n.º 1
0
bool clsCfgParam::funcNET_IO_PREV_CHAN_STOP_Cam(DEVICE *d)
{
	NET_DVR_StopRealPlay(d->PlayHandle);
	d->PlayHandle = -1;
	d->HeadLength = 0;
	NET_DVR_StopRealPlay(d->SubHandle);
	d-> SubHandle = -1;
	d->SubHeadLength = 0;
	return true;
}
Ejemplo n.º 2
0
j_result_t CHikSdkChannel::CloseStream(J_Obj *pObj, CRingBuffer *pRingBuffer)
{
	if (!m_bOpened)
		return J_OK;

	CHikSdkStream *pHikStream = dynamic_cast<CHikSdkStream *>(pObj);
	if (pHikStream == NULL)
		return J_OK;

	if (pHikStream->RingBufferCount() == 1)
	{
		NET_DVR_StopRealPlay(m_hStream);
		m_hStream = -1;

		m_bOpened = false;
		(dynamic_cast<CHikSdkStream *> (pObj))->Shutdown();
		//J_OS::LOGINFO("StopView Begin");
		pHikStream->DelRingBuffer(pRingBuffer);
		//J_OS::LOGINFO("StopView End");
		delete pObj;

		return J_NO_REF;
	}

	if (pHikStream->RingBufferCount() > 0)
		pHikStream->DelRingBuffer(pRingBuffer);

	return J_OK;
}
Ejemplo n.º 3
0
BOOL CPlayer::HKStopMonitor()
{
	if(m_lPlayHandle >= 0)
	{
		m_hkStopMonitor = NET_DVR_StopRealPlay(m_lPlayHandle);
		m_lPlayHandle = -1;
	}
	return m_hkStopMonitor;
}
Ejemplo n.º 4
0
bool CDevHKPreview::StopRealPlay()
{
    if (IsPlaying())
    {
        NET_DVR_StopRealPlay(m_lRealHandle);
        m_lRealHandle = -1;
    }
    return true;
}
Ejemplo n.º 5
0
void CSingleCamDlg::OnBnClickedBtnStopcam()//停止
{

	NET_DVR_StopRealPlay(lRealHandle1);
	NET_DVR_StopRealPlay(lRealHandle2);

	//释放播放库资源
	PlayM4_Stop(nPort1);
	PlayM4_CloseStream(nPort1);
	PlayM4_FreePort(nPort1);
	PlayM4_Stop(nPort2);
	PlayM4_CloseStream(nPort2);
	PlayM4_FreePort(nPort2);
	GetDlgItem(IDC_BTN_Login)->EnableWindow(TRUE);  //登录按钮失效
	GetDlgItem(IDC_BTN_PlayCam)->EnableWindow(TRUE);  //播放按钮 有效
	GetDlgItem(IDC_BTN_StopCam)->EnableWindow(FALSE);  //停止按钮 失效
	GetDlgItem(IDC_BTN_SavePicture)->EnableWindow(FALSE); // 抓图按钮 失效
	GetDlgItem(IDC_BTN_SavePicture2)->EnableWindow(FALSE); // 抓图按钮 失效
	GetDlgItem(IDC_BTN_StopSave)->EnableWindow(FALSE); // 停止抓图按钮 失效
}
Ejemplo n.º 6
0
DevChannelHK::~DevChannelHK() {
	InfoL << endl;
	if (m_i64PreviewHandle >= 0) {
		NET_DVR_StopRealPlay(m_i64PreviewHandle);
		m_i64PreviewHandle = -1;
	}
	if (m_iPlayHandle >= 0) {
		PlayM4_StopSoundShare(m_iPlayHandle);
		PlayM4_Stop(m_iPlayHandle);
		m_iPlayHandle = -1;
	}
}
Ejemplo n.º 7
0
void CHaikangSDK::PtzStopPlay()
{
	//关闭预览
	if(m_ptzRealHandle != -1)
	{
		NET_DVR_StopRealPlay(m_ptzRealHandle);
	}
	//注销用户
	if(m_ptzLoginHandle != -1)
	{
		NET_DVR_Logout_V30(m_ptzLoginHandle);
	}
}
Ejemplo n.º 8
0
MainWindow::~MainWindow()
{
    // 停止解码
    PlayM4_Stop(lPort);

    //关闭流,回收源数据缓冲
    PlayM4_CloseStream(lPort);

    //释放播放库端口号
    PlayM4_FreePort(lPort);

    NET_DVR_StopRealPlay(lRealPlayHandle);
    //注销用户
    NET_DVR_Logout(lUserID);
    //释放SDK资源
    NET_DVR_Cleanup();
    delete ui;
}
Ejemplo n.º 9
0
void CHaikangSDK::StopPlay(int screenNo)
{

	//关闭预览
	NET_DVR_StopRealPlay(m_RealHandle[screenNo]);
	//注销用户
	NET_DVR_Logout_V30(m_LoginHandle[screenNo]);
	
	PlayM4_Stop(m_lPort[screenNo]);
	PlayM4_CloseStream(m_lPort[screenNo]);
	PlayM4_FreePort(m_lPort[screenNo]);

	m_LoginHandle[screenNo] = -1;
	m_lPort[screenNo]=-1;
#if OPEN_CARDETECT_CODE 	
	//停止识别
	if(false == DlgMain->DlgScreen.m_videoInfo[screenNo].enableDetect)
		DlgMain->DlgScreen.CarDetect[screenNo].Stop();
#endif

}
Ejemplo n.º 10
0
void * HK_Store_Thread(void * para){

    /*info to login HK camera*/
    char HK_userName[] = "admin";
    char HK_password[] = "12345";
    int stopResult = 0;

    LONG lUserID = 0;

    LONG streamHandle = 0;
    //unsigned int NVR_recordHandle = 0;

    NET_DVR_DEVICEINFO_V30 struDeviceInfo;
    NET_DVR_CLIENTINFO ClientInfo = {0};
    //ClientInfo.hPlayWnd = NULL;
    ClientInfo.lChannel = 1;
    ClientInfo.lLinkMode = 0;
    ClientInfo.sMultiCastIP = NULL;


    RecordParas *t_para = (RecordParas *)para;
    HKcameraArgs hkargs;

    //hkargs.NVR_LoginID = t_para->NVR_LoginID;//nvr server loginID
    strcpy(hkargs.NAR_cameraID, t_para->cameraID);//the VolID in nvr server
    hkargs.block_flag = 0;
    hkargs.NAR_recordHandle = 0;
    hkargs.HK_streamHandle = &streamHandle;

    while(1){
    	//-----------Init
    	NET_DVR_Init();
        hkargs.block_flag = 0;

    	//------------Set Connecttime and ReconnectTime
    	NET_DVR_SetConnectTime(2000,1);
    	NET_DVR_SetReconnect(10000,TRUE);

    	//-------------HKLogin
    	lUserID = NET_DVR_Login_V30(t_para->cameraIP, t_para->cameraPort, HK_userName, HK_password, &struDeviceInfo);
    	if(lUserID < 0){
    	    syslog(LOG_ERR,"connect HK IPC %s failed! errorCode: %d\n", t_para->cameraIP, NET_DVR_GetLastError());
    	    NET_DVR_Cleanup();//clear all the info
            continue;
    	}
        syslog(LOG_ERR,"connect HK IPC %s sucess!\n", t_para->cameraIP);

	//set exception callback function
    	NET_DVR_SetExceptionCallBack_V30(0, NULL, HK_RP_Exp_Callback, &hkargs);

	//get data stream and store
   	streamHandle = NET_DVR_RealPlay_V30(lUserID, &ClientInfo, HK_Store_CallBack, &hkargs, 0);
        if(streamHandle < 0){
            NET_DVR_Logout(lUserID);//get wrong handle ,logout
            NET_DVR_Cleanup();
            continue;
    	}
    	while(!hkargs.block_flag){ 
    	}
        stopResult = NET_DVR_StopRealPlay(streamHandle);
        syslog(LOG_INFO,"(InHKTransdata) stoped real play ? result:%d\n", stopResult);
        NET_DVR_Logout_V30(lUserID);
        syslog(LOG_INFO,"(InHKTransdata) HKcamera Logout(loginID was %d)\n",lUserID);
        NET_DVR_Cleanup();
        if(hkargs.block_flag == 1){
			break;
		}
    }
	return NULL;
}
Ejemplo n.º 11
0
void HikNetHelper::endRealplay() {
    if(_isLogin == true) {
        NET_DVR_StopRealPlay(_hikRealPlayHandle);
    }
}