Commit graph

38 commits

Author SHA1 Message Date
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
jpark37 695f476553 win-capture: Add logging for Force SDR checkbox 2023-02-19 11:40:32 -08:00
jpark37 7bf3015864 win-capture: Add Force SDR for DXGI duplicator
Also plumb support for wide SDR although DXGI chooses narrow anyway?
2023-02-19 11:40:32 -08:00
Richard Stanway 0121533e3e win-capture: Convert monitor name to UTF-8 for display
Also increase the buffer size to account for potential wide characters
consuming many bytes.
2023-02-15 15:36:13 -05:00
jpark37 6734167bf1 win-capture: Log display ids 2023-02-11 15:05:28 -08:00
jpark37 0b30ff1deb win-capture: Support EnumDisplayDevices failure
Seeing EnumDisplayDevices fail in the wild, so use GetMonitorInfo name
when the persistent name is unavailable.
2023-01-25 10:44:10 -05:00
jpark37 22ea8f4e1f libobs-winrt,win-capture: Add Force SDR for WGC display
Leverage existing window capture support for display capture.
2023-01-14 15:49:43 -08:00
Richard Stanway 20d4bab77a win-capture: Always reset timeout when searching for target display
If the display wasn't found, the timer was not reset, causing the code
to execute on every single tick, stalling the graphics thread and using
excessive CPU.
2023-01-04 23:20:41 -08:00
jpark37 803fcc4c3e win-capture,UI: Look up display by id, not index
The index is not reliable. The id persists better, so use that.

Also remove matching against the first monitor if the expected monitor
is not available. That feature seems like a good way to get doxxed by
accident.
2022-11-18 15:15:13 -05:00
Norihiro Kamae 7e3656ab33 plugins: Cleanup unused-parameters
- Remove unnecessary UNUSED_PARAMETER
- Add OBS_UNUSED attribute to unused parameters
- Also removes unused variables
2022-07-19 11:01:00 -04:00
jpark37 93fe82d1ce win-capture: Add DXGI/WGC HDR support
HDR for DXGI/WGC display capture, and WGC window capture.

Also add fast SDR paths for BitBlt to skip color conversions.
2022-04-14 09:36:09 -07:00
jpark37 bf27941f5f libobs-winrt, win-capture: Linear SRGB support
Update window, display, and game capture to always bilinear filter in
linear space, even if the source texture is not SRGB typed. This helps
resolve confusion in situations where we were filtering in nonlinear
space vs. linear space, like when toggling an empty crop filter.
2021-07-11 08:26:30 -07:00
Ryan Foster 85ffdd57f4 win-capture: Return early in property callbacks if param is null
When obs_get_source_properties is called, it calls the property modified
callbacks without a source instantiation. The callbacks set in
.get_properties for display capture and window capture would then result
in exceptions when anything is dereferenced on the source, such as
wgc_supported or update_mutex, because the source itself is null. Let's
make the callbacks return early if the property param is null.
2021-06-30 01:45:42 -07:00
Ryan Foster 1da97fb0d0 win-capture: Check for WGC support on plugin load
We shouldn't have to check WGC support for every display capture or
window capture source. Either the system supports it or it doesn't.
Check when the plugin loads and use that result.
2021-06-30 01:45:42 -07:00
Ryan Foster 2f3c0911fa win-capture: Determine D3D11 usage once per run
The device type (OBS renderer) cannot change without restarting OBS, so
we should only have to check if we're using D3D11 once instead of
checking every time a new display capture or window capture source is
created.
2021-06-30 01:45:42 -07:00
jpark37 366b716f20 libobs-winrt,win-capture: Cursor toggle exceptions
A user has reported that toggling the cursor can cause exceptions.

Propagate that information upward, so we can reset the capture.

Display capture never needed to call the function in the first place.

Shuffle around window capture code to make a common reset function.

Builds on PR #4663.
2021-05-07 23:50:13 -07:00
jpark37 3514f4fea5 win-capture: Fix WGC disable index for display
Previously disabled DXGI because the index is wrong.
2021-05-06 13:58:14 -07:00
jpark37 01d065fa7d win-capture: Remove SRGB code
Not having OBS_SOURCE_SRGB is good enough now.
2021-05-03 01:19:56 -07:00
jpark37 7e263ab775 win-capture: Better laptop test for auto-selection
Only auto-select WGC for desktop capture if a battery exists and
multiple GPU adapters are present. May false-positive on desktops with
a smart UPS attached, but we don't know of a better test.
2021-03-12 20:59:31 -08:00
jpark37 80b4a65cd2 win-capture: Add WGC desktop capture
Copy patterns from WGC window capture, and BitBlt monitor capture.
2021-01-26 17:11:12 -08:00
jpark37 a311299606 win-capture: Support linear SRGB
For game capture, neither GL nor D3D9 support SRGB shared textures, so
disable linear SRGB support if the texture format doesn't support it.

Similarly, DXGI display capture doesn't work with SRGB at the moment.
Unsure if it will with more work, but disable for now.

Also force linear SRGB off if using GDI-compatible textures.
2021-01-21 07:42:57 -08:00
Matt Gajownik 0e07e034a0 win-capture: Log duplicator display when updating properties 2020-07-14 22:40:15 +10:00
jpark37 6393399758 win-capture: Remove game capture scaling
The performance save is not worth accidental usage support.

Also remove unnecessary copies from the shmem paths.
2020-06-22 15:07:07 -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
Matt Gajownik 9931f22ff4 win-capture, libobs: Show names of displays in Display Capture 2020-03-09 11:13:59 +11: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
Clayton Groeneveld 82ffcdc827 UI: Add source icons 2019-11-24 20:50:42 -08: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
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
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
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
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 6ad8df8adb (API Change) libobs: Use single func for base effects
API removed:
--------------------
gs_effect_t *obs_get_default_effect(void);
gs_effect_t *obs_get_default_rect_effect(void);
gs_effect_t *obs_get_opaque_effect(void);
gs_effect_t *obs_get_solid_effect(void);
gs_effect_t *obs_get_bicubic_effect(void);
gs_effect_t *obs_get_lanczos_effect(void);
gs_effect_t *obs_get_bilinear_lowres_effect(void);

API added:
--------------------
gs_effect_t *obs_get_base_effect(enum obs_base_effect effect);

Summary:
--------------------
Combines multiple near-identical functions into a single function with
an enum parameter.
2015-10-19 00:52:45 -07:00
jp9000 6285a47726 (API Change) libobs: Pass type data to get_name callbacks
API changed from:
obs_source_info::get_name(void)
obs_output_info::get_name(void)
obs_encoder_info::get_name(void)
obs_service_info::get_name(void)

API changed to:
obs_source_info::get_name(void *type_data)
obs_output_info::get_name(void *type_data)
obs_encoder_info::get_name(void *type_data)
obs_service_info::get_name(void *type_data)

This allows the type data to be used when getting the name of the
object (useful for plugin wrappers primarily).

NOTE: Though a parameter was added, this is backward-compatible with
older plugins due to calling convention.  The new parameter will simply
be ignored by older plugins, and the stack (if used) will be cleaned up
by the caller.
2015-09-16 09:21:12 -07:00
jp9000 e20ec366b2 Make capture sources w/o alpha use opaque effect
This fixes an issue primarily with filter rendering: when capturing
windows and displays, their alpha channel is almost always 0, causing
the image to be completely invisible unintentionally.  The original fix
for this for many sources was just to turn off the blending, which would
be fine if you're not rendering any filters, but filters will render to
render targets first, and that lack of alpha will end up carrying over
in to the final image.

This doesn't apply to any mac captures because mac actually seems to set
the alpha channel to 1.
2015-03-22 19:18:05 -07:00
jp9000 e2ee8adf77 win-capture: Fix potentially uninitialized vars 2015-02-09 03:49:20 -08:00
jp9000 0c1d121ff2 Remove various unused variables
Unused variables detected by mingw
2015-02-09 03:49:13 -08:00
jp9000 f466e9ec1c win-capture: Add win8+ monitor capture
Uses the output duplicator API in order to get a high performance
monitor capture on windows 8+.  This is actually designed to be
interchangeable with regular GDI-based monitor capture (uses the same
source id).
2015-01-03 02:37:18 -08:00