public ScreenCastStreamerConfiguration(IVideoStreamerConfiguration videoConfiguration, IStreamersConfiguration streamersConfiguration, IConfigurationSource source) : base(source) { DeviceNameProperty = CreateProperty(nameof(DeviceName), DEFAULT_DeviceName, source); if (videoConfiguration is IConfiguration) { var videoConfig = videoConfiguration as IConfiguration; var videoSettings = videoConfig.Settings.ToDictionary(s => s.Key); FFmpegCodecArgsProperty = new ConfigurationSettingProperty(nameof(FFmpegCodecArgs), videoSettings[nameof(videoConfiguration.FFmpegCodecArgs)], DefaultSection); StopRecordingTimeoutMillisecondsProperty = new ConfigurationSettingProperty(nameof(StopRecordingTimeoutMilliseconds), videoSettings[nameof(videoConfiguration.StopRecordingTimeoutMilliseconds)], DefaultSection); ExtensionProperty = new ConfigurationSettingProperty(nameof(Extension), videoSettings[nameof(videoConfiguration.Extension)], DefaultSection); } else { FFmpegCodecArgsProperty = new ConfigurationSettingProperty(nameof(FFmpegCodecArgs), typeof(string), videoConfiguration.FFmpegCodecArgs, DefaultSection); StopRecordingTimeoutMillisecondsProperty = new ConfigurationSettingProperty(nameof(StopRecordingTimeoutMilliseconds), typeof(int), videoConfiguration.StopRecordingTimeoutMilliseconds, DefaultSection); ExtensionProperty = new ConfigurationSettingProperty(nameof(Extension), typeof(string), videoConfiguration.Extension, DefaultSection); } if (streamersConfiguration is IConfiguration) { var streamersConfig = streamersConfiguration as IConfiguration; var streamersSettings = streamersConfig.Settings.ToDictionary(s => s.Key); AutoSelectDeviceProperty = new ConfigurationSettingProperty(nameof(AutoSelectDevice), streamersSettings[nameof(streamersConfiguration.AutoSelectDevice)], DefaultSection); } else { AutoSelectDeviceProperty = new ConfigurationSettingProperty(nameof(AutoSelectDevice), typeof(bool), streamersConfiguration.AutoSelectDevice, DefaultSection); } }
public VideoStreamerDevice(FFmpegStreamer streamer, IVideoStreamerConfiguration configuration) { _config = configuration; _recordingConfig = new VideoStreamerRecordingConfiguration(configuration); _streamer = streamer; _streamer.ProcessExited += (_, __) => ConnectionError?.Invoke(this, new ConnectionException("Webcam video process exited.")); Code = DeviceCode.Create(this, DeviceType.Streaming.WEBCAM_VIDEO) .RunsOnMainThread(false) .ConnectionType(DeviceConnectionType.Process) .Build(); }
public VideoStreamerRecordingConfiguration(IVideoStreamerConfiguration configuration) { if (configuration is IConfiguration) { var config = (IConfiguration)configuration; var settings = config.Settings.ToDictionary(s => s.Key); StopRecordingTimeoutMillisecondsProperty = new ConfigurationSettingProperty(nameof(StopRecordingTimeoutMilliseconds), settings[nameof(IVideoStreamerConfiguration.StopRecordingTimeoutMilliseconds)]); } else { StopRecordingTimeoutMillisecondsProperty = new ConfigurationSettingProperty(nameof(StopRecordingTimeoutMilliseconds), typeof(int), configuration.StopRecordingTimeoutMilliseconds); } //StopRecordingTimeoutMillisecondsProperty = new ConfigurationSettingProperty( }