Esempio n. 1
0
        private void DoKernelStatus(IMonitorSystemContext context, string vsName, VideoSourceKernelState vsStatus)
        {
            //System.Console.Out.WriteLine("CVideoSourceManager.DoKernelStatus vsName="+VideoSourceName+", VideoSourceKernelState="+vsStatus);

            if (OnKernelStatus != null)
            {
                OnKernelStatus(context, vsName, vsStatus);
            }
        }
Esempio n. 2
0
        private void DoVideoSourceKernelStateChanged(string name, VideoSourceKernelState state)
        {
            CLocalSystem.WriteDebugLog(string.Format("{0} CVideoSource({1}).DoKernelStateChanged KernelState={2}", Config.Desc, name, state));

            if (OnKernelStatus != null)
            {
                if (CLocalSystem.MainForm != null)
                {
                    MethodInvoker form_invoker = delegate
                    {
                        OnKernelStatus(SystemContext, name, state);
                    };
                    CLocalSystem.MainForm.Invoke(form_invoker);
                }
                else
                {
                    OnKernelStatus(SystemContext, name, state);
                }
            }

            if (state < 0)
            {
                if (VideoSourceStatus != VideoSourceState.NoLink)
                {
                    VideoSourceStatus = VideoSourceState.KernelError;
                }

                switch (state)
                {
                case VideoSourceKernelState.VSState_FrameFailed:
                    //System.Windows.Forms.MessageBox.Show(name + " 视频源帧内容失效!", "视频源内核状态提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    CLocalSystem.WriteErrorLog(string.Format("\"{0}\"视频源帧内容失效!", name));
                    break;

                case VideoSourceKernelState.VSState_FrameNull:
                    //System.Windows.Forms.MessageBox.Show(name + " 视频源抓帧连续为空!", "视频源内核状态提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    CLocalSystem.WriteErrorLog(string.Format("\"{0}\"视频源抓帧连续为空!", name));
                    break;

                case VideoSourceKernelState.VSState_LockLost:
                    //System.Windows.Forms.MessageBox.Show(name + " 视频源抓帧死锁!", "视频源内核状态提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    CLocalSystem.WriteErrorLog(string.Format("\"{0}\"视频源抓帧死锁!", name));
                    break;

                case VideoSourceKernelState.VSState_TimerFailed:
                    //System.Windows.Forms.MessageBox.Show(name + " 视频源抓帧失效!", "视频源内核状态提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    CLocalSystem.WriteErrorLog(string.Format("\"{0}\"视频源抓帧失效!", name));
                    break;

                case VideoSourceKernelState.VSState_OtherProblem:
                    //System.Windows.Forms.MessageBox.Show(name + " 视频源出现其它问题!", "视频源内核状态提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    CLocalSystem.WriteErrorLog(string.Format("\"{0}\"视频源出现其它问题!", name));
                    break;

                default:
                    //System.Windows.Forms.MessageBox.Show(name + " 视频源出现未知错误!", "视频源内核状态提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    CLocalSystem.WriteErrorLog(string.Format("\"{0}\"视频源出现未知错误!", name));
                    //KernelReset();
                    break;
                }
            }
        }