Esempio 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);
        }
Esempio n. 2
0
        public void GetAccessTokenTest()
        {
            //SDKState.Ezviz_SDKInit();
            int intInitResult        = SDK_EzvizSDK.OpenSDK_InitLib(ProgParameter.strEzviz__AuthAddr, ProgParameter.strEzviz__PlatForm, ProgParameter.strEzviz__AppID);
            JsonRequestResult result = SDK_EzvizSDK.GetAccessToken();

            SDK_EzvizSDK.OpenSDK_FiniLib();
            Assert.AreEqual(200, (int)result);
        }
Esempio n. 3
0
        public int TestInit()
        {
            int intResult = 0;

            intResult = SDK_EzvizSDK.OpenSDK_InitLib(ProgParameter.strEzviz__AuthAddr, ProgParameter.strEzviz__PlatForm, ProgParameter.strEzviz__AppID);
            JsonRequestResult result      = SDK_EzvizSDK.GetAccessToken();
            IntPtr            intptrToken = Marshal.StringToHGlobalAnsi(ProgParameter.strEzviz_AccessToken);

            intResult = SDK_EzvizSDK.OpenSDK_SetAccessToken(intptrToken);
            return(intResult);
        }
Esempio n. 4
0
        public void OpenSDK_Data_GetDevListTest()
        {
            SDK_EzvizSDK.OpenSDK_InitLib(ProgParameter.strEzviz__AuthAddr, ProgParameter.strEzviz__PlatForm, ProgParameter.strEzviz__AppID);
            JsonRequestResult result = SDK_EzvizSDK.GetAccessToken();
            IntPtr            intptrMessage;
            int    intLenght;
            int    intResult      = SDK_EzvizSDK.OpenSDK_Data_GetDevList(ProgParameter.strEzviz_AccessToken, 0, 50, out intptrMessage, out intLenght);
            string strDevInfoJosn = Marshal.PtrToStringAnsi(intptrMessage);

            SDK_EzvizSDK.OpenSDK_FiniLib();
            Assert.AreEqual("1", strDevInfoJosn);
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
        public void OpenSDK_StartRealPlayExTest()
        {
            VideoPlayControl.ProgParameter.strEzviz__AppID    = "5b97c1d157474f96b8d4c75b936a0057";
            VideoPlayControl.ProgParameter.strEzviz_AppSecret = "4318d0cc4c43ca156052ba688bc9006a";
            int intResult = 0;

            intResult = SDK_EzvizSDK.OpenSDK_InitLib(ProgParameter.strEzviz__AuthAddr, ProgParameter.strEzviz__PlatForm, ProgParameter.strEzviz__AppID);
            JsonRequestResult result      = SDK_EzvizSDK.GetAccessToken();
            IntPtr            intptrToken = Marshal.StringToHGlobalAnsi(ProgParameter.strEzviz_AccessToken);

            intResult = SDK_EzvizSDK.OpenSDK_SetAccessToken(intptrToken);
            IntPtr     intptrSession = IntPtr.Zero;
            int        intLenght     = 0;
            PictureBox pic           = new PictureBox();

            SDK_EzvizSDK.MsgHandler m = new SDK_EzvizSDK.MsgHandler(MsgHandler);
            timStartTime = DateTime.Now;
            intResult    = SDK_EzvizSDK.OpenSDK_AllocSessionEx(m, IntPtr.Zero, out intptrSession, out intLenght);
            //intResult = SDK_EzvizSDK.OpenSDK_SetVideoLevel(intptrSession, 1, 1);
            SDK_EzvizSDK.DataCallBack callback = new SDK_EzvizSDK.DataCallBack(DataCallBack);
            //IntPtr inptrUser = Marshal.StringToHGlobalAnsi("10086");
            //intResult = SDK_EzvizSDK.OpenSDK_SetDataCallBack(intptrSession, callback, inptrUser);
            intResult = SDK_EzvizSDK.GetDevOnlineState("797085722", 1);
            IntPtr ii = Marshal.StringToHGlobalAnsi("797085722");

            intResult = SDK_EzvizSDK.OpenSDK_StartRealPlayEx(intptrSession, IntPtr.Zero, ii, 1, "CHZUVA");
            //int intErrorCode = 0;
            //string strErrorDesc = "";
            //if (intResult == -1)
            //{
            //    //错误码
            //    intErrorCode = SDK_EzvizSDK.OpenSDK_GetLastErrorCode();
            //    IntPtr i = SDK_EzvizSDK.OpenSDK_GetLastErrorDesc();
            //    strErrorDesc = Marshal.PtrToStringAnsi(i);
            //}
            Delay_Millisecond(10000);
            intResult = SDK_EzvizSDK.OpenSDK_StopRealPlayEx(intptrSession);
            intResult = SDK_EzvizSDK.OpenSDK_FreeSession(intptrSession);
            SDK_EzvizSDK.OpenSDK_FiniLib();
            Assert.AreEqual("1", intResult);
        }
Esempio n. 7
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);
        }