pop-os / xdg-desktop-portal-cosmic

GNU General Public License v3.0
27 stars 22 forks source link

Testing / improvements for screencast portal #20

Closed ids1024 closed 5 months ago

ids1024 commented 5 months ago

I have an example that uses ashpd/gstreamer to get dmabufs from the pipewire stream. This could be expanded to take arguments to test different kinds of capture, using different GPUs, etc.

It works fine capturing an Intel output to a gstreamer waylandsink window, where Intel is the main_device. I can't seem to get vaapi or nvenc h264 encoding to work here (with different errors). When being careful to avoid copy to CPU.

Capturing the Nvidia output seems to fail here (xdg-desktop-portal cosmic is currently using dmabufs allocated with the main_device regardless of capture source). When I ran wayland-1-renderD129 xdg-desktop-portal-cosmic to capture with the Nvidia GPU, the compositor completely froze...

Anyway, this should be helpful for testing and improving xdg-desktop-portal-cosmic and cosmic-comp. I still need to test this with https://github.com/pop-os/cosmic-comp/pull/278. Though also, xdg-desktop-portal-cosmic (unlike cosmic-workspaces) isn't currently passing the node id to screencopy_session.attach_buffer.

ids1024 commented 5 months ago

The fixes here should improve behavior and performance with screen capture.