emersion / xdg-desktop-portal-wlr

xdg-desktop-portal backend for wlroots
MIT License
598 stars 60 forks source link

screencast: memfd support #27

Open emersion opened 4 years ago

emersion commented 4 years ago

We may get y-inverted data from the compositor. We can avoid the memptr copy by using a negative stride, if the consumer supports it.

danshick commented 4 years ago

This should be easy enough to do (barring the buffer and format negotiation issues).

I wonder if any clients support that negative stride value today. A lot of code, that I've seen in clients (and that I've written FWIW), uses the stride interchangeably as a frame width for computing frame sizes, which leads me to believe stride is often misused.

We may want to wait until this is more well documented to get a better chance of finding supported clients.

emersion commented 4 years ago

Do clients get the chance to say they support only a positive stride? That would allow PipeWire to signal us when the client doesn't support the feature.

danshick commented 4 years ago

I think you could set a range in the metadata header as a client, but I'm not sure anyone does, and not specifying is an "allow any" when it comes to those headers (at least that's how it works for framerate).

In general, because pipewire is not 1.0 and the documentation needs improvement, we should expect a lot of consumer compatibility issues.

Totally unrelated, but take a look at this patch from Fedora for WebRTC. AFAICS, this was needed to support casts using newer functionalities, because WebRTC upstream is behind.

emersion commented 3 years ago

Note, we shouldn't get y-inverted buffers from wlroots anymore.

columbarius commented 1 year ago

Can we close this issue, or is the y-inverted/negative stride trick expected to be relevant? We require wl_output version 4, which should make us incompatible with older versions of wlroots anyway.