[frogr] Disable GStreamer support for OS X, to avoid build issues
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Disable GStreamer support for OS X, to avoid build issues
- Date: Mon, 16 Dec 2013 00:47:47 +0000 (UTC)
commit 8ae1c5b76358d479ba5e6d294239d0c2117b3992
Author: Mario Sanchez Prada <msanchez gnome org>
Date: Sun Dec 15 22:44:45 2013 +0000
Disable GStreamer support for OS X, to avoid build issues
This means that we won't be able to use frogr to upload videos on OS X,
but everything else should be fine, and the bundle should be smaller.
configure.ac | 18 +++++++++++++-----
osx/frogr.bundle | 8 --------
src/frogr-main-view.c | 8 ++++++++
src/frogr-util.c | 10 ++++++++++
src/main.c | 4 ++++
5 files changed, 35 insertions(+), 13 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5031bdf..081c859 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,11 +37,6 @@ PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_MIN_VERSION)
FROGR_CFLAGS="$FROGR_CFLAGS $LIBXML2_CFLAGS"
FROGR_LIBS="$FROGR_LIBS $LIBXML2_LIBS"
-GSTREAMER_MIN_VERSION=1.0
-PKG_CHECK_MODULES(GSTREAMER, gstreamer-1.0 >= $GSTREAMER_MIN_VERSION)
-FROGR_CFLAGS="$FROGR_CFLAGS $GSTREAMER_CFLAGS"
-FROGR_LIBS="$FROGR_LIBS $GSTREAMER_LIBS"
-
JSON_GLIB_MIN_VERSION=0.12
PKG_CHECK_MODULES(JSON_GLIB, json-glib-1.0 >= $JSON-GLIB_MIN_VERSION)
FROGR_CFLAGS="$FROGR_CFLAGS $JSON_GLIB_CFLAGS"
@@ -65,6 +60,18 @@ else
fi
AM_CONDITIONAL([PLATFORM_MAC],[test "x$osx" = "xyes"])
+# Decide whether to use gstreamer or not
+with_gstreamer=no
+if test "x$platform" = "xGNOME"; then
+ GSTREAMER_MIN_VERSION=1.0
+ PKG_CHECK_MODULES(GSTREAMER, gstreamer-1.0 >= $GSTREAMER_MIN_VERSION)
+ FROGR_CFLAGS="$FROGR_CFLAGS $GSTREAMER_CFLAGS"
+ FROGR_LIBS="$FROGR_LIBS $GSTREAMER_LIBS"
+
+ AC_DEFINE(HAVE_GSTREAMER, 1, [Have GStreamer available])
+ with_gstreamer=yes
+fi
+
# Decide whether to use libsoup or libsoup-gnome (if available)
LIBSOUP_MIN_VERSION=2.34
@@ -157,6 +164,7 @@ echo "*************************************"
echo ""
echo "Platform : $platform"
echo "Using libsoup variant : $with_libsoup"
+echo "Using gstreamer : $with_gstreamer"
echo "Enable debug : $enable_debug"
echo ""
echo ""
diff --git a/osx/frogr.bundle b/osx/frogr.bundle
index 278c8c2..71fac55 100644
--- a/osx/frogr.bundle
+++ b/osx/frogr.bundle
@@ -31,14 +31,6 @@
${prefix}/lib/gdk-pixbuf-2.0/${pkg:gdk-pixbuf-2.0:gdk_pixbuf_binary_version}/loaders/*.so
</binary>
- <!-- Gstreamer plugins and scanner -->
- <binary>
- ${prefix}/lib/gstreamer-0.10/*.so
- </binary>
- <binary>
- ${prefix}/libexec/gstreamer-0.10/gst-plugin-scanner
- </binary>
-
<!-- Translation filenames, one for each program or library -->
<translations name="gtk30">
${prefix}/share/locale
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index 18e77f2..1d2bcb6 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -1496,7 +1496,9 @@ _load_pictures_dialog (FrogrMainView *self)
GtkWidget *dialog;
GtkFileFilter *all_filter;
GtkFileFilter *image_filter;
+#ifdef HAVE_GSTREAMER
GtkFileFilter *video_filter;
+#endif
gint i;
const gchar * const *supported_mimetypes;
@@ -1511,15 +1513,19 @@ _load_pictures_dialog (FrogrMainView *self)
/* Set images filter */
all_filter = gtk_file_filter_new ();
image_filter = gtk_file_filter_new ();
+#ifdef HAVE_GSTREAMER
video_filter = gtk_file_filter_new ();
+#endif
supported_mimetypes = frogr_util_get_supported_mimetypes ();
for (i = 0; supported_mimetypes[i]; i++)
{
if (g_str_has_prefix (supported_mimetypes[i], "image"))
gtk_file_filter_add_mime_type (image_filter, supported_mimetypes[i]);
+#ifdef HAVE_GSTREAMER
else
gtk_file_filter_add_mime_type (video_filter, supported_mimetypes[i]);
+#endif
gtk_file_filter_add_mime_type (all_filter, supported_mimetypes[i]);
}
@@ -1530,8 +1536,10 @@ _load_pictures_dialog (FrogrMainView *self)
gtk_file_filter_set_name (image_filter, _("Image Files"));
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), image_filter);
+#ifdef HAVE_GSTREAMER
gtk_file_filter_set_name (video_filter, _("Video Files"));
gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), video_filter);
+#endif
gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (dialog), TRUE);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (dialog), FALSE);
diff --git a/src/frogr-util.c b/src/frogr-util.c
index 0b0603c..a192747 100644
--- a/src/frogr-util.c
+++ b/src/frogr-util.c
@@ -27,8 +27,10 @@
#include <config.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#ifdef HAVE_GSTREAMER
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
+#endif
#include <libexif/exif-byte-order.h>
#include <libexif/exif-data.h>
#include <libexif/exif-entry.h>
@@ -36,8 +38,10 @@
#include <libexif/exif-loader.h>
#include <libexif/exif-tag.h>
+#ifdef HAVE_GSTREAMER
#define CAPS "video/x-raw,format=RGB,width=160,pixel-aspect-ratio=1/1"
#define PREROLL_TIMEOUT (5*GST_SECOND)
+#endif
static gboolean
_spawn_command (const gchar* cmd)
@@ -370,6 +374,7 @@ _get_pixbuf_from_image_contents (const guchar *contents, gsize length, GError **
static GdkPixbuf *
_get_pixbuf_from_video_file (GFile *file, GError **out_error)
{
+#ifdef HAVE_GSTREAMER
GdkPixbuf *pixbuf = NULL;
GstElement *pipeline, *sink;
GstStateChangeReturn ret, sret;
@@ -446,6 +451,9 @@ _get_pixbuf_from_video_file (GFile *file, GError **out_error)
gst_object_unref (pipeline);
return pixbuf;
+#else
+ return NULL;
+#endif
}
GdkPixbuf *
@@ -534,6 +542,7 @@ frogr_util_get_supported_mimetypes (void)
"image/png",
"image/bmp",
"image/gif",
+#ifdef HAVE_GSTREAMER
"video/mpeg",
"video/mp4",
"video/quicktime",
@@ -546,6 +555,7 @@ frogr_util_get_supported_mimetypes (void)
"video/mp2t",
"video/vnd.dlna.mpeg-tts",
"application/ogg",
+#endif
NULL
};
diff --git a/src/main.c b/src/main.c
index fae7a43..0f57582 100644
--- a/src/main.c
+++ b/src/main.c
@@ -25,7 +25,9 @@
#include <config.h>
#include <glib/gi18n.h>
+#ifdef HAVE_GSTREAMER
#include <gst/gst.h>
+#endif
#include <libxml/parser.h>
int
@@ -35,6 +37,7 @@ main (int argc, char **argv)
GError *error = NULL;
int status;
+#ifdef HAVE_GSTREAMER
/* Initialize gstreamer before using any other GLib function */
gst_init_check (&argc, &argv, &error);
if (error)
@@ -42,6 +45,7 @@ main (int argc, char **argv)
DEBUG ("Gstreamer could not be initialized: %s", error->message);
g_error_free (error);
}
+#endif
/* Initialize libxml2 library */
xmlInitParser ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]