Commit 0f10047a authored by Xavier de Blas's avatar Xavier de Blas

webcam get supported modes for Windows (done!)

parent 38de27b2
......@@ -793,6 +793,7 @@ public class PreferencesWindow
string modesStr = "";
//TODO: move all this to a class similar to WebcamDevices
if(UtilAll.GetOSEnum() == UtilAll.OperatingSystems.LINUX)
List<string> parameters = new List<string>();
......@@ -806,10 +807,31 @@ public class PreferencesWindow
modesStr = execute_result.stdout;
else if(UtilAll.GetOSEnum() == UtilAll.OperatingSystems.WINDOWS)
string executable = System.IO.Path.Combine(Util.GetPrefixDir(), "bin/ffmpeg.exe");
//ffmpeg -f dshow -list_options true -i video="USB 2.0 WebCamera"
List<string> parameters = new List<string>();
parameters.Add("video=" + cameraCode);
ExecuteProcess.Result execute_result = (executable, parameters, true, true);
if(! execute_result.success) {
new DialogMessage("Chronojump - Modes of this webcam",
Constants.MessageTypes.WARNING, "Need to install ffmpeg");
modesStr = execute_result.stdout;
else if(UtilAll.GetOSEnum() == UtilAll.OperatingSystems.MACOSX)
//select and impossible mode just to get an error on mac, this error will give us the "Supported modes"
Webcam webcamPlay = new WebcamFfmpeg (Webcam.Action.PLAYPREVIEW, UtilAll.GetOSEnum(),
cameraCode, "8000x8000", "8000"); //select and impossible mode just to get an error on mac, this error will give us the "Supported modes"
cameraCode, "8000x8000", "8000");
Webcam.Result result = webcamPlay.PlayPreviewNoBackgroundWantStdoutAndStderr();
modesStr = result.output;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment