0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00
Commit Graph

186 Commits

Author SHA1 Message Date
Scott Cooper
dfe6151465 win-capture: Fix segfault when calling data.free()
data.free should be checked before calling.
2024-09-07 16:09:03 -07:00
PatTheMav
46b5f7e6d0 plugins: Remove CMake legacy code paths for Windows modules 2024-08-22 15:39:00 -04:00
PatTheMav
d81fcd70e0 cmake: Update cross-platform build project management for Windows
Enables creation of x64 and x86 child projects when building on ARM64
and decouples functionality from legacy_check function
2024-08-20 16:00:21 -04:00
PatTheMav
b8cfacaec3 Update formatting of CMake files 2024-08-14 12:07:47 -04:00
tytan652
4b0b71ad5f deps,shared,win-capture: Move ipc-util to shared folder 2024-07-27 07:38:36 +02:00
PatTheMav
14654807cb win-capture: Add missing MSVC runtime setting to 32-bit build 2024-03-16 19:36:33 -04:00
PatTheMav
f4733ec6a2 Update source code formatting with clang-format 17.0.3
Added SCDisplayRef type alias to fix a quirk of this specific
clang-format version with ObjC block syntax.
2024-03-11 15:55:30 -04:00
PatTheMav
eae5cc1e38 plugins: Update CMake formatting with manual format choices 2023-12-19 17:59:44 -05:00
jpark37
ea9df85512 graphics-hook: Fix DXGI ref leak for D3D12 capture
Create ID3D11Resource dynamically to avoid reference inflation.
2023-12-16 17:03:43 -06:00
jpark37
263e027938 graphics-hook: Remove unused member variables 2023-12-10 04:45:33 -06:00
jpark37
395ab0fbf5 graphics-hook: Use ID3DDestructionNotifier
Cleaner and more correct than hooking IUnknown::Release.
2023-12-10 04:45:33 -06:00
Seth Williams
aa1f2dea84 win-capture: Fix Vulkan race condition
This race condition is caused when one thread creates a swap chain,
which calls OBS_CreateSwapchainKHR, at the same time another thread
calls OBS_CreateImageView.

OBS_CreateSwapchainKHR allocates swap data, publishes this into the
data->swaps linked list, then initializes it. Meanwhile,
OBS_CreateImageView is iterating the swaps linked list, to see if the
image matches any swap chain images. Due to the order in
OBS_CreateSwapchainKHR, there's no guarantee this data is initialized
so it often ends up running out of bounds on the swap_images array.

The fix is simply to defer the swap data publish to after init.
2023-11-07 23:48:34 -06:00
jpark37
b5c5f71cee graphics-hook: Handle VkImageViewUsageCreateInfo
Our solution for adding TRANSFER_SRC usage for imageless framebuffers
was triggering validation errors when combined with image view usage
overrides. Add TRANSFER_SRC onto usage overrides for swap chain image
views to fix mismatches.
2023-08-04 03:35:10 -07:00
Carl Pédimina
b12ed3008b win-capture: Fix leaking framebuffers data
The wrong linked list was used when removing framebuffer data.
Furthermore, a pointer referenced an object on the stack that
was no more valid.
2023-07-25 10:48:10 -07:00
PatTheMav
db895092ed cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-06-29 10:11:32 -04:00
Lain
106c7aa61f Update copyrights/names 2023-05-20 01:31:18 -07:00
PatTheMav
349372b3b3 cmake: Add changes for CMake build framework 3.0
New code path only taken if OBS_CMAKE_VERSION is set to 3.0.0 or
greater, old functionality remains unchanged.
2023-03-26 18:20:38 -04:00
jpark37
feae65c472 graphics-hook: Handle VK_KHR_imageless_framebuffer
Applications that use this Vulkan extension would have image usage
mismatches because we add VK_IMAGE_USAGE_TRANSFER_SRC_BIT to
VkSwapchainCreateInfoKHR::imageUsage, so make the same modification to
VkFramebufferAttachmentImageInfo::usage.
2023-03-24 15:17:43 -07:00
jpark37
148122f5aa graphics-hook: Stop trying to connect early
It never works, and leaves a confusing message behind.
2023-02-04 15:44:16 -08:00
tytan652
107b2a8f27 libobs-d3d11,libobs-opengl,plugins: Remove unneeded cast in switches
Those casts were usually used to workaround switch warnings.
2023-01-16 11:52:26 +01:00
PatTheMav
b417df7d95
win-capture: Replace invocations of sprintf with snprintf
Fixes deprecation warnings in Xcode 14/clang on macOS and reduces
chance of buffer overflows.
2022-11-11 19:51:28 +01:00
jpark37
afeb78e022 graphics-hook: Print DXGI swap chain desc 2022-09-10 15:36:53 -07:00
jpark37
5fd22f3dfd graphics-hook: Remove unused code 2022-09-10 15:36:53 -07:00
jpark37
f55021be90 graphics-hook: Bump Vulkan version
Vulkan loader blocks implicit layers older than application apiVersion.
2022-07-29 23:22:39 -07:00
jpark37
8a4352c1e5 graphics-hook: Relax Vulkan allocation strategy
Stop requiring DEVICE_LOCAL. May be needed for integrated GPUs.
2022-07-29 23:22:39 -07:00
jpark37
b7d630af6b graphics-hook: Update VkResult strings 2022-07-29 23:22:39 -07:00
jpark37
4c7c1854bd graphics-hook: Track DXGI status with counter
Previous approach could mark Present exit too early.
2022-07-29 21:54:28 -07:00
Eric Laberge
dfb9bb74f7 graphics-hook: Avoid conflict between Vulkan and DXGI Present 2022-07-29 21:54:07 -07:00
jpark37
69ff026647 libobs, win-capture: Share window helper code
Add "ms_" prefix as makeshift namespace.
2022-07-23 17:41:34 -07:00
PatTheMav
9145e3063d win-capture: Fix subprojects not installing on incremental builds
When changing a subproject (e.g. graphics-hook), the generated binaries
are not installed without also building win-capture. This commit enables
the subprojects to be treated as "plugins" which are installed to rundir
and also the installation directory without any additional workarounds.
2022-07-13 15:52:13 -04:00
jpark37
df96e68ca6 cmake: Disable LNK4099 warning
We are very unlikely to ship PDBs for deps.
2022-07-11 22:07:10 -07:00
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
jpark37
40cea9ca50 win-capture: Remove dependency on psapi.lib 2021-09-12 14:10:36 -07:00
Jim
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
kokole
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
jpark37
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
jpark37
0ffcb66526 graphics-hook: Add Detours include dir 2021-05-19 19:52:49 -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
jpark37
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
jpark37
c6cee82c92 graphics-hook: Try multiple D3D12 queues
Keep trying queues until one of them passes D3D11On12CreateDevice.
2021-05-17 02:28:11 -07:00
jpark37
5290326b77 graphics-hook: Do not persist device unnecessarily 2021-05-17 02:28:11 -07:00
jpark37
7439e1c4b8 graphics-hook: More logging to help debugging 2021-05-17 02:28:11 -07:00
jpark37
d9d87e6502 graphics-hook: Kill early return 2021-05-17 02:28:11 -07:00
jpark37
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
jpark37
3412f6fece graphics-hook: Reduce variable scopes 2021-05-17 02:28:11 -07:00
jpark37
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
jpark37
b899f06877 graphics-hook: Fix potential D3D12 device leak 2021-05-17 02:28:11 -07:00