Skip to content

Commit

Permalink
Fix windows NPEs around exposure+klogs (#1529)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 authored Nov 7, 2024
1 parent 8dcf0b3 commit a842581
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ public KernelLogLogger() {
}

public void outputNewPrintks() {
if (listener == null) {
return;
}

for (var msg : listener.getNewlines()) {
// We currently set all logs to debug regardless of their actual level
logger.log(msg, LogLevel.DEBUG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ protected void setUpExposureProperties() {
var autoExpProp = findProperty("exposure_auto", "auto_exposure");

exposureAbsProp = expProp.get();
autoExposureProp = autoExpProp.get();
this.minExposure = exposureAbsProp.getMin();
this.maxExposure = exposureAbsProp.getMax();

if (autoExpProp.isPresent()) {
autoExposureProp = autoExpProp.get();
}
}

public void setAllCamDefaults() {
Expand Down Expand Up @@ -169,7 +172,7 @@ public void setAutoExposure(boolean cameraAutoExposure) {
softSet("auto_exposure_bias", 0);
softSet("iso_sensitivity_auto", 0); // Disable auto ISO adjustment
softSet("iso_sensitivity", 0); // Manual ISO adjustment
autoExposureProp.set(PROP_AUTO_EXPOSURE_DISABLED);
if (autoExposureProp != null) autoExposureProp.set(PROP_AUTO_EXPOSURE_DISABLED);

// Most cameras leave exposure time absolute at the last value from their AE
// algorithm.
Expand Down Expand Up @@ -199,7 +202,7 @@ public double getMaxExposureRaw() {
public void setExposureRaw(double exposureRaw) {
if (exposureRaw >= 0.0) {
try {
autoExposureProp.set(PROP_AUTO_EXPOSURE_DISABLED);
if (autoExposureProp != null) autoExposureProp.set(PROP_AUTO_EXPOSURE_DISABLED);

int propVal = (int) MathUtil.clamp(exposureRaw, minExposure, maxExposure);

Expand Down

0 comments on commit a842581

Please sign in to comment.