Use calibration for preview
This commit is contained in:
@@ -927,7 +927,7 @@ on_output_changed(bool format_changed)
|
||||
if (gles2_debayer)
|
||||
gles2_debayer_free(gles2_debayer);
|
||||
|
||||
gles2_debayer = gles2_debayer_new(state_proc.mode->format, state_proc.mode->xfer);
|
||||
gles2_debayer = gles2_debayer_new(state_proc.mode->format);
|
||||
check_gl();
|
||||
|
||||
gles2_debayer_use(gles2_debayer);
|
||||
@@ -940,8 +940,7 @@ on_output_changed(bool format_changed)
|
||||
state_proc.mode->height,
|
||||
state_proc.mode->rotation,
|
||||
0,
|
||||
NULL,
|
||||
0);
|
||||
state_proc.calibration);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -954,6 +953,7 @@ mod(int a, int b)
|
||||
static void
|
||||
update_state(MPPipeline *pipeline, const mp_state_proc *new_state)
|
||||
{
|
||||
bool camera_changed = state_proc.camera != new_state->camera;
|
||||
state_proc.configuration = new_state->configuration;
|
||||
state_proc.camera = new_state->camera;
|
||||
|
||||
@@ -1008,6 +1008,15 @@ update_state(MPPipeline *pipeline, const mp_state_proc *new_state)
|
||||
on_output_changed(format_changed);
|
||||
}
|
||||
|
||||
if (camera_changed) {
|
||||
char *cf;
|
||||
if (find_calibration(cf, state_proc.camera->name)) {
|
||||
state_proc.calibration = parse_calibration_file(cf);
|
||||
} else {
|
||||
printf("No calibration for %s\n", state_proc.camera->name);
|
||||
}
|
||||
}
|
||||
|
||||
mp_state_main new_main = {
|
||||
.camera = pr_camera,
|
||||
.has_auto_focus_continuous = false,
|
||||
|
Reference in New Issue
Block a user