Skip to content

screen-cast/stream-src: Fix stride and max buffer size calculation

Robert Mader requested to merge rmader/mutter:issue6747 into main
  1. Centralize stride calculation in one function.
  2. For dmabufs query the stride instead of assuming a certain value.
  3. For system memory buffers use the pixel format to calculate the stride.
  4. Stop negotiating SPA_PARAM_BUFFERS_size and SPA_PARAM_BUFFERS_stride.
  5. Clean up variables, notably spa_data.

2 fixes an actual bug where we reported wrong max buffer sizes, resulting in crashes in Gstreamer when doing area screencasts on AMD GPUs.

The reasoning for 4. is that the values were possibly wrong for dmabufs as the negotiation happens before we create any buffers. Further more neither Mutter nor the common consumers required it. The later either ignore the values (OBS), always accept (gstpipewiresrc) them or calculate the exact same possibly wrong values (libwebrtc).

Closes: gnome-shell#6747 (closed)

Edited by Robert Mader

Merge request reports