public IEnumerable <VideoDeviceInfo> GetVideoDevices()
        {
            var deviceAliasList = _videoDeviceAliasService.GetDeviceAliasList();

            if (deviceAliasList == null)
            {
                deviceAliasList = new List <VideoDeviceAlias>();
            }
            ICollection <VideoDeviceInfo> videoDevices = new List <VideoDeviceInfo>();
            var devices = _videoDeviceManager.GetVideoDevices();

            foreach (var device in devices)
            {
                var alias = deviceAliasList.FirstOrDefault(item => item.DeviceName == device.Name);
                if (alias != null)
                {
                    device.Name = alias.DeviceNoteName;
                }
                if (device.IsAvailable)
                {
                    videoDevices.Add(new VideoDeviceInfo(device));
                }
            }
            return(videoDevices);
        }
Esempio n. 2
0
        public void ShouldGetAllLocalVideoDevices()
        {
            IVideoDeviceManager videoDeviceManager = Resolve <IVideoDeviceManager>();

            var deviceList = videoDeviceManager.GetVideoDevices();

            Assert.IsNotNull(deviceList);

            Assert.IsTrue(deviceList.Any());

            videoDeviceManager.Dispose();
        }