Open embedded-creations opened 5 years ago
if anyone needs this it's in my fork: https://github.com/marcmerlin/AnimatedGIFs
I'm not sure where this stands after updating GifDecoder to use the AnimatedGIF library, so I'm going to close it
if it still uses arrays instead of mallocs, the problem isn't fixed. arrays get alloced early in a smaller pool in ESP32, and just don't fit on a decent size display, but they fit if you use malloc because that goes into another pool (yeah, ESP32 sucks in that way)
OK, thanks for the clarification, I'll reopen it.
I think this shows how to allocate the block needed for AnimatedGIF with malloc (after allocating mymemorypool with malloc):
https://github.com/bitbank2/AnimatedGIF/issues/8#issuecomment-676480432
I'm only seeing the use of a single static array. If so, that is not as good as malloc as ESP32 has memory available at runtime with malloc but not available in pre-allocated buffers (global arrays). Also, to use psram if you choose to, you have to use malloc.
This is what I did to my old fork of the library, I switched everything to malloc. Sorry, this is not a single CL, I wrote it over time
I later updated mallocordie to allow allocating in PSRAM to further save main memory
Thanks for the links, I'm not working on this now, but they look useful for later
https://github.com/pixelmatix/AnimatedGIFs/issues/26