diff --git a/src/toplevel_export.rs b/src/toplevel_export.rs index 13f385f..44a1675 100644 --- a/src/toplevel_export.rs +++ b/src/toplevel_export.rs @@ -558,23 +558,10 @@ impl Dispatch for ExportState { } } -// ---- T10 follow-up note ---- -// -// The actual `gbm_bo_map` (import dmabuf → gbm_bo → map → read pixels → -// copy into a PNG-encoded buffer) is a documented follow-up. Wiring it -// in is one new dep (`gbm` + `drm-fourcc` + a DRM device handle) plus a -// ~50-line renderer that: -// 1. opens /dev/dri/renderD128, -// 2. creates a gbm_device, -// 3. imports the dmabuf fd (we have it from the `object` event), -// 4. gbm_bo_map(...) → *mut u8, -// 5. reads stride*height bytes, swizzles into the PNG writer above. -// -// Until then `write_synthetic_frame` produces the right-sized, format- -// labelled placeholder so callers can verify the wire path. - -/// Public stub: where the gbm_bo_map read belongs. Kept as a function -/// so the test below can assert its shape. +/// Read the plane-0 dmabuf as an RGBA8 byte buffer and write a PNG +/// of it to `dest`. This is the public entry point used by callers +/// that want the raw pixels (the live `capture_toplevel` path goes +/// through `write_pixels_via_gbm` instead). pub fn read_pixels_via_gbm(frame: &DmabufFrame, dest: &Path) -> anyhow::Result> { read_pixels_via_gbm_full(frame, dest) }