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

Function readU32BE

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

Read a big-endian uint32 from a byte span at offset. Returns 0 and sets ok=false if out of bounds.

Source from the content-addressed store, hash-verified

7// Read a big-endian uint32 from a byte span at offset.
8// Returns 0 and sets ok=false if out of bounds.
9inline fl::u32 readU32BE(fl::span<const fl::u8> data, fl::size offset, bool& ok) {
10 if (offset + 4 > data.size()) { ok = false; return 0; }
11 return (fl::u32(data[offset]) << 24) |
12 (fl::u32(data[offset + 1]) << 16) |
13 (fl::u32(data[offset + 2]) << 8) |
14 fl::u32(data[offset + 3]);
15}
16
17inline fl::u16 readU16BE(fl::span<const fl::u8> data, fl::size offset, bool& ok) {
18 if (offset + 2 > data.size()) { ok = false; return 0; }

Callers 3

findBoxFunction · 0.85
parseMp4Function · 0.85
extractH264NalUnitsFunction · 0.85

Calls 2

u32Enum · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected