Internal HDMI capture cards are barely supported, there are some professional brands like blackmagic that have support but nearly all consumer grade capture cards are not supported at all, because the companies who make them don’t care about Linux.
USB based capture cards often work because they use the same standard protocols as USB cameras.
There already is a API for this with ebpf for Windows and it is the same API that can be used on Linux (because it originates from Linux).
https://microsoft.github.io/ebpf-for-windows/
EBPF still runs in Kernel space but in a much more limited and confined way.