Skip to content

Commit

Permalink
Add an option to show video preview without video effects on non-maco…
Browse files Browse the repository at this point in the history
…s platforms
  • Loading branch information
levs42 committed Feb 13, 2024
1 parent 31cd4f8 commit d78387a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/IO/IOVideoMixer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ final class IOVideoMixer<T: IOVideoMixerDelegate> {
#if os(macOS)
pixelBufferPool?.createPixelBuffer(&imageBuffer)
#else
if buffer.width != Int(extent.width) || buffer.height != Int(extent.height) {
if settings.effectsBuffer || buffer.width != Int(extent.width) || buffer.height != Int(extent.height) {
pixelBufferPool?.createPixelBuffer(&imageBuffer)
}
#endif
Expand Down
2 changes: 2 additions & 0 deletions Sources/IO/IOVideoMixerSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public struct IOVideoMixerSettings: Codable {
public let direction: ImageTransform
/// Specifies the main channel number.
public var channel: UInt8 = 0
/// Specifies if effects are always rendered to a new buffer.
public var effectsBuffer: Bool = false

/// Create a new IOVideoMixerSettings.
public init(mode: Mode, cornerRadius: CGFloat, regionOfInterest: CGRect, direction: ImageTransform) {
Expand Down

0 comments on commit d78387a

Please sign in to comment.