Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo4405 committed Nov 23, 2023
1 parent f64071a commit e0fdc59
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions Sources/IO/IOCaptureSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,16 @@ final class IOCaptureSession {
return false
}
#else
return false
return true
#endif
}

deinit {
if #available(tvOS 17.0, *) {
if session.isRunning {
session.stopRunning()
}
guard #available(tvOS 17.0, *) else {
return
}
if session.isRunning {
session.stopRunning()
}
}

Expand Down
6 changes: 3 additions & 3 deletions Sources/IO/MTHKView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public class MTHKView: MTKView {
}
didSet {
currentStream.map {
$0.mixer.videoIO.context = CIContext(mtlDevice: device!)
currentStream?.setNetStreamDrawable(self)
$0.context = CIContext(mtlDevice: device!)
$0.setNetStreamDrawable(self)
}
}
}
Expand Down Expand Up @@ -134,7 +134,7 @@ extension MTHKView: MTKViewDelegate {
guard
let currentDrawable = currentDrawable,
let commandBuffer = commandQueue?.makeCommandBuffer(),
let context = currentStream?.mixer.videoIO.context else {
let context = currentStream?.context else {
return
}
if
Expand Down
6 changes: 3 additions & 3 deletions Sources/IO/PiPHKView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public class PiPHKView: UIView {
captureVideoPreview?.removeFromSuperview()
}
didSet {
if let captureVideoPreview {
addSubview(captureVideoPreview)
sendSubviewToBack(captureVideoPreview)
captureVideoPreview.map {
addSubview($0)
sendSubviewToBack($0)
}
}
}
Expand Down

0 comments on commit e0fdc59

Please sign in to comment.