Exemplo n.º 1
0
        public void OpenSDK_StartRealPlay_OldTest()
        {
            VideoPlayControl.ProgParameter.strEzviz__AppID    = "5b97c1d157474f96b8d4c75b936a0057";
            VideoPlayControl.ProgParameter.strEzviz_AppSecret = "4318d0cc4c43ca156052ba688bc9006a";

            SDK_EzvizSDK.OpenSDK_InitLib(ProgParameter.strEzviz__AuthAddr, ProgParameter.strEzviz__PlatForm, ProgParameter.strEzviz__AppID);
            JsonRequestResult result = SDK_EzvizSDK.GetAccessToken();

            timStartTime = DateTime.Now;
            string     strSession;
            IntPtr     intptrSession = IntPtr.Zero;
            int        intLenght     = 0;
            PictureBox pic           = new PictureBox();

            SDK_EzvizSDK.MsgHandler m = new SDK_EzvizSDK.MsgHandler(MsgHandler);
            int intResult             = SDK_EzvizSDK.OpenSDK_AllocSession(m, IntPtr.Zero, ref intptrSession, ref intLenght, false, uint.MaxValue);

            strSession = Marshal.PtrToStringAnsi(intptrSession);
            intResult  = SDK_EzvizSDK.OpenSDK_StartRealPlay_Old(intptrSession, pic.Handle, "667ed52a9d834fdfa3692ba0a39b94a5", ProgParameter.strEzviz_AccessToken, 0, null, ProgParameter.strEzviz__AppID);
            Delay_Millisecond(10000);
            intResult = SDK_EzvizSDK.OpenSDK_StopRealPlay(intptrSession, 0);
            //Thread.Sleep(5000);
            intResult = SDK_EzvizSDK.OpenSDK_FreeSession(strSession);
            SDK_EzvizSDK.OpenSDK_FiniLib();
            Assert.AreEqual("1", strSession);
        }
Exemplo n.º 2
0
        public void OpenSDK_AllocSessionTest()
        {
            SDK_EzvizSDK.OpenSDK_InitLib(ProgParameter.strEzviz__AuthAddr, ProgParameter.strEzviz__PlatForm, ProgParameter.strEzviz__AppID);
            JsonRequestResult result = SDK_EzvizSDK.GetAccessToken();
            string            strSession;
            IntPtr            intptrSession = IntPtr.Zero;
            int intLenght = 0;

            SDK_EzvizSDK.MsgHandler m = new SDK_EzvizSDK.MsgHandler(MsgHandler);
            int intResult             = SDK_EzvizSDK.OpenSDK_AllocSession(m, IntPtr.Zero, ref intptrSession, ref intLenght, false, uint.MaxValue);

            strSession = Marshal.PtrToStringAnsi(intptrSession);
            intResult  = SDK_EzvizSDK.OpenSDK_FreeSession(intptrSession);
            SDK_EzvizSDK.OpenSDK_FiniLib();
            Assert.AreEqual("1", strSession);
        }
Exemplo n.º 3
0
        public void OpenSDK_StartRealPlayTest()
        {
            SDK_EzvizSDK.OpenSDK_InitLib(ProgParameter.strEzviz__AuthAddr, ProgParameter.strEzviz__PlatForm, ProgParameter.strEzviz__AppID);
            JsonRequestResult result = SDK_EzvizSDK.GetAccessToken();
            string            strSession;
            IntPtr            intptrSession = IntPtr.Zero;
            int        intLenght            = 0;
            PictureBox pic = new PictureBox();

            SDK_EzvizSDK.MsgHandler m = new SDK_EzvizSDK.MsgHandler(MsgHandler);
            int intResult             = SDK_EzvizSDK.OpenSDK_AllocSession(m, IntPtr.Zero, ref intptrSession, ref intLenght, false, uint.MaxValue);

            strSession = Marshal.PtrToStringAnsi(intptrSession);
            intResult  = SDK_EzvizSDK.OpenSDK_StartRealPlay(intptrSession, pic.Handle, "7e1c18bad66544408b38d1711552e320", ProgParameter.strEzviz_AccessToken, 0, null, ProgParameter.strEzviz__AppID, 0);
            Delay_Millisecond(10000);
            intResult = SDK_EzvizSDK.OpenSDK_StopRealPlayEx(intptrSession);
            Delay_Millisecond(10000);
            intResult = SDK_EzvizSDK.OpenSDK_FreeSession(strSession);
            SDK_EzvizSDK.OpenSDK_FiniLib();
            Assert.AreEqual("1", strSession);
        }