Limit PS3Eye to 100FPS (#218)

This helps prevent running in to USB bandwidth issues with multiple PS3Eyes.
This commit is contained in:
Banks T
2021-01-06 17:27:01 -05:00
committed by GitHub
parent b8bc65ec32
commit 08a51fd237
4 changed files with 11 additions and 2 deletions

View File

@@ -21,5 +21,7 @@ public enum CameraQuirk {
/** Camera settable for controllable image gain */
Gain,
/** For the Raspberry Pi Camera */
PiCam
PiCam,
/** Cap at 100FPS for high-bandwidth cameras */
FPSCap100
}

View File

@@ -25,7 +25,7 @@ public class QuirkyCamera {
private static final List<QuirkyCamera> quirkyCameras =
List.of(
new QuirkyCamera(0x2000, 0x1415, CameraQuirk.Gain), // PS3Eye
new QuirkyCamera(0x2000, 0x1415, CameraQuirk.Gain, CameraQuirk.FPSCap100), // PS3Eye
new QuirkyCamera(-1, -1, "mmal service 16.1", CameraQuirk.PiCam) // PiCam (via V4L2)
);

View File

@@ -194,6 +194,12 @@ public class USBCameraSource implements VisionSource {
}
}
if (cameraQuirks.hasQuirk(CameraQuirk.FPSCap100)) {
if (videoMode.fps > 100) {
continue;
}
}
videoModesList.add(videoMode);
// We look for modes with the same height/width/pixelformat as this mode