Commit Graph

187 Commits (7df46d4a8ef1f1f2313e46e059e07349cbe36de6)

Author SHA1 Message Date
jp9000 2f305cb550 win-capture: Use static runtimes for hooks/helpers
(Note: This commit also modifies the ipc-util/seg-service modules)

When compiling the final project, always compile
ipc-util/get-graphics-offsets/graphics-hook/inject-helper/seg-service
with static MSVC runtimes to prevent the need of requiring the MSVC
runtimes for both architectures.
2016-11-23 06:03:00 -08:00
Gol-D-Ace 90e805ad9b Update translations from CrowdIn 2016-11-16 00:32:47 +01:00
jp9000 eaa32c20be win-capture: Defer hook offset loading to separate thread
Boosts startup time significantly to defer this to a separate thread.
2016-11-14 17:34:44 -08:00
jp9000 35285a26b7 win-capture: Do not load 64bit hook offsets on 32bit systems 2016-11-14 17:34:32 -08:00
jp9000 ed85b22534 Update translations from CrowdIn 2016-11-03 13:32:52 -07:00
jp9000 0b27b51294 win-capture: Add D3D12 capture support
Currently only supports shared texture capture, and doesn't support
rescaling.
2016-11-03 12:13:42 -07:00
jp9000 f49065b1e6 win-capture: Use IUnknown for getting swap backbuffers
Using IDXGIResource doesn't work with D3D12.  D3D12 textures are not a
subclass of that class.
2016-11-03 09:28:32 -07:00
jp9000 81ab13a2a4 win-capture: Cache cursor textures to prevent reallocation
Whenever a cursor is captured and the cursor icon changes, it creates a
new texture.  This isn't particularly optimal, so instead just store a
cache of cursor textures (based on size), and make the textures dynamic.
Doing this will prevent unnecessary texture reallocation.
2016-11-03 09:23:25 -07:00
Gol-D-Ace aadc7263c0 Update translations from Crowdin 2016-09-28 01:17:24 +02:00
jp9000 6d33f7e091 win-capture: Add trick to ensure game cap. shared tex support
This new trick forgoes the use of patches and allows the ability to use
shared GPU resources despite being a Direct3D 9.0c context.
2016-08-12 18:44:54 -07:00
jp9000 83a042f95c win-capture: Add missing game capture "Mode" string 2016-08-08 16:03:33 -07:00
Gol-D-Ace cb036b2713 Update translations from Crowdin 2016-08-08 16:21:48 +02:00
jp9000 2c531f04df win-capture: Fix game capture hotkey activating immediately
When game capture was set to hotkey mode by the user, it would try to
activate the capture right away without waiting for the user to press a
hotkey.
2016-08-08 04:57:10 -07:00
jp9000 06b42f4f27 win-capture: Always allow conf. of game capture hotkey
Even if the hotkey is not enabled, always allow configuration of the
hotkey.  Fixes a bug where the hotkey configuration settings would not
save if the settings were changed.

Annoyingly this means that the hotkey will still be shown to the user,
possibly confusing the user as to whether they can use it, but for the
time being it's better than having their hotkey configuration removed
each time they change the mode.
2016-08-06 20:17:29 -07:00
jp9000 571c3a6859 win-capture: Update D3D9 patches
Fixes performance issues with windows 10.0.14393.0
2016-08-06 15:27:33 -07:00
jp9000 183ee11e24 win-capture: Fix lookup order for d3d9 patch
It's supposed to look for patch segments in ascending order, from the
smallest offset to the largest offset.  Patch type/comparison is
identical to the one it's being swapped with, so only the offsets need
to be swapped.
2016-08-06 15:27:33 -07:00
jp9000 8fe01f2de1 win-capture: Do not blacklist league lobby window
The league lobby window can apparently be captured by game capture, and
may actually be useful to capture for some people.
2016-08-05 18:59:37 -07:00
jp9000 bf166c07f4 win-capture: Blacklist specific executables from game capture
Prevents the common problem of injecting in to certain processes and
getting the hook DLL "stuck":
- windows explorer
- steam
- battle.net
- gog galaxy
- skype
- uplay
- origin
- microsoft visual studio
- task manager
- league of legends lobby window
- windows 10 system settings window
2016-07-30 13:04:53 -07:00
jp9000 17667b8b9d win-capture: Add game capture hotkey support
Changed the first property of game capture to be a "mode" list (with
"any fullscreen window", "specific window", and "hotkey").

When hotkey mode is set, it'll add a hotkey pair to hotkey settings to
activate/deactivate game capture.  When the hotkey to activate is
pressed, it'll treat the current foreground window as the target window
similar to "selected window" mode; it'll keep trying to capture the same
window even if the window or its application closes/reopens, and will
continue to do so until deactivated via the deactivate hotkey, or until
a new window is set via the activate hotkey.
2016-07-30 13:04:53 -07:00
jp9000 383c96744e win-capture: Expose helper funcs to get win. class/title 2016-07-30 11:24:39 -07:00
jp9000 7feb21572f win-capture: Update D3D9 shared texture patches 2016-07-15 13:00:21 -07:00
jp9000 d7ed0f1976 Revert "win-capture: Track gl "swap" invocations to prevent duplicate work"
This reverts commit 4c505e7030.

Reverting this for the time being due to issues with quakelive.  This
will be more thoroughly tested and hopefully added again.
2016-07-10 00:38:15 -07:00
Gol-D-Ace 81adb13f59 Update translations from Crowdin 2016-07-06 01:18:27 +02:00
Palana 4c505e7030 win-capture: Track gl "swap" invocations to prevent duplicate work
Tested using FTL (steam): SwapBuffers ultimately calls wgl_swap_buffers
causing an additional copy which just isn't necessary

This also causes game capture to sometimes capture overlays even when
not intended
2016-07-03 13:18:23 -07:00
jp9000 b012c7280a win-capture/graphics-hook: Fix vs2015 internal compiler error
Removing this union fixes the internal compile error that would occur on
visual studio 2015 update 2 and above when these variables were all in a
union.
2016-06-22 14:40:54 -07:00
jp9000 d32424e5ad win-capture: Reset d3d9 capture if device recreated
Fixes a bug where if a D3D9 program recreates its device the capture
would become invalid.  Certain games (especially blizzard games) will
completely recreate their Direct3D device if a critical D3D9 error
occurs.
2016-06-11 12:27:06 -07:00
jp9000 6ca3cd3504 win-capture: Fix VS2015 update 2 compiler error
Having volatile variables inside of a union causes a C1001 compiler
error in visual studio 2015 update 2.

Closes jp9000/obs-studio#544
2016-05-28 09:40:49 -07:00
jp9000 b101868e47 Revert "win-capture: Don't draw window if minimized"
This reverts commit 997f05f10e.
2016-05-15 06:14:18 -07:00
jp9000 997f05f10e win-capture: Don't draw window if minimized 2016-05-15 04:35:29 -07:00
jp9000 5a5b8b20e3 win-capture: Clear window capture if window no longer exists 2016-05-15 04:35:01 -07:00
jp9000 d24a81868e win-capture: Do not render game capture if not active 2016-05-15 04:20:39 -07:00
jp9000 2707f05c46 Revert "win-capture: Allow window capturing of current process"
This reverts commit 8d520b970d.

This can actually cause a hard lock due to the windows API when
destroying window capture.  When the graphics thread locks the source
list for doing tick or render, and then the UI thread tries to destroy a
source, the UI thread will wait for the graphics thread to complete
rendering/ticking of sources.  The video_tick of window capture would
then check windows in the same process and try to query the window's
name via GetWindowText.  However, GetWindowText is synchronous, and will
not return until the window event has been processed by the UI thread,
so it will perpetually lock because the two threads are waiting for each
other to finish.
2016-05-13 04:21:39 -07:00
jp9000 8d520b970d win-capture: Allow window capturing of current process
Allows window capture to capture windows of the current process, and
adds windows of the current process to the end of the window list.
2016-05-13 02:14:24 -07:00
jp9000 bd9980a206 win-capture: Reset game cap. wait_for_target_startup on update
This flag should be reset when the user changes the game capture
settings.
2016-05-12 19:42:00 -07:00
jp9000 94e22dae49 win-capture: Instantly capture already-hooked processes
If a process is already hooked, immediately initialize the capture
rather than wait for the processes to initialize or wait for the timer
to trigger.
2016-05-12 19:38:46 -07:00
jp9000 8681baeec3 win-capture: Shut down game cap. when not showing
Prevents game capture from acting as a global source.  This fixes an
issue where a game capture in another scene could capture a window and
prevent a separate game capture in the current scene from being able to
capture that same window.
2016-05-12 19:36:33 -07:00
jp9000 9493095c25 win-capture: Shut down win8 monitor capture when not showing
Completely shut down monitor capture when it's not being shown in the
program (for example in a different scene).  This fixes an issue where
it would cause lag when a game enters fullscreen mode.
2016-05-12 17:59:01 -07:00
Richard Stanway e5e5189c7b
win-capture: Make sure we don't try to hook ourselves
Can trigger when using "Hook any fullscreen application" is enabled and
the projector is active.
2016-04-25 23:46:20 +02:00
Gol-D-Ace 5ed7081213 Update translations from Crowdin 2016-04-23 10:29:21 +02:00
jp9000 d56dc4791d win-capture: Fix cursor corruption bug (typo) 2016-04-18 18:34:41 -07:00
jp9000 bef1b37ae2 win-capture: Fix case where hook only captures one frame
When using a chain hook method (forward or reverse), it was unwisely
assumed that the previous hook in the chain would not overwrite new
hooks when it's called.  When the game capture hook calls the previous
hook in the chain, certain other programs that hook (in this case,
rivatuner on-screen display) would overwrite the hook with older data
and erase the game capture hook, causing it to only capture the first
frame and then never capture again.

This patch ensures that the hook is always saved before calling the next
hook in the chain and then restored after the call returns.  It also
preserves any new hooks that may be added on top of it at any point.
2016-04-14 23:45:19 -07:00
sorayuki a2b6432f53 win-capture: Fix game capture file integrity test
Fixes the file integrity test when required files are placed in a path
containing non-english character encodings.

Closes jp9000/obs-studio#523
2016-03-24 01:05:47 -07:00
jp9000 bcdb3dccb9 win-capture: Always use anti-cheat by default
Originally this on by default, but then was changed to being off by
default because it was thought that there were permission issues, but it
turned out that the permission issues were a separate bug, so it's safe
to have this be default to on again.
2016-03-21 14:11:23 -07:00
jp9000 363d449789 win-capture: Actually always refetch capture addresses
195fe9a560 did not actually fix the issue; the code was misread and
the wrong section of code was disabled.  This actually forces a refetch.
2016-03-21 13:54:50 -07:00
jp9000 69da1151e0 Update translations from Crowdin 2016-03-19 12:08:48 -07:00
jp9000 195fe9a560 win-capture: Always refetch game capture addresses
This is a fast/immediate solution to a possible bug with caching the DLL
versions for game capture hook addresses - may as well just reload game
capture hook addresses each time the program is run for the time being
just to be safe.  Load time will increase a little for the time being
but it's worth it to prevent any issues with game capture.
2016-03-13 08:20:37 -07:00
Gol-D-Ace 2b7036dc93 Add latest translations from Crowdin 2016-02-21 22:16:12 +01:00
jp9000 cd97ce2a17 libobs: Add source output flag OBS_SOURCE_DO_NOT_DUPLICATE
Certain types of sources (display captures, game captures, audio
device captures, video device captures) should not be duplicated.  This
capability flag hints that the source prefers references over full
duplication.
2016-01-26 11:49:50 -08:00
jp9000 2591f24594 win-capture: Add game capture fix for darkest dungeon
Darkest dungeon uses an unusual technique for drawing its frames: a
fixed 1920x1080 frame buffer used in place of the backbuffer, which is
then stretched to fit the size of the screen (whether the screen is
bigger or smaller than the actual texture).

The custom frame would cause glReadBuffer to initially fail with an
error.  When this happens, their custom frame buffer is in use, so all
that needs to be done is simply reset the capture and force the current
output size to 1920x1080 while that custom frame is in use.

They presumably did this in order to ensure the game looks the same at
any resolution.  Instead of having to use power-of-two sprites and
mipmaps for every single game sprite and stretch/skew each of them
(which would risk the final output "not looking quite right" at
different resolutions), they simply use non-pow-2 sprites with no
mipmaps and render them all on to one texture of a fixed size and then
stretch that final output texture.  That ensures that the actual
composite of the game still looks the same at any resolution, while
reducing texture memory by not requiring each sprite to use a
power-of-two texture and mipmaps.
2016-01-26 11:49:28 -08:00
jp9000 2c8edb8a8a win-capture: Clear GL error flag before initializing capture
Some games don't catch GL errors via glGetError, so there's a
possibility that an error will pass through to the capture calls,
causing a false failure.

The most simple solution is to just clear the error flag on each capture
call.
2015-12-10 15:54:30 -08:00