Example #1
0
        public void AcceptVideoCall(ref STVideoWindow stLocalWnd, ref STVideoWindow stRemoteWnd)//接听视频呼叫
        {
            LogManager.SystemLog.Debug(string.Format("Start UC_SDK_AcceptVideoCall"));
            int iRet = UCInterface.UC_SDK_AcceptVideoCall(stLocalWnd.hWnd, stLocalWnd.left, stLocalWnd.top, stLocalWnd.width, stLocalWnd.height,
                                                          stRemoteWnd.hWnd, stRemoteWnd.left, stRemoteWnd.top, stRemoteWnd.width, stRemoteWnd.height);

            if (iRet != 0)
            {
                LogManager.SystemLog.Error(string.Format("UC_SDK_AcceptVideoCall = {0}", iRet));
            }
            LogManager.SystemLog.Debug(string.Format("End UC_SDK_AcceptVideoCall"));
        }
Example #2
0
        /// <summary>
        /// 获取视频播放窗体参数
        /// </summary>
        /// <param name="stLocalWnd"></param>
        /// <param name="stRemoteWnd"></param>
        public void GetVideoPlayPara(ref STVideoWindow stLocalWnd, ref STVideoWindow stRemoteWnd)
        {
            System.Drawing.Point phRemote = new System.Drawing.Point();
            System.Drawing.Point phLocal  = new System.Drawing.Point();
            IntPtr intpRemote             = new IntPtr();

            System.Drawing.Point plRemote = new System.Drawing.Point();
            IntPtr intpLocal = new IntPtr();

            System.Drawing.Point plLocal = new System.Drawing.Point();
            Dispatcher.Invoke(new Action(() =>
            {
                intpRemote = (host.Child as UCVideo).Remote.Handle;
                intpLocal  = (host.Child as UCVideo).Local.Handle;
                plRemote.X = 0;
                plRemote.Y = 0;
                UCInterface.ClientToScreen(intpRemote, ref plRemote);

                phRemote.X = (int)(host.Child as UCVideo).Remote.Width;
                phRemote.Y = (int)(host.Child as UCVideo).Remote.Height;
                UCInterface.ClientToScreen(intpRemote, ref phRemote);

                plLocal.X = 0;
                plLocal.Y = 0;
                UCInterface.ClientToScreen(intpLocal, ref plLocal);

                phLocal.X = (int)(host.Child as UCVideo).Local.Width;
                phLocal.Y = (int)(host.Child as UCVideo).Local.Height;
                UCInterface.ClientToScreen(intpLocal, ref phLocal);
            }));
            stRemoteWnd.height = phRemote.Y;
            stRemoteWnd.hWnd   = (int)(intpRemote);
            stRemoteWnd.left   = plRemote.X;
            stRemoteWnd.top    = plRemote.Y;
            stRemoteWnd.width  = phRemote.X;

            stLocalWnd.height = phLocal.Y;
            stLocalWnd.hWnd   = (int)(intpLocal);
            stLocalWnd.left   = plLocal.X;
            stLocalWnd.top    = plLocal.Y;
            stLocalWnd.width  = phLocal.X;
            SetWinSize();          //重新设置video尺寸
            this.isreturn = false; //modify by jinyeqing  重置Video后由于线程原因仍会进入closewinvideo    所以还是要使用这个isreturn还判断避免在updatelayout
            this.IsReturn = true;
        }