camerabin-tests: fix lookup of UI files
authorStefan Kost <ensonic@users.sf.net>
Wed, 12 Jan 2011 15:13:07 +0000 (17:13 +0200)
committerStefan Kost <ensonic@users.sf.net>
Mon, 7 Feb 2011 09:28:23 +0000 (11:28 +0200)
These are uninstalled examples. Pass $srcdir to cpp to build the correct
location for the UI file.

tests/examples/camerabin/Makefile.am
tests/examples/camerabin/gst-camera.c
tests/examples/camerabin2/Makefile.am
tests/examples/camerabin2/gst-camera2.c

index 5898a0ce51e203d2a7c8ecd37f2f2cb020e2598e..9d74d91d725fc8f94665f3be14b3433049942c13 100644 (file)
@@ -21,7 +21,7 @@ gst_camera_LDADD   = \
 
 noinst_DATA = $(GST_CAMERABIN_UI_FILES)
 
-INCLUDES = -DCAMERA_APPS_UIDIR=\""$(uidir)"\"
+INCLUDES = -DCAMERA_APPS_UIDIR=\""$(srcdir)"\"
 
 else
 GST_CAMERABIN_GTK_EXAMPLES =
@@ -29,7 +29,7 @@ endif
 
 gst_camera_perf_SOURCES = gst-camera-perf.c
 gst_camera_perf_CFLAGS  = $(GST_CFLAGS)
-gst_camera_perf_LDADD = $(GST_LIBS) 
+gst_camera_perf_LDADD = $(GST_LIBS)
 
 if HAVE_X11
 
index eded8bb881faedfd0c14dfb314c9d64329d12490..57ff706e14d89ba89e40b6ea2a2292c201641320 100644 (file)
@@ -65,8 +65,7 @@ gtk_widget_get_allocation (GtkWidget * w, GtkAllocation * a)
 
 #define PREVIEW_TIME_MS (2 * 1000)
 #define N_BURST_IMAGES 10
-#define DEFAULT_UI_FILE "gst-camera.ui"
-#define SHARED_UI_FILE CAMERA_APPS_UIDIR"/"DEFAULT_UI_FILE
+#define UI_FILE CAMERA_APPS_UIDIR G_DIR_SEPARATOR_S "gst-camera.ui"
 
 /* Names of default elements */
 #define CAMERA_APP_VIDEOSRC "v4l2src"
@@ -762,7 +761,7 @@ set_metadata (void)
   /* for more information about image metadata tags, see:
    * http://webcvs.freedesktop.org/gstreamer/gst-plugins-bad/tests/icles/metadata_editor.c
    * and for the mapping:
-   * http://webcvs.freedesktop.org/gstreamer/gst-plugins-bad/ext/metadata/metadata_mapping.htm?view=co 
+   * http://webcvs.freedesktop.org/gstreamer/gst-plugins-bad/ext/metadata/metadata_mapping.htm?view=co
    */
 
   GstTagSetter *setter = GST_TAG_SETTER (gst_camera_bin);
@@ -1622,14 +1621,9 @@ static gboolean
 ui_create (void)
 {
   GError *error = NULL;
-  const gchar *uifile = DEFAULT_UI_FILE;
-
-  if (!g_file_test (uifile, G_FILE_TEST_EXISTS)) {
-    uifile = SHARED_UI_FILE;
-  }
 
   builder = gtk_builder_new ();
-  if (!gtk_builder_add_from_file (builder, uifile, &error)) {
+  if (!gtk_builder_add_from_file (builder, UI_FILE, &error)) {
     g_warning ("Couldn't load builder file: %s", error->message);
     g_error_free (error);
     goto done;
index 781f2016399af08259017ca8ba7520fd4886f817..5fa753471288d4d74f025aa9baaf34eca6063260 100644 (file)
@@ -21,7 +21,7 @@ gst_camera2_LDADD   = \
 
 noinst_DATA = $(GST_CAMERABIN_UI_FILES)
 
-INCLUDES = -DCAMERA_APPS_UIDIR=\""$(uidir)"\"
+INCLUDES = -DCAMERA_APPS_UIDIR=\""$(srcdir)"\"
 
 else
 GST_CAMERABIN_GTK_EXAMPLES =
index 42b6e07a068bc10455d02ad8f8b218ef3e7249b6..14e3be10f4b75289c91668671241cee6cd25d753 100644 (file)
@@ -37,7 +37,7 @@
 #include <gdk/gdkx.h>
 #include <gdk/gdkkeysyms.h>
 
-#define UI_FILE "gst-camera2.ui"
+#define UI_FILE CAMERA_APPS_UIDIR G_DIR_SEPARATOR_S "gst-camera2.ui"
 
 static GstElement *camera;
 static GtkBuilder *builder;