decode_stream
decode_stream(
self ,
resource ,
meta: ParsedMeta ,
windows: collections.abc.Sequence[tuple[tuple[int | None[int, None], int | None[int, None]], <class ’slice, None]] = (),
)
Fill the requested array window packet by packet from the stream.
Bounded reads visit all headers and META records, but discard or seek past sample payloads outside the window. Only selected payloads are decoded and validated; cross-packet header validation still covers the whole file.
The endpoint shortcut already established the shape, so samples go straight to their final home and each decoded packet is released at once; holding every packet and the output array, as the generic path must, costs roughly twice the patch.
Headers are copied into fresh messages before the packet is dropped. Clearing the samples in place would not do: protobuf releases an arena only when the whole message dies, so a cleared packet still owns the space its samples occupied. The copies go to from_parsed at the end, so full cross-packet validation still runs and supplies the coords and attrs returned.