Example #1
0
        public DeviceCollector()
        {
            var finder   = new UPnPDeviceFinderClass();
            var searchId = finder.CreateAsyncFind("urn:ses-com:device:SatIPServer:1", 0, this);

            finder.StartAsyncFind(searchId);
        }
Example #2
0
        public static void DoDeviceSearch(string sTypeURI)
        {
            IUPnPDeviceFinderCallback oCallback          = new UPnPDeviceFinderCallback();
            UPnPDeviceFinderClass     oDeviceFinderClass = new UPnPDeviceFinderClass();

            oDeviceFinderClass.CreateAsyncFind(sTypeURI, 0, oCallback);
            oDeviceFinderClass.StartAsyncFind(0);
        }
Example #3
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            var finder = new UPnPDeviceFinderClass();
            var device = finder.FindByUDN(e.Node.Name);

            if (device != null)
            {
                Logger.Info("Selected Sat>Ip Server is {0}", device.FriendlyName);
                _keepaLiveTimer = new Timer {
                    Enabled = true
                };
                _keepaLiveTimer.Tick += _keepaLiveTimer_Tick;

                if ((_rtspDevice != null) && (!_rtspDevice.FriendlyName.Equals(device.FriendlyName)))
                {
                    //_keepaLiveTimer.Stop();
                    _rtspDevice.Dispose();
                    _rtspDevice = new RtspDevice(device);
                    _keepaLiveTimer.Interval = _rtspDevice.RtspSession.RtspSessionTimeToLive;
                    _keepaLiveTimer.Start();
                    _isstreaming = false;
                }
                else
                {
                    //_keepaLiveTimer.Stop();
                    _rtspDevice = new RtspDevice(device);
                    _keepaLiveTimer.Interval = _rtspDevice.RtspSession.RtspSessionTimeToLive;
                    _keepaLiveTimer.Start();
                }
                var service = (Service)PlayList.SelectedItem;
                Logger.Info("Selected Service is {0}", service.Name);
                if (!_isstreaming)
                {
                    _rtspDevice.RtspSession.Setup(service.ToString(), TransmissionMode.Unicast);
                    _rtspDevice.RtspSession.Play(String.Empty);
                    _isstreaming = true;
                    axWindowsMediaPlayer1.URL = string.Format("rtp://{0}:{1}", _rtspDevice.RtspSession.Destination,
                                                              _rtspDevice.RtspSession.RtpPort);
                    Text = string.Format("rtp://{0}:{1}", _rtspDevice.RtspSession.Destination,
                                         _rtspDevice.RtspSession.RtpPort);
                }
            }
        }
        private void treeDevices_AfterSelect(object sender, TreeViewEventArgs e)
        {
            toolStripProgressBar.Style = ProgressBarStyle.Marquee;

            UPnPDeviceFinderClass finder = new UPnPDeviceFinderClass();
            UPnPDevice device = finder.FindByUDN(e.Node.Name);

            if (device != null)
            {
                //
                // Populate the Device tab
                //
                
                txtFriendlyName.Text = device.FriendlyName;
                txtUniqueDeviceName.Text = device.UniqueDeviceName;
                txtDescription.Text = device.Description;
                txtManuFacturerName.Text = device.ManufacturerName;
                txtType.Text = device.Type;

                string sImageUrl = device.IconURL("image/jpeg", 150, 150, 32);

                if (sImageUrl != null)
                {
                    pictureBoxDevice.LoadAsync(sImageUrl);
                    pictureBoxDevice.Visible = true;
                }
                else
                    pictureBoxDevice.Visible = false;
                
                //
                // Populate the Services tab
                //

                listViewServices.Items.Clear();
                
                UPnPServices services = device.Services;

                if (services != null)
                {
                    foreach (UPnPService service in services)
                    {
                        ListViewItem item = new ListViewItem();

                        item.Text = service.Id;
                        item.Tag = service.Id;
                        item.SubItems.Add(service.ServiceTypeIdentifier);

                        listViewServices.Items.Add(item);
                    }
                }
                

                //
                // Populate the document tab
                //

                webBrowserDocument.Url = new Uri(((IUPnPDeviceDocumentAccess)device).GetDocumentURL());
                
                tabControl.Visible = true;
            }

            toolStripProgressBar.Style = ProgressBarStyle.Blocks;
        }
 public DeviceCollector()
 {
     _finder = new UPnPDeviceFinderClass();
     _SearchId = _finder.CreateAsyncFind("upnp:rootdevice", 0, this);
     _finder.StartAsyncFind(_SearchId);
 }