From cb56a6b32bd2f1c0afbbc4d5c29a6b4f5a62c807 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Mon, 27 Apr 2015 19:28:57 -0300 Subject: [PATCH] examples: gst-camera: add zoom property to UI Add a slider to modify the zoom in camerabin --- tests/examples/camerabin2/gst-camera2.c | 7 +++++++ tests/examples/camerabin2/gst-camera2.h | 3 +++ tests/examples/camerabin2/gst-camera2.ui | 36 ++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/tests/examples/camerabin2/gst-camera2.c b/tests/examples/camerabin2/gst-camera2.c index 0b656a5..5104d3b 100644 --- a/tests/examples/camerabin2/gst-camera2.c +++ b/tests/examples/camerabin2/gst-camera2.c @@ -203,6 +203,13 @@ on_formatComboBox_changed (GtkWidget * widget, gpointer data) } } +void +on_zoomScale_value_changed (GtkWidget * widget, gpointer data) +{ + g_object_set (camera, "zoom", + (gfloat) gtk_range_get_value (GTK_RANGE (widget)), NULL); +} + static GstBusSyncReply bus_sync_callback (GstBus * bus, GstMessage * message, gpointer data) { diff --git a/tests/examples/camerabin2/gst-camera2.h b/tests/examples/camerabin2/gst-camera2.h index 8477dac..825d10a 100644 --- a/tests/examples/camerabin2/gst-camera2.h +++ b/tests/examples/camerabin2/gst-camera2.h @@ -48,4 +48,7 @@ on_viewfinderArea_realize (GtkWidget * widget, gpointer data); void on_formatComboBox_changed (GtkWidget * widget, gpointer data); +void +on_zoomScale_value_changed (GtkWidget * widget, gpointer data); + #endif /* __GST_CAMERA_BIN_H__ */ diff --git a/tests/examples/camerabin2/gst-camera2.ui b/tests/examples/camerabin2/gst-camera2.ui index af05fd7..52bcfc6 100644 --- a/tests/examples/camerabin2/gst-camera2.ui +++ b/tests/examples/camerabin2/gst-camera2.ui @@ -2,6 +2,13 @@ + + 1 + 10 + 1 + 0.10000000000000001 + 1 + False 800 @@ -44,6 +51,7 @@ 0 True True + imageRButton @@ -147,6 +155,34 @@ 4 + + + True + False + Zoom + + + False + True + 5 + + + + + True + True + zoomadjustment + 10 + 1 + right + + + + False + True + 6 + + False -- 2.7.4