From 6ab05b3929b78317eda86fcf2afac118a6f7de1c Mon Sep 17 00:00:00 2001 From: shogo4405 Date: Mon, 15 Apr 2024 20:28:37 +0900 Subject: [PATCH] Refactor IOUnit class. --- Sources/IO/IOAudioUnit.swift | 6 ++---- Sources/IO/IOVideoUnit.swift | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Sources/IO/IOAudioUnit.swift b/Sources/IO/IOAudioUnit.swift index 10faed6d0..447b23ef2 100644 --- a/Sources/IO/IOAudioUnit.swift +++ b/Sources/IO/IOAudioUnit.swift @@ -20,8 +20,6 @@ protocol IOAudioUnitDelegate: AnyObject { } final class IOAudioUnit: IOUnit { - typealias FormatDescription = AVAudioFormat - var muted = false var isMonitoringEnabled = false { didSet { @@ -41,8 +39,8 @@ final class IOAudioUnit: IOUnit { var isRunning: Atomic { return codec.isRunning } - private(set) var inputFormat: FormatDescription? - var outputFormat: FormatDescription? { + private(set) var inputFormat: AVAudioFormat? + var outputFormat: AVAudioFormat? { return codec.outputFormat } private lazy var codec: AudioCodec = { diff --git a/Sources/IO/IOVideoUnit.swift b/Sources/IO/IOVideoUnit.swift index 30ef07b87..2237a26c8 100644 --- a/Sources/IO/IOVideoUnit.swift +++ b/Sources/IO/IOVideoUnit.swift @@ -20,8 +20,6 @@ protocol IOVideoUnitDelegate: AnyObject { } final class IOVideoUnit: IOUnit { - typealias FormatDescription = CMVideoFormatDescription - enum Error: Swift.Error { case multiCamNotSupported } @@ -57,8 +55,8 @@ final class IOVideoUnit: IOUnit { codec.settings = newValue } } - private(set) var inputFormat: FormatDescription? - var outputFormat: FormatDescription? { + private(set) var inputFormat: CMVideoFormatDescription? + var outputFormat: CMVideoFormatDescription? { codec.outputFormat }