19 FL_WARN(
"Starting format " << codecName);
21 fl::u32 start_time = millis();
26 fl::u32 diff_time = millis() - start_time;
28 FL_WARN(
"Format took " << diff_time <<
"ms to process " << codecName);
32 message <<
"Format: " << codecName <<
"\n";
38 message <<
"First 4 pixels: ";
39 for (
int i = 0; i < 4 && i <
numLeds; i++) {
40 message <<
"RGB(" << (int)
leds[i].r <<
"," << (
int)
leds[i].g <<
"," << (int)
leds[i].b <<
") ";
45 for (
int i = 0; i <
numLeds; i++) {
46 message <<
"LED " << i <<
": " <<
leds[i] <<
"\n";
54 Serial.println(
"\n=== Processing JPEG ===");
57 Serial.println(
"JPEG decoding not supported on this platform");
77 if (framePtr && framePtr->isValid()) {
81 Serial.print(
"Failed to decode JPEG: ");
88 Serial.println(
"\n=== Processing GIF ===");
91 Serial.println(
"GIF decoding not supported on this platform");
109 Serial.print(
"Failed to create GIF decoder: ");
116 stream->write(gifData);
119 if (!decoder->begin(stream)) {
121 decoder->hasError(&error);
122 Serial.print(
"Failed to begin GIF decoding: ");
131 fl::Frame frame = decoder->getCurrentFrame();
136 Serial.println(
"Invalid GIF frame received");
140 decoder->hasError(&error);
141 Serial.print(
"GIF frame decode error: ");
149 Serial.println(
"\n=== Processing MPEG1 ===");
152 Serial.println(
"MPEG1 decoding not supported on this platform");
172 Serial.print(
"Failed to create MPEG1 decoder: ");
179 stream->write(mpegData);
182 if (!decoder->begin(stream)) {
184 decoder->hasError(&error);
185 Serial.print(
"Failed to begin MPEG1 decoding: ");
194 fl::Frame frame = decoder->getCurrentFrame();
199 Serial.println(
"Invalid MPEG1 frame received");
203 decoder->hasError(&error);
204 Serial.print(
"MPEG1 frame decode error: ");
224 leds[ledIndex] = color;
235 int pixelIndex =
y * (int)frame.
getWidth() +
x;
238 if (pixelIndex < (
int)frame.
size()) {
239 return frame.
rgb()[pixelIndex];
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
fl::u16 getHeight() const
static IDecoderPtr createDecoder(const GifConfig &config, fl::string *error_message=nullptr)
static bool isSupported()
static bool decode(const JpegConfig &config, fl::span< const fl::u8 > data, Frame *frame, fl::string *error_message=nullptr)
static bool isSupported()
static bool isSupported()
static IDecoderPtr createDecoder(const Mpeg1Config &config, fl::string *error_message=nullptr)
const char * c_str() const FL_NOEXCEPT
string str() const FL_NOEXCEPT
fl::size size() const FL_NOEXCEPT
const size_t sampleJpegDataLength
const size_t sampleGifDataLength
const uint8_t sampleMpeg1Data[]
const uint8_t sampleJpegData[]
const uint8_t sampleGifData[]
const size_t sampleMpeg1DataLength
void displayFrameOnLEDs(const fl::Frame &frame)
CRGB getPixelFromFrame(const fl::Frame &frame, int x, int y)
void showDecodedMessage(const char *format)
void processCodecWithTiming(const char *codecName, fl::function< void()> codecFunc)
void * memcopy(void *dest, const void *src, size_t n) FL_NOEXCEPT
shared_ptr< T > make_shared(Args &&... args) FL_NOEXCEPT
third_party::Mpeg1Config Mpeg1Config
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>