Commit Graph

274 Commits (047e586eafa43b139a4a605985592be75570fd61)

Author SHA1 Message Date
Jim 0f6761468b
Merge pull request #1479 from tompeeters368/master
win-capture: Add option to adjust hook rate for game capture
2018-09-17 13:52:41 -07:00
Jim af320a0838
Merge pull request #1480 from kkartaltepe/module-descriptions
Plugins: Add descriptions to modules
2018-09-16 15:34:28 -07:00
Tom Peeters 6bbeaae02e win-capture: Add option to adjust hook rate for game capture
This option slows down or speeds up the rate at which
the game capture plugin checks for a valid window.
2018-09-13 19:35:37 +02:00
jp9000 b3ef46d986 cmake: Make static VC runtime libraries consistent
Makes Visual C runtime libraries consistent across
Debug/MinSizeRel/Release/RelWithDebInfo, rather than just changing those
flags for RelWithDebInfo.  Also adds /Zl for statically linked
libraries.

Closes obsproject/obs-studio#1421
2018-09-12 07:49:13 -07:00
Kurt Kartaltepe d86c8121ed Plugins: Add descriptions to modules 2018-09-11 18:28:58 -07:00
Jim 4e90b61210
Merge pull request #1364 from kkartaltepe/patch-5
[win-capture] Modify log for sharedmem
2018-09-05 23:59:03 -07:00
Matt Gajownik d2538690b5 UI: Blacklist LockApp and Text Input from Game Capture
Occasionally users accidentally select the following applications built
into Windows 10 using game capture, which cannot be captured.
This PR simply hides them from the game capture list.
The latter takes up 6 entries in the dropdown.

LockApp.exe - the lock screen which doesn't run in user space
WindowsInternal.ComposableShell.Experiences.TextInput.InputApp
2018-09-02 15:21:10 +10:00
Gol-D-Ace a79aaa28ab Update translations from Crowdin 2018-08-18 04:16:35 +02:00
sorayuki b3ed50aa08
win-capture: Avoid segfault when retrieve size
When changing size of a game-capture scene item in preview window, 
if the capture target window closed, it may crash.
2018-08-08 16:28:40 +08:00
sorayuki ce53c5cc70
win-capture: Avoid tex size mismatch for cursor
Re-fetch texture when cursor's either width or height changed.

When the cursor icon changed and the new one has the same width or height,
it may not recreate the texture and thus cause memory access violation.
2018-08-07 17:15:07 +08:00
Kurt Kartaltepe f90a052b5e win-capture: Modify log for sharedmem
Distinguish in the log that this is for shared-mem/mutli-adapter
not anti-cheat.
2018-07-13 23:14:30 -07:00
SuslikV a75724d8a5 win-capture: Fix cursor draw size with certain cursors
When drawing cursor to window capture area - use actual resource width
and height instead of system metric values for icons.  Fixes an issue
where under rare circumstances, certain cursors would not draw at the
correct size.

Closes obsproject/obs-studio#1284
2018-05-06 11:38:49 -07:00
Richard Stanway 4df7914767
win-capture: Update D3D9 signature for Win10 April 2018 Update 2018-05-02 14:00:44 +02:00
Zachary Lund 6475a1c000 win-capture: Avoid obs functions in init_hooks 2018-04-24 14:17:28 -07:00
Gol-D-Ace 88282c168c Update translations from Crowdin 2018-03-15 09:00:28 +01:00
jp9000 4b54bde426 cmake, libobs, win-capture: Fix VS2017 warnings 2018-03-12 16:16:38 -07:00
jp9000 8a16fa8341 win-capture/graphics-hook: Fix memory offset calculation
Fixes an issue where align_pos could be smaller than
sizeof(struct shmem_data), potentially overwriting memory of the header.

References jp9000/obs-studio#1202
2018-02-24 21:48:50 -08:00
Gol-D-Ace ae22886f67 Update translations from Crowdin 2018-01-22 04:55:52 +01:00
jp9000 ae259bf8d8 win-capture: Make minor clarification to locale string 2018-01-13 18:30:23 -08:00
Joel Bethke 10b27723a3 win-capture: Change string for memory capture option
Makes it a bit more clear this option shouldn't be used unless you're on
SLI/crossfire.

In the future, something should be put in to the program that detects
laptops and warns on how to set up their adapter for efficient capture.

Closes jp9000/obs-studio#1138
2018-01-08 15:44:05 -08:00
Richard Stanway 66ec96d52c
win-capture: Fix memory capture crash on new capture
If the target process re-creates its D3D context, the game capture tick
can trigger before the capture is setup, in which case OBS gets a
CAPTURE_RETRY message. However with the memory capture method, it
continues to try and copy from the shared memory pointer which is no
longer valid, resulting in a crash. The fix uses the old texture until
the next tick at which point the new capture should be ready for use.
2017-12-14 16:40:14 +01:00
Richard Stanway cf9f016820
win-capture: Rename structs to avoid SDK conflict
Windows SDK 10.0.16299.0 defines these structures as part of winternl.h
but using different types and names. Unfortunately there's no macro to
detect the SDK version, so to avoid conflicting with newer / older SDKs
the OBS structs have been renamed.
2017-12-12 18:20:56 +01:00
Ryan Foster 1db301f907 win-capture: Log window capture's target
Closes jp9000/obs-studio#983
2017-11-26 18:00:51 -08:00
Bazhenoff b9d044267d graphics-hook: blacklist OpenGL capture for "cm_client.exe"
Closes jp9000/obs-studio#1076
2017-11-16 17:57:11 -08:00
jp9000 e5d660e944 graphics-hook: Blacklist specific game from GL capture
"Life is Feudal: Your Own" will use Direct3D to render the game, then
OpenGL to render its in-game menus, which causes a conflict with itself.
This specifically blacklists the game from capturing OpenGL to prevent
that from happening.
2017-10-02 15:29:04 -07:00
jp9000 008e38f5b6 win-capture: Remove buffering from window capture
Removes the unnecessary buffering from window capture to prevent window
capture from being one frame out of sync
2017-10-02 07:36:02 -07:00
Gol-D-Ace 8d8c2e5a22 Update translations from Crowdin 2017-08-10 16:07:40 +02:00
Richard Stanway bc3a5cb832
win-capture: Log when game capture compatibilty mode is set 2017-07-01 21:39:20 +02:00
Richard Stanway 20cc8e6ab7
inject-helper: Set error mode to SEM_FAILCRITICALERRORS
This prevents spurious dialog boxes appearing, such as "No disk is in the
drive" if the application attempts to access an invalid drive.
2017-06-21 17:42:05 +02:00
Richard Stanway 8ad8e18d04
get-graphics-offsets: Set error mode to SEM_FAILCRITICALERRORS
This prevents spurious dialog boxes appearing, such as "No disk is in the
drive" if the application attempts to access an invalid drive.
2017-06-21 17:41:26 +02:00
jp9000 603825ee39 win-capture: Use PROCESS_QUERY_INFORMATION for game capture
PROCESS_QUERY_LIMITED_INFORMATION might be a bit insufficient for what
we need to do.
2017-06-19 16:02:02 -07:00
jp9000 1ca9f8872e win-capture: Add IDXGISwapChain1::Present1 hook support
Allows capturing games/programs that may be using Present1 instead of
the regular Present call for rendering.
2017-06-19 15:45:00 -07:00
jp9000 c4036b18bb win-capture/graphics-hook: Fix D3D10/D3D11 detection
When hooking DXGI-based graphics programs in the hook, the first hook
point is IDXGISwapChain::Present.  To be able to initiate a capture, a
pointer to the device context that created the swap chain is required,
which can be retrieved via IDXGISwapChain::GetDevice.  Determining
whether the device context was D3D10 or D3D11 has always been somewhat
of an issue due to D3D10 and D3D11 being nearly identical, as well as
their interoperability/interchangeability.  The GetDevice function would
first be called with the UUID of ID3D10Device, then if that failed,
the UUID of ID3D11Device.

However, with certain specific D3D11 games, GetDevice would for some
unknown reason succeed with the UUID of ID3D10Device, which would cause
capture to fail.  (Conversely, attempting to call GetDevice with the
UUID of ID3D11Device on a device that's actually ID3D10Device would
always succeed, so reversing the order of the test was not an option).
There were originally three known D3D11 games that would erroneously
succeed when querying a D3D10 device interface:  Call of Duty: Ghosts,
Just Cause 3, and theHunter: Call of the Wild.  All other known D3D11
games would work correctly.  Because it was only these three games, a
hack was originally implemented in the form of an executable exception
list that would force them to capture D3D11.

Unfortunately, Oculus games are now failing under the same circumstance
as well, so a simple hack will no longer work.  To fix this, a more
reliable method of detecting which context it is had to be discovered:
simply check the feature level using ID3D11Device::GetFeatureLevel.  If
the feature level is D3D_FEATURE_LEVEL_11_0 or D3D_FEATURE_LEVEL_11_1,
the device is definitely a D3D11 device.  Otherwise, continue the tests
as they were before.  Successfully tested with many D3D10 games, many
D3D11 games, and especially those three D3D11 games that previously were
detected as D3D10 erroneously.
2017-06-15 03:48:43 -07:00
jp9000 0acf86ba04 win-capture: Limit OpenProcess flags to prevent A/C issues
Limits OpenProcess flags to only the flags that are necessary to prevent
any further issues with anti-cheat hooks in the future.
2017-05-29 19:30:10 -07:00
Gol-D-Ace 3d2cacd782 Update translations from Crowdin 2017-05-20 10:18:41 +02:00
Richard Stanway 0c167d27a6
win-capture: Hide cursor when in background (window capture) 2017-05-11 00:01:33 +02:00
Richard Stanway 9e95b2eb6f
Various: Don't use boolean bitfields
Using bitfields causes less optimized code generation and the memory
savings are minimal as none of the objects are instantiated enough
times to be worth it.

See https://blogs.msdn.microsoft.com/oldnewthing/20081126-00/?p=20073
2017-05-10 23:28:46 +02:00
Richard Stanway 62c40eac0c
win-capture: Hide cursor when in background (game capture)
Prevents random OS cursors showing if someone alt+tabs out of a game but
still moves their cursor over the captured area (possibly fullscreen).
2017-05-10 23:08:25 +02:00
Richard Stanway 2ae706782c
Merge branch 'new-get-graphics-offsets'
Added offsets to support Windows 10 Creator's Update
2017-05-01 16:15:16 +02:00
jp9000 2e0d237341 win-capture: Fix and clarify window capture prioritization
Changes "class" prioritization to attempt to find the window either with
the same title, or the next window of the same window class (window
type), changes "title" prioritization to only find the window based
upon its title, and changes "executable" prioritization to attempt to
find the window with the same title, or the next window of the same
executable.

Additionally changes the text associated with these selections to
clarify that functionality to users.
2017-04-30 00:25:02 -07:00
Richard Stanway 38294d6c47
win-capture: Add missing 32 bit offsets 2017-04-26 21:36:49 +02:00
Richard Stanway 35a9b2d27f
win-capture: Update get-graphics-offsets
Added support for multiple signature matching and variable offset
positions. Added support for Win7 64 bit signature for consistency.
2017-04-26 21:23:34 +02:00
Richard Stanway d4de8b9a7e win-capture: Log if shared texture capture is unavailable 2017-04-26 21:04:41 +02:00
Ryan Foster be98cee2a0 Fix various typos across multiple modules 2017-04-25 22:39:42 -04:00
Gol-D-Ace dbf95bdc15 Update translations from Crowdin 2017-03-05 23:40:11 +01:00
Gol-D-Ace a13c0a3c29 Update translations from Crowdin 2017-02-27 20:54:02 +01:00
Richard Stanway d2e9e47bb4 graphics-hook: Account for sizeof(wchar_t) in len 2017-02-25 17:18:55 +01:00
Cam 8a6491c9bf win-capture: Add hook exception for theHunter: COTW
Adds an exception to skip d3d10 checks for theHunter: Call of the Wild,
which fixes incompatibility with game capture.

Closes jp9000/obs-studio#801
2017-02-25 06:42:36 -08:00
jp9000 5b8a0a2777 win-capture: Blacklist chrome/firefox from game capture 2017-02-21 23:05:49 -08:00
jp9000 eb90b7dfff win-capture: Fall back to GetWindow if FindWindowEx fails
When kaspersky is installed on windows 7, FindWindowEx will fail to find
any windows due to apparently being blocked by kaspersky, so detect when
that happens, and fall back to GetWindow instead if it does.
2017-02-21 00:42:14 -08:00