Skip to content

Commit

Permalink
Add StickyFPS quirk to disable setting first video mode on boot
Browse files Browse the repository at this point in the history
  • Loading branch information
superpenguin612 committed Nov 2, 2023
1 parent 1277459 commit edf77fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ public enum CameraQuirk {
CompletelyBroken,
/** Has adjustable focus and autofocus switch */
AdjustableFocus,
/** Changing FPS repeatedly with small delay does not work correctly */
StickyFPS,
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class QuirkyCamera {
new QuirkyCamera(
-1, -1, "mmal service 16.1", CameraQuirk.PiCam), // PiCam (via V4L2, not zerocopy)
new QuirkyCamera(-1, -1, "unicam", CameraQuirk.PiCam), // PiCam (via V4L2, not zerocopy)
new QuirkyCamera(0x85B, 0x46D, CameraQuirk.AdjustableFocus) // Logitech C925-e
new QuirkyCamera(0x85B, 0x46D, CameraQuirk.AdjustableFocus), // Logitech C925-e
new QuirkyCamera(0x6366, 0x0c45, CameraQuirk.StickyFPS) // Arducam OV2311
);

public static final QuirkyCamera DefaultCamera = new QuirkyCamera(0, 0, "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ public class USBCameraSettables extends VisionSourceSettables {
protected USBCameraSettables(CameraConfiguration configuration) {
super(configuration);
getAllVideoModes();
setVideoMode(videoModes.get(0));
if (!cameraQuirks.hasQuirk(CameraQuirk.StickyFPS))
setVideoMode(videoModes.get(0)); // fixes double FPS set
}

public void setAutoExposure(boolean cameraAutoExposure) {
Expand Down

0 comments on commit edf77fa

Please sign in to comment.