Move mode types and functions to a new object (MR 13)

Rename MPCameraMode to a more generic MPMode and move it along
with related functions to a new object in preparation for using
it in the device object.
This commit is contained in:
Yassine Oudjana
2022-02-23 10:23:02 +04:00
committed by Martijn Braam
parent cd4ecdd964
commit a4c2c1ec1f
13 changed files with 381 additions and 364 deletions

View File

@@ -68,7 +68,7 @@ static struct device_info devices[MP_MAX_CAMERAS];
static size_t num_devices = 0;
static const struct mp_camera_config *camera = NULL;
static MPCameraMode mode;
static MPMode mode;
static bool just_switched_mode = false;
static int blank_frame_count = 0;
@@ -204,7 +204,7 @@ setup_camera(MPDeviceList **device_list, const struct mp_camera_config *config)
// 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;
MPMode mode = config->capture_mode;
mp_camera_set_mode(info->camera, &mode);
// Trigger continuous auto focus if the sensor supports it