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

◆ readFrameAt()

bool fl::PixelStream::readFrameAt ( uint32_t frameNumber,
Frame * frame )

Definition at line 99 of file pixel_stream.cpp.

99 {
100 // DBG("read frame at " << frameNumber);
101 if (mUsingByteStream) {
102 // ByteStream doesn't support seeking
103 FASTLED_DBG("ByteStream doesn't support seeking");
104 return false;
105 } else {
106 // DBG("mbytesPerFrame: " << mbytesPerFrame);
107 mFileHandle->seek(frameNumber * mbytesPerFrame);
108 if (mFileHandle->bytesLeft() == 0) {
109 return false;
110 }
111 size_t read =
112 mFileHandle->readCRGB(frame->rgb(), mbytesPerFrame / 3) * 3;
113 // DBG("read: " << read);
114 // DBG("pos: " << mFileHandle->Position());
115
116 bool ok = int(read) == mbytesPerFrame;
117 if (!ok) {
118 DBG("readFrameAt failed - read: "
119 << read << ", mbytesPerFrame: " << mbytesPerFrame << ", frame:"
120 << frameNumber << ", left: " << mFileHandle->bytesLeft());
121 }
122 return ok;
123 }
124}
int32_t mbytesPerFrame
fl::FileHandlePtr mFileHandle
#define FASTLED_DBG(X)
Definition dbg.h:57
#define DBG
Definition time.cpp:8

References DBG, FASTLED_DBG, mbytesPerFrame, mFileHandle, mUsingByteStream, and fl::Frame::rgb().

+ Here is the call graph for this function: