Commit 0797c88e authored by Xavier de Blas's avatar Xavier de Blas

webcam play stuff createWindow to see if works better on windows

parent 40ca8ec9
......@@ -136,7 +136,8 @@ class ExecuteProcess
* don't call WaitForExit(), kill it on Chronojump exit
* returns false if there are problems calling it
*/
public static bool RunAtBackground(ref Process process, string file_name, List<string> parameters, bool redirectInput)
public static bool RunAtBackground(ref Process process, string file_name, List<string> parameters,
bool createNoWindow, bool useShellExecute, bool redirectInput)
{
ProcessStartInfo processStartInfo = new ProcessStartInfo();
......@@ -153,8 +154,8 @@ class ExecuteProcess
LogB.Debug ("ExecuteProcess FileName: " + processStartInfo.FileName);
LogB.Debug ("ExecuteProcess Arguments: " + processStartInfo.Arguments);
processStartInfo.CreateNoWindow = true;
processStartInfo.UseShellExecute = false;
processStartInfo.CreateNoWindow = createNoWindow;
processStartInfo.UseShellExecute = useShellExecute;
processStartInfo.RedirectStandardInput = redirectInput; //note UseShellExecute has to be false to be able to redirect
processStartInfo.RedirectStandardError = true;
processStartInfo.RedirectStandardOutput = true;
......
......@@ -70,7 +70,7 @@ public class WebcamFfmpeg : Webcam
List<string> parameters = createParametersPlayPreview();
process = new Process();
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, false);
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, false, false, false);
if(! success)
{
process = null;
......@@ -89,7 +89,7 @@ public class WebcamFfmpeg : Webcam
List<string> parameters = createParametersPlayFile (filename);
process = new Process();
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, false);
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, false, false, false);
if(! success)
{
process = null;
......@@ -111,7 +111,7 @@ public class WebcamFfmpeg : Webcam
process = new Process();
List<string> parameters = createParametersOnlyCapture();
//List<string> parameters = createParametersCaptureAndDelayedView();
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, true); //redirectInput
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, true, false, true); //redirectInput
if(! success)
{
streamWriter = null;
......
......@@ -71,7 +71,7 @@ public class WebcamMplayer : Webcam
parameters.Insert (i ++, "screenshot=" + Util.GetMplayerPhotoTempFileNamePre(videoDeviceToFilename()));
process = new Process();
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, true); //redirectInput
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, true, false, true); //redirectInput
if(! success)
{
streamWriter = null;
......@@ -124,7 +124,7 @@ public class WebcamMplayer : Webcam
process = new Process();
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, false);
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, false, true, false);
if(! success)
{
process = null;
......
......@@ -165,7 +165,7 @@ class FfmpegCapture
List<string> parameters = createParametersPlayFile (filename);
process = new Process();
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, false, false, false);
bool success = ExecuteProcess.RunAtBackground (ref process, executable, parameters, false, true, false);
if(! success)
{
process = null;
......
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