[chronojump] webcam play stuff createWindow to see if works better on windows



commit 0797c88e6f84dcd569654495a4c15d606befc50a
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Jan 9 19:58:40 2019 +0100

    webcam play stuff createWindow to see if works better on windows

 src/executeProcess.cs                         |   7 ++++---
 src/webcamFfmpeg.cs                           |   6 +++---
 src/webcamMplayer.cs                          |   4 ++--
 testing-stuff/ffmpegCapture/ffmpegCapture.exe | Bin 19456 -> 19456 bytes
 testing-stuff/ffmpegCapture/main.cs           |   2 +-
 5 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/src/executeProcess.cs b/src/executeProcess.cs
index 55c7bc46..52d3d87c 100644
--- a/src/executeProcess.cs
+++ b/src/executeProcess.cs
@@ -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;
diff --git a/src/webcamFfmpeg.cs b/src/webcamFfmpeg.cs
index f0cc15bc..a84f5229 100644
--- a/src/webcamFfmpeg.cs
+++ b/src/webcamFfmpeg.cs
@@ -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;
diff --git a/src/webcamMplayer.cs b/src/webcamMplayer.cs
index b6094bc6..956b3383 100644
--- a/src/webcamMplayer.cs
+++ b/src/webcamMplayer.cs
@@ -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;
diff --git a/testing-stuff/ffmpegCapture/ffmpegCapture.exe b/testing-stuff/ffmpegCapture/ffmpegCapture.exe
index 73bdcdd6..0facdc9c 100755
Binary files a/testing-stuff/ffmpegCapture/ffmpegCapture.exe and 
b/testing-stuff/ffmpegCapture/ffmpegCapture.exe differ
diff --git a/testing-stuff/ffmpegCapture/main.cs b/testing-stuff/ffmpegCapture/main.cs
index 44f4eef6..8ebda5a3 100644
--- a/testing-stuff/ffmpegCapture/main.cs
+++ b/testing-stuff/ffmpegCapture/main.cs
@@ -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;


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