308 Commits

Author SHA1 Message Date
jpark37
2111a3a02f libobs-winrt: win-capture: Support client area toggle for WGC 2020-02-24 21:31:53 -08:00
jpark37
cce9fb7f95 win-capture: Hide settings if Automatic is WGC 2020-02-24 19:42:46 -08:00
jp9000
572ce73115 win-capture: Add 'auto' method to window capture
Adds an "Automatic" method to the capture method property of window
capture.  This allows the ability for window capture to automatically
determine the best capture method to use.  Primarily, it prefers BitBlt
in most cases, but will use WGC when it detects the window is a browser,
microsoft office, or a UWP program.

This was implemented because the new capture method has a number of
undesired effects associated with it -- the issue of the capture border
that we can do nothing about, the fact that we can't control the capture
of the cursor, and the fact that Microsoft designed it to switch the
cursor away from hardware cursor mode when the capture is active (there
was absolutely no reason to do this because even OBS can capture the
hardware cursor with no issue).  Until we get a new version of this API
that doesn't absolutely blow, we're stuck preferring BitBlt instead.

But hey, at least people will be able to capture browser windows now.
2020-02-22 21:02:33 -08:00
jpark37
ffc48dbbab win-capture: Windows Graphics Capture support
Users will now have the option of legacy window capture via BitBlt, or
Windows Graphics Capture, which is new to Windows 10.

There are two annoyances with the new capture method though. One is that
there is a bright, yellow border added to the original window (but not
the OBS view of it). The other is that the mouse cursor is always
captured, and we won't be able to capture without cursor until a later
version of Windows 10 is released.

It should also be noted that DPI scaling is now applied, which may
result in blurrier images caused by Windows rescaling.
2020-02-22 21:02:33 -08:00
jpark37
d4ca08c4c7 win-capture: Add support for finding windows via EnumWindows
The top-level window appears to be preferred for upcoming Windows
Graphics Capture support, at least for UWP apps.
2020-02-22 21:02:33 -08:00
Richard Stanway
fb6936a934 win-capture: Faster display / window capture updates
When changing the target for display or window capture, force a
refresh of the source by setting the timer to fire immediately. This
removes 1-3 seconds of "lag" before the new display or window is
visible and makes the UI feel more responsive.

Closes https://github.com/obsproject/obs-studio/issues/2322
2020-02-03 23:22:42 +01:00
Peter Geis
64d0b7fcb4 libobs: Enable compilation on aarch64
Add arch checks to enable aarch-compat layer on aarch64, retain normal
gcc intrinsics on x86 and ppc64.
2019-11-25 13:04:21 -05:00
Clayton Groeneveld
82ffcdc827 UI: Add source icons 2019-11-24 20:50:42 -08:00
tujinshu
76e6a99124 win-capture: Fix rare crash when GL program exits
**Commit message modified and clarified by Jim**

When hooking a program that has both DirectX and OpenGL contexts in use,
it is possible to cause a crash on shutdown due to capture_active()
returning true when an OpenGL context is deleted.  Normally, when
capturing an OpenGL program, this would not happen because the 'active'
variable would not be set due to OpenGL capture not being initialized,
but if DirectX is captured while an OpenGL context is available, and
OpenGL could not load these required functions, then GL can crash due to
trying to use unavailable functions.

This case is extremely rare and doesn't happen under normal
circumstances; only if a program is using both DirectX and OpenGL within
the same program simultaneously, and *only* if OpenGL could not load the
required functions.  This likely almost never happens under normal
programs, games, and hardware.  This was apparently produced by hooking
a GL Qt program that used QWebEngine, which used multiple contexts at
once.
2019-11-05 13:44:15 -08:00
Joel Bethke
6fb3552d70 win-capture: Add additional exe to window capture blacklist
These are additional internal windows processes that should not
be listed in the window capture dropdown.
2019-10-16 19:47:43 -05:00
Jim
6b08c064f6
Merge pull request #2066 from jpark37/feature-level-baseline
Use D3D_FEATURE_LEVEL_10_0 as baseline
2019-10-12 20:55:33 -07:00
jpark37
1ce61c57c0 win-capture: Fix extra duplicator refs
Make duplicator_capture_tick the sole creater, and reference adder of
IDXGIOutputDuplication objects. This prevents a situation where
duplicator_capture::showing cause be false while
duplicator_capture::duplicator was not null at startup on background
scenes, preventing IDXGIOutputDuplication from being recreated when
DXGI_ERROR_ACCESS_LOST.
2019-10-10 19:03:18 -07:00
Gol-D-Ace
03b5be75e4 Update translations from Crowdin 2019-09-17 23:21:00 +02:00
jpark37
3ddef4bf7d win-capture: Remove support for feature level 9.3
Be consistent with libobs-d3d11, which now uses 10_0 as the baseline.
2019-09-08 22:43:41 -07:00
jpark37
ef39715c31 win-capture: Remove unused variable from D3D12 capture 2019-09-08 22:36:25 -07:00
craftwar
e004ce8064 graphics-hook: Fix format specifier 2019-09-02 21:12:27 +08:00
jp9000
d981c10906 Revert "win-capture: Don't leak dynamic library references"
This reverts commit c5928bff4a96977b220027c067ac6b9335b6b4e2.

This breaks game capture.
2019-08-17 12:23:44 -07:00
Michael Fabian 'Xaymar' Dirks
c5928bff4a win-capture: Don't leak dynamic library references 2019-07-24 18:26:45 +02:00
jp9000
f53df7da64 clang-format: Apply formatting
Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
2019-06-23 23:49:10 -07:00
jp9000
53615ee10f clang-format: Add clang-format files 2019-06-23 01:53:56 -07:00
Gol-D-Ace
973bc481ce Update translations from Crowdin 2019-06-11 01:42:42 +02:00
jp9000
1f39259bc5 win-capture: Add discord to game capture blacklist 2019-06-01 20:07:39 -07:00
geemion
f6581952bc win-capture/graphics-hook: Check if mutex abandoned
It's possible that the mutexes used with shared memory capture to return
WAIT_ABANDONED if OBS is shut down abnormally while the mutex is locked.
2019-04-14 03:44:48 -07:00
Gol-D-Ace
e78ac5ebef Update translations from Crowdin 2019-04-04 16:19:51 +02:00
jp9000
93cc09f078 obs-text, win-capture: Do not use premultiplied alpha 2019-03-07 08:14:34 -08:00
Gol-D-Ace
c3711bdd5e Update translations from Crowdin 2019-02-20 22:26:07 +01:00
jp9000
c372d26c02 win-capture: Don't try to find window every frame
When window capture is not capturing a window, don't try to find the
window every frame.  Instead, just check once per frame.  The process of
finding a window has a lot of checks and requires a surprising amount of
processing.
2019-02-11 17:57:24 -08:00
Colin Edwards
17524a9691
Merge pull request #1638 from WizardCM/offset-monitor-count
win-capture: Start user-facing monitor count at 1
2019-02-04 21:00:05 -06:00
jp9000
a4e8b93653 win-capture: Add a few more blacklisted capture exes 2019-02-04 18:16:43 -08:00
jp9000
da1f84133e win-capture: Do not capture "explorer.exe" with null titles 2019-02-04 18:16:43 -08:00
Matt Gajownik
84a3a906a0 win-capture: Start user-facing monitor count at 1
Operating systems don't report monitors from 0, so OBS shouldn't
either. This avoids user confusion when display capture doesn't work.
This does not change monitor count internally.
2019-02-03 11:18:00 +11:00
Christopher Serr
7c53483388 Use Premultiplied Alpha for Text and Game Capture (#1578)
The GDI+ based Text Source actually uses Premultiplied Alpha. The edges
of the fonts are therefore incorrectly blended, causing ugly artifacts
especially if bright text above a bright background is used. Here's an
image comparing the new text blending (left) to before (right):
![https://i.imgur.com/VhhkQcZ.png](https://i.imgur.com/VhhkQcZ.png)

Additionally, the game capture has the same problem, so premultiplied
alpha is used there as well now.
2019-01-30 21:54:24 -06:00
Richard Stanway
7a32f12d9c win-capture: Disable cached offsets writing
We don't read cached offsets any more, so it makes little sense to write
them on every startup.
2019-01-27 16:18:53 +01:00
Richard Stanway
f48b210d61 win-capture: Improve reading from get-graphics-offsets
Increase the buffer size to read the response in one call if possible,
and cause an error condition with log message if the offsets string is
empty.
2019-01-27 16:18:53 +01:00
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