Esempio n. 1
0
        private LocalVideoSource GetVideoSource(DsDevice s)
        {
            var caps = GetCapabilities(s);

            var state = caps.state;

            if (ObsHelper.IsObsAudioVideoAndItIsOff(s.Name))
            {
                state = InputDeviceState.NotStarted;
            }

            return(new LocalVideoSource
            {
                Name = s.Name,
                Id = s.DevicePath,
                Type = s.DevicePath.ToLowerInvariant().Contains("?\\usb#") ? InputDeviceType.USB : InputDeviceType.Virtual,
                State = state,
                Capabilities = caps.caps
            });
        }
        private LocalAudioSource GetAudioSource(DsDevice s, bool getCaps)
        {
            var caps = getCaps ? GetCapabilities(s) : (null, true);

            var state = InputDeviceState.Ready;

            if (ObsHelper.IsObsAudioVideoAndItIsOff(s.Name))
            {
                state = InputDeviceState.NotStarted;
            }
            else if (!caps.success)
            {
                state = InputDeviceState.Failed;
            }

            return(new LocalAudioSource
            {
                Name = s.Name,
                Id = s.DevicePath,
                Type = s.DevicePath.ToLowerInvariant().Contains(":sw:") ? InputDeviceType.Virtual : InputDeviceType.USB,
                State = state,
                Capabilities = caps.caps
            });
        }