Add workaround for OV5640 capture mode not being set on first start after reboot

This commit is contained in:
Benjamin Schaaf 2021-05-01 01:31:37 +10:00
parent 36b7b2b38d
commit 207aabf16a
4 changed files with 9 additions and 3 deletions

View File

@ -11,7 +11,7 @@ capture-rate=10
capture-fmt=BGGR8 capture-fmt=BGGR8
preview-width=1280 preview-width=1280
preview-height=720 preview-height=720
preview-rate=60 preview-rate=30
preview-fmt=BGGR8 preview-fmt=BGGR8
rotate=270 rotate=270
colormatrix=1.384,-0.3203,-0.0124,-0.2728,1.049,0.1556,-0.0506,0.2577,0.8050 colormatrix=1.384,-0.3203,-0.0124,-0.2728,1.049,0.1556,-0.0506,0.2577,0.8050

View File

@ -11,7 +11,7 @@ capture-rate=10
capture-fmt=BGGR8 capture-fmt=BGGR8
preview-width=1280 preview-width=1280
preview-height=720 preview-height=720
preview-rate=60 preview-rate=30
preview-fmt=BGGR8 preview-fmt=BGGR8
rotate=270 rotate=270
colormatrix=1.384,-0.3203,-0.0124,-0.2728,1.049,0.1556,-0.0506,0.2577,0.8050 colormatrix=1.384,-0.3203,-0.0124,-0.2728,1.049,0.1556,-0.0506,0.2577,0.8050

View File

@ -11,7 +11,7 @@ capture-rate=10
capture-fmt=BGGR8 capture-fmt=BGGR8
preview-width=1280 preview-width=1280
preview-height=720 preview-height=720
preview-rate=60 preview-rate=30
preview-fmt=BGGR8 preview-fmt=BGGR8
rotate=270 rotate=270
mirrored=false mirrored=false

View File

@ -185,6 +185,12 @@ setup_camera(MPDeviceList **device_list, const struct mp_camera_config *config)
info->camera = mp_camera_new(dev_info->video_fd, info->fd); info->camera = mp_camera_new(dev_info->video_fd, info->fd);
// Start with the capture format, this works around a bug with
// the ov5640 driver where it won't allow setting the preview
// format initially.
MPCameraMode mode = config->capture_mode;
mp_camera_set_mode(info->camera, &mode);
// Trigger continuous auto focus if the sensor supports it // Trigger continuous auto focus if the sensor supports it
if (mp_camera_query_control(info->camera, V4L2_CID_FOCUS_AUTO, if (mp_camera_query_control(info->camera, V4L2_CID_FOCUS_AUTO,
NULL)) { NULL)) {