示例#1
0
        public bool Start(Profile profile)
        {
            bool Result = service.Start(profile);

            if (Result == true)
            {
                MediaDevice device = service.MediaDevice;

                service.VideoDataReady += service_VideoDataReady; //new EventHandler(service_VideoDataReady);
                service.AudioDataReady += service_AudioDataReady; //new EventHandler(service_AudioDataReady);

                string uri      = device.ONVIF.GetCurrentMediaProfileRtspStreamUri().AbsoluteUri;
                string filename = ""; //device.AVProcessor.FFmpegMedia.OutputFilename;

                int width  = 640;     //device.AVProcessor.InVideoParams.Width;
                int height = 480;     //device.AVProcessor.InVideoParams.Height;

                videoForm = new VideoForm(uri, filename, width, height);
                if (videoForm != null)
                {
                    //device.AVProcessor.ShowVideo += videoForm.ShowVideo;
                    //device.AVProcessor.PlayAudio += videoForm.PlayAudio;

                    MediaFormManager.AddForm(videoForm);

                    videoForm.Show();
                }
                MediaFormManager.UpdateControls();
            }

            return(Result);
        }
        public bool Start(Profile profile)
        {
            bool Result = service.Start(profile);

            if (Result == true)
            {
                MediaDevice device = service.MediaDevice;

                service.VideoDataReady +=service_VideoDataReady; //new EventHandler(service_VideoDataReady);
                service.AudioDataReady += service_AudioDataReady; //new EventHandler(service_AudioDataReady);

                string uri = device.ONVIF.GetCurrentMediaProfileRtspStreamUri().AbsoluteUri;
                string filename = "";//device.AVProcessor.FFmpegMedia.OutputFilename;

                int width = 640;//device.AVProcessor.InVideoParams.Width;
                int height = 480;//device.AVProcessor.InVideoParams.Height;

                videoForm = new VideoForm(uri, filename, width, height);
                if (videoForm != null)
                {
                    //device.AVProcessor.ShowVideo += videoForm.ShowVideo;
                    //device.AVProcessor.PlayAudio += videoForm.PlayAudio;

                    MediaFormManager.AddForm(videoForm);

                    videoForm.Show();
                }
                MediaFormManager.UpdateControls();
            }

            return Result;
        }