[chronojump] Webcam on edit/new person has the correct parameters



commit 2f1a28c3be1c55f6e420a796d01e331622e97efc
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Nov 4 13:53:28 2019 +0100

    Webcam on edit/new person has the correct parameters

 src/gui/chronojump.cs |  6 ++++--
 src/gui/person.cs     | 13 ++++++++++---
 2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index b496a7c3..65a070d9 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2634,7 +2634,8 @@ public partial class ChronoJumpWindow
                                currentSession, new Person(-1), 
                                //preferences.digitsNumber, checkbutton_video, configChronojump.UseVideo,
                                preferences.digitsNumber, checkbutton_video,
-                               preferences.videoDevice, configChronojump.Compujump
+                               preferences.videoDevice, preferences.videoDevicePixelFormat, 
preferences.videoDeviceResolution, preferences.videoDeviceFramerate,
+                               configChronojump.Compujump
                                );
                //-1 means we are adding a new person
                //if we were modifying it will be it's uniqueID
@@ -2761,7 +2762,8 @@ public partial class ChronoJumpWindow
                personAddModifyWin = PersonAddModifyWindow.Show(app1, currentSession, currentPerson, 
                                //preferences.digitsNumber, checkbutton_video, configChronojump.UseVideo,
                                preferences.digitsNumber, checkbutton_video,
-                               preferences.videoDevice, configChronojump.Compujump
+                               preferences.videoDevice, preferences.videoDevicePixelFormat, 
preferences.videoDeviceResolution, preferences.videoDeviceFramerate,
+                               configChronojump.Compujump
                                ); 
                personAddModifyWin.FakeButtonAccept.Clicked += new 
EventHandler(on_edit_current_person_accepted);
        }
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 7d415972..f9662160 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -877,6 +877,9 @@ public class PersonAddModifyWindow
        private Person currentPerson;
        private Session currentSession;
        private string videoDevice;
+       private string videoDevicePixelFormat;
+       private string videoDeviceResolution;
+       private string videoDeviceFramerate;
        private PersonSession currentPersonSession;
        private string sex = Constants.M;
        private double weightIni;
@@ -1075,7 +1078,7 @@ public class PersonAddModifyWindow
                //webcam = new WebcamMplayer (videoDevice);
                //Webcam.Result result = webcam.CapturePrepare (Webcam.CaptureTypes.PHOTO);
                //constructor for playpreview
-               webcam = new WebcamFfmpeg (Webcam.Action.PLAYPREVIEW, UtilAll.GetOSEnum(), videoDevice, "", 
"", "");
+               webcam = new WebcamFfmpeg (Webcam.Action.PLAYPREVIEW, UtilAll.GetOSEnum(), videoDevice, 
videoDevicePixelFormat, videoDeviceResolution, videoDeviceFramerate);
                //Webcam.Result result = webcam.PlayPreviewNoBackground ();
                Webcam.Result result = webcam.PlayPreview ();
 
@@ -1089,7 +1092,7 @@ public class PersonAddModifyWindow
        void on_button_take_photo_do_clicked (object o, EventArgs args)
        {
                if(webcam == null)
-                       webcam = new WebcamFfmpeg (Webcam.Action.PLAYPREVIEW, UtilAll.GetOSEnum(), 
videoDevice, "", "", "");
+                       webcam = new WebcamFfmpeg (Webcam.Action.PLAYPREVIEW, UtilAll.GetOSEnum(), 
videoDevice, videoDevicePixelFormat, videoDeviceResolution, videoDeviceFramerate);
                else if(webcam != null && webcam.Running)
                {
                        webcam.ExitCamera();
@@ -1219,7 +1222,8 @@ public class PersonAddModifyWindow
                        Session mySession, Person currentPerson, int pDN, 
                        //Gtk.CheckButton app1_checkbutton_video, bool showCapturePhoto,
                        Gtk.CheckButton app1_checkbutton_video,
-                       string videoDevice, bool compujump)
+                       string videoDevice, string videoDevicePixelFormat, string videoDeviceResolution, 
string videoDeviceFramerate,
+                       bool compujump)
        {
                if (PersonAddModifyWindowBox == null) {
                        //PersonAddModifyWindowBox = new PersonAddModifyWindow (parent, mySession, 
currentPerson, showCapturePhoto);
@@ -1229,6 +1233,9 @@ public class PersonAddModifyWindow
                PersonAddModifyWindowBox.pDN = pDN;
                PersonAddModifyWindowBox.app1_checkbutton_video = app1_checkbutton_video;
                PersonAddModifyWindowBox.videoDevice = videoDevice;
+               PersonAddModifyWindowBox.videoDevicePixelFormat = videoDevicePixelFormat;
+               PersonAddModifyWindowBox.videoDeviceResolution = videoDeviceResolution;
+               PersonAddModifyWindowBox.videoDeviceFramerate = videoDeviceFramerate;
                //do not allow camera on compujump
                PersonAddModifyWindowBox.hbox_camera.Visible = ! compujump;
 


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