Commit graph

611 commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks
6e0f85d3f7 encoders/ffmpeg: Rebase onto obs::encoder_factory 2020-06-21 19:24:58 +02:00
Michael Fabian 'Xaymar' Dirks
18980b8863 obs/encoder-factory: Factory to create encoder instances 2020-06-21 19:24:58 +02:00
Michael Fabian 'Xaymar' Dirks
2ba556d99e project: Apply formatting 2020-05-31 20:21:55 +02:00
Michael Fabian 'Xaymar' Dirks
88e5a12cb9 source/mirror: Fix rare out-of-order lock on source
Occasionally, mostly due to other sources rebuilding their UI, an out-of-order lock freeze can be observed with Source Mirror. This is unwanted, so we need to move the freezing logic into a place where freezing shouldn't happen.

Fixes #228
Actually fixes #61
2020-05-31 20:21:29 +02:00
Michael Fabian 'Xaymar' Dirks
8a8b0cf3fa ffmpeg/tools: Fix incorrect colors for sRGB 2020-05-31 17:20:58 +02:00
Michael Fabian 'Xaymar' Dirks
e3817bc087 encoders/ffmpeg: Assume source pixel format for empty support lists 2020-05-31 02:49:32 +02:00
Michael Fabian 'Xaymar' Dirks
85f2ebc7e7 configuration: Fix failed saving due to invalid path 2020-05-31 01:49:17 +02:00
Michael Fabian 'Xaymar' Dirks
c667b8a147 ui: Fix about dialog not being shown and move menu
Moves the menu for StreamFX to the primary menu, so that it is not hidden under tools. This makes it clearer to the user if their installation of StreamFX is working correctly, in addition to reducing the steps necessary to use the menu.

Also the 'About StreamFX' dialog now actually shows up for every update, as expected.
2020-05-31 01:46:38 +02:00
Michael Fabian 'Xaymar' Dirks
e1afa67e9c transitions/shader: Fix order of assignment 2020-05-31 01:41:07 +02:00
Michael Fabian 'Xaymar' Dirks
eaf89193fb gfx/shader/param/basic: Fix bool and suffixes, add enums and optimize
Adds support for enumerations, a different way of selecting how something should behave in a shader. Enumerations rely on a continuous list of values, and will automatically detect how many values there are in the enumeration. Only non-vector types are supported as enumeration entries, and array/vector parameters can have each member set to a different enumeration value.

Furthermore suffixes now are properly assigned, and 'bool' no longer causes shaders to stop rendering. Additionally by inlining some functions and using std::string_view we can achieve a slightly better performance than before.
2020-05-31 01:41:07 +02:00
Michael Fabian 'Xaymar' Dirks
7b8774b834 gfx/shader: Inlining, std::string_view and optimizations 2020-05-31 01:41:07 +02:00
Michael Fabian 'Xaymar' Dirks
7a9f1e9a5b obs/gs/effect-parameter: Use string_view over std::string
Using std::string_view over std::string (and const std::string&) has the advantage that we skip potential temporary std::string objects that are immediately thrown away, thus slowing down the code. It can also be implicitly cast to std::string, which makes it compatible with existing code that uses std::string.
2020-05-31 01:41:07 +02:00
Michael Fabian 'Xaymar' Dirks
bd00fd3836 ui/about: Add 'Thank You' images to the About dialog
Images were created by the talented Inga (https://twitter.com/IngaPotejto).
2020-05-31 01:40:44 +02:00
Michael Fabian 'Xaymar' Dirks
f111330f8e 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.
2020-05-13 02:30:15 +02:00
Michael Fabian 'Xaymar' Dirks
ef283d219c nvicia/cuda-context: Don't modify the primary context
Doing so could potentially cause other CUDA implementations to suddenly fail.
2020-05-13 02:30:15 +02:00
Michael Fabian 'Xaymar' Dirks
1902df524c nvidia/cuda: Add cuCtxCreate, cuCtxSynchronize 2020-05-13 02:30:15 +02:00
Michael Fabian 'Xaymar' Dirks
a26827f614 ui/about: Add version information 2020-05-12 15:07:38 +02:00
Michael Fabian 'Xaymar' Dirks
54fc987f51 obs/gs-helper: Optimize performance with inline 2020-05-12 04:13:20 +02:00
Michael Fabian 'Xaymar' Dirks
5892f8a85c util/threadpool: Formatting and allow cancelling of tasks 2020-05-12 04:13:11 +02:00
Michael Fabian 'Xaymar' Dirks
920f35fcdf project: Optimize to use single fullscreen tri instead 2020-05-02 21:43:14 +02:00
Michael Fabian 'Xaymar' Dirks
2f853ac166 gs-helper: Only include debug markers if profiling is enabled 2020-05-01 11:37:24 +02:00
Michael Fabian 'Xaymar' Dirks
d72f6a3991 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.
2020-05-01 11:37:24 +02:00
Michael Fabian 'Xaymar' Dirks
c2c31d1d70 ffmpeg-encoder/nvenc: Invert "no-scenecut" option for "Adaptive I-Frames"
Our "Adaptive I-Frames" is the inverse of the expected parameter to "no-scenecut" in FFmpegs NVENC.

Related #191
2020-04-26 00:35:03 +02:00
Michael Fabian 'Xaymar' Dirks
363bae9c78 ffmpeg-encoder/nvenc: Test for "h264_nvenc" in for "Adaptive B-Frames"
Fixes the bug where "Adaptive B-Frames" would not be applied in the way it was expected to be applied.

Related: #191
2020-04-26 00:35:03 +02:00
Michael Fabian 'Xaymar' Dirks
ca54fb4d6a gfx-blur-dual-filtering: Implement asynchronous rendering
Asynchronous rendering allows the GPU to perform work while the CPU performs other work, and is significantly faster than lockstep immediate rendering. By reusing existing render targets we can see a performance improvement of up to 500%, while still doing the same things.
2020-04-25 14:57:17 +02:00
Michael Fabian 'Xaymar' Dirks
fd799b458f filter-blur: Add debug markers for performance tracking 2020-04-25 11:57:22 +02:00
Michael Fabian 'Xaymar' Dirks
bc6a0c5281 gfx-blur-*: Add debug markers for performance tracking 2020-04-25 11:57:22 +02:00
Michael Fabian 'Xaymar' Dirks
28aca9ff15 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.
2020-04-25 08:40:06 +02:00
Michael Fabian 'Xaymar' Dirks
c88301cee2 gs-vertexbuffer: Initialize memory to 0 2020-04-25 08:40:06 +02:00
Michael Fabian 'Xaymar' Dirks
f8972f5667 ui: Fix incorrect namespace for Qt symbol
Q_INIT_RESOURCE and Q_CLEANUP_RESOURCE can't be called from within a namespace and instead have to be in outside of the namespace, so by moving them into small inline functions we can fulfill this restriction.

Related: #192 #155
2020-04-25 01:24:15 +02:00
Michael Fabian 'Xaymar' Dirks
d5eadbc148 gfx-shader: Actually fix the thing 93207d was supposed to fix 2020-04-24 08:53:25 +02:00
Michael Fabian 'Xaymar' Dirks
93207d4655 gfx-shader: Actually write alpha channel to render target 2020-04-24 06:18:12 +02:00
Michael Fabian 'Xaymar' Dirks
9f96c82e87 project: Fix virtual overrides not using the correct type 2020-04-24 05:13:58 +02:00
Michael Fabian 'Xaymar' Dirks
a0e5b6c080 util-profiler: Specify type for template 2020-04-24 05:13:58 +02:00
Michael Fabian 'Xaymar' Dirks
bd0d3e5baa util-profiler: Fix typo with in reparent() 2020-04-24 02:46:36 +02:00
Michael Fabian 'Xaymar' Dirks
fb46ae228d util-event: Fix unknown type 2020-04-24 02:46:36 +02:00
Michael Fabian 'Xaymar' Dirks
c6c8a66b6c gfx-shader: Add default path for file selection 2020-04-24 01:34:31 +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
5291b193e2 gfx-shader: Fix rendering at unexpected sizes and fix performance
Fixes rendering at unexpected sizes by first rendering to a render target and then rendering the contents of that render target to the frame buffer instead. This also prevent rendering twice or more, which might cause severe FPS impact.
2020-04-23 08:10:01 +02:00
Michael Fabian 'Xaymar' Dirks
f58ce9f421 project: Implement a brand new UI with fancy windows
Implements support for various new UI features that weren't possible up until now, such as an 'About StreamFX' window with a thank you to everyone that supported the project up until now.
2020-04-23 01:09:02 +02:00
Michael Fabian 'Xaymar' Dirks
d0941895ad project: Refactor into namespace streamfx 2020-04-23 00:50:39 +02:00
Michael Fabian 'Xaymar' Dirks
2ab8949ba5 cmake: Place Windows exclusive functionality into own file 2020-04-22 23:32:22 +02:00
Michael Fabian 'Xaymar' Dirks
9ddc9051c7 configuration: Add global configuration handler 2020-04-22 23:15:32 +02:00
Michael Fabian 'Xaymar' Dirks
6cbfee4579 obs-tools: Add OBS data deleter 2020-04-22 23:15:32 +02:00
Michael Fabian 'Xaymar' Dirks
ce74d2f7cd common: Undefine the unsafe 'strtoll' define from libobs 2020-04-22 23:11:30 +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
4d8ff417e7 nvidia-cuda: Improve usage of CUDA resources and functions
Load additional functions from CUDA and add new enumerations to support them:
* cuDevicePrimaryCtxSetFlags allows us to sched scheduling mode for the GPU.
* cuCtxgetStreamPriorityRange allows us to check which priority levels are supported.
* cuStreamCreateWithPriority allows us to create streams with non-default priority.

The scheduler mode is now set to yield so that other threads can do work when we hit an eventual stalling problem. Streams can also now be created with higher priority and different flags, if necessary. In most cases this should allow CUDA resources to execute even while the GPU is under heavy load.
2020-04-17 11:44:37 +02:00
Michael Fabian 'Xaymar' Dirks
97e1846156 obs-tools: Add deleter for obs_weak_source_t 2020-04-17 11:44:37 +02:00
Michael Fabian 'Xaymar' Dirks
e4b4dc23e8 gs-helper: Define extra debug colors 2020-04-17 11:44:37 +02:00
Michael Fabian 'Xaymar' Dirks
05d69e3c59 util-threadpool: Fix rare double-execute bug 2020-04-17 11:44:37 +02:00