[chronojump] webcam supportedModes parses resolution ok on raspberry



commit 42c18f41485523a5a1797b5ac53af5018a61141f
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Jan 14 14:06:04 2020 +0100

    webcam supportedModes parses resolution ok on raspberry

 src/webcam/webcamFfmpegSupportedModes.cs | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/webcam/webcamFfmpegSupportedModes.cs b/src/webcam/webcamFfmpegSupportedModes.cs
index f241ed75..16482319 100644
--- a/src/webcam/webcamFfmpegSupportedModes.cs
+++ b/src/webcam/webcamFfmpegSupportedModes.cs
@@ -231,10 +231,12 @@ public class WebcamFfmpegSupportedModesLinux : WebcamFfmpegSupportedModes
        {
                Match match = Regex.Match(l, @"(\d+)x(\d+)");
 
-               LogB.Information("resolution match group count is 3?", (match.Groups.Count == 3).ToString());
+               LogB.Information(string.Format("resolution match group count: {0}", match.Groups.Count));
 
-               if(match.Groups.Count == 3)
-                       return string.Format("{0}x{1}", match.Groups[1].Value, match.Groups[2].Value);
+               //we use >=3 because on raspberry we found this string:
+               //Size: Stepwise 32x32 - 2592x1944 width step 2/2
+               if(match.Groups.Count >= 3)
+                       return string.Format("{0}x{1}", match.Groups[match.Groups.Count -2].Value, 
match.Groups[match.Groups.Count -1].Value);
 
                return "";
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]