Now you gather everything about one track into a single summary - its kind, codec, dimensions, and duration - by navigating the tree and reusing the parsers you built. This is the media-inspector view a user actually reads.
Build a TrackSummary from a trak subtree by combining hdlr, stsd, tkhd, and mdhd.
A track summary is the line an inspector prints per track: what kind of media it
is, which codec, how big, how long. Every piece already exists - you just have to
gather them. Use find to reach the handler (mdia/hdlr), the codec
(mdia/minf/stbl/stsd), the dimensions (tkhd, decoded through the 16.16
converter), and the timing (mdia/mdhd, divided into seconds).
The tkhd width and height are the two 16.16 fixed-point fields at the very
end of the track-header box, which is why you built the converter earlier. This
lesson is mostly wiring, but it is the wiring that turns a pile of parsed boxes into
something legible - and it is exactly what the capstone prints for every track in a
real file.
type TrackSummary struct {Type, Codec stringWidth, Height float64DurationSec float64}// use find() to reach tkhd, mdia/hdlr, mdia/mdhd, mdia/minf/stbl/stsd// then reuse each box's parser and fixed16() for the dimensionsfunc summarize(trak []Box) TrackSummary { /* fill in */ }