Beispiel #1
0
        public void H264_DVR_PTZControlTest()
        {
            int  iLogin    = -1;
            int  intResult = 0;
            bool bolResult = false;

            SDKState.XMSDK_Init();
            H264_DVR_DEVICEINFO OutDev;
            int nError = 0;

            iLogin = SDK_XMSDK.H264_DVR_Login_Cloud("4bba3f71cdd143cb", 34567, "admin", "123456", out OutDev, out nError, "");
            H264_DVR_CLIENTINFO playstru = new H264_DVR_CLIENTINFO();

            playstru.nChannel = 0;
            //playstru.nChannel = 0;
            playstru.nStream = 0;
            playstru.nMode   = 1;
            playstru.hWnd    = IntPtr.Zero;
            int m_iPlayhandle = SDK_XMSDK.H264_DVR_RealPlay(Convert.ToInt32(iLogin), ref playstru);

            bolResult = SDK_XMSDK.H264_DVR_PTZControl(iLogin, 0, Convert.ToInt32(SDK_XMSDK.PTZ_ControlType.PAN_LEFTTOP), false, 10);
            //bolResult = SDK_XMSDK.H264_DVR_PTZControl(1, 0,1, false, 4);
            //(long lLoginID, int nChannelNo, long lPTZCommand, bool bStop DEF_PARAM(0), long lSpeed DEF_PARAM(4));
            Thread.Sleep(1000);
            SDK_XMSDK.H264_DVR_PTZControl(iLogin, 0, Convert.ToInt32(SDK_XMSDK.PTZ_ControlType.PAN_RIGTHDOWN), true, 0);
            //SDK_XMSDK.H264_DVR_PTZControl(iLogin, 1, Convert.ToInt64(SDK_XMSDK.PTZ_ControlType.TILT_DOWN), false, 100);
            //bool bolResult = SDK_XMSDK.H264_DVR_PTZControl(Convert.ToInt32(lLogin), CurrentCameraInfo.Channel, Convert.ToInt32(XMVideoPtzType), !bolStart, CurrentVideoPlaySet.PTZSpeed);
            SDK_XMSDK.H264_DVR_Logout(Convert.ToInt32(intResult));
            SDKState.XMSDK_Release();
            Assert.IsTrue(bolResult);
        }
Beispiel #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            VideoPlayControl.ProgParameter.strEzviz__AppID      = "5b97c1d157474f96b8d4c75b936a0057";
            VideoPlayControl.ProgParameter.strEzviz_AppSecret   = "4318d0cc4c43ca156052ba688bc9006a";
            videoPlayGroupControls_PTZAndTalk1.bolAutoPlayVideo = true;
            videoPlayGroupControls_PTZAndTalk1.videoPlaySet.VideoRecordEnable  = true;
            videoPlayGroupControls_PTZAndTalk1.videoPlaySet.VideoMonitorEnable = true;
            //videoPlayGroupControls_Basic1.videoPlaySet.VideoRecordFilePath = "C:\\SHIKE_Video\\4603\\20170925094530";
            //videoPlayGroupControls_Basic1.bolDisplaySDKEvent = true;
            //videoPlayGroupControls_Basic1.bolDisPlaySDKState = true;
            //videoPlayGroupControls_Basic1.videoPlaySet.PreSetPosi = 13;
            //SDKState.CloundSee_SDKInit();
            //SDKState.Ezviz_SDKInit();
            //SDKState.SKVideoSDKInit();
            //SDKState.HuaMai_Init();
            //SDKState.XMSDK_Release();
            SDKState.XMSDK_Init();
            //SDKState.SKVideoSDKInit(ProgParameter.uintSKVideo_AVPort, ProgParameter.strSKVideo_ClientUGID, "192.168.2.10", ProgParameter.uintSKVideo_ControlPort, ProgParameter.uintSKVideo_VideoPort, ProgParameter.uintSKVideo_AudioPort, "");

            //HuaMaiVideo_TestData();
            Dictionary <string, VideoInfo> dicVideoInfos = new Dictionary <string, VideoInfo>();
            VideoInfo v = TestDataSource.TestDataSource.XMDataSource();

            dicVideoInfos[v.DVSNumber] = v;
            VideoInfo v1 = TestDataSource.TestDataSource.XMDataSource1();

            dicVideoInfos[v1.DVSNumber] = v1;
            videoPlayGroupControls_PTZAndTalk1.bolPreViewPwdVerify = false;
            //videoPlayGroupControls_PTZAndTalk1.PreViewPwdVerifyEvent += PreViewPwdVerify;
            videoPlayGroupControls_PTZAndTalk1.videoPlaySet.VideoRecordEnable   = true;
            videoPlayGroupControls_PTZAndTalk1.videoPlaySet.VideoRecordFilePath = Application.StartupPath + "\\AxisVideoRecord";
            videoPlayGroupControls_PTZAndTalk1.Init_VideoInfoSet(dicVideoInfos);
            //videoPlayGroupControls_PTZAndTalk1.VideoPlay("", -1);
        }
Beispiel #3
0
        public void H264_DVR_LoginTest()
        {
            SDKState.XMSDK_Init();
            H264_DVR_DEVICEINFO OutDev;
            int nError    = 0;
            int intResult = SDK_XMSDK.H264_DVR_Login("192.168.2.165", 34567, "admin", "", out OutDev, out nError, SocketStyle.TCPSOCKET);

            SDK_XMSDK.H264_DVR_Logout(Convert.ToInt32(intResult));
            SDKState.XMSDK_Release();
            Assert.AreEqual(intResult, 1);
        }
Beispiel #4
0
        public void H264_DVR_Login_CloudTest()
        {
            SDKState.XMSDK_Init();
            H264_DVR_DEVICEINFO OutDev;
            int nError    = 0;
            int intResult = SDK_XMSDK.H264_DVR_Login_Cloud("93c4de073e976f89", 34567, "admin", "", out OutDev, out nError, "");

            SDK_XMSDK.H264_DVR_Logout(Convert.ToInt32(intResult));
            SDKState.XMSDK_Release();
            Assert.AreEqual(intResult, 1);
        }
Beispiel #5
0
        public void H264_DVR_Check_Device_Exist_V2Test()
        {
            int  iLogin    = -1;
            int  intResult = 0;
            bool bolResult = false;

            SDKState.XMSDK_Init();
            H264_DVR_DEVICEINFO OutDev;
            int       nError = 0;
            VideoInfo v      = TestDataSource.TestDataSource.XMDataSource2();

            SDK_XMSDK.SDK_SDevicesState state = new SDK_XMSDK.SDK_SDevicesState();
            state.nun          = 2;
            state.state        = new int[32];
            state.state[0]     = 1;
            state.state[1]     = 1;
            state.uuid         = new SDK_XMSDK.SDK_UUID[32];
            state.uuid[0].uuid = v.DVSAddress;
            state.uuid[1].uuid = "4bba3f71cdd143cb";
            IntPtr iUserData = Marshal.StringToHGlobalAnsi("hongdongcheng");

            SDK_XMSDK.OnFoundDevCB callBack = new SDK_XMSDK.OnFoundDevCB(OnFoundDevCB);
            Ezviz_gchMsgBack = GCHandle.Alloc(callBack);
            IntPtr iData = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SDK_XMSDK.SDK_SDevicesState)));

            Marshal.StructureToPtr(state, iData, true);

            int intResut = SDK_XMSDK.H264_DVR_Check_Device_Exist_V2(ref iData, 3, callBack, iUserData);
            var result   = Marshal.PtrToStructure(iData, typeof(SDK_XMSDK.SDK_SDevicesState));

            SDK_XMSDK.SDK_SDevicesState A = (SDK_XMSDK.SDK_SDevicesState)result;
            int error = SDK_XMSDK.H264_DVR_GetLastError();

            iLogin = SDK_XMSDK.H264_DVR_Login_Cloud(v.DVSAddress, 34567, v.UserName, v.Password, out OutDev, out nError, "");

            //H264_DVR_CLIENTINFO playstru = new H264_DVR_CLIENTINFO();
            //playstru.nChannel = 0;
            //playstru.nStream = 0;
            //playstru.nMode = 1;
            //playstru.hWnd = IntPtr.Zero;
            //int m_iPlayhandle = SDK_XMSDK.H264_DVR_RealPlay(Convert.ToInt32(iLogin), ref playstru);
            bolResult = SDK_XMSDK.H264_DVR_PTZControlEx(iLogin, 0, Convert.ToInt32(SDK_XMSDK.PTZ_ControlType.EXTPTZ_POINT_MOVE_CONTROL), 1, 0, 0, false);
            SDK_XMSDK.H264_DVR_Logout(Convert.ToInt32(intResult));
            SDKState.XMSDK_Release();
            Assert.IsTrue(bolResult);
        }
        private void Frm_VideoPlayGroupControls_PTZAndTalk_Load(object sender, EventArgs e)
        {
            VideoPlayControl.ProgParameter.strEzviz__AppID = "5b97c1d157474f96b8d4c75b936a0057";
            VideoPlayControl.ProgParameter.strEzviz_AppSecret = "4318d0cc4c43ca156052ba688bc9006a";
            SDKState.Ezviz_SDKInit();
            //SDKState.XMSDK_Init();
            //videoPlayGroupControls_PTZAndTalk1.bolAutoPlayVideo = true;
            //videoPlayGroupControls_PTZAndTalk1.videoPlaySet.VideoRecordEnable = true;
            //videoPlayGroupControls_PTZAndTalk1.videoPlaySet.VideoMonitorEnable = true;
            //videoPlayGroupControls_Basic1.videoPlaySet.VideoRecordFilePath = "C:\\SHIKE_Video\\4603\\20170925094530";
            //videoPlayGroupControls_Basic1.bolDisplaySDKEvent = true;
            //videoPlayGroupControls_Basic1.bolDisPlaySDKState = true;
            //videoPlayGroupControls_Basic1.videoPlaySet.PreSetPosi = 13;
            //SDKState.CloundSee_SDKInit();
            //SDKState.Ezviz_SDKInit();
            //SDKState.SKVideoSDKInit();
            //SDKState.HuaMai_Init();
            SDKState.XMSDK_Init();
            //SDKState.HikDVRSDK_Init();
            //SDKState.BlueSkySDK_Init();
            SDKState.SKVideoSDKInit("50023370", "192.168.2.19", 47624,47724, 47824, 47924);

            //HuaMaiVideo_TestData();
            //SDKState.SKNVideoSDK_Init("192.168.2.19", 48624, "xhc1", "", "C:\\SHIKE_Video");
            //SDKState.DHVideoSDK_Init();
            //SDKState.SKVideoSDKInit("hdc", "121.41.87.203");
            Dictionary<string, VideoInfo> dicVideoInfos = new Dictionary<string, VideoInfo>();
            //VideoInfo v = TestDataSource.TestDataSource.GetSKDVSData1();
            //dicVideoInfos[v.DVSNumber] = v;
            VideoInfo v = TestDataSource.XMDataSource.GetData3();
            dicVideoInfos[v.DVSNumber] = v;
            videoPlayGroupControls_PTZAndTalk1.bolPreViewPwdVerify = false;
            videoPlayGroupControls_PTZAndTalk1.PreViewPwdVerifyEvent += PreViewPwdVerify;
            videoPlayGroupControls_PTZAndTalk1.videoPlaySet.VideoRecordEnable = true;
            videoPlayGroupControls_PTZAndTalk1.videoPlaySet.VideoRecordFilePath = Application.StartupPath + "\\TestVideo\\";
            videoPlayGroupControls_PTZAndTalk1.videoPlaySet.VideoRecordFilePath_Server = "\\0712\\" + DateTime.Now.ToString("yyyyMMddHHmmss");
            //videoPlayGroupControls_PTZAndTalk1.SetPTZVisible(false);

            videoPlayGroupControls_PTZAndTalk1.Init_VideoInfoSet(dicVideoInfos);
            videoPlayGroupControls_PTZAndTalk1.StartTalkingEvent += VideoPlayGroupControls_PTZAndTalk1_StartTalkingEvent;
            videoPlayGroupControls_PTZAndTalk1.VideoPlay("", 1);
            videoPlayGroupControls_PTZAndTalk1.VideoPlayCallbackEvent += VideoPlayGroupControls_PTZAndTalk1_VideoPlayCallbackEvent;
            videoPlayGroupControls_PTZAndTalk1.CurrentTalkSetting.TalkRecordEnable = true;
            videoPlayGroupControls_PTZAndTalk1.CurrentTalkSetting.TalkRecordPath_Server = "Audio/0712/" + DateTime.Now.ToString("yyyyMMddHHmmss");
        }
Beispiel #7
0
        public void H264_DVR_PTZControlExTest()
        {
            int  iLogin    = -1;
            int  intResult = 0;
            bool bolResult = false;

            SDKState.XMSDK_Init();
            H264_DVR_DEVICEINFO OutDev;
            int nError = 0;

            iLogin = SDK_XMSDK.H264_DVR_Login_Cloud("4bba3f71cdd143cb", 34567, "admin", "123456", out OutDev, out nError, "");
            //H264_DVR_CLIENTINFO playstru = new H264_DVR_CLIENTINFO();
            //playstru.nChannel = 0;
            //playstru.nStream = 0;
            //playstru.nMode = 1;
            //playstru.hWnd = IntPtr.Zero;
            //int m_iPlayhandle = SDK_XMSDK.H264_DVR_RealPlay(Convert.ToInt32(iLogin), ref playstru);
            bolResult = SDK_XMSDK.H264_DVR_PTZControlEx(iLogin, 0, Convert.ToInt32(SDK_XMSDK.PTZ_ControlType.EXTPTZ_POINT_MOVE_CONTROL), 1, 0, 0, false);
            SDK_XMSDK.H264_DVR_Logout(Convert.ToInt32(intResult));
            SDKState.XMSDK_Release();
            Assert.IsTrue(bolResult);
        }