Exemplo n.º 1
0
        private void GetStreamUri(INvtSession session, Profile profile)
        {
            var streamSetup = new StreamSetup()
            {
                stream    = StreamType.rtpUnicast,
                transport = new Transport()
                {
                    protocol = TransportProtocol.tcp
                }
            };

            disposables.Add(
                session
                .GetStreamUri(streamSetup, profile.token)
                .ObserveOnCurrentDispatcher()
                .Subscribe(
                    muri => {
                videoSize = new Size(profile.videoEncoderConfiguration.resolution.width, profile.videoEncoderConfiguration.resolution.height);
                InitializePlayer(muri.uri.ToString(), credentials, videoSize);
            },
                    err => {
            }
                    )
                );
        }
Exemplo n.º 2
0
        void GetStreamUri(INvtSession session, onvif.services.Profile prof)
        {
            var srtSetup = new StreamSetup()
            {
                stream    = StreamType.rtpUnicast,
                transport = new Transport()
                {
                    protocol = TransportProtocol.udp
                }
            };

            //Get stream uri for selected profile
            disposables.Add(session.GetStreamUri(srtSetup, prof.token)
                            .ObserveOnCurrentDispatcher()
                            .Subscribe(
                                muri => {
                Size videosize = new Size(prof.videoEncoderConfiguration.resolution.width, prof.videoEncoderConfiguration.resolution.height);

                InitPlayer(muri.uri.ToString(), account, videosize);
            }, err => {
                errBox.Text = err.Message;
            }));
        }
        //public ObservableCollection<MetadataUnit> MetaData { get; set; }

        void Reload(INvtSession session)
        {
            var vs = AppDefaults.visualSettings;

            StreamSetup strSetup = new StreamSetup()
            {
                stream    = StreamType.rtpUnicast,
                transport = new Transport()
                {
                    protocol = vs.Transport_Type,
                    tunnel   = null
                }
            };

            //TODO: provide a way of cancelation
            //try {
            //	var streamInfo = await session.GetStreamUri(strSetup, profile.token);
            //	VideoInfo.MediaUri = streamInfo.uri;
            //	VideoStartup(VideoInfo);
            //} catch (Exception err) {
            //	dbg.Error(err);
            //	throw;
            //}

            subscription.Add(
                session.GetStreamUri(strSetup, profile.token)
                .ObserveOnCurrentDispatcher()
                .Subscribe(
                    uri => {
                VideoInfo.MediaUri = uri.uri;
                VideoStartup(VideoInfo);
            },
                    err => {
            }
                    )
                );
        }
		//public ObservableCollection<MetadataUnit> MetaData { get; set; }

		void Reload(INvtSession session) {
			var vs = AppDefaults.visualSettings;

			StreamSetup strSetup = new StreamSetup() {
				stream = StreamType.rtpUnicast,
				transport = new Transport(){
					protocol = vs.Transport_Type,
					tunnel = null
				}
			};

			//TODO: provide a way of cancelation
			//try {
			//	var streamInfo = await session.GetStreamUri(strSetup, profile.token);
			//	VideoInfo.MediaUri = streamInfo.uri;
			//	VideoStartup(VideoInfo);
			//} catch (Exception err) {
			//	dbg.Error(err);
			//	throw;
			//}

			subscription.Add(
				session.GetStreamUri(strSetup, profile.token)
				.ObserveOnCurrentDispatcher()
				.Subscribe(
					uri => {
						VideoInfo.MediaUri = uri.uri;
						VideoStartup(VideoInfo);
					}, 
					err => {
					}
				)
			);
		}