Full-motion zero-copy screen capture in Weston

Hoosier, Matt Matt.Hoosier at garmin.com
Tue May 28 15:53:23 UTC 2024


Hi Marius,

Okay, I guess that answers the bit about needing to screen-scrape to get content into Pipewire now.

But I'm still a little unclear about a couple things, if I were to try to build on this PW backend as a starting point:

First, it looks to me like when you use the PW backend to Weston, that becomes your display. That is, rendering directly targets it. I was hoping for a way to get it to broadcast the very same framebuffer(s) that are getting scanned out for the current frame by the DRM backend.

Second, I'm don't see the path to getting this to leverage the DRM_MODE_CONNECTOR_WRITEBACK hardware (like the weston_screen_recorder does).  I think that any layering would be forced to be offloaded to the GPU ahead of time. Maybe I missed some implication of what you were pointing out here?

> -----Original Message-----
> From: Marius Vlad <marius.vlad at collabora.com>
> Sent: Saturday, May 25, 2024 6:12 AM
> To: Hoosier, Matt <Matt.Hoosier at garmin.com>
> Cc: wayland-devel at lists.freedesktop.org
> Subject: Re: Full-motion zero-copy screen capture in Weston
> 
> On Fri, May 24, 2024 at 09:43:58PM +0000, Hoosier, Matt wrote:
> > Hi,
> >
> > I'm interested in finding or contributing some mechanism to get sort of the
> same effect as a cross between:
> >
> >
> >   *
> > weston_output_capture's support for using the
> > DRM_MODE_CONNECTOR_WRITEBACK connectors, and
> >
> >   *
> > the streamed orientation of weston_screen_recorder, and
> >
> >   *
> > no forced reliance on the GPU to pre-blend the 2D scene – whatever
> > plane blending would otherwise have occurred must still occur when the
> > screen recording mechanism is active
> >
> > The desktop environments' compositors implement the XDG screencast
> portal. If I read things correctly, that one deposits the stream of dmabuf frame
> fds into the Pipewire stream indicated by the user invoking the D-Bus
> Screencast API.
> >
> > That doesn't really seem like a starter for doing this in Weston.
> > There was conversation back in 2019 about trying to add zero-copy
> > dmabuf support in Weston's own Pipewire integration, but I think that
> > didn't happen?
> https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1366
> >
> > Alternately, I see that the remoting plugin on today's main branch supports
> GStreamer dmabuf allocators. Does this mean that I could build something
> using a virtual weston_output in the drm-backend?
> >
> > Cheers,
> > Matt


More information about the wayland-devel mailing list