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); }
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); }