[totem/wip/kalev/codecs] missing plugins: Don't hard depend on too new gst-plugins-base



commit 301037f093b74bd5f79c679b6762b5fe161a001d
Author: Kalev Lember <kalevlember gmail com>
Date:   Mon Feb 16 18:27:10 2015 +0100

    missing plugins: Don't hard depend on too new gst-plugins-base
    
    Check if we have the required functions before using them, to avoid hard
    depending on gst-plugins-base git master.

 configure.ac                                       |   10 ++++++++++
 .../bacon-video-widget-gst-missing-plugins.c       |    8 ++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 51d9ca7..253a50b 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 969baab..d254e7e 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]