예제 #1
0
파일: CameraWr.cs 프로젝트: zhchtao323/sp
 private void w_Load(object sender, EventArgs e)
 {
     mjpegSource             = new MJPEGSource();
     mjpegSource.VideoSource = source;
     mjpegSource.Login       = "******";
     mjpegSource.Password    = "******";
     mjpegSource.NewFrame   += new CameraEventHandler(mjpegSource_NewFrame);
 }
예제 #2
0
파일: CameraW.cs 프로젝트: zhchtao323/sp
 /// <summary>
 /// 启动视屏,仅通过此方式启动,默认状态视屏不运行
 /// </summary>
 public void Start()
 {
     mjpegSource             = null;
     mjpegSource             = new MJPEGSource();
     mjpegSource.Login       = "******";
     mjpegSource.Password    = "******";
     mjpegSource.NewFrame   += new CameraEventHandler(mjpegSource_NewFrame);
     mjpegSource.ErrEvent   += mjpegSource_ErrEvent;
     mjpegSource.VideoSource = source;
     mjpegSource.Start();
     //ms = new MjpegDecoder();
     //ms.FrameReady += new EventHandler<FrameReadyEventArgs>(ms_FrameReady);
     //ms.ParseStream(new Uri(source));
 }
예제 #3
0
        // Create video source object
        public IVideoSource CreateVideoSource(object config)
        {
            MJPEGConfiguration cfg = (MJPEGConfiguration)config;

            if (cfg != null)
            {
                MJPEGSource source = new MJPEGSource();

                source.VideoSource = cfg.source;
                source.Login       = cfg.login;
                source.Password    = cfg.password;

                return((IVideoSource)source);
            }
            return(null);
        }
예제 #4
0
파일: CameraW.cs 프로젝트: zhchtao323/sp
        //void ms_FrameReady(object sender, FrameReadyEventArgs e)
        //{
        //    //throw new NotImplementedException();
        //    drawbmp11(e.Bitmap);
        //}

        /// <summary>
        /// 停止通讯
        /// </summary>
        public void Stop()
        {
            try
            {
                if (aw != null)
                {
                    aw.Close();
                }

                mjpegSource.NewFrame -= new CameraEventHandler(mjpegSource_NewFrame);
                mjpegSource.Yx        = false;
                mjpegSource.Stop();
                mjpegSource     = null;
                motionDetecotor = null;
                GC.Collect();
            }
            catch { }
        }