|
| Config | defaultConfig () |
| | Create a default configuration with reasonable defaults.
|
| |
| | H264Decoder (Stream &input_stream) |
| | Constructor with input stream.
|
| |
| | H264Decoder () |
| | Default constructor (no input stream)
|
| |
| | ~H264Decoder () |
| | Destructor.
|
| |
| void | setInputStream (Stream *input_stream) |
| | Set input stream for H.264 data.
|
| |
| bool | begin (Config cfg) |
| | Initialize H.264 decoder and allocate buffers.
|
| |
| bool | processStream () |
| | Process H.264 data from configured input stream.
|
| |
| bool | decode (const uint8_t *h264_data, size_t h264_len) |
| | Decode H.264 data from buffer.
|
| |
| bool | hasFrame () const |
| | Check if a decoded frame is available.
|
| |
| bool | getFrame (uint8_t *dst, size_t dst_len, uint32_t &width, uint32_t &height) |
| | Retrieve decoded frame data.
|
| |
| uint32_t | getFrameCount () const |
| | Get total number of successfully decoded frames.
|
| |
| uint32_t | getDecodeErrors () const |
| | Get total number of decode errors.
|
| |
| bool | getFrameDimensions (uint32_t &width, uint32_t &height) const |
| | Get current frame dimensions.
|
| |
| void | end () |
| | Cleanup and release decoder resources.
|
| |
template<typename Alloc = H264_DEFAULT_ALLOCATOR>
class esp_h264::H264Decoder< Alloc >
Template class for decoding H.264 streams to raw video frames.
H264Decoder is a lightweight, header-only class that wraps H.264 decoder initialization, stream processing, and output format conversions (I420 → RGB565/other formats).
The class is templated on an allocator type to allow customization of memory allocation strategy (e.g., PSRAM vs regular heap).
- Template Parameters
-
- Note
- This class intentionally keeps implementation in the header for easy integration into Arduino sketches without separate .cpp files
-
The decoder supports constrained baseline H.264 profile
-
Requires ESP32 with sufficient memory for frame buffers
Example usage:
#include <WiFiUdp.h>
WiFiUDP udp;
void setup() {
auto cfg = decoder.defaultConfig();
tft.drawFrame(frame, w, h);
};
udp.begin(5000);
if (!decoder.begin(cfg)) {
Serial.println("Failed to start decoder");
}
}
void loop() {
decoder.processStream();
}
ESP32-S3 H.264 Decoder with Stream Input Support.
Template class for decoding H.264 streams to raw video frames.
Definition: H264Decoder.h:78
esp_h264_raw_format_t
This is an unencoded data format.
Definition: esp_h264_types.h:55
@ ESP_H264_RAW_FMT_RGB565_LE
Definition: esp_h264_types.h:57