The `add_target_resource` function uses unnecessary path components
when copying files to the rundir, resulting in files added that way
not to end up where OBS expects them to.
The generated binaries created by sub-targets also need to be copied
as part of `win-capture`'s data files, which was easy to fix as the
target exists before CMake switches into the subdirectories.
Doesn't make sense to grab the oldest frame when not capturing overlays,
because the overlay was already rendered in it. This will grab the
latest frame (before the overlay is rendered).
Use D3D12_RESOURCE_STATE_PRESENT for CreateWrappedResource arguments. We
should assume the application will set the backbuffer to PRESENT, and
expect that to be preserved across the Present() call.
Remove unnecessary calls to ReleaseWrappedResources.
Clean up (void**) casts with modern patterns.
On my system with ~250 processes running, this loop has to run over 500
times before allocating enough memory. Use better initial and increment
values to avoid thrashing the heap.
Update window, display, and game capture to always bilinear filter in
linear space, even if the source texture is not SRGB typed. This helps
resolve confusion in situations where we were filtering in nonlinear
space vs. linear space, like when toggling an empty crop filter.
When obs_get_source_properties is called, it calls the property modified
callbacks without a source instantiation. The callbacks set in
.get_properties for display capture and window capture would then result
in exceptions when anything is dereferenced on the source, such as
wgc_supported or update_mutex, because the source itself is null. Let's
make the callbacks return early if the property param is null.
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.
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.