public VideoStreamerConfiguration(IStreamersConfiguration streamersConfiguration, IConfigurationSource source) : base(source) { DeviceNameProperty = CreateProperty(nameof(DeviceName), DEFAULT_DeviceName, source); FFmpegCodecArgsProperty = CreateProperty(nameof(FFmpegCodecArgs), DEFAULT_FFmpegCodecArgs, source); ExtensionProperty = CreateProperty(nameof(Extension), DEFAULT_Extension, source); if (streamersConfiguration is IConfiguration) { var config = streamersConfiguration as IConfiguration; var settings = config.Settings.ToDictionary(s => s.Key); AutoSelectDeviceProperty = new ConfigurationSettingProperty(nameof(AutoSelectDevice), settings[nameof(streamersConfiguration.AutoSelectDevice)], DefaultSection); StopRecordingTimeoutMillisecondsProperty = new ConfigurationSettingProperty(nameof(StopRecordingTimeoutMilliseconds), settings[nameof(streamersConfiguration.StopRecordingTimeoutMilliseconds)], DefaultSection); } else { AutoSelectDeviceProperty = new ConfigurationSettingProperty(nameof(AutoSelectDevice), typeof(bool), streamersConfiguration.AutoSelectDevice, DefaultSection); StopRecordingTimeoutMillisecondsProperty = new ConfigurationSettingProperty(nameof(StopRecordingTimeoutMilliseconds), typeof(int), streamersConfiguration.StopRecordingTimeoutMilliseconds, DefaultSection); } }
public FFmpegStreamer(FFmpegHelper helper, IStreamersConfiguration configuration) { _ffmpeg = helper; _config = configuration; }