Skip to content

Commit

Permalink
Refactor IOUnit class.
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo4405 committed Apr 15, 2024
1 parent 649e8ac commit 6ab05b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions Sources/IO/IOAudioUnit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ protocol IOAudioUnitDelegate: AnyObject {
}

final class IOAudioUnit: IOUnit<IOAudioCaptureUnit> {
typealias FormatDescription = AVAudioFormat

var muted = false
var isMonitoringEnabled = false {
didSet {
Expand All @@ -41,8 +39,8 @@ final class IOAudioUnit: IOUnit<IOAudioCaptureUnit> {
var isRunning: Atomic<Bool> {
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<IOMixer> = {
Expand Down
6 changes: 2 additions & 4 deletions Sources/IO/IOVideoUnit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ protocol IOVideoUnitDelegate: AnyObject {
}

final class IOVideoUnit: IOUnit<IOVideoCaptureUnit> {
typealias FormatDescription = CMVideoFormatDescription

enum Error: Swift.Error {
case multiCamNotSupported
}
Expand Down Expand Up @@ -57,8 +55,8 @@ final class IOVideoUnit: IOUnit<IOVideoCaptureUnit> {
codec.settings = newValue
}
}
private(set) var inputFormat: FormatDescription?
var outputFormat: FormatDescription? {
private(set) var inputFormat: CMVideoFormatDescription?
var outputFormat: CMVideoFormatDescription? {
codec.outputFormat
}

Expand Down

0 comments on commit 6ab05b3

Please sign in to comment.