4#include "H264Decoder.h"
5#include "H264Encoder.h"
54template <
typename Alloc = H264_DEFAULT_ALLOCATOR>
59 config_.output_format = ESP_H264_RAW_FMT_RGB565_LE;
71 config_.input_buffer_size = 64 * 1024;
72 config_.output_buffer_size = 100 * 1024;
73 config_.frame_callback = [
this](
const uint8_t *frame, uint32_t w,
74 uint32_t h, esp_h264_raw_format_t fmt) {
76 size_t bytes = (size_t)(w * h * ESP_H264_GET_BPP_BY_PIC_TYPE(fmt));
105 config_.output_format = ESP_H264_RAW_FMT_RGB565_LE;
108 config_.output_format = ESP_H264_RAW_FMT_I420;
111 LOGW(
"H264DecoderESP32S3: unsupported VideoFormat %d", (
int)format);
125 uint32_t w = 0, h = 0;
126 if (
decoder_.getFrameDimensions(w, h)) {
127 info.
width = (uint16_t)w;
128 info.
height = (uint16_t)h;
159 size_t write(
const uint8_t *data,
size_t len)
override {
183 typename esp_h264::H264Decoder<Alloc>::Config
config_;
216template <
typename Alloc = H264_DEFAULT_ALLOCATOR>
231 size_t write(
const uint8_t *data,
size_t len)
override {
277 LOGW(
"H264EncoderESP32S3: unsupported VideoFormat %d", (
int)format);
336 size_t write(
const uint8_t *data,
size_t len)
override {
362 typename esp_h264::H264Encoder<Alloc>::Config
config_;
#define LOGW(...)
Definition AudioLoggerIDF.h:29
virtual size_t write(const uint8_t *data, size_t len)
Definition Arduino.h:120
VideoFormat
Video codec/pixel-format identifier, shared by two unrelated uses: the (single) video stream of a con...
Definition VideoOutput.h:29
bool isH264KeyFrame(const uint8_t *data, size_t len)
True if the given Annex-B H.264 access unit contains an IDR slice NAL unit (nal_unit_type 5) - the re...
Definition Video.h:52