It is not necessary to set the mask parameter for Blur FX.
Setting it to NULL, will apply the blur to the whole image.
This is not documented in the SDK but is returned when info about the
FX is requested by the plugin to the SDK library.
Signed-off-by: pkv <pkv@obsproject.com>
The NvVFX_Run function can be run in SYNC or ASYNC mode; the SDK sample
uses SYNC. This defines the magic numbers in an enum and sets the
NvVFX_Run function to SYNC.
Signed-off-by: pkv <pkv@obsproject.com>
The SDK samples uses the same CudaStream for both FX. Do likewise which
simplifies the code. (The Background Blur calls the Background Removal.)
Signed-off-by: pkv <pkv@obsproject.com>
This adds the following new options for background removal effect,
namely the ability to remove the chair or leave it with the talking
head.
Requires sdk >= 0.7.6.
Signed-off-by: pkv <pkv@obsproject.com>
This adds a new property for the audio filters: VAD (Voice Audio Data).
When it is toggled, the effect will be optimized for voice processing.
Noise suppression will "remove low-volume noise and all non-speech data"
in the words of the SDK.
Requires SDK >= 1.6.0.
Signed-off-by: pkv <pkv@obsproject.com>
This enables a new logger function introduced in SDK >= 1.6.0, which
gives much more details about what is going on during the effect
processing.
Signed-off-by: pkv <pkv@obsproject.com>
This enables a new logger function introduced in SDK >= 0.7.5, which
gives much more details about what is going on during the effect
processing.
Signed-off-by: pkv <pkv@obsproject.com>
The audio filters are now disabled if an issue is detected;
the filter is no longer destroyed.
This avoids a call to destroy function within the filter.
Signed-off-by: pkv <pkv@obsproject.com>
A boolean comparison that involves at least one vector type will
result in a boolean vector (not a boolean scalar) for Direct3D and
Metal, whereas OpenGL returns a scalar boolean.
To avoid unnecessary code complexity, use the "distance" function
instead, which treats the color values as vectors and returns a
non-zero value if they are any different, achieving the same result.
Since video rendering happens on a separate thread from PipeWire buffer
ingestion, it may happen that two buffers are ingested in quick
succession without the rendering thread ever getting to them. Since,
prior to this commit, the release sync point is only "primed" (set to
signal in the future) only on the video rendering thread, this results
in the buffer being returned to PipeWire's pool without anything ever
signaling the release point, effectively blocking it from ever getting
reused in the future. This quickly clogs up the buffer pool and leaves
only one buffer to circulate between the screencast source and OBS.
This commit adds a flag tracking whether the release point had been
primed. If, when ingesting a new PW buffer, the old buffer's release
point hadn't been primed, that means the video rendering thread never
got to that buffer, so the release point is immediately signaled,
marking the buffer reusable by the screencast source.
PipeWire format renegotiation runs in parallel with video rendering.
When the stream format is renegotiated, PipeWire removes the existing
buffers and closes the syncobj file descriptors. At the same time, the
video rendering thread may try to import the (already closed) syncobj
acquire fd, and hang on waiting for the fence to become available.
This is not a problem for the dmabuf fd because it's imported into a
texture right away, which doesn't disappear when PipeWire closes the fd.
This commit adds duping to the syncobj fds so that they too remain open
as long as the rendering thread may access them.