42 if (
mHandle->size() >= kFledHeaderBytes) {
43 char hdr[kFledHeaderBytes];
45 bool isFled = got == kFledHeaderBytes
46 &&
static_cast<fl::u8>(hdr[0]) == kFledMagic[0]
47 &&
static_cast<fl::u8>(hdr[1]) == kFledMagic[1]
48 &&
static_cast<fl::u8>(hdr[2]) == kFledMagic[2]
49 &&
static_cast<fl::u8>(hdr[3]) == kFledMagic[3]
50 &&
static_cast<fl::u8>(hdr[4]) == kFledVersionV1
51 &&
static_cast<fl::u8>(hdr[5]) == kFledPixelFormatRgb8;
53 const fl::u32 jsonLen =
54 static_cast<fl::u32
>(
static_cast<fl::u8>(hdr[8]))
55 | (
static_cast<fl::u32
>(
static_cast<fl::u8>(hdr[9])) << 8)
56 | (
static_cast<fl::u32
>(
static_cast<fl::u8>(hdr[10])) << 16)
57 | (
static_cast<fl::u32
>(
static_cast<fl::u8>(hdr[11])) << 24);
64 const bool jsonInRange = jsonLenSz <= kFledMaxJsonBytes
65 && jsonLenSz <= fileSize - kFledHeaderBytes;
71 if (jr == jsonLenSz) {
131 DBG(
"Not implemented and therefore always returns true");
140 return target < total_bytes;
146 FL_DBG(
"Streaming handle doesn't support seeking");
152 if (
mHandle->bytesLeft() == 0) {
160 DBG(
"readFrameAt failed - read: "
162 << frameNumber <<
", left: " <<
mHandle->bytesLeft());
171 if (bytes_left <= 0) {
223 while (bytesRead < len && mHandle->
available(len)) {
224 if (
mHandle->read(dst + bytesRead, 1)) {
231 while (bytesRead < len && mHandle->
available()) {
232 if (
mHandle->read(dst + bytesRead, 1)) {
fl::Video video(NUM_LEDS, 2.0f)
PixelStream(int bytes_per_frame)
virtual ~PixelStream() FL_NOEXCEPT
bool begin(fl::filebuf_ptr h)
i32 bytesRemaining() const
i32 framesDisplayed() const
fl::size_t mPayloadOffset
bool hasEmbeddedScreenMap() const FL_NOEXCEPT
bool hasFrame(fl::u32 frameNumber)
const fl::string & embeddedScreenMapJson() const FL_NOEXCEPT
i32 framesRemaining() const
bool readFrameAt(fl::u32 frameNumber, Frame *frame)
i32 bytesRemainingInFrame() const
size_t readBytes(u8 *dst, size_t len)
bool readFrame(Frame *frame)
bool readPixel(CRGB *dst)
fl::string mEmbeddedScreenMapJson
Centralized logging categories for FastLED hardware interfaces and subsystems.
constexpr fl::u8 kFledVersionV1
constexpr fl::u8 kFledPixelFormatRgb8
constexpr fl::u8 kFledMagic[4]
constexpr fl::size_t kFledMaxJsonBytes
constexpr fl::size_t kFledHeaderBytes
fl::shared_ptr< filebuf > filebuf_ptr
Base definition for an LED controller.
Representation of an 8-bit RGB pixel (Red, Green, Blue)
static constexpr T max() FL_NOEXCEPT