Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Linux wayland support #38

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

MAlba124
Copy link

@MAlba124 MAlba124 commented Jul 23, 2024

This implements basic wayland screencapture.

TODO

  • Select sources
  • Negotiate frame format
  • Receive video frames
  • Bitmap
  • Send the video frames to the user
  • Detect stalling when format negotiation fails
  • GPU

@OutOfTheVoid
Copy link
Contributor

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.

Callback for state_changed event so that stream errors and
unconnected events can be handled and notify consumer(s)
+ treat virtual sources as display
@MAlba124
Copy link
Author

MAlba124 commented Aug 1, 2024

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 MAlba124 marked this pull request as ready for review August 12, 2024 13:32
@MAlba124
Copy link
Author

MAlba124 commented Sep 6, 2024

Hey! Is this project sunset?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants