3 struct CaptureSessionConfiguration {
5 let outputFormats: OutputFormatSetting
6 let backendFormat: OutputFormatSetting
8 let shouldKeepLocalFiles: Bool
14 let preventResize: Bool
19 frameRate: Int? = nil,
20 outputFormats: OutputFormatSetting? = nil,
21 backendFormat: OutputFormatSetting? = nil,
23 shouldKeepLocalFiles: Bool? = nil
25 self.frameRate = frameRate ?? CapturaSettings.frameRate
26 self.outputFormats = outputFormats ?? CapturaSettings.outputFormats
27 self.backendFormat = backendFormat ?? CapturaSettings.backendFormat
28 self.backend = backend ?? CapturaSettings.backend
29 self.shouldKeepLocalFiles = shouldKeepLocalFiles ?? CapturaSettings.shouldKeepLocalFiles
40 init(from action: RecordAction) {
41 self.frameRate = action.fps ?? CapturaSettings.frameRate
42 self.outputFormats = action.outputs ?? CapturaSettings.outputFormats
43 self.backendFormat = action.backendOutput ?? CapturaSettings.backendFormat
44 if action.skipBackend {
47 self.backend = action.backend ?? CapturaSettings.backend
49 self.shouldKeepLocalFiles = action.keepLocalFiles ?? CapturaSettings.shouldKeepLocalFiles
52 self.width = action.width
53 self.height = action.height
54 preventMove = action.preventMove ?? false
55 preventResize = action.preventResize ?? false
56 autoStart = action.autoStart ?? false
57 maxLength = action.maxLength ?? 300
60 var shouldSaveMp4: Bool {
61 outputFormats.shouldSaveMp4() || (shouldUseBackend && shouldUploadMp4)
64 var shouldSaveGif: Bool {
65 outputFormats.shouldSaveGif() || (shouldUseBackend && shouldUploadGif)
68 var shouldUploadGif: Bool {
69 backendFormat.shouldSaveGif()
72 var shouldUploadMp4: Bool {
73 backendFormat.shouldSaveMp4()
76 var shouldUseBackend: Bool {