[0.11] gst-plugins-bad: tests: test for GTK 2. 24 for new symbols used in camerabin2 tests

Sebastian Dröge slomo at kemper.freedesktop.org
Tue Jan 10 06:50:49 PST 2012


Module: gst-plugins-bad
Branch: 0.11
Commit: 74952a15bf1db09711681cf7238981e03fd2608d
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=74952a15bf1db09711681cf7238981e03fd2608d

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Thu Jan  5 11:01:01 2012 +0000

tests: test for GTK 2.24 for new symbols used in camerabin2 tests

The whole tree is likely to switch to GTK 3.0 at some point, but
we might as well continue building with slightly less new versions
if it's not hard to do.

---

 tests/examples/camerabin2/gst-camera2.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/tests/examples/camerabin2/gst-camera2.c b/tests/examples/camerabin2/gst-camera2.c
index 13299ea..8f34501 100644
--- a/tests/examples/camerabin2/gst-camera2.c
+++ b/tests/examples/camerabin2/gst-camera2.c
@@ -257,9 +257,10 @@ bus_callback (GstBus * bus, GstMessage * message, gpointer data)
   return TRUE;
 }
 
-static void
+static gboolean
 init_gtkwidgets_data (void)
 {
+#if GTK_CHECK_VERSION(2,24,0)
   gint i;
   GtkComboBoxText *combobox =
       GTK_COMBO_BOX_TEXT (gtk_builder_get_object (builder, "formatComboBox"));
@@ -273,6 +274,11 @@ init_gtkwidgets_data (void)
 
   /* default to the first one -> ogg */
   gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
+  return TRUE;
+#else
+  g_warning ("This needs a newer version of GTK (2.24 at least)");
+  return FALSE;
+#endif
 }
 
 int
@@ -298,7 +304,9 @@ main (int argc, char *argv[])
   gst_bus_set_sync_handler (bus, bus_sync_callback, NULL);
   gst_object_unref (bus);
 
-  init_gtkwidgets_data ();
+  if (!init_gtkwidgets_data ()) {
+    goto error;
+  }
 
   ui_main_window = GTK_WIDGET (gtk_builder_get_object (builder, "mainWindow"));
   gtk_builder_connect_signals (builder, NULL);
@@ -308,6 +316,7 @@ main (int argc, char *argv[])
 
   gtk_main ();
 
+error:
   gst_element_set_state (camera, GST_STATE_NULL);
   gst_object_unref (camera);
   return ret;



More information about the gstreamer-commits mailing list