Remove duplicate video modes (#1221)

(Fixes #1219)
This commit is contained in:
Craig Schardt
2024-02-04 19:42:01 -08:00
committed by GitHub
parent bc55218739
commit 45a39f6609

View File

@@ -395,6 +395,7 @@ public class USBCameraSource extends VisionSource {
// Sort by resolution
var sortedList =
videoModesList.stream()
.distinct() // remove redundant video mode entries
.sorted(((a, b) -> (b.width + b.height) - (a.width + a.height)))
.collect(Collectors.toList());
Collections.reverse(sortedList);