-
-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to show video output on a drawable without video effects #1377
Add an option to show video output on a drawable without video effects #1377
Conversation
eff0f29
to
1069872
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With HKView.isCaptureVideoPreviewEnabled = true, it's possible to preview the unprocessed video. Could this feature serve as an alternative?
I found the cause. Looks like |
1069872
to
d78387a
Compare
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, understood. I accept changes of this magnitude. I'd like the variable name to be changed to "isXXXXEnabled". For example, "isEffectsBufferEnabled" is a bit unclear to me. Do you have any other suggestions for a more appropriate name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use "alwaysUseBufferPoolForVideoEffects" or similar. "always" might be a good choice because even when the flag is false, macos will use the buffer pool. And when the flag is true, pixel buffer pool will always be used. Alternatively, we could add a new enum to the settings:
enum EffectsRenderMode {
/// This mode tries to save memory on non-macos platforms by rendering to the video output pixel buffer.
case optimized
/// This mode is always using a separate pixel buffer to render the video effects.
case separateBuffer
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with "alwaysUseBufferPoolForVideoEffects".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated, please take a look
d78387a
to
8c9bb7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thank you.
Description & motivation
This PR brings an option to display camera output on a drawable before applying the video effects. It allows to show the video effects only on the stream. Default value is the same as before.
effectsBuffer
flags helps to prevent the race condition when the video effects appear on the drawable for some frames; it happens when effects rendering is faster than drawable rendering.Type of change
Please delete options that are not relevant.