Exemplo n.º 1
0
 void GetVideoDevices()
 {
     DeviceNames.Clear();
     //Find system video devices
     DsDevice[] _SystemCameras = DsDevice.GetDevicesOfCat(DirectShowLib.FilterCategory.VideoInputDevice);
     foreach (DsDevice d in _SystemCameras)
     {
         DeviceNames.Add(d.Name);
     }
 }
Exemplo n.º 2
0
        public bool Publish(int port, string appendToName)
        {
            Port = port;
            RegisterService service;

            try
            {
                service = new RegisterService();
            }
            catch (Exception e)
            {
                BonjourInstalled = false;
                log.Error("Unable to register service: " + e.Message);
                ShowBonjourDialog();
                return(false);
            }

            string name;

            try
            {
                name = Environment.MachineName.ToLower();
            }
            catch (Exception e)
            {
                name = "PocketStrafe Companion";
            }

            name += (" - " + appendToName);

            service.Name        = name;
            service.RegType     = "_IAmTheBirdman._udp";
            service.ReplyDomain = "local.";
            service.Port        = (short)port;

            TxtRecord record = null;

            log.Info(String.Format("!! Registering name = '{0}', type = '{1}', domain = '{2}'",
                                   service.Name,
                                   service.RegType,
                                   service.ReplyDomain));

            service.Response += OnRegisterServiceResponse;

            service.Register();

            PublishedServices.Add(service);
            DeviceNames.Add(appendToName);
            DeviceCount = DeviceNames.Count;
            return(true);
        }
        // Process each found device in the event handler
        void deviceLocator_DeviceAvailable(object sender, DeviceAvailableEventArgs e)
        {
            DeviceNames.Add(e.DiscoveredDevice.DescriptionLocation.ToString());
            //Can retrieve the full device description easily though.

            /*var fullDevice = await e.DiscoveredDevice.GetDeviceInfo();
             * try
             * {
             *  if (fullDevice != null)
             *      DeviceNames.Add(fullDevice.FriendlyName);
             * }
             * catch
             * {
             *  Android.Util.Log.Debug("CommunicationController: searchFordevices method", "Null Error");
             * }*/
            DeviceCount++;
        }