Beispiel #1
0
 private void w_Load(object sender, EventArgs e)
 {
     mjpegSource             = new MJPEGSource();
     mjpegSource.VideoSource = source;
     mjpegSource.Login       = "******";
     mjpegSource.Password    = "******";
     mjpegSource.NewFrame   += new CameraEventHandler(mjpegSource_NewFrame);
 }
Beispiel #2
0
 /// <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));
 }
        // 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);
        }
Beispiel #4
0
        //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 { }
        }