Commit Graph

1051 Commits

Author SHA1 Message Date
Michael Fabian 'Xaymar' Dirks cfa2806e89 code: Migrate source::shader to new dynamic loader 2023-05-14 09:14:29 +02:00
Michael Fabian 'Xaymar' Dirks 765e663180 code: Migrate filter::color_grade to new dynamic loader 2023-05-14 09:14:29 +02:00
Michael Fabian 'Xaymar' Dirks 1363b14288 code: Migrate transition::shader to new dynamic loader 2023-05-14 09:14:29 +02:00
Michael Fabian 'Xaymar' Dirks b4e6bb57e4 code: Migrate ui::handler to new dynamic loader 2023-05-14 09:14:29 +02:00
Michael Fabian 'Xaymar' Dirks acf4dde783 code: Migrate encoder::ffmpeg to new dynamic loader 2023-05-14 09:14:29 +02:00
Michael Fabian 'Xaymar' Dirks 66698ef938 code: Migrate obs::source_tracker to new dynamic loader 2023-05-14 09:14:29 +02:00
Michael Fabian 'Xaymar' Dirks 2f362efa38 code: Migrate configuration to new dynamic loader 2023-05-14 09:14:29 +02:00
Michael Fabian 'Xaymar' Dirks 5ed2010015 code: Migrate util::threadpool to new dynamic loader 2023-05-14 09:14:29 +02:00
Michael Fabian 'Xaymar' Dirks 49f763aa44 code: Add a proper dynamic loader for components
This loader model should have wider compatibility, as it relies on defined C++ behavior instead of undefined preprocessor behavior. We may even be able to implement a simple dependency system that automatically sorts components into the correct order.
2023-05-14 09:14:29 +02:00
Michael Fabian 'Xaymar' Dirks 65c45c4461 code: Fix version comparison logic
This is a lot more complex that I expected it to be.
2023-05-14 06:35:36 +02:00
Michael Fabian 'Xaymar' Dirks fa8d66b951 code: Disable useless alignment styling and update standard 2023-05-14 03:25:07 +02:00
Michael Fabian 'Xaymar' Dirks 0476185a65 code: Fix support for libAVCodec 59.x and beyond 2023-05-14 03:25:07 +02:00
Michael Fabian 'Xaymar' Dirks 81ed7241ff cmake, code: Remove Displacement Filter completely 2023-05-14 03:25:07 +02:00
Michael Fabian 'Xaymar' Dirks 5b2e28a723 code: Disable profiling on MacOS
This may address a nullptr crash on MacOS with several features.
2023-04-05 19:21:13 +02:00
Michael Fabian 'Xaymar' Dirks 9735e1bcec ui/obs-browser-widget: Pull in browser-panel.hpp to fix MacOS
MacOS complains that QCefWidget is an undefined type, while all other compilers are fine.
2023-04-05 19:08:31 +02:00
Michael Fabian 'Xaymar' Dirks 0fa12f1029 ui/obs-browser-widget: Switch header order to fix Qt AutoMoc bug
Qt's CMake integration does not pass the C++ standard to AutoMoc, resulting in weird parsing issues (see https://bugreports.qt.io/browse/QTBUG-73263).
2023-04-05 19:08:30 +02:00
Michael Fabian 'Xaymar' Dirks db23069eb6 ui/obs-browser-widget: Add missing includes for Unix compilers 2023-04-05 19:08:30 +02:00
Michael Fabian 'Xaymar' Dirks ce19d25d71 ui/obs-browser-widget: Fix bad include path for standalone builds 2023-04-05 19:08:30 +02:00
Michael Fabian 'Xaymar' Dirks 5a58aa8a6b ui/obs-browser-widget: Fix strange layout issue in Qt6
When a QCefWidget is alone and all by itself, no layout updates are performed on the "window". This causes a problem where it just stays in place, instead of moving with the rest of the elements. The fix to this appears to be to just add a different Qt widget into the layout.

Looks stupid, is stupid, but works anyway. Qt is weird.
2023-04-05 19:08:30 +02:00
Michael Fabian 'Xaymar' Dirks 3187a165ba ui/obs-browser-widget: Allow directly modifying underlying widget 2023-04-05 19:08:30 +02:00
Michael Fabian 'Xaymar' Dirks d073889126 ui/obs-browser-widget: Prevent unwanted crashes or corruptions on Wayland
The obs-browser module does not work well on Wayland, so removing it there appears to be the best option for now.
2023-04-05 19:08:29 +02:00
Michael Fabian 'Xaymar' Dirks dadd56b31d ui/obs-browser-widget: Integrate OBS Browser Source as a Qt Widget
Provides us with an easy and clean way to use Browser Sources as a Qt enabled widget.
2023-04-05 19:08:29 +02:00
Michael Fabian 'Xaymar' Dirks 54859e9f14 util/library: Allow loading of obs_module_t
Allows us to pass an obs_module_t into util::library::load() for cleaner code. This requires an additional flag so we don't unload a module that is still in use by libOBS.
2023-04-05 19:08:29 +02:00
Michael Fabian 'Xaymar' Dirks 5a3954ae0e project: Fix License, License headers and Copyright information
Fixes several files incorrectly stated a different license from the actual project, as well as the copyright headers included in all files. This change has no effect on the licensing terms, it should clear up a bit of confusion by contributors. Plus the files get a bit smaller, and we have less duplicated information across the entire project.

Overall the project is GPLv2 if not built with Qt, and GPLv3 if it is built with Qt. There are no parts licensed under a different license, all have been adapted from other compatible licenses into GPLv2 or GPLv3.
2023-04-05 18:59:08 +02:00
Michael Fabian 'Xaymar' Dirks 7f3ab14128 cmake, code: Remove unused files
These files are not used, and serve no purpose.
2023-04-05 18:59:05 +02:00
Michael Fabian 'Xaymar' Dirks e8ec23c4d4 obs/source-tracker: Fix leaked source references
This functionality broke at some point in the past without anyone noticing, resulting in most dropdowns that rely on this functionality being blank.

Fixes #1025
2023-04-05 18:59:03 +02:00
tt2468 20e1a94eba util/threadpool: Initialize worker count to 0
Many platforms (and/or kernels) don't zero memory before it is acquired, resulting in uninitialized memory being used to store critical content. This made the threadpool assume it had an infinite number of threads to work with, despite actually having spawned none.

Fixes #1017
2023-04-05 18:59:03 +02:00
Michael Fabian 'Xaymar' Dirks ad422895fa updater: Compare all parts of the version number
This should fix the case where comparing '0.12.0b164' with '0.12.0a169' results in it claiming the former is newer. Also should fix the case where stable releases would always be treated as older.

Fixes #1015
2023-04-05 18:59:02 +02:00
Michael Fabian 'Xaymar' Dirks bc7f949c7b filter/blur: Don't increment your own reference count
Fixes #818
2023-04-05 18:58:57 +02:00
Michael Fabian 'Xaymar' Dirks 0f4f6d0485 gfx/source-texture: Don't use weak_source for strong references 2023-04-05 18:58:57 +02:00
Michael Fabian 'Xaymar' Dirks 7226fe7046 gfx/blur/box: Initialize streamfx::gfx::util 2023-04-05 18:58:56 +02:00
Michael Fabian 'Xaymar' Dirks 52afca38aa gfx/mipmapper: Move gs-mipmapper into proper directory
This is not an obs feature, so it shouldn't be in the obs directory.
2023-04-05 18:58:56 +02:00
Michael Fabian 'Xaymar' Dirks 8aa8745a3a gfx/util: Move draw_fullscreen_triangle here for consistency 2023-04-05 18:58:56 +02:00
Michael Fabian 'Xaymar' Dirks 9b8ef5ac74 gfx/util: Rename debug to util(ity)
They may be useful for debugging, but they are still utilities.
2023-04-05 18:58:55 +02:00
Michael Fabian 'Xaymar' Dirks 6f742da524 plugin: Only initialize GLAD on OpenGL graphics backend 2023-04-05 18:58:54 +02:00
Michael Fabian 'Xaymar' Dirks 2577622dbe filter/dynamic-mask: Replace rendering code and optimize storage
The rendering code here was one of the older code bases, which was riddled with bugs and leaks. The new code doesn't look pretty, but it works for the time being until a better solution is found or made. It should be able to handle HDR inputs now, but it may not be completely correct yet. This also fixes the double-free bug.

As an additional improvement, I've moved the allocation of the effect to a shared class which should reduce the memory usage slightly when multiple effects are in play. And now selecting nothing selects the filter target itself without infinitely adding references to the filter. Good enough in my eyes.

Fixes #819
2023-04-05 18:58:54 +02:00
Michael Fabian 'Xaymar' Dirks 5b978a20e0 obs/source-factory: Add support for color spaces 2023-04-05 18:58:54 +02:00
Michael Fabian 'Xaymar' Dirks 15eaec2e09 obs/gs/rendertarget: Add support for color spaces 2023-04-05 18:58:53 +02:00
Michael Fabian 'Xaymar' Dirks c0967e9252 encoder/ffmpeg: Remove usage of `avcodec_close`
This functionality has been deprecated by FFmpeg.
2023-04-05 18:58:53 +02:00
Michael Fabian 'Xaymar' Dirks 4236c28c58 ffmpeg/hwapi/d3d11: Only Release() the immediate ID3D11DeviceContext once
While this had no actual effect due to the immediate ID3D11DeviceContext being tied to the ID3D11Device itself, it shouldn't have occured at all. With this there should now only be a single Release() call for every AddRef() call.
2023-04-05 18:58:53 +02:00
Michael Fabian 'Xaymar' Dirks 0b23d28164 ffmpeg/hwapi/d3d11: Remove double unref 2023-04-05 18:58:52 +02:00
Michael Fabian 'Xaymar' Dirks 39dc1fa5e1 configuration: Save after some time has passed
Prevents data loss after 100ms have passed, which should improve the saving situation.

Fixes #805
2023-04-05 18:58:50 +02:00
Michael Fabian 'Xaymar' Dirks 589f6c4018 plugin: Finalize threadpool after configuration 2023-04-05 18:58:50 +02:00
Michael Fabian 'Xaymar' Dirks fddf21b8de util/threadpool: Optimize for dynamic thread pooling
While the previous approach of a static thread pool worked, it was sub-optimal in its resource usage. Many of the threads would never see a single task, and simply permanently sleep. This seems like a good idea, except that sleeping threads still end up in the scheduler, and thus waste a tiny amount of resources.

It is better to instead dynamically spawn threads when needed and only keeping the bare minimum around all the time. These dynamically spawned threads are also explicitly set to background priority which further reduces scheduling overhead. Finally optimizing the memory layout to prevent unwanted false sharing should also keep sporadic wake ups at a minimum.

This new model should be able to handle many more tasks than ever before, but is still not as optimal as it could be.
2023-04-05 18:58:49 +02:00
Michael Fabian 'Xaymar' Dirks a0d60e751b encoder/handler/dnxhd: Use endian-independent formats 2023-04-05 18:58:46 +02:00
Michael Fabian 'Xaymar' Dirks 50919e1a49 encoder/handler/prores_aw: Don't enable Key-Frame options 2023-04-05 18:58:46 +02:00
Michael Fabian 'Xaymar' Dirks b46e771a81 ffmpeg/tools: Add support for HDR formats
This allows for HDR formats to be encoded by FFmpeg encoders.
2023-04-05 18:58:46 +02:00
Michael Fabian 'Xaymar' Dirks 7296bbc16b encoder/ffmpeg: Improve software scaling quality
Might be better to allow end-users to choose swscale quality, if they deem it necessary.
2023-04-05 18:58:46 +02:00
Michael Fabian 'Xaymar' Dirks b55e4b283b encoder/ffmpeg: Add split framerate with integer fractions
It seems to be possible to encode with a different framerate than what libOBS is configured for. While technically any framerate appears to be possible, it is currently limited to integer fractions only in order to make the implementation much easier. Integer fractions only require skipping N frames and multiplying the denominator by N, where N is the configured integer. For sanity reasons, the limit of N is currently 10.

This allows power users to split their streaming and recording framerates with relative ease, and opt for things such as:
- 30 FPS (1/4) streaming with 120 FPS (1/1) recording.
- 30 FPS (1/10) streaming with 300 FPS (1/1) recording.
- 30 FPS (1/10) streaming with 100 FPS (1/3) recording.
- and so on.
While some of these combinations are just stupid, they are now available to power users.
2023-04-05 18:58:45 +02:00
Michael Fabian 'Xaymar' Dirks bbac990644 encoder/ffmpeg: Assume extra data and sei are present on first frame
While this may break some unusual encoders that require additional frames for extra data or sei data to be present, it fixes the problem where encoders would never record at all. May need to look into a different solution in the future.

Fixes #911
2023-04-05 18:58:45 +02:00
Michael Fabian 'Xaymar' Dirks 78e5c10a74 code: Fix GCC warning diagnostic pragmas 2023-04-05 18:58:41 +02:00
Michael Fabian 'Xaymar' Dirks 1c7350edf7 code: Fix initialization order for constructors
Prevents some out-of-order events from occurring.
2023-04-05 18:58:40 +02:00
Michael Fabian 'Xaymar' Dirks 08544b4116 cmake, code: Abuse pre-processor to disable/enable warnings 2023-04-05 18:58:39 +02:00
Michael Fabian 'Xaymar' Dirks 8e52bbf88b code: Ignore warnings from external code
May need to find a better solution such as disabling all warnings on third party code.
2023-04-05 18:58:38 +02:00
Michael Fabian 'Xaymar' Dirks 4e41c5cf24 code: Revert #836
The compiler will choose the optimal way automatically, and forcing std::move here actually results in two objects existing side by side, before being "moved" into one.
2023-04-05 18:58:38 +02:00
Michael Fabian 'Xaymar' Dirks b9d8583d58 code: (sn)printf automatically zero-terminates strings 2023-04-05 18:58:38 +02:00
Michael Fabian 'Xaymar' Dirks 24a19c2ed3 ffmpeg/tools: Revert #836
It is not valid to pass std::string_view to snprintf's %s.
2023-04-05 18:58:38 +02:00
Michael Fabian 'Xaymar' Dirks 0aca1fc132 code: Always provide a default case for enumerations 2023-04-05 18:58:37 +02:00
Michael Fabian 'Xaymar' Dirks badca28a08 updater: Don't pass unused variables into lambda captures 2023-04-05 18:58:37 +02:00
Michael Fabian 'Xaymar' Dirks 4fa26dd2d6 code: Always initialize or cast to correct type 2023-04-05 18:58:37 +02:00
Michael Fabian 'Xaymar' Dirks de703867e6 encoder/ffmpeg: Drop support for broken FFmpeg versions
This removes the Matroska fix for ProRes content, and upgrades from av_init_packet to av_packet_alloc.
2023-04-05 18:58:37 +02:00
Michael Fabian 'Xaymar' Dirks 0fe5c7e654 code: Don't use try-catch as function definition
This breaks MSVC and results in leaked exceptions.
2023-04-05 18:58:37 +02:00
Michael Fabian 'Xaymar' Dirks b5195c580c filter/displacement: Add missing deprecation notice 2023-04-05 18:58:35 +02:00
Michael Fabian 'Xaymar' Dirks 5ea8aa2acc encoders/handlers/amf: Add missing deprecation notice 2023-04-05 18:58:35 +02:00
Michael Fabian 'Xaymar' Dirks c150a1b0d7 encoders/aom-av1: Deprecate encoder 2023-04-05 18:58:35 +02:00
Michael Fabian 'Xaymar' Dirks 3883c4759c encoders/handlers/amf: Deprecate encoder 2023-04-05 18:58:34 +02:00
Michael Fabian 'Xaymar' Dirks fb09e98a5f gfx/shader/param-texture: Use obs::weak_source instead of obs::source 2023-04-05 18:58:33 +02:00
Michael Fabian 'Xaymar' Dirks 8f8b8839e5 obs/weak-source: Further optimization and modernization 2023-04-05 18:58:33 +02:00
Michael Fabian 'Xaymar' Dirks 808f5c63fb obs/gs/effect: Revert #836
The use of const references breaks '#include' for relative paths.
2023-04-05 18:58:32 +02:00
lainon 6e1566386e project: Apply more C++ paradigms to the code
- Use auto in places where code clarity is improved or identical.
- Replace trivial constructors and destructors with default.
- Use true random for random generation.
- Use std::string_view where it is valid to do so.
- Apply const where it is valid to do so.
- Use references where it is valid to do so.
- Manually optimize memory usage with std::move and std::copy.
- Opt for memory efficient containers where the size is known ahead of time.

Signed-off-by: lainon <GermanAizek@yandex.ru>
2023-04-05 18:58:32 +02:00
Michael Fabian 'Xaymar' Dirks cbddee5b90 nvidia: Assign to std::string_view& instead of swapping
For unknown reasons this results in an error only when the project is built within git-bash and with cmake. It does not occur with cmake-gui or VS itself.
2023-04-05 18:58:32 +02:00
Michael Fabian 'Xaymar' Dirks 16a52ca126 ui/updater: Include QActionGroup for Qt6 support
In some cases, this include is provided automatically when it shouldn't exist at all. The exact cause is unknown.
2023-04-05 18:58:32 +02:00
Michael Fabian 'Xaymar' Dirks 30134bd284 gfx/source-texture: Fix bad ref with Debug compiles 2023-04-05 18:58:30 +02:00
Michael Fabian 'Xaymar' Dirks a149531fb8 cmake: Upgrade version code to shared cmake-version module
This module handles parsing, generating, modifying and comparing of versions with pure CMake.
2023-04-05 18:58:28 +02:00
Michael Fabian 'Xaymar' Dirks e9283aec37 project: Add support for multi stage release cycles
To ensure better stability of future releases, we need to adopt multiple stages in the release cycle. As we already label Alpha, Beta, Candidate and Stable differently, simply adopting this classification system already does everything for us. This also allows us to maintain compatibility with the existing system, while offering something new entirely.
2023-04-05 18:58:27 +02:00
Michael Fabian 'Xaymar' Dirks ba15203c67 gfx/source-texture: Apply formatting as required by clang-format 14 2023-04-05 18:58:26 +02:00
Michael Fabian 'Xaymar' Dirks 8a31b986ab project: Update to new classes 2023-04-05 18:58:22 +02:00
Michael Fabian 'Xaymar' Dirks 3667426f49 obs/signal-handler: Update to new classes 2023-04-05 18:58:22 +02:00
Michael Fabian 'Xaymar' Dirks b108362ee1 gfx/source-texture: Update to new classes 2023-04-05 18:58:21 +02:00
Michael Fabian 'Xaymar' Dirks fc693e0210 obs/tools: Remove more legacy tools 2023-04-05 18:58:21 +02:00
Michael Fabian 'Xaymar' Dirks 39548e760d obs/tools: Replace scene_contains_source
As the recursion checking code is somewhat broken in libOBS, we need something to prevent accidental recursion from occurring. While the alternative fix is to simply make all of libOBS support recursion, unfortunately that endeavor would be too large for a single person to take on.
2023-04-05 18:58:21 +02:00
Michael Fabian 'Xaymar' Dirks e3c7b13d6f obs/source-factory: Add support for OBS Studio 27.x
Also improves the functionality logic slightly to be more in line with real behavior.
2023-04-05 18:58:21 +02:00
Michael Fabian 'Xaymar' Dirks 9bbc35b293 obs/source: Refactor old deprecated classes 2023-04-05 18:58:21 +02:00
Michael Fabian 'Xaymar' Dirks 6dd661a41c obs/source-tracker: Fix missing sources and modernize singleton design
In some rare cases, a bug is observed where some sources end up missing despite being visible in the OBS Studio UI. This is most likely related to us actually missing the events due to plugin load order. We can fix this by explicitly enumerating sources in the constructor.

Additionally in order to reduce the human error factor, we should avoid explicit initialize() and finalize() calls for our singleton. Instead the get() function should do all of the heavy lifting, including thread safety, so that the human writing the code will have next to no chances to break it.
2023-04-05 18:58:20 +02:00
Michael Fabian 'Xaymar' Dirks 0627628884 obs/tools: Remove work-around for obs_properties_remove_by_name
The bug fix to this was applied upstream, so we no longer need to support the broken behavior
2023-04-05 18:58:20 +02:00
Michael Fabian 'Xaymar' Dirks 98e2447ec8 common: Add macro to force inlining 2023-04-05 18:58:20 +02:00
carsten.braun 0540a18f27 encoders/ffmpeg/dnxhr: Add Avid DNxHR Encoder based on FFmpeg 2023-04-05 18:58:18 +02:00
Chris Pence f93d5c2202 encoder/ffmpeg: Remove legacy API usage (#783)
The build breaks if compiling against a newer version of ffmpeg which does not define the FF_API_NEXT macro and has fully removed the av_codec_next() API.
2023-04-05 18:58:18 +02:00
Michael Fabian 'Xaymar' Dirks 03b16786e7 encoders/ffmpeg/nvenc: Improve compatibility with FFmpeg
Replaces some very specific code with generic support for FFmpeg, which should last us much longer than the old way. Also improves the migration of settings, which wasn't quite working with the previous way.
2023-04-05 18:58:17 +02:00
Michael Fabian 'Xaymar' Dirks 378f2b3f0e ffmpeg/tools: Improve helper functions for AVOption lists 2023-04-05 18:58:17 +02:00
Michael Fabian 'Xaymar' Dirks 36aec3be54 encoders/ffmpeg/nvenc: Ensure compatibility with more than just FFmpeg 4.2
When FFmpeg Encoders was originally written, FFmpeg 4.2 was still new and OBS Studio did not seem to want to update to anything newer for a while. This led to code being fine-tuned for FFmpeg 4.2, which stops working the moment OBS Studio upgrades FFmpeg. This removes the dependency on FFmpeg 4.2 hopefully, and allows using newer FFmpeg versions - or perhaps even older versions.

Additionally the nonsensical behavior of the Target Quality slider was fixed. It is now from 0 to 51, instead of from 0 to 100, and as such matches FFmpeg exactly.
2023-04-05 18:58:17 +02:00
Michael Fabian 'Xaymar' Dirks 7f6047f43f ffmpeg/tools: Helpers for easily populating OBS property lists 2023-04-05 18:58:17 +02:00
Michael Fabian 'Xaymar' Dirks a32c2b1104 ui/about: Remove additional spacers
These just break the flow, with no visual improvement.
2023-04-05 18:51:55 +02:00
Michael Fabian 'Xaymar' Dirks b5cb3440f2 filters/autoframing: Always set projection matrix
Fixes #739
2023-04-05 18:51:55 +02:00
Michael Fabian 'Xaymar' Dirks decca6e906 ui/about: Use auto-generated credits for "About StreamFX"
As contributors and translators always increase in number and never decrease, it was getting difficult to thank everyone properly with every update. So instead of manually writing each entry we should take advantage of the power of automation and use APIs to gather this information properly. As long as the user is not actively hiding their profile, they will be thanked properly.

This also includes a potential fix for the problem with multi-lingual text in the About StreamFX window.
2023-04-05 18:51:54 +02:00
Michael Fabian 'Xaymar' Dirks d15e8d58da encoders/ffmpeg/nvenc: Fix new Reference Frames setting 2023-04-05 18:51:54 +02:00
Michael Fabian 'Xaymar' Dirks 2505b193c8 encoders/ffmpeg/nvenc: Allow OBS to detect or override bitrate
We won't allow OBS to override everything, just the bare minimum necessary for Replay Buffer, Dynamic Bitrate and generic Streaming.
2023-04-05 18:51:54 +02:00
Michael Fabian 'Xaymar' Dirks 567620a6ad encoders/ffmpeg/nvenc: Support reconfiguration during encoding 2023-04-05 18:51:53 +02:00
Michael Fabian 'Xaymar' Dirks 19689d1a11 encoders/ffmpeg: Add support for re-configuration of encoders 2023-04-05 18:51:53 +02:00
Michael Fabian 'Xaymar' Dirks 977716d679 encoders/ffmpeg/nvenc: Always set rc_max_rate if needed 2023-04-05 18:51:53 +02:00