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

◆ readFrameAt()

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

Definition at line 143 of file pixel_stream.cpp.hpp.

143 {
144 if (mType == kStreaming) {
145 // Streaming handle doesn't support seeking
146 FL_DBG("Streaming handle doesn't support seeking");
147 return false;
148 }
149 fl::size_t frameBytes = static_cast<fl::size_t>(frameNumber)
150 * static_cast<fl::size_t>(mbytesPerFrame);
151 mHandle->seek(mPayloadOffset + frameBytes);
152 if (mHandle->bytesLeft() == 0) {
153 return false;
154 }
155 size_t read =
156 mHandle->readRGB8(frame->rgb()) * 3;
157
158 bool ok = int(read) == mbytesPerFrame;
159 if (!ok) {
160 DBG("readFrameAt failed - read: "
161 << read << ", mbytesPerFrame: " << mbytesPerFrame << ", frame:"
162 << frameNumber << ", left: " << mHandle->bytesLeft());
163 }
164 return ok;
165}
fl::filebuf_ptr mHandle
#define FL_DBG
Definition log.h:388
__SIZE_TYPE__ size_t
Definition s16x16x4.h:16
int read()
#define DBG
Definition time.cpp.hpp:7

References DBG, FL_DBG, kStreaming, mbytesPerFrame, mHandle, mPayloadOffset, mType, fl::read(), and fl::Frame::rgb().

+ Here is the call graph for this function: