FastLED 3.10.6
Loading...
Searching...
No Matches
mp3_memory.h
Go to the documentation of this file.
1#pragma once
2
3#include "fl/stl/allocator.h"
5#include "fl/stl/noexcept.h"
6#include "fl/stl/stdint.h"
7
8namespace fl {
9namespace third_party {
10
11// Internal codec-allocation contract. These declarations are visible through
12// mp3.h only because decoder private storage contains typed deleters. They are
13// not a consumer allocation API and may change with the decoder backends.
14constexpr fl::size MP3_MINIMP3_STREAM_BUFFER_SIZE = 4096;
15
23
25
26#if defined(FASTLED_TESTING)
27class Mp3MemoryHook {
28public:
29 virtual ~Mp3MemoryHook() FL_NO_EXCEPT;
30 virtual bool allowAllocate(fl::size, Mp3MemoryTag) FL_NO_EXCEPT;
31 virtual void onAllocate(void* ptr, fl::size bytes,
32 Mp3MemoryTag tag) FL_NO_EXCEPT = 0;
33 virtual void onFree(void* ptr, fl::size bytes,
34 Mp3MemoryTag tag) FL_NO_EXCEPT = 0;
35};
36
37void SetMp3MemoryHook(Mp3MemoryHook* hook) FL_NO_EXCEPT;
38void ClearMp3MemoryHook() FL_NO_EXCEPT;
39#endif
40
42 fl::size bytes, Mp3MemoryTag tag) FL_NO_EXCEPT;
43void Mp3MemoryFree(void* ptr, fl::size bytes,
45
46template <typename T>
47T* Mp3MemoryAllocateArray(fl::size count,
49
50template <typename T>
53 Mp3MemoryDeleter(fl::size bytes, Mp3MemoryTag tag) FL_NO_EXCEPT;
54
55 void operator()(T* ptr) const FL_NO_EXCEPT;
56
57 fl::size mBytes;
59};
60
61} // namespace third_party
62} // namespace fl
#define FL_NO_INLINE
const char * Mp3MemoryTagName(Mp3MemoryTag tag) FL_NO_EXCEPT
Definition mp3.cpp.hpp:47
T * Mp3MemoryAllocateArray(fl::size count, Mp3MemoryTag tag) FL_NO_EXCEPT
Definition mp3.cpp.hpp:16
constexpr fl::size MP3_MINIMP3_STREAM_BUFFER_SIZE
Definition mp3_memory.h:14
FL_NO_INLINE void * Mp3MemoryAllocate(fl::size bytes, Mp3MemoryTag tag) FL_NO_EXCEPT
Definition mp3.cpp.hpp:80
void Mp3MemoryFree(void *ptr, fl::size bytes, Mp3MemoryTag tag) FL_NO_EXCEPT
Definition mp3.cpp.hpp:98
unsigned char u8
Definition stdint.h:131
InputGamut g FL_NO_EXCEPT
Definition rgbw.h:121
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NO_EXCEPT
void operator()(T *ptr) const FL_NO_EXCEPT
Definition mp3.cpp.hpp:31