JianyuWang0623 opened a new pull request, #3450:
URL: https://github.com/apache/nuttx-apps/pull/3450

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   Improve the `examples/camera` application to work with 8-bit DVP camera 
sensors (e.g. GC0308) on ESP32-S3:
   
   1. **MMAP with USERPTR fallback** (`c59dd0feb6`): Use `V4L2_MEMORY_MMAP` by 
default so the driver can allocate DMA-capable buffers with proper alignment 
and cache attributes. Fall back to `V4L2_MEMORY_USERPTR` if the driver does not 
support MMAP. Also fix NX framebuffer stride calculation to use the actual 
display width instead of hardcoded values.
   
   2. **RGB565X (big-endian) handling** (`ef0eca7fe4`): Some sensors on 8-bit 
DVP buses produce RGB565X — the high byte is clocked out first and stored first 
in PSRAM by the CAM controller. Try RGB565 first and fall back to RGB565X if 
`VIDIOC_S_FMT` fails. When RGB565X is active, invalidate D-Cache after DQBUF 
and byte-swap pixels in place for LCD display.
   
   3. **Horizontal mirror option** (`c053b31668`): Add `-m` command line option 
to enable hardware horizontal flip via `VIDIOC_S_CTRL` + `V4L2_CID_HFLIP`. Also 
refactor `parse_arguments` to a loop-based parser so options (`-jpg`, `-m`, 
capture_num) can appear in any order.
   
   ## Impact
   
   - Existing `camera` usage is unchanged — MMAP is transparent, RGB565 sensors 
still work as before.
   - New `-m` option is additive; no existing arguments are affected.
   - No impact on build process, documentation, security, or other apps.
   
   ## Testing
   
   - Host: Ubuntu x86_64, GCC (xtensa-esp32s3-elf)
   - Target: ESP32-S3 (lckfb-szpi-esp32s3, ESP32-S3-WROOM-1-N16R8, PSRAM 8MB 
OCT) with GC0308 DVP camera and ST7789 LCD
   - Build: `make -j$(nproc)` — clean build, no warnings
   - Runtime:
     - `camera 0` — continuous preview on LCD, correct colors (RGB565X path), 
no artifacts
     - `camera 0 -m` — mirrored preview, correct orientation
     - MMAP buffers allocated by driver, 3 video buffers in RING mode


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to