From 1f560af76b4859b30444a1667ee8907dd0acf1cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 30 Oct 2021 00:52:42 +0100 Subject: [PATCH] dtls: don't use deprecated g_binding_get_source() with newer GLib versions Part-of: --- subprojects/gst-plugins-bad/ext/dtls/gstdtlssrtpenc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/ext/dtls/gstdtlssrtpenc.c b/subprojects/gst-plugins-bad/ext/dtls/gstdtlssrtpenc.c index 21734c6..d27fc47 100644 --- a/subprojects/gst-plugins-bad/ext/dtls/gstdtlssrtpenc.c +++ b/subprojects/gst-plugins-bad/ext/dtls/gstdtlssrtpenc.c @@ -268,12 +268,21 @@ gst_dtls_srtp_enc_init (GstDtlsSrtpEnc * self) NULL, auth_enum_class, NULL); } +#if GLIB_CHECK_VERSION(2,68,0) +#define binding_get_source(b) g_binding_dup_source(b) +#define unref_source(s) G_STMT_START { if(s) g_object_unref(s); } G_STMT_END +#else +#define binding_get_source(b) g_binding_get_source(b) +#define unref_source(s) /* no op */ +#endif + static gboolean transform_enum (GBinding * binding, const GValue * source_value, GValue * target_value, GEnumClass * enum_class) { GEnumValue *enum_value; const gchar *nick; + GObject *bind_src; nick = g_value_get_string (source_value); g_return_val_if_fail (nick, FALSE); @@ -281,9 +290,13 @@ transform_enum (GBinding * binding, const GValue * source_value, enum_value = g_enum_get_value_by_nick (enum_class, nick); g_return_val_if_fail (enum_value, FALSE); - GST_DEBUG_OBJECT (g_binding_get_source (binding), + bind_src = binding_get_source (binding); + + GST_DEBUG_OBJECT (bind_src, "transforming enum from %s to %d", nick, enum_value->value); + unref_source (bind_src); + g_value_set_enum (target_value, enum_value->value); return TRUE; -- 2.7.4