AugmendTech / CrabGrab

🦀 🖥️ 🦀
Apache License 2.0
153 stars 11 forks source link

Linux wayland support #38

Open MAlba124 opened 3 months ago

MAlba124 commented 3 months ago

This implements basic wayland screencapture.

TODO

OutOfTheVoid commented 3 months ago

This is looking awesome so far.

I think we may want to build an abstraction around whether window selection can happen application side vs window manager side, since the current interface isn't a 1:1 match with how it's done on xdg-desktop-portal, but that's still TBD.

I'm planning to also do a basic XCB based implementation which is more in line with the current API, but likely with lower performance. To that end, can you make the platform folder name represent the capturing backend as well? Something like linux-xdg-desktop-portal or linux-wayland.

Backend selection is probably another important abstraction we want to make for any case where there are multiple supported backends. For now, that's just a future plan for Linux.

MAlba124 commented 3 months ago

I have removed the option to render the cursor as metadata as there seems to be a lot of edge cases where it won't work, e.g. when I tested display capture + cursor as meta on plasma the cursor was already rendered on the frame when it was received. This whole functionality can be omitted by having a show_cursor flag in CaptureContentFilter. This is preferred as it greatly reduces the implementation complexity.

There's also a problem with the red and blue channels should be swapped for some pixel formats on some hardware. This seems to be a known problem and there's probably a way to identify these cases. I would have to look into how OBS-studio does it.

MAlba124 commented 1 month ago

Hey! Is this project sunset?