Skip to content

capture_jpeg() encodes through jpegio - #10

Merged
bdbarnett merged 1 commit into
mainfrom
media/2-capture-jpeg-over-jpegio
Oct 6, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
media/2-capture-jpeg-over-jpegio

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

Media modules roadmap, Phase 2 (D2): cameraif owns no JPEG encoder; capture_jpeg() calls jpegio's C API (jpegio_encode, declared weak), asking for the engine's own RGB565 read (exact=false), zero-copy from the frame buffer as before.

Proven on the P4 panel's camera with micropython-pydevices media/2-jpegio-encode: examples/camera_snapshot.py and examples/camera_mjpeg.py run unchanged (every streamed frame a whole 800x800 JPEG Pillow decodes), and capture_jpeg(70) runs at 35.7 fps, the README's 36.

A firmware without jpegio still links; capture_jpeg() then raises OSError naming jpegio.

…encoder

jpegio_encode() is declared weak, so a firmware without jpegio still links
and capture_jpeg() raises OSError naming what is missing. It asks for the
engine's own RGB565 read (exact=false): zero-copy from the frame buffer, as
before, so the frame rate is unchanged.
@bdbarnett
bdbarnett merged commit 274ca6f into main Oct 6, 2026
2 checks passed
@bdbarnett
bdbarnett deleted the media/2-capture-jpeg-over-jpegio branch October 6, 2026 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant