StreamFX: Status of the Spout/Sink Feature
Added 2024-06-10 11:08:08 +0000 UTCIn hindsight, I regret planning this feature. It's dug up quite a few pieces of code rot, where legacy code and the libOBS boundaries came to bite me, resulting in additional work that should have been done years ago. But now it's finally shaping up to be functionally equivalent to what Source Mirror has done for years - just super powered. Anyway, here's what's done and left to do:
What's already done:
Reimplemented render targets using borrowed/pooled textures instead of permanently allocated textures. This has the potential of reducing VRAM usage and optimizing the rendering flow for several effects significantly, making more effects possible on weaker GPUs.
Ringbuffer is now implemented as a generic variant and a Windows specialized variant. The Windows specialized variant abuses virtual memory to have the CPU handle the hard work of figuring out where writes actually went to. The generic variant still uses math based slicing of the written data, until I figure out a MacOS/Linux compatible version.
Audio Source/Sink is fully implemented with a possible delay of 1s with sample accuracy (in OBS Studio's samplerate). Using this you can clone audio at any step of a filter chain. This may open up more options later on when I get more into the audio side of effects and even implement the Audio Mix source.
What's left to do:
Optimize Ringbuffers for Unix-like platforms with the same functionality as the Windows variant. These are only used for audio, so right now low priority.
Implement Video/Effect Source/Sink fully with support for delay. Upper limit for delay here will likely be up to the end user, as you can only be frame accurate here.
And finally, make some tutorials on how to use this new feature.