v4l2: prefer yuyv over mjpeg if all other factors are equal

This commit is contained in:
dec05eba
2026-01-15 23:02:36 +01:00
parent 91f48ce332
commit d2f449bd73

View File

@@ -336,7 +336,7 @@ static bool gsr_capture_v4l2_get_best_matching_setup(
setup_framerate = 50000; setup_framerate = 50000;
} }
const uint64_t match_score = setup_resolution_width * setup_resolution_height * setup_framerate; const uint64_t match_score = setup_resolution_width * setup_resolution_height * setup_framerate + (pixfmt == GSR_CAPTURE_V4L2_PIXFMT_YUYV ? 5 : 0);
if(match_score > best_match_score) { if(match_score > best_match_score) {
best_match_score = match_score; best_match_score = match_score;
best_match_index = i; best_match_index = i;