import Foundation struct CaptureSessionConfiguration { let frameRate: Int let outputFormats: OutputFormatSetting let backendFormat: OutputFormatSetting let backend: URL? let shouldKeepLocalFiles: Bool init( frameRate: Int? = nil, outputFormats: OutputFormatSetting? = nil, backendFormat: OutputFormatSetting? = nil, backend: URL? = nil, shouldKeepLocalFiles: Bool? = nil ) { self.frameRate = frameRate ?? CapturaSettings.frameRate self.outputFormats = outputFormats ?? CapturaSettings.outputFormats self.backendFormat = backendFormat ?? CapturaSettings.backendFormat self.backend = backend ?? CapturaSettings.backend self.shouldKeepLocalFiles = shouldKeepLocalFiles ?? CapturaSettings.shouldKeepLocalFiles } var shouldSaveMp4: Bool { outputFormats.shouldSaveMp4() || (shouldUseBackend && shouldUploadMp4) } var shouldSaveGif: Bool { outputFormats.shouldSaveGif() || (shouldUseBackend && shouldUploadGif) } var shouldUploadGif: Bool { backendFormat.shouldSaveGif() } var shouldUploadMp4: Bool { backendFormat.shouldSaveMp4() } var shouldUseBackend: Bool { backend != nil } }