We shouldn't have to check WGC support for every display capture or
window capture source. Either the system supports it or it doesn't.
Check when the plugin loads and use that result.
The device type (OBS renderer) cannot change without restarting OBS, so
we should only have to check if we're using D3D11 once instead of
checking every time a new display capture or window capture source is
created.
The cursor bitmap is centered on the hotspot, so not accounting
for it means PipeWire captures were positioning the cursor sprite
slightly off.
Properly account for the hotspot by subtracting it from the cursor
position.
Related: https://github.com/obsproject/obs-studio/issues/4766
Only use lossless encode if the capability is supported.
Set qpPrimeYZeroTransformBypassFlag to 1 for lossless.
Do not set profileGUID for lossless.
For both NVENC implementations, retry with a heavier reset because both
are unable to recover from failure lightly.
For new NVENC, warn if PVT is requested, but unsupported by the GPU.
Also retry without PVT on failure to try to catch bad cominbations.
For old NVENC, if PVT is enabled when FFmpeg failure occurs, retry
without PVT.
Prevents situations where the redistributable is installed and OBS
enables the RTX denoiser but it is non-functional. Changes were tested
on systems with both supported / unsupported GPUs and it adds around
10-20ms to the load time in both cases.
Because it's not currently possible to guarantee synchronization between
two separate media files (yet), disable separated track matte media
files for now. It'll just result in support requests that can't be
solved.
Fixes a memory leak with stinger texrender objects. These functions must
be called while the graphics context is locked. Caught via warnings
generated by the destroy functions.
The actual crash is caused because obs_module_unload() is called before
the decklink outputs are stopped. In obs_module_unload(), the deviceEnum
pointer is freed. During decklink_output_stop(), the removed code tries
to retrieve a reference of the decklink device from the deviceEnum and
crashes because it has already been freed. This code appears to serve no
purpose anyway, so we remove it.
This ensures correct texture filtering, simplifies the render callback,
and allows us to remove the custom draw flag, restoring the direct
rendering optimization for filters against image sources.
When using a stacked track matte stinger transition with a visibility
transition, the matte portion of video would also be visible on the
right side or below the source. This fixes it by first rendering the
video to a texrender object in order to filter out the unwanted portion.
(Jim note: So basically, track matte stingers now use two texrenders. I
really don't like this. Texrender objects can already cause stalling as
it is.)
When using track matte stingers as visibility transitions, it would
render the matte portion at the incorrect size. This was due to the fact
that texrender render code blocks do not set the projection matrix.
You're supposed to do that manually. Thus, it was using whatever the
current projection matrix was, which was usually the canvas projection
matrix.
(Jim note: There were reasons why I didn't make texrender objects do
this automatically, mostly scaling and performance reasons, but I
realize now I should have at least provided an option for it instead to
prevent this "gotcha" situation from happening. Bad design on my part. I
do not blame Palakis for falling for this.)
This would cause a null pointer check log message because matte_source
only exists when using an explicit separate video for track matte
stingers. Instead, explicitly set matte_ph to null if matt_source is
null to avoid the null pointer check logging.
This causes the track matte render target to only be reset once per
frame, rather than potentially multiple times per frame. Palakis most
likely did not know that you're supposed to reset only once per frame in
order to prevent the render target from being rendered more than once
per frame.
(Jim note: I probably should have made texrender objects automatically
detect new frames internally so it wouldn't require this. Not Palakis'
fault.)
Color mismatch is apparent when using source transitions, which lerps
against transparent black and blends into the canvas nonlinearly. When
the transition is done, the blend switches to linear, leading to a pop.
Fix the issue by blending into the canvas in linear space. The lerp is
still nonlinear by design.
A user has reported that toggling the cursor can cause exceptions.
Propagate that information upward, so we can reset the capture.
Display capture never needed to call the function in the first place.
Shuffle around window capture code to make a common reset function.
Builds on PR #4663.