device: some v4l2 cameras do not accept parameters unless streaming
This fixes 3DO camera not accepting `--camera-options=focus_absolute=100` and `--camera-options=focus_automatic_continuous=0`, and not properly configuring the sensor. The settings are applied twice (if failed) to ignore ordering problems related to auto-focus and focus-absolute value command line order.
This commit is contained in:
@ -99,7 +99,15 @@ void camera_capture_add_callbacks(camera_t *camera, buffer_list_t *capture, link
|
||||
int camera_set_params(camera_t *camera)
|
||||
{
|
||||
device_set_fps(camera->camera, camera->options.fps);
|
||||
device_set_option_list(camera->camera, camera->options.options);
|
||||
|
||||
// HACK:
|
||||
// Some cameras require to be in streaming to apply settings
|
||||
// This applies twice to avoid ordering issues (auto-focus vs focus value)
|
||||
if (camera->camera->n_capture_list > 0)
|
||||
buffer_list_set_stream(camera->camera->capture_lists[0], true);
|
||||
if (device_set_option_list(camera->camera, camera->options.options) < 0)
|
||||
device_set_option_list(camera->camera, camera->options.options);
|
||||
|
||||
device_set_option_list(camera->isp, camera->options.isp.options);
|
||||
|
||||
if (camera->options.auto_focus) {
|
||||
|
Reference in New Issue
Block a user