FastLED 3.9.15
Loading...
Searching...
No Matches

◆ findBox()

fl::size fl::anonymous_namespace{mp4_parser.cpp.hpp}::findBox ( fl::span< const fl::u8 > data,
fl::size start,
fl::size end,
const char * type )

Definition at line 32 of file mp4_parser.cpp.hpp.

32 {
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}
uint8_t pos
Definition Blur.ino:11
fl::u32 readU32BE(fl::span< const fl::u8 > data, fl::size offset, bool &ok)
bool boxIs(fl::span< const fl::u8 > data, fl::size offset, const char *type)
constexpr T * end(T(&array)[N]) FL_NOEXCEPT

References boxIs(), fl::end(), findBox(), pos, and readU32BE().

Referenced by findBox().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: