19 size_t nFramesInBuffer)
78 return draw(now, frame->rgb());
85 i32 frames =
mStream->framesRemaining();
89 fl::u32 micros_per_frame =
91 return (frames * micros_per_frame);
100 now =
mTime->update(now);
105 if (!
mStream->isRgb8Playback()) {
114 FL_WARN(
"updateBufferIfNecessary failed");
131 i32 frames_remaining =
mStream->framesRemaining();
132 if (frames_remaining < 0) {
138 fl::u32 micros_per_frame =
140 fl::u32 millis_left =
141 (frames_remaining * micros_per_frame) / 1000;
175 FASTLED_ASSERT(
mTime,
"mTime is null");
184 fl::u32 currFrameNumber = 0;
185 fl::u32 nextFrameNumber = 0;
201 if (!has_current_frame) {
202 frame_numbers.
push_back(currFrameNumber);
205 if (capacity > 1 && !has_next_frame) {
206 frame_numbers.
push_back(nextFrameNumber);
209 for (
size_t i = 0; i < frame_numbers.
size(); ++i) {
210 FramePtr recycled_frame;
212 fl::u32 frame_to_erase = 0;
216 FL_WARN(
"get_oldest_frame_number failed");
220 if (!recycled_frame) {
221 FL_WARN(
"erase failed for frame: " << frame_to_erase);
225 fl::u32 frame_to_fetch = frame_numbers[i];
226 if (!recycled_frame) {
231 if (!
mStream->readFrame(recycled_frame.get())) {
239 if (!
mStream->readFrameAt(frame_to_fetch,
240 recycled_frame.get())) {
251 FL_WARN(
"We failed for some other reason");
265 fl::u32 currFrameNumber = 0;
266 fl::u32 nextFrameNumber = 0;
274 if (has_curr_frame && has_next_frame) {
284 frame_numbers.
push_back(currFrameNumber);
288 frame_numbers.
push_back(nextFrameNumber);
291 for (
size_t i = 0; i < frame_numbers.
size(); ++i) {
292 FramePtr recycled_frame;
294 fl::u32 frame_to_erase = 0;
300 FL_WARN(
"get_oldest_frame_number failed");
307 FL_WARN(
"get_newest_frame_number failed");
312 if (!recycled_frame) {
313 FL_WARN(
"erase failed for frame: " << frame_to_erase);
317 fl::u32 frame_to_fetch = frame_numbers[i];
318 if (!recycled_frame) {
324 if (!
mStream->readFrameAt(frame_to_fetch, recycled_frame.get())) {
336 if (!
mStream->readFrameAt(frame_to_fetch,
337 recycled_frame.get())) {
343 FL_WARN(
"We failed for some other reason");
359 const bool forward = now >= prev;
383 return mStream->hasEmbeddedScreenMap();
389 return mStream->embeddedScreenMapJson();
fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
void push_back(const T &value) FL_NO_EXCEPT
constexpr fl::size size() const FL_NO_EXCEPT
fl::u32 microsecondsPerFrame() const FL_NO_EXCEPT
bool full() const FL_NO_EXCEPT
bool hasEmbeddedScreenMap() const FL_NO_EXCEPT
float timeScale() const FL_NO_EXCEPT
VideoImpl(size_t pixelsPerFrame, float fpsVideo, size_t frameHistoryCount=0) FL_NO_EXCEPT
bool needsFrame(fl::u32 now) const FL_NO_EXCEPT
const fl::string & embeddedScreenMapJson() const FL_NO_EXCEPT
bool updateBufferFromStream(fl::u32 now) FL_NO_EXCEPT
void resume(fl::u32 now) FL_NO_EXCEPT
bool updateBufferIfNecessary(fl::u32 prev, fl::u32 now) FL_NO_EXCEPT
bool draw(fl::u32 now, fl::span< CRGB > leds) FL_NO_EXCEPT
bool videoColor(fled::VideoColor *out) const FL_NO_EXCEPT
bool pixelStorage(fled::PixelStorage *out) const FL_NO_EXCEPT
void pause(fl::u32 now) FL_NO_EXCEPT
bool begin(fl::filebuf_ptr h) FL_NO_EXCEPT
void setFade(fl::u32 fadeInTime, fl::u32 fadeOutTime) FL_NO_EXCEPT
~VideoImpl() FL_NO_EXCEPT
FrameInterpolatorPtr mFrameInterpolator
bool updateBufferFromFile(fl::u32 now, bool forward) FL_NO_EXCEPT
i32 durationMicros() const FL_NO_EXCEPT
void setTimeScale(float timeScale) FL_NO_EXCEPT
bool rewind() FL_NO_EXCEPT
size_t pixelsPerFrame() const FL_NO_EXCEPT
bool readSample(PixelSample *out) FL_NO_EXCEPT
Centralized logging categories for FastLED hardware interfaces and subsystems.
shared_ptr< T > make_shared(Args &&... args) FL_NO_EXCEPT
constexpr T && forward(typename remove_reference< T >::type &t) FL_NO_EXCEPT
constexpr common_type_t< T, U > max(T a, U b) FL_NO_EXCEPT
u8 u8 fract8 blur_amount FL_NO_EXCEPT
fl::u64 time() FL_NO_EXCEPT
Alias for millis64() - returns 64-bit millisecond time.
fl::shared_ptr< filebuf > filebuf_ptr
Base definition for an LED controller.
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>