Commit Graph
478 Commits
Author SHA1 Message Date
PatTheMav d42c98fa22 win-capture: Fix added resources not properly copied to rundir
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.
2022-03-30 11:10:54 +02:00
PatTheMav 49e9d49943 plugins: Update CMakeLists.txt for included plugins 2022-03-16 23:11:08 +01:00
Translation UpdaterandTranslation Updater ac8dbf67be Update translations from Crowdin 2022-02-06 02:24:08 +00:00
jpark37andMatt Gajownik 63a6534966 win-capture: Fix parameter mismatches
Fix missing HWND argument type, and use DWORD based on MS sample.
2022-01-23 20:39:54 +11:00
Matt GajownikandJim fa35fd0f55 win-capture: Don't list minimized UWP apps 2022-01-18 03:42:27 -08:00
Richard Stanway d458780f02 win-capture: Use stack buffer for small window titles
Avoids expensive malloc calls that might also contribute to excessive
heap fragmentation.
2022-01-18 01:58:45 +01:00
Richard Stanway ecf8c1239d win-capture: Make open_process_proc static
Seems like the original intention and avoids repeatedly calling
GetProcAddress. Detected by PVS Studio.
2022-01-18 00:00:10 +01:00
wangshaohuiandJim 81d70b5d1b win-capture: Should not init module if HWND is invisible 2021-12-16 23:39:55 -08:00
Translation UpdaterandTranslation Updater 261345f9ef Update translations from Crowdin 2021-12-12 02:38:59 +00:00
jpark37andJim 2fa145899f inject-helper: Remove UNUSED_PARAMETER macro
Potential definition clash with c99defs.h. Not needed anyway.
2021-11-20 22:53:10 -08:00
jpark37andJim 6a288b255a win-capture: Use DPI context for game capture
Fixes cursor position for windows unaware of DPI.

Only works on Windows 10 1607 and above.
2021-10-09 15:45:55 -07:00
jpark37andJim 3706a21327 win-capture: Use DPI context for window BitBlt
Fixes GetClientRect and cursor position for windows unaware of DPI.

Only works on Windows 10 1607 and above.
2021-10-09 15:45:55 -07:00
jp9000 9deb8fe292 win-capture: Update graphics hook version to 1.7.1
Makes sure that OBS updates its graphics hook version
2021-09-28 10:08:55 -07:00
VainockandJim 11a690b038 Update translations from Crowdin 2021-09-24 09:42:08 -07:00
jpark37andJim 40cea9ca50 win-capture: Remove dependency on psapi.lib 2021-09-12 14:10:36 -07:00
jpark37andJim c5e7a6f23b win-capture: Clear stale pointers for game capture
Fixes shmem crashes when using Alt+Tab.
2021-08-27 22:46:17 -07:00
JimandGitHub 84bf08c171 Merge pull request #4720 from jpark37/detours-integration
Finish Detours integration for remaining game capture APIs
2021-08-23 23:18:10 -07:00
kokoleandJim dd6dd4e104 win-capture: Fix D3D12 third party overlay capture
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).
2021-08-17 08:24:57 -07:00
jpark37andJim 0f2c1447ab graphics-hook: Fix D3D11On12 usages
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.
2021-08-15 15:58:09 -07:00
Richard Stanway ff0350b515 win-capture: Fix formatting 2021-07-24 23:21:02 +02:00
Richard Stanway 320177926d win-capture: Use better defaults in thread_is_suspended
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.
2021-07-24 23:15:45 +02:00
Richard Stanway b2e30c955d win-capture: Move NT functions to shared file
Having them declared statically in a header included by multiple
compilation units results in duplicate functions being created.
2021-07-24 23:15:45 +02:00
jpark37 bf27941f5f libobs-winrt, win-capture: Linear SRGB support
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.
2021-07-11 08:26:30 -07:00
Ryan FosterandJim 85ffdd57f4 win-capture: Return early in property callbacks if param is null
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.
2021-06-30 01:45:42 -07:00
Ryan FosterandJim 1da97fb0d0 win-capture: Check for WGC support on plugin load
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.
2021-06-30 01:45:42 -07:00
Ryan FosterandJim 2f3c0911fa win-capture: Determine D3D11 usage once per run
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.
2021-06-30 01:45:42 -07:00
TranslationandJim ef2b1eb1c6 Update translations from Crowdin 2021-06-11 07:18:15 -07:00
Gol-D-Ace 90df8d44df Update translations from Crowdin 2021-05-30 20:33:35 +02:00
jpark37andJim 0ffcb66526 graphics-hook: Add Detours include dir 2021-05-19 19:52:49 -07:00
jpark37 4aadf28036 win-capture: Bump graphics hook version to 1.7.0 2021-05-18 12:52:16 -07:00
jpark37 57f9c61069 win-capture: Remove custom function hooking
Detours seems to be more stable.
2021-05-18 12:51:01 -07:00
jpark37 452ee646e1 graphics-hook: Use Detours for function hooking
Helped D3D12 path recover from window mode changes, so we assume it
should be more stable across the board for all API hooks.
2021-05-18 12:51:01 -07:00
jpark37 492f4c05e1 graphics-hook: Remove unused header 2021-05-18 12:51:01 -07:00
jpark37andJim 924d9a7d9c win-capture: Remove D3D12 fix toggle
The new D3D12 path seems stable enough. Remove the old path.
2021-05-18 12:47:25 -07:00
jpark37andJim a05b6f7280 win-capture: Bump graphics hook version to 1.5.0 2021-05-17 02:28:11 -07:00
jpark37andJim c6cee82c92 graphics-hook: Try multiple D3D12 queues
Keep trying queues until one of them passes D3D11On12CreateDevice.
2021-05-17 02:28:11 -07:00
jpark37andJim 5290326b77 graphics-hook: Do not persist device unnecessarily 2021-05-17 02:28:11 -07:00
jpark37andJim 7439e1c4b8 graphics-hook: More logging to help debugging 2021-05-17 02:28:11 -07:00
jpark37andJim d9d87e6502 graphics-hook: Kill early return 2021-05-17 02:28:11 -07:00
jpark37andJim c160a6ff3e graphics-hook: Give up on DXGI swap chain
If a swap chain hasn't been seen in a while, assume it no longer exists,
and reset the capture.
2021-05-17 02:28:11 -07:00
jpark37andJim 3412f6fece graphics-hook: Reduce variable scopes 2021-05-17 02:28:11 -07:00
jpark37andJim 32f9fc120a graphics-hook: Prevent recursive free
Make sure to set data.swap to null before calling data.free().
Otherwise, we may call data.free() again in the Release() hook.
2021-05-17 02:28:11 -07:00
jpark37andJim b899f06877 graphics-hook: Fix potential D3D12 device leak 2021-05-17 02:28:11 -07:00
jpark37andJim 2e7b0e3340 graphics-hook: Use Detours for D3D12 hook
Will attempt to fully use Detours after 27 ships.
2021-05-17 02:28:11 -07:00
jpark37andJim 4de5863d07 graphics-hook: Link Detours library 2021-05-17 02:28:11 -07:00
jpark37andJim 366b716f20 libobs-winrt,win-capture: Cursor toggle exceptions
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.
2021-05-07 23:50:13 -07:00
jpark37andJim 3514f4fea5 win-capture: Fix WGC disable index for display
Previously disabled DXGI because the index is wrong.
2021-05-06 13:58:14 -07:00
jpark37andJim 01d065fa7d win-capture: Remove SRGB code
Not having OBS_SOURCE_SRGB is good enough now.
2021-05-03 01:19:56 -07:00
jpark37andJim 78711fa648 win-capture: Add OBS_SOURCE_SRGB flag 2021-05-03 01:19:56 -07:00
jpark37andJim 2472529520 win-capture: Restore GL capture deduplication
Previous fix attempted to place swap_recurse count in gl_data struct,
where it could be unexpectedly memset to 0. Separate member from struct,
and make thread-local for additional safety.
2021-03-31 02:35:22 -07:00