summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKalev Lember <kalevlember@gmail.com>2015-02-16 18:27:10 +0100
committerKalev Lember <kalevlember@gmail.com>2015-02-16 18:29:44 +0100
commit301037f093b74bd5f79c679b6762b5fe161a001d (patch)
treee1d19638197ec948c329fb55de4d2e96e0cba1a7
parent863a276545facff828aa5d5d30e62a14eb2c1923 (diff)
downloadtotem-wip/kalev/codecs.tar.gz
missing plugins: Don't hard depend on too new gst-plugins-basewip/kalev/codecs
Check if we have the required functions before using them, to avoid hard depending on gst-plugins-base git master.
-rw-r--r--configure.ac10
-rw-r--r--src/backend/bacon-video-widget-gst-missing-plugins.c8
2 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 51d9ca707..253a50bc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,6 +125,16 @@ if test "x$enable_easy_codec_installation" != "xno"; then
AC_DEFINE([ENABLE_MISSING_PLUGIN_INSTALLATION], 1,
[Whether we can and want to do installation of missing plugins])
])
+
+ # Check for gst_install_plugins_context_set_desktop_id, as we don't
+ # want to hard depend on this until there is a stable gst-plugins-base
+ # release with it.
+ save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
+ CFLAGS="`$PKG_CONFIG --cflags gstreamer-pbutils-1.0` $CFLAGS"
+ LIBS="`$PKG_CONFIG --libs gstreamer-pbutils-1.0` $LIBS"
+ AC_CHECK_FUNCS(gst_install_plugins_context_set_desktop_id)
+ LIBS="$save_LIBS"
fi
# ================================================================
diff --git a/src/backend/bacon-video-widget-gst-missing-plugins.c b/src/backend/bacon-video-widget-gst-missing-plugins.c
index 969baabe0..d254e7eeb 100644
--- a/src/backend/bacon-video-widget-gst-missing-plugins.c
+++ b/src/backend/bacon-video-widget-gst-missing-plugins.c
@@ -239,6 +239,7 @@ on_plugin_installation_done (GstInstallPluginsReturn res, gpointer user_data)
}
#ifdef GDK_WINDOWING_X11
+#ifdef HAVE_GST_INSTALL_PLUGINS_CONTEXT_SET_DESKTOP_ID
static gchar *
make_startup_notification_id ()
{
@@ -248,6 +249,7 @@ make_startup_notification_id ()
return g_strdup_printf ("_TIME%u", timestamp);
}
#endif
+#endif
static gboolean
bacon_video_widget_start_plugin_installation (TotemCodecInstallContext *ctx, gboolean confirm_search)
@@ -259,8 +261,10 @@ bacon_video_widget_start_plugin_installation (TotemCodecInstallContext *ctx, gbo
#endif
install_ctx = gst_install_plugins_context_new ();
+#ifdef HAVE_GST_INSTALL_PLUGINS_CONTEXT_SET_DESKTOP_ID
gst_install_plugins_context_set_desktop_id (install_ctx, "org.gnome.Totem.desktop");
gst_install_plugins_context_set_confirm_search (install_ctx, confirm_search);
+#endif
#ifdef GDK_WINDOWING_X11
display = gdk_display_get_default ();
@@ -269,12 +273,16 @@ bacon_video_widget_start_plugin_installation (TotemCodecInstallContext *ctx, gbo
gtk_widget_get_window (GTK_WIDGET (ctx->bvw)) != NULL &&
gtk_widget_get_realized (GTK_WIDGET (ctx->bvw)))
{
+#ifdef HAVE_GST_INSTALL_PLUGINS_CONTEXT_SET_DESKTOP_ID
gchar *startup_id;
+#endif
gulong xid = 0;
+#ifdef HAVE_GST_INSTALL_PLUGINS_CONTEXT_SET_DESKTOP_ID
startup_id = make_startup_notification_id ();
gst_install_plugins_context_set_startup_notification_id (install_ctx, startup_id);
g_free (startup_id);
+#endif
xid = bacon_video_widget_gst_get_toplevel (GTK_WIDGET (ctx->bvw));
gst_install_plugins_context_set_xid (install_ctx, xid);