pidgin/plugins/vvconfig.c

branch
release-2.x.y
changeset 36316
2415067473ba
parent 36256
a437550a9308
child 37650
f827e56eea34
--- a/pidgin/plugins/vvconfig.c	Fri Mar 06 21:03:03 2015 +0000
+++ b/pidgin/plugins/vvconfig.c	Wed Mar 11 11:39:19 2015 +0000
@@ -26,7 +26,11 @@
 #include "gtkutils.h"
 #include "gtkprefs.h"
 
+#if GST_CHECK_VERSION(1,0,0)
+#include <gst/video/videooverlay.h>
+#else
 #include <gst/interfaces/propertyprobe.h>
+#endif
 
 /* container window for showing a stand-alone configurator */
 static GtkWidget *window = NULL;
@@ -81,8 +85,10 @@
 	GList *ret = NULL;
 	GstElement *element;
 	GObjectClass *klass;
+#if !GST_CHECK_VERSION(1,0,0)
 	GstPropertyProbe *probe;
 	const GParamSpec *pspec;
+#endif
 
 	ret = g_list_prepend(ret, (gpointer)_("Default"));
 	ret = g_list_prepend(ret, "");
@@ -103,6 +109,10 @@
 		return g_list_reverse(ret);
 	}
 
+#if GST_CHECK_VERSION(1,0,0)
+	purple_debug_info("vvconfig", "'%s' - gstreamer-1.0 doesn't suport "
+		"property probing\n", element_name);
+#else
 	if (!g_object_class_find_property(klass, "device") ||
 			!GST_IS_PROPERTY_PROBE(element) ||
 			!(probe = GST_PROPERTY_PROBE(element)) ||
@@ -155,6 +165,7 @@
 			gst_element_set_state(element, GST_STATE_NULL);
 		}
 	}
+#endif
 	gst_object_unref(element);
 
 	return g_list_reverse(ret);
@@ -168,8 +179,13 @@
 	ret = g_list_prepend(ret, "Default");
 	ret = g_list_prepend(ret, "");
 	for (; plugins[0] && plugins[1]; plugins += 2) {
+#if GST_CHECK_VERSION(1,0,0)
+		if (gst_registry_check_feature_version(gst_registry_get(),
+				plugins[0], 0, 0, 0)) {
+#else
 		if (gst_default_registry_check_feature_version(
 				plugins[0], 0, 0, 0)) {
+#endif
 			ret = g_list_prepend(ret, (gpointer)plugins[1]);
 			ret = g_list_prepend(ret, (gpointer)plugins[0]);
 		}
@@ -588,7 +604,13 @@
 
 	list = gst_structure_get_value(
 				gst_message_get_structure(msg), value_name);
+#if GST_CHECK_VERSION(1,0,0)
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+	value = g_value_array_get_nth(g_value_get_boxed(list), 0);
+G_GNUC_END_IGNORE_DEPRECATIONS
+#else
 	value = gst_value_list_get_value(list, 0);
+#endif
 	value_db = g_value_get_double(value);
 	percent = pow(10, value_db / 20);
 	return (percent > 1.0) ? 1.0 : percent;
@@ -604,7 +626,7 @@
 gst_bus_cb(GstBus *bus, GstMessage *msg, BusCbCtx *ctx)
 {
 	if (GST_MESSAGE_TYPE(msg) == GST_MESSAGE_ELEMENT &&
-		gst_structure_has_name(msg->structure, "level")) {
+		gst_structure_has_name(gst_message_get_structure(msg), "level")) {
 
 		GstElement *src = GST_ELEMENT(GST_MESSAGE_SRC(msg));
 		gchar *name = gst_element_get_name(src);

mercurial