Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,27 @@ public void setAutoWhiteBalance(boolean autoWB) {
}
}

@Override
public void setAutoExposure(boolean cameraAutoExposure) {
if (configuration.cameraQuirks.hasQuirk(CameraQuirk.ArduOV9281Controls)
&& !cameraAutoExposure) {
// OV9281 on Linux seems to sometimes ignore our exposure requests on first boot if we're in
// manual mode. Poking the camera into and out of auto exposure seems to fix it.
try {
setAutoExposureImpl(false);
Thread.sleep(2000);
setAutoExposureImpl(true);
Thread.sleep(2000);
setAutoExposureImpl(false);
} catch (InterruptedException e) {
logger.error("Thread interrupted while setting OV9281 exposure!", e);
}
} else {
setAutoExposureImpl(cameraAutoExposure);
}
}

public void setAutoExposureImpl(boolean cameraAutoExposure) {
logger.debug("Setting auto exposure to " + cameraAutoExposure);

if (!cameraAutoExposure) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,13 @@ boolean setPipeline(int index) {
pipelineSettings.cameraExposureRaw = 10; // reasonable default
}

settables.setExposureRaw(pipelineSettings.cameraExposureRaw);
try {
settables.setAutoExposure(pipelineSettings.cameraAutoExposure);
} catch (VideoException e) {
logger.error("Unable to set camera auto exposure!");
logger.error(e.toString());
}
settables.setExposureRaw(pipelineSettings.cameraExposureRaw);
if (cameraQuirks.hasQuirk(CameraQuirk.Gain)) {
// If the gain is disabled for some reason, re-enable it
if (pipelineSettings.cameraGain == -1) pipelineSettings.cameraGain = 75;
Expand Down
Loading