[GH-ISSUE #3] Add support for zero-copy pipeline #3

Closed
opened 2026-10-15 12:47:16 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @ABeltramo on GitHub (Jun 22, 2024).
Original GitHub issue: https://github.com/games-on-whales/gst-wayland-display/issues/3

In our pipeline we are currently doing one unnecessary GPU -> CPU copy in order to expose our raw frame buffer as a
gstreamer buffer. The rationale behind it is explained in
the docs.
This will cause some overhead that will eventually be a bottleneck when going with high resolutions and frame rates (on
Discord it has been reported that the current pipeline can't handle 1080p when going over 200 fps).

There are at least two ways to achieve this in Gstreamer:

  • OpenGL: exposing the buffer as
    a GstGLBuffer, design docs
    • We'll have to share the OpenGL context between our comp and the Gstreamer pipeline.
    • I guess worst case this will end up doing GPU->GPU copy?
  • DMA-BUF: exposing the buffer as a GstBuffer backed by
    a dmabuf, design docs
    • Cuda doesn't seem to support this directly, (vaapi should) it should be possible to import DMABuf
      using glupload -> cudaupload.
    • I guess worst case this will end up doing GPU->GPU copy?

This needs more research...

Originally created by @ABeltramo on GitHub (Jun 22, 2024). Original GitHub issue: https://github.com/games-on-whales/gst-wayland-display/issues/3 In our pipeline we are currently doing one unnecessary GPU -> CPU copy in order to expose our raw frame buffer as a gstreamer buffer. The rationale behind it is explained in the [docs](https://games-on-whales.github.io/wolf/stable/dev/wayland.html#_gstreamer). This will cause some overhead that will eventually be a bottleneck when going with high resolutions and frame rates (on Discord it has been reported that the current pipeline can't handle 1080p when going over **200 fps**). There are at least two ways to achieve this in Gstreamer: - **OpenGL**: exposing the buffer as a `GstGLBuffer`, [design docs](https://gstreamer.freedesktop.org/documentation/additional/design/opengl.html) - We'll have to share the OpenGL context between our comp and the Gstreamer pipeline. - I guess worst case this will end up doing GPU->GPU copy? - **DMA-BUF**: exposing the buffer as a `GstBuffer` backed by a `dmabuf`, [design docs](https://gstreamer.freedesktop.org/documentation/additional/design/dmabuf.html) - Cuda doesn't seem to support this directly, (`vaapi` should) it should be possible to import `DMABuf` using `glupload -> cudaupload`. - I guess worst case this will end up doing GPU->GPU copy? This needs more research... ## Useful links - https://github.com/cmeissl/gst-wlr-screencopy-src/tree/main/src - https://github.com/cmeissl/gst_gl_test/blob/main/src/main.rs
bsakaguchi 2026-10-15 12:47:16 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/gst-wayland-display#3
No description provided.