src.nth.io/

summaryrefslogtreecommitdiff
path: root/main/jpeg_decoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'main/jpeg_decoder.h')
-rw-r--r--main/jpeg_decoder.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/main/jpeg_decoder.h b/main/jpeg_decoder.h
index 2ac436d..e8a8504 100644
--- a/main/jpeg_decoder.h
+++ b/main/jpeg_decoder.h
@@ -23,12 +23,17 @@ void jpeg_decoder_unlock(void);
// JPEG_DECODER_MAX_INPUT_BYTES. Caller fills before calling decode.
void *jpeg_decoder_input_buffer(void);
-// Decode the JPEG sitting in the input buffer. Fills out_bgr888 with a
-// pointer to the decoded 24-bit image (3 bytes/pixel, BGR memory order so
-// the DSI engine + TC358762 + Pi panel render channels correctly) and
-// reports the image's width/height in pixels. The output buffer is owned
-// by the decoder — valid only until the next jpeg_decoder_unlock().
-esp_err_t jpeg_decoder_decode(size_t jpeg_len,
- void **out_bgr888,
+// Decode the JPEG sitting in the input buffer into the caller-provided
+// out_buf (must be at least out_cap bytes, ≥ 800*480*3 for a full
+// panel-sized frame). Bytes land in BGR memory order so the DSI engine
+// + TC358762 + Pi panel render channels correctly. Reports image
+// width/height in pixels.
+//
+// In the /frame hot path the caller passes display_back_buffer() so
+// the hardware decoder writes pixels straight into the panel's back
+// framebuffer with zero intermediate copies.
+esp_err_t jpeg_decoder_decode(size_t jpeg_len,
+ void *out_buf,
+ size_t out_cap,
uint16_t *out_width,
uint16_t *out_height);