Skip to content

fix(camera): flip sensor stream via v4l2#164

Merged
baba-dev merged 1 commit into
mainfrom
codex/add-camera-flip-controls-and-verify-orientation
Sep 20, 2025
Merged

fix(camera): flip sensor stream via v4l2#164
baba-dev merged 1 commit into
mainfrom
codex/add-camera-flip-controls-and-verify-orientation

Conversation

@baba-dev
Copy link
Copy Markdown
Owner

Summary

  • enable the CSI sensor's horizontal flip control (and disable vertical flip) after the video device is initialized so the raw stream matches the UI without post-processing
  • remove the SRM mirror setting so the PPA client just copies the frame while continuing to support future scaling/rotation
  • add periodic logging of the PPA transfer duration to confirm the lower workload during profiling

Testing

  • idf.py build (fails: command not found)

https://chatgpt.com/codex/tasks/task_e_68cf1076e18083248a52d1993b5bd17b

@baba-dev baba-dev merged commit 8af4dbd into main Sep 20, 2025
1 of 6 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

int app_video_open(char* dev, example_fmt_t init_fmt)
{
struct v4l2_format default_format;
struct v4l2_capability capability;
const int type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
int fd = open(dev, O_RDONLY);
if (fd < 0)
{
ESP_LOGE(TAG, "Open video failed");

[P1] Open video device read-only breaks new sensor flip controls

The change now relies on VIDIOC_S_CTRL to set V4L2_CID_HFLIP/VFLIP and disables the PPA mirror, but the device is still opened with open(dev, O_RDONLY). V4L2 control ioctls require write access; with a read-only descriptor these calls will fail with EPERM, so the sensor flip is never applied while software mirroring is removed and the preview remains mirrored. Open the device with O_RDWR or fall back to software mirroring when the control cannot be set.


Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant