diff options
Diffstat (limited to 'tools/guest-diag/xgrab.c')
| -rw-r--r-- | tools/guest-diag/xgrab.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/guest-diag/xgrab.c b/tools/guest-diag/xgrab.c index eb605d6..bca23c0 100644 --- a/tools/guest-diag/xgrab.c +++ b/tools/guest-diag/xgrab.c @@ -3,8 +3,9 @@ // Pure client-side XGetImage on a software X server (Xvfb): no GL, no driver, // no present-path hooks. Same record format as sdl_cap.c: // [0] 8B "GZCAPV01" + zero pad to 4096 -// [4096..] records: 4B "GZF2" | u32 w | u32 h | u32 stride | u32 bpp | +// [4096..] records: 4B "GZF2" | u32 w | u32 h | u32 stride | u32 fmt | // u64 ts_ns | u64 seq | stride*h bytes (top-down BGRA) +// fmt is a pixel-order tag: 33 = BGRA8 (ZPixmap on little-endian X). // Trailing record seq=0xFFFFFFFFFFFFFFFF on clean stop. // Usage: xgrab <display> <out> <maxframes|0> <pace_us|0> #include <X11/Xlib.h> @@ -83,7 +84,7 @@ int main(int argc, char **argv) rh[0] = (uint32_t)r_w; rh[1] = (uint32_t)r_h; rh[2] = (uint32_t)r_w * 4; - rh[3] = 32; + rh[3] = 33; /* GZF2 pixel-order tag: BGRA8 */ fwrite(m, 1, 4, f); fwrite(rh, 4, 4, f); fwrite(&tns, 8, 1, f); |
