A head screenshot during a stream returns black plus the floating menu button.
Measured 2026-11-09: a 92 KB JPEG, entirely black, while the operator at the
iPad could see the game.
AppState.captureAndUploadScreenshot uses window.drawHierarchy(in:afterScreenUpdates:).
The video is in an AVSampleBufferDisplayLayer (VideoDecoderRenderer.m:44,
added as a sublayer at line 70). drawHierarchy and CALayer.render(in:) walk
the Core Animation tree the application owns. The render server composites that
layer, so neither call can read it, and the result is the layer's own black
backgroundColor set at line 45. No flag changes this. The menu button
survives because it is an ordinary UIButton, so a black image with one button
is proof the interface half of the capture path is correct.
There is no decoded pixel buffer to tap. submitDecodeBuffer: builds a
CMSampleBuffer holding compressed H.264 access units and hands it to
enqueueSampleBuffer:. The layer decodes internally and never returns the
pixels. Any head side capture must decode a second time with a session this
application owns.
submitDecodeBuffer: runs on the MAIN thread. Connection.m:517 sets
CAPABILITY_PULL_RENDERER, so the renderer owns the frame loop through a
CADisplayLink on the main run loop (VideoDecoderRenderer.m:105). The hazard
is therefore not a data race but the display link budget, 16.6 ms at 60 frames
per second, with frame pacing on. Slow work there drops frames in front of a
visitor.
AVSampleBufferDisplayLayer has no public readback. copyDisplayedPixelBufferOn request, call LiRequestIdrFrame(), which setHdrMode: already calls, so it
is a known safe event. When the next FRAME_TYPE_IDR reaches
submitDecodeBuffer:, retain that sample buffer and hand it to a private serial
queue, which creates a VTDecompressionSession, decodes the one self contained
frame, converts it and encodes JPEG. Steady state cost is one boolean test per
frame. Peak memory about 12 MB for a few tens of milliseconds.
Draw the frame into a window shaped canvas at the display layer's rectangle on
the letterbox background, rather than returning a bare video frame. A bare frame
hides the head's orientation and letterboxing, which are two of the faults this
lane exists to catch.
This is not the way to operate a head remotely. The body already captures
its own desktop and that lane is cheaper, serves every head type, and works when
the head is asleep or absent. See #1161 and #1160.
The justification for this issue is the roughly 45 unwalked testbook steps
across #1150, #1151, #1153 and #1154 that ask what the person in front of the
iPad sees. No body capture can answer any of them:
submitDecodeBuffer:, the hot loop of the only feature thatEstimate about 270 lines in the submodule plus about 70 in the app, one focused
day plus a walk on real hardware. The new file pair needs six
project.pbxproj entries, not four, because there are two files.
Full design note including the thread ownership table, memory figures, the HDR
path when HEVC is re-enabled, and sources was produced on 2026-11-09.