From 911b86c51b7daa5490386038894fc2c0d3e0f692 Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 28 Oct 2024 17:18:59 -0500 Subject: [PATCH 1/3] fix #279 --- src/Widgets/CameraView.vala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Widgets/CameraView.vala b/src/Widgets/CameraView.vala index b25951571..1317e4401 100644 --- a/src/Widgets/CameraView.vala +++ b/src/Widgets/CameraView.vala @@ -297,10 +297,12 @@ public class Camera.Widgets.CameraView : Gtk.Box { "v4l2src device=%s name=%s num-buffers=1 !".printf (device_path, VIDEO_SRC_NAME) + "videoscale ! video/x-raw, width=%d, height=%d !".printf (picture_width, picture_height) + "videoflip method=%s !".printf ((horizontal_flip)?"horizontal-flip":"none") + - "videobalance brightness=%f contrast=%f !".printf (brightness_value.get_double (), contrast_value.get_double ()) + + "videobalance brightness=%s contrast=%s !".printf ( + convert_comma_to_dot (brightness_value.get_double ()), + convert_comma_to_dot (contrast_value.get_double ()) + ) + "jpegenc ! filesink location=%s name=filesink".printf (Camera.Utils.get_new_media_filename (Camera.Utils.ActionType.PHOTO)) ); - } catch (Error e) { warning ("Could not make picture pipeline for photo - %s", e.message); return; @@ -330,6 +332,10 @@ public class Camera.Widgets.CameraView : Gtk.Box { Gst.Debug.BIN_TO_DOT_FILE (pipeline, Gst.DebugGraphDetails.VERBOSE, "snapshot"); } + private string convert_comma_to_dot (double value) { + return value.to_string ().replace (",", "."); + } + public void start_recording () { if (recording) { return; From 6bae18f451fd64768f993c892e596815e4435936 Mon Sep 17 00:00:00 2001 From: Alain Date: Tue, 29 Oct 2024 10:15:39 -0500 Subject: [PATCH 2/3] use delimit --- src/Widgets/CameraView.vala | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Widgets/CameraView.vala b/src/Widgets/CameraView.vala index 1317e4401..f2672490d 100644 --- a/src/Widgets/CameraView.vala +++ b/src/Widgets/CameraView.vala @@ -297,10 +297,7 @@ public class Camera.Widgets.CameraView : Gtk.Box { "v4l2src device=%s name=%s num-buffers=1 !".printf (device_path, VIDEO_SRC_NAME) + "videoscale ! video/x-raw, width=%d, height=%d !".printf (picture_width, picture_height) + "videoflip method=%s !".printf ((horizontal_flip)?"horizontal-flip":"none") + - "videobalance brightness=%s contrast=%s !".printf ( - convert_comma_to_dot (brightness_value.get_double ()), - convert_comma_to_dot (contrast_value.get_double ()) - ) + + "videobalance brightness=%f contrast=%f !".printf (brightness_value.get_double (), contrast_value.get_double ()).delimit (null, '.') + "jpegenc ! filesink location=%s name=filesink".printf (Camera.Utils.get_new_media_filename (Camera.Utils.ActionType.PHOTO)) ); } catch (Error e) { @@ -332,10 +329,6 @@ public class Camera.Widgets.CameraView : Gtk.Box { Gst.Debug.BIN_TO_DOT_FILE (pipeline, Gst.DebugGraphDetails.VERBOSE, "snapshot"); } - private string convert_comma_to_dot (double value) { - return value.to_string ().replace (",", "."); - } - public void start_recording () { if (recording) { return; From c3ab07461c355c82681a4f8209b6c5d6ea00b7e5 Mon Sep 17 00:00:00 2001 From: Alain Date: Wed, 30 Oct 2024 14:28:47 +0000 Subject: [PATCH 3/3] Update src/Widgets/CameraView.vala MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Corentin Noël --- src/Widgets/CameraView.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Widgets/CameraView.vala b/src/Widgets/CameraView.vala index f2672490d..765c04b53 100644 --- a/src/Widgets/CameraView.vala +++ b/src/Widgets/CameraView.vala @@ -297,7 +297,7 @@ public class Camera.Widgets.CameraView : Gtk.Box { "v4l2src device=%s name=%s num-buffers=1 !".printf (device_path, VIDEO_SRC_NAME) + "videoscale ! video/x-raw, width=%d, height=%d !".printf (picture_width, picture_height) + "videoflip method=%s !".printf ((horizontal_flip)?"horizontal-flip":"none") + - "videobalance brightness=%f contrast=%f !".printf (brightness_value.get_double (), contrast_value.get_double ()).delimit (null, '.') + + "videobalance brightness=%s contrast=%s !".printf (brightness_value.get_double ().to_string (), contrast_value.get_double ().to_string ()) + "jpegenc ! filesink location=%s name=filesink".printf (Camera.Utils.get_new_media_filename (Camera.Utils.ActionType.PHOTO)) ); } catch (Error e) {