Commit Graph

121 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks 63a5873413 project: Remove non-standard std:: prefix from types 2023-03-28 12:52:22 +02:00
Michael Fabian 'Xaymar' Dirks dbb9db596e project: Apply formatting 2023-03-28 12:52:21 +02:00
Michael Fabian 'Xaymar' Dirks dbb71cf801 project: Code cleanup and reapply formatting
Changes applied:

* Moved utility files to /util/.
* Removed unused #includes.
* Removed unused ::ffmpeg::tools function.
* Removed unused variables.
* Fixed missing parentheses in the version macro.
* Fixed missing override on virtual function overrides and removed unnecessary virtual keyword from them.
* Disabled additional warning for ATL headers on MSVC only.
* Replaced direct printf parameters with their macro equivalent.
* Replaced C-style casts with C++-style casts.
* Applied clang-format again after an earlier change to the CMake file broke the integration for it.
2023-03-28 12:52:20 +02:00
Michael Fabian 'Xaymar' Dirks 68a49498e6 common: Rename LOG_ to DLOG_ to avoid macro confusion 2023-03-28 12:52:17 +02:00
Michael Fabian 'Xaymar' Dirks d9198211f7 gfx/shader: Add Per-Instance/Activation/Frame Random values 2023-03-28 12:52:13 +02:00
Michael Fabian 'Xaymar' Dirks 9562d84221 filters/shader: Fix occasional invisibility problem 2023-03-28 12:52:13 +02:00
Michael Fabian 'Xaymar' Dirks 22e94bb0d8 filters/shader: Don't use scaled size for input capture 2023-03-28 12:52:12 +02:00
Michael Fabian 'Xaymar' Dirks ee0a69bbf0 project: Adjust object Ids and add proxies for compatibility 2023-03-28 12:52:12 +02:00
Michael Fabian 'Xaymar' Dirks 5530d2d416 nvidia/cuda/cuda: Convert to global Singleton 2023-03-28 12:52:12 +02:00
Michael Fabian 'Xaymar' Dirks 9658c1ee0f nvidia/cuda: Remove 'cu_' prefix from types 2023-03-28 12:52:11 +02:00
Michael Fabian 'Xaymar' Dirks 5fc95b48d8 filters/nv-face-tracking: Improve tracking and remove high priority CUDA stream
The high priority CUDA stream causes libOBS to be at a lower priority than the tracking, which is not what we want. Instead we want tracking to be incomplete in those cases, rather than slowing down encoding and other things.

Geometry updates are also now done once per frame instead of one per tracking update, which should improve the smoothness without affecting performance too much. Additionally all tracking info is now in the 0..1 range, which drastically simplifies some math - especially with texture coordinates.

To deal with tracking and updates being asynchronous, a very simple approximation of movement velocity has been added. This is mostly wrong, but it can bridge the gap where tracking updates are slower, as the values are all filtered anyway.
2023-03-28 12:40:43 +02:00
Michael Fabian 'Xaymar' Dirks a9bb56c5ee project: Optimize to use single fullscreen tri instead 2023-03-28 12:40:42 +02:00
Michael Fabian 'Xaymar' Dirks 49f1cbc15e project: Improve performance profiling support
Adds a new CMake option "ENABLE_PROFILING" which enables all CPU and GPU performance profiling available in StreamFX for tracking what's actually causing things to be slow.
2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks 9b13d64551 filter-blur: Add debug markers for performance tracking 2023-03-28 12:40:41 +02:00
Michael Fabian 'Xaymar' Dirks 4947d46aa1 gs-mipmapper: Update API usage, remove broken options and optimize
The new libOBS API allows us to directly access the underlying API instead of having to mess around in memory. By using it we can avoid crashing in case the compiler for it is different, or in case the actual back end structure changes.

Additionally the mostly unimplemented and unused options have also been removed, which streamlines the use of this class even further and reduces both shader and code complexity.

Finally by optimizing the use of the internal render target we can achieve a speed up of up to 3000% over the old way, allowing for many more mipmapped filters.
2023-03-28 12:40:40 +02:00
Michael Fabian 'Xaymar' Dirks bb21d940bf project: Fix virtual overrides not using the correct type 2023-03-28 12:40:39 +02:00
Michael Fabian 'Xaymar' Dirks 7a929d6af4 locale: Add missing and remove unused strings 2020-04-23 09:14:31 +02:00
Michael Fabian 'Xaymar' Dirks d0941895ad project: Refactor into namespace streamfx 2020-04-23 00:50:39 +02:00
Michael Fabian 'Xaymar' Dirks 04ac0a640f filter-nv-face-tracking: Improve performance with asynchronous tracking
Through converting the code to a threaded asynchronous approach, the libOBS video renderer no longer has to wait on our tracking code to run, and we can enjoy a little bit of extra calculation time before we actually have to do anything.

However due to the remaining synchronization with the Direct3D11/OpenGL context, it is not entirely safe to spend a full frame tracking as libOBS will then start skipped/dropping frames. Even though the priority of the stream is now increased, this still means that we can't just sit around and have to quickly finish all work.

Related #150
2020-04-17 11:44:37 +02:00
Michael Fabian 'Xaymar' Dirks 908d1f0a20 project: Modernize code to proper C++ 2020-04-09 00:17:25 +02:00
Michael Fabian 'Xaymar' Dirks 05399bd183 filter-dynamic-mask: Add missing include
Fixes #134
2020-04-06 15:39:12 +02:00
Michael Fabian 'Xaymar' Dirks cd5acd42f4 obs-source-factory: Add settings migration code
Previously sources had to manually implement migration code, which resulted in unresolvable regression issues due to the lack of version and commit tagging. With the new migration code, all sources automatically have this version and commit tagging at all times, and as such can now have a temporary regression fixed without the user needing to change any values manually.
2020-04-05 07:28:10 +02:00
Michael Fabian 'Xaymar' Dirks a138f95126 cmake: Fix clang support in native OBS Studio build 2020-04-05 06:50:21 +02:00
Michael Fabian 'Xaymar' Dirks 59fa1d36d7 common: Common header include for improved platform support
This header includes all common data between headers used in the plugin. This should improve cross-platform compiling support whenever possible, as all platform-dependent common includes and defines can be done here.
2020-04-02 17:02:01 +02:00
Michael Fabian 'Xaymar' Dirks 30aaea8449 filter-nv-face-tracking: Possibly fix for rare 0x0 bug 2020-04-01 01:41:18 +02:00
Michael Fabian 'Xaymar' Dirks 3dcf4e5dd6 filter-shader: Fix detected sizes 2020-03-31 22:42:18 +02:00
Michael Fabian 'Xaymar' Dirks ac8844b305 gfx-shader: Add defaults 2020-03-31 22:34:22 +02:00
Michael Fabian 'Xaymar' Dirks d5dffbbe03 filter-shader: Fix some crashes 2020-03-31 22:26:50 +02:00
Michael Fabian 'Xaymar' Dirks bb2f43a629 filter-shader: Fix incorrect shader mode 2020-03-31 22:22:55 +02:00
Michael Fabian 'Xaymar' Dirks 43f1dcf205 filter-nv-face-tracking: Nvidia exclusive Face Tracking filter
Ever wished you had a professional camera operator to highlight and follow the action, ensuring the audience never misses a beat? Thanks to NVIDIA, you can now do this at home for free! The new NVIDIA AR SDK unlocks augmented reality features, including motion tracking for faces.

This allows me to provide you with an automated zoom and cropping solution for your video camera to transform your streams into a slick, polished broadcast, where you’ll always be the star of the show. Don’t forget - everything is customizable so the possibilities are endless. You can even recreate that Futurama squinting meme if you wanted to (with some scripting)!

The filter requires compatible Nvidia RTX hardware and the Nvidia AR SDK Runtime to be installed ahead of time. This filter is considered "stable" and shouldn't change much from version to version.
2020-03-31 21:46:47 +02:00
Michael Fabian 'Xaymar' Dirks 43b5d309eb transition: Add initial version of Shader filter
These allow you to apply any kind of filtering to a any source, using just standard HLSL. Just like transitions, one extra parameter is set called 'InputA'.

Fixes #95
2020-03-28 18:54:56 +01:00
Michael Fabian 'Xaymar' Dirks e66acbeb98 filter-transform: Fix function location 2020-03-28 16:24:26 +01:00
Michael Fabian 'Xaymar' Dirks 18b3cd30bf filter-transform: Migration code for earlier stable versions
This fixes #116 which was caused by a refactor in commit efb6b0b9be. This bug was left undiscovered until users started upgrading from the last stable version to the current pre-release.
2020-03-28 16:18:17 +01:00
Michael Fabian 'Xaymar' Dirks ff3c2e8c66 filter-dynamic-mask: Initialize all members 2020-03-27 20:10:17 +01:00
Michael Fabian 'Xaymar' Dirks 0b3ce10aff filter-transform: Fix discoloration issue
Previously a wrong blend state caused a slight discoloration on transparent sources, which was caused by assuming them to always be fully solid without transparency. By instead relying on OBS to do the rendering we do not have to deal with blend states as much and instead can simply enjoy the result.

Fixes #104
2020-03-07 03:43:30 +01:00
Michael Fabian 'Xaymar' Dirks 0a16ce07dc project: Merged FFmpeg Encoders Step 2 2020-01-13 22:40:15 +01:00
Michael Fabian 'Xaymar' Dirks cbada3e438 obs-source: Deprecate obs::source due to stability issues
This should be replaced with a class inheriting from std::shared_ptr.
2019-12-21 17:43:12 +01:00
Michael Fabian 'Xaymar' Dirks 7e5cbe18cf project: Apply clang-format 2019-12-21 17:05:53 +01:00
Michael Fabian 'Xaymar' Dirks f49f3a30b6 filter-displacement: Fix typo 2019-12-18 06:39:07 +01:00
Michael Fabian 'Xaymar' Dirks 16347beb87 filter-*, source-*: Fix rendering of filters and duplication of sources 2019-12-17 23:52:10 +01:00
Michael Fabian 'Xaymar' Dirks b54e95527a gs-effect*: Finish up refactoring onto std::shared_ptr
This is most likely not the last refactor, the entire obs/gs stuff is very very basic right now and likely needs a complete rewrite.
2019-12-15 12:55:19 +01:00
Michael Fabian 'Xaymar' Dirks d53e9eeadf filter-sdf-effects: Restore compatibility with 24.0.3 and earlier 2019-12-14 21:33:32 +01:00
Michael Fabian 'Xaymar' Dirks 01895c1ccc filter-dynamic-mask: Restore compatibility with 24.0.3 and earlier 2019-12-14 21:33:25 +01:00
Michael Fabian 'Xaymar' Dirks af78c177ad filter-displacement: Restore compatibility with 24.0.3 and earlier 2019-12-14 21:33:16 +01:00
Michael Fabian 'Xaymar' Dirks a24e0d2c10 filter-blur: Restore compatibility with 24.0.3 and earlier 2019-12-14 21:33:06 +01:00
Michael Fabian 'Xaymar' Dirks d8e1c7c779 filter-transform: Restore compatibility with 24.0.3 and earlier 2019-12-14 21:32:48 +01:00
Michael Fabian 'Xaymar' Dirks 66abaac67b filter-color-grade: Refactor onto obs::source_factory
Related: #90
2019-12-14 02:34:48 +01:00
Michael Fabian 'Xaymar' Dirks 5be2941299 filter-sdf-effects: Move factory to bottom of the file 2019-12-03 20:38:34 +01:00
Michael Fabian 'Xaymar' Dirks 59878b62d0 filter-dynamic-mask: Fix nonstandard use of va_start 2019-12-03 20:38:14 +01:00
Michael Fabian 'Xaymar' Dirks d9f43ec2e8 filter-blur: Refactor onto obs::source_factory 2019-12-03 20:37:57 +01:00