diff --git a/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/CameraServerPlugin.java b/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/CameraServerPlugin.java index 938499aed..85bd27152 100644 --- a/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/CameraServerPlugin.java +++ b/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/CameraServerPlugin.java @@ -34,7 +34,7 @@ @Description( group = "edu.wpi.first.shuffleboard", name = "CameraServer", - version = "3.1.0", + version = "3.1.1", summary = "Provides sources and widgets for viewing CameraServer MJPEG streams" ) @Requires(group = "edu.wpi.first.shuffleboard", name = "NetworkTables", minVersion = "2.0.0") diff --git a/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/widget/CameraServerWidget.java b/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/widget/CameraServerWidget.java index 7077daed7..6b00725e7 100644 --- a/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/widget/CameraServerWidget.java +++ b/plugins/cameraserver/src/main/java/edu/wpi/first/shuffleboard/plugin/cameraserver/widget/CameraServerWidget.java @@ -162,9 +162,12 @@ private void applySettings() { if (getSource() instanceof CameraServerSource) { CameraServerSource source = (CameraServerSource) getSource(); int compression = (int) compressionSlider.getValue(); - int fps = frameRateField.getNumber(); - int width = this.width.getNumber(); - int height = this.height.getNumber(); + // Gson uses an internal subclass of Number that can't be implicitly cast to Integer, + // and Java *really* likes implicitly casting to Integer, + // so we need to explcitly cast to Number. + int fps = ((Number) frameRateField.getNumber()).intValue(); + int width = ((Number) this.width.getNumber()).intValue(); + int height = ((Number) this.height.getNumber()).intValue(); boolean change = source.getTargetCompression() != compression || source.getTargetFps() != fps || source.getTargetResolution().isNotEqual(width, height);