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

◆ readFrameAt()

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

Definition at line 101 of file pixel_stream.cpp.

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