Skip to content

Commit

Permalink
fix #279
Browse files Browse the repository at this point in the history
  • Loading branch information
alainm23 committed Oct 28, 2024
1 parent 0f8b74f commit 911b86c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Widgets/CameraView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 911b86c

Please sign in to comment.