Commit Graph

362 Commits (42bbca3d4ba2330c8c3a905c153d39a090403757)

Author SHA1 Message Date
jpark37 097ea77488 libobs-winrt: win-capture: Detect GraphicsCaptureItem closure
Make WGC window capture recover from GraphicsCaptureItem closure, which
can occur when following links in fullscreen Chrome for example.
2020-05-06 21:42:26 -07:00
jp9000 83991a1345 win-capture: Update graphics hook version to 1.1.4 2020-04-05 03:48:34 -07:00
jpark37 348fcd5b00 win-capture: Fix crash if GPU can't Vulkan capture 2020-03-28 09:01:26 -07:00
jp9000 8ecfb405ce Revert "win-capture, libobs: Show names of displays in Display Capture"
This reverts commit 9931f22ff4.
2020-03-19 06:43:57 -07:00
jp9000 b3ca1bd059 win-capture: Retry with last known window if first fails
This fixes a bug where games like "Don't Starve Together" wouldn't
capture because their actual render window is a completely different
window than their actual window on the screen.

So, because we already have the hook info by this point with the last
known window handle available, instead of using 0 here, we can just use
the window handle provided by the shared memory.  And we didn't even
have to change the hook!  That's nice.
2020-03-18 07:53:21 -07:00
jpark37 e4e96c5cef libobs-winrt: win-capture: Clean up error handling
Use proper check to fix false positive on 1809, and rework error spew to
remove output parameters from winrt_capture_init.
2020-03-18 00:33:12 -07:00
jp9000 327a6f599e win-capture: Fix potential crash due to unhandled exceptions 2020-03-17 12:22:20 -07:00
Gol-D-Ace d74fc65047 Update translations from Crowdin 2020-03-16 20:14:50 +01:00
jp9000 6209bea371 win-capture: Destroy winrt in graphics thread 2020-03-14 10:54:37 -07:00
jp9000 59351b27ae win-capture/graphics-hook: Separate some debugging stuff
Reduces debugging spam when debugging Vulkan capture is needed in the
hook.
2020-03-13 06:57:16 -07:00
jpark37 9f15514c1a win-capture: Vulkan surface refactor
Make sure HWND tracking is cleaned up when Vulkan surfaces are
destroyed. Also use unbounded linked list to fix games that leak
surfaces on Alt+Tab like Doom.

Also replace CRITICAL_SECTION with SRWLOCK, both for claimed speed
benefit, and to remove initialization code.
2020-03-13 04:36:19 -07:00
jp9000 98c1ac2f80 win-capture/graphics-hook: Add a bit of logging
Just makes sure to be explicit when a device isn't valid.
2020-03-11 02:00:42 -07:00
jpark37 421f97e68d win-capture: Handle vkCreateSwapchainKHR errors
Fixes behavior for an application reported by AMD.
2020-03-10 21:31:40 -07:00
jp9000 f1cb1a42cc win-capture: Try window handle 0 if actual handle fails
Certain UWP programs can't obtain a normal window handle from their API
for whatever reason (this was observed with minecraft win10 edition), so
if the normal window handle on the map fails, try window handle 0
instead.
2020-03-10 07:13:58 -07:00
jp9000 c76426c5bd win-capture: Use full app obj name for keepalive mutex
Ensures that the UWP program can open the keepalive mutex to check to
see whether OBS is still alive.  Fixes a bug where UWP programs wouldn't
capture.
2020-03-10 07:13:58 -07:00
jp9000 428a19edd6 win-capture/graphics-hook: Make vulkan layer all capital 2020-03-09 10:44:04 -07:00
Jim 519b3096aa
Merge pull request #2474 from WizardCM/named-display-monitors
Show friendly monitor names on Display Capture on Windows & Projectors
2020-03-09 06:26:52 -07:00
jp9000 6b7d38adfd win-capture: Increment graphics hook version 2020-03-09 02:51:52 -07:00
jp9000 229f8d37cb win-capture/graphics-hook: Fix reacquire bug
Sometimes the width/height would initially be at 0x0 when the swap chain
was alt-tabbing, causing the capture to fail full-stop when trying to
reacquire.
2020-03-09 02:50:34 -07:00
jp9000 e9b41e5fc5 win-capture: Always copy file when debugging
Helps ensure that the hook can be debugged for things like vulkan
capture.
2020-03-09 02:49:46 -07:00
jp9000 30e3ef3b49 win-capture/graphics-hook: Log vulkan capture dimensions 2020-03-09 02:34:33 -07:00
Matt Gajownik 9931f22ff4 win-capture, libobs: Show names of displays in Display Capture 2020-03-09 11:13:59 +11:00
jp9000 141c42c4b5 win-capture: Allow write permission on graphics hook
(This commit also modified the updater module on Windows)

Ensures that an older hook version can be replaced by a newer hook
version.
2020-03-08 15:56:23 -07:00
jp9000 b0e4859238 win-capture: If elevated, replace HKCU reg entry with HKLM 2020-03-08 15:56:23 -07:00
jp9000 abf3ed2b05 win-capture: Remove SYNCHRONIZE permission
This isn't really meant for file permissions.  This is meant for handle
permissions.
2020-03-08 15:56:23 -07:00
Jim 0a7d1b9baf
Merge pull request #2469 from jpark37/wgc-cursor-toggle
libobs-winrt: win-capture: HDC cursor capture for WGC
2020-03-08 03:23:48 -07:00
jpark37 cb4954c279 libobs-winrt: win-capture: HDC cursor capture for WGC
Starting with Windows 10 2004, we can disable WGC cursor capture, and
provide a user toggle. We swap out WGC support for our own though
because ours does not break hardware cursor support.
2020-03-07 20:40:39 -08:00
jpark37 4f4fc3bfe6 win-capture: Restore Vulkan 1.1 version hack 2020-03-07 20:07:56 -08:00
jpark37 3439be57fe win-capture: Support VK_FORMAT_A8B8G8R8_UNORM_PACK32 2020-03-07 09:58:07 -08:00
jp9000 87f5bd6e9f win-capture/graphics-hook: Fix wrong HWND
Game capture assumes the top-level ancestor HWND, not a child HWND.
This fixes bugs such as the VLC window not capturing anymore due to the
fact that the capture HWND of VLC is a child window of the main VLC
window and not the main VLC window itself.
2020-03-07 07:35:34 -08:00
Jim abff240d2a
Merge pull request #2466 from jpark37/win-capture-cleanup
win-capture clean-up
2020-03-07 04:46:13 -08:00
jp9000 5dcad74019 win-capture: Set ALL APPLICATION PACKAGES perms if elevated 2020-03-07 04:01:13 -08:00
jp9000 465174413a win-capture: Remove microsoft store from capture blacklist 2020-03-06 21:53:53 -08:00
jpark37 9da6a4d6f6 win-capture: Vulkan capture clean-up
Remove unnecessary DXGI swap chain creation, and use VK_NULL_HANDLE.
2020-03-06 17:04:31 -08:00
jpark37 fc4f3c0934 win-capture: Clean up various VC++ warnings 2020-03-06 17:02:38 -08:00
craftwar 3821a0344e win-capture: Fix format string warning 2020-03-06 19:52:02 +08:00
jp9000 72bb592673 win-capture: Increment graphics hook version 2020-03-06 03:39:56 -08:00
jpark37 c706a7bed5 win-capture: Handle NULL VkApplicationInfo 2020-03-05 21:20:00 -08:00
jp9000 ec247ba982 win-capture: Find correct window even if it's minimized
In window capture, it will search for a window with a specific title,
but will not search minimized windows.  This fixes that by making is
acquire the correct window even if that window is minimized, rather than
potentially risk it capturing the wrong window of the same type.
2020-03-04 22:21:45 -08:00
jp9000 d5974b9e30 win-capture: Disable correct capture method index
When "Automatic" was added, the index for the item that needed to be
disabled became incorrect (to disable WCG).
2020-03-03 21:09:54 -08:00
VodBox 9aedc7e5b7 win-capture: Prevent WGC being selected when unavailable 2020-03-03 23:06:25 +13:00
jp9000 e40f2cc155 win-capture: Fix registry lookup bug
The make_filename command was misplaced.  Was meant to be right below
the get_programdata_path call.
2020-02-29 10:32:20 -08:00
jp9000 7e78c17ace win-capture: Check hook version before capture init
Checks the hook version to ensure compatibility with hook DLL.  It's
unlikely it'll ever be necessary to increment the hook version, but this
is just a precautionary thing that allows a hook DLL to make sure it's
rejected by an older OBS version if needed.  Again however, very
unlikely that the major version will ever be incremented.
2020-02-29 04:53:29 -08:00
Matthieu Cunzi 74acbd7ed0 win-capture: Add Vulkan capture
Co-authored-by: jp9000 <obs.jim@gmail.com>
Co-authored-by: jpark37 <jpark37@users.noreply.github.com>
2020-02-29 04:53:28 -08:00
jp9000 72e770458f win-capture: Use full DLL path for inject helper
The inject helper should be able to specify the full path rather than
assume the path of the hook DLL.  This change allows us to modify the
hook's location.  This needs to be done because the hook needs to be
relocated to ProgramData to prevent the possibility of multiple Vulkan
capture hooks.
2020-02-29 00:15:54 -08:00
jp9000 a20f1168a7 win-capture/graphics-hook: Don't allow multiple hooks
Prevents multiple separate hook DLLs from being loaded in to a target at
once.  This is done just in the off-chance that someone might add
another hook to the Vulkan layer registry.
2020-02-29 00:15:54 -08:00
jpark37 5c38c6455f win-capture: Refactor create_hook_info 2020-02-29 00:15:54 -08:00
jpark37 39dc64f0f8 win-capture/graphics-hook: Refactor mutex check
OpenMutex doesn't return INVALID_HANDLE_VALUE, so there's no need to
check for that.  Also only call CloseHandle if the call was successful.
2020-02-29 00:15:54 -08:00
jp9000 3e3521b9e1 win-capture/graphics-hook: Fix OBS detection
Fixes where the graphics hook would try to detect if OBS is currently
active or not.
2020-02-28 23:48:11 -08:00
jp9000 ef6a6827f4 win-capture/graphics-hook: Add flog and flog_hr
Allows automatically outputting the function name as part of the hook
logging.  This really doesn't need to be a manual process.  Makes code a
bit cleaner when used.
2020-02-28 23:48:11 -08:00