MCPcopy Create free account
hub / github.com/FastLED/FastLED / findBox

Function findBox

src/fl/codec/mp4_parser.cpp.hpp:32–42  ·  view source on GitHub ↗

Find a top-level box by type within a range. Returns offset of box start, or ~0 if not found.

Source from the content-addressed store, hash-verified

30
31// Find a top-level box by type within a range. Returns offset of box start, or ~0 if not found.
32fl::size findBox(fl::span<const fl::u8> data, fl::size start, fl::size end, const char* type) {
33 fl::size pos = start;
34 while (pos + 8 <= end) {
35 bool ok = true;
36 fl::u32 boxSize = readU32BE(data, pos, ok);
37 if (!ok || boxSize < 8) break;
38 if (boxIs(data, pos + 4, type)) return pos;
39 pos += boxSize;
40 }
41 return fl::size(-1); // not found
42}
43
44// Parse avcC (AVC Decoder Configuration Record) at given offset.
45// ISO 14496-15 section 5.2.4.1

Callers 1

parseMp4Function · 0.85

Calls 3

readU32BEFunction · 0.85
boxIsFunction · 0.85
sizeFunction · 0.50

Tested by

no test coverage detected