From bfcb5a43a6e3a068dbd72565210806e50f526cf5 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 2 Dec 2011 13:19:38 +0100 Subject: [PATCH 1/9] identity: unlock clock wait when appropriate ... notably FLUSH and state change to READY. --- plugins/elements/gstidentity.c | 62 +++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index ba2026d4b1..f51ca5ae75 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -111,6 +111,8 @@ static GstFlowReturn gst_identity_prepare_output_buffer (GstBaseTransform GstBuffer ** out_buf); static gboolean gst_identity_start (GstBaseTransform * trans); static gboolean gst_identity_stop (GstBaseTransform * trans); +static GstStateChangeReturn gst_identity_change_state (GstElement * element, + GstStateChange transition); static guint gst_identity_signals[LAST_SIGNAL] = { 0 }; @@ -179,9 +181,11 @@ static void gst_identity_class_init (GstIdentityClass * klass) { GObjectClass *gobject_class; + GstElementClass *gstelement_class; GstBaseTransformClass *gstbasetrans_class; gobject_class = G_OBJECT_CLASS (klass); + gstelement_class = GST_ELEMENT_CLASS (klass); gstbasetrans_class = GST_BASE_TRANSFORM_CLASS (klass); gobject_class->set_property = gst_identity_set_property; @@ -271,6 +275,9 @@ gst_identity_class_init (GstIdentityClass * klass) gobject_class->finalize = gst_identity_finalize; + gstelement_class->change_state = + GST_DEBUG_FUNCPTR (gst_identity_change_state); + gstbasetrans_class->event = GST_DEBUG_FUNCPTR (gst_identity_event); gstbasetrans_class->transform_ip = GST_DEBUG_FUNCPTR (gst_identity_transform_ip); @@ -377,6 +384,17 @@ gst_identity_event (GstBaseTransform * trans, GstEvent * event) ret = parent_class->event (trans, event); + if (GST_EVENT_TYPE (event) == GST_EVENT_FLUSH_START) { + GST_OBJECT_LOCK (identity); + if (identity->clock_id) { + GST_DEBUG_OBJECT (identity, "unlock clock wait"); + gst_clock_id_unschedule (identity->clock_id); + gst_clock_id_unref (identity->clock_id); + identity->clock_id = NULL; + } + GST_OBJECT_UNLOCK (identity); + } + if (identity->single_segment && (GST_EVENT_TYPE (event) == GST_EVENT_NEWSEGMENT)) { /* eat up segments */ @@ -656,7 +674,6 @@ gst_identity_transform_ip (GstBaseTransform * trans, GstBuffer * buf) timestamp = runtimestamp + GST_ELEMENT (identity)->base_time; /* save id if we need to unlock */ - /* FIXME: actually unlock this somewhere in the state changes */ identity->clock_id = gst_clock_new_single_shot_id (clock, timestamp); GST_OBJECT_UNLOCK (identity); @@ -825,3 +842,46 @@ gst_identity_stop (GstBaseTransform * trans) return TRUE; } + +static GstStateChangeReturn +gst_identity_change_state (GstElement * element, GstStateChange transition) +{ + GstStateChangeReturn ret; + GstIdentity *identity = GST_IDENTITY (element); + + switch (transition) { + case GST_STATE_CHANGE_NULL_TO_READY: + break; + case GST_STATE_CHANGE_READY_TO_PAUSED: + break; + case GST_STATE_CHANGE_PAUSED_TO_PLAYING: + break; + case GST_STATE_CHANGE_PAUSED_TO_READY: + GST_OBJECT_LOCK (identity); + if (identity->clock_id) { + GST_DEBUG_OBJECT (identity, "unlock clock wait"); + gst_clock_id_unschedule (identity->clock_id); + gst_clock_id_unref (identity->clock_id); + identity->clock_id = NULL; + } + GST_OBJECT_UNLOCK (identity); + break; + default: + break; + } + + ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); + + switch (transition) { + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: + break; + case GST_STATE_CHANGE_PAUSED_TO_READY: + break; + case GST_STATE_CHANGE_READY_TO_NULL: + break; + default: + break; + } + + return ret; +} From ca179625f89edf6a118eb9e934a89de4ed4b720b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 3 Dec 2011 13:58:51 +0000 Subject: [PATCH 2/9] g_thread_create() is deprecated in GLib master, use g_thread_try_new() instead --- gst/gstsystemclock.c | 6 ++++++ libs/gst/check/gstcheck.h | 11 +++++++++++ libs/gst/net/gstnetclientclock.c | 8 +++++++- libs/gst/net/gstnettimeprovider.c | 8 +++++++- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c index ef691fd17d..2c71489cfa 100644 --- a/gst/gstsystemclock.c +++ b/gst/gstsystemclock.c @@ -735,8 +735,14 @@ gst_system_clock_start_async (GstSystemClock * clock) if (G_LIKELY (clock->thread != NULL)) return TRUE; /* Thread already running. Nothing to do */ +#if !GLIB_CHECK_VERSION (2, 31, 0) clock->thread = g_thread_create ((GThreadFunc) gst_system_clock_async_thread, clock, TRUE, &error); +#else + clock->thread = g_thread_try_new ("GstSystemClock", + (GThreadFunc) gst_system_clock_async_thread, clock, &error); +#endif + if (G_UNLIKELY (error)) goto no_thread; diff --git a/libs/gst/check/gstcheck.h b/libs/gst/check/gstcheck.h index 004eb7457d..e77c007bce 100644 --- a/libs/gst/check/gstcheck.h +++ b/libs/gst/check/gstcheck.h @@ -277,6 +277,17 @@ MAIN_INIT(); \ MAIN_START_THREAD_FUNCTIONS(count, function, data); \ MAIN_SYNCHRONIZE(); +#if GLIB_CHECK_VERSION (2, 31, 0) +#define g_thread_create gst_g_thread_create +static inline GThread * +gst_g_thread_create (GThreadFunc func, gpointer data, gboolean joinable, + GError **error) +{ + g_assert (joinable); + return g_thread_try_new ("gst-check", func, data, error); +} +#endif + #define MAIN_INIT() \ G_STMT_START { \ _gst_check_threads_running = TRUE; \ diff --git a/libs/gst/net/gstnetclientclock.c b/libs/gst/net/gstnetclientclock.c index dcaa975891..dc56b4f09d 100644 --- a/libs/gst/net/gstnetclientclock.c +++ b/libs/gst/net/gstnetclientclock.c @@ -457,9 +457,15 @@ gst_net_client_clock_start (GstNetClientClock * self) gst_poll_add_fd (self->priv->fdset, &self->priv->sock); gst_poll_fd_ctl_read (self->priv->fdset, &self->priv->sock, TRUE); +#if !GLIB_CHECK_VERSION (2, 31, 0) self->thread = g_thread_create (gst_net_client_clock_thread, self, TRUE, &error); - if (!self->thread) +#else + self->thread = g_thread_try_new ("GstNetClientClock", + gst_net_client_clock_thread, self, &error); +#endif + + if (error != NULL) goto no_thread; return TRUE; diff --git a/libs/gst/net/gstnettimeprovider.c b/libs/gst/net/gstnettimeprovider.c index b04d28243e..8e3e7f6d1e 100644 --- a/libs/gst/net/gstnettimeprovider.c +++ b/libs/gst/net/gstnettimeprovider.c @@ -403,9 +403,15 @@ gst_net_time_provider_start (GstNetTimeProvider * self) gst_poll_add_fd (self->priv->fdset, &self->priv->sock); gst_poll_fd_ctl_read (self->priv->fdset, &self->priv->sock, TRUE); +#if !GLIB_CHECK_VERSION (2, 31, 0) self->thread = g_thread_create (gst_net_time_provider_thread, self, TRUE, &error); - if (!self->thread) +#else + self->thread = g_thread_try_new ("GstNetTimeProvider", + gst_net_time_provider_thread, self, &error); +#endif + + if (error != NULL) goto no_thread; return TRUE; From 4b18f0a5c3d9d7d2bf91b5228bb5b84081ccb16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 3 Dec 2011 15:36:58 +0000 Subject: [PATCH 3/9] taglist: update for thread API deprecations in glib master --- gst/gsttaglist.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/gst/gsttaglist.c b/gst/gsttaglist.c index 566a4e0d9d..282c920048 100644 --- a/gst/gsttaglist.c +++ b/gst/gsttaglist.c @@ -65,14 +65,23 @@ typedef struct } GstTagInfo; +#if GLIB_CHECK_VERSION (2, 31, 0) +#define g_value_get_char g_value_get_schar +#endif + +#if !GLIB_CHECK_VERSION (2, 31, 0) static GMutex *__tag_mutex; +#define TAG_LOCK g_mutex_lock (__tag_mutex) +#define TAG_UNLOCK g_mutex_unlock (__tag_mutex) +#else +static GMutex __tag_mutex; +#define TAG_LOCK g_mutex_lock (&__tag_mutex) +#define TAG_UNLOCK g_mutex_unlock (&__tag_mutex) +#endif /* tags hash table: maps tag name string => GstTagInfo */ static GHashTable *__tags; -#define TAG_LOCK g_mutex_lock (__tag_mutex) -#define TAG_UNLOCK g_mutex_unlock (__tag_mutex) - GType gst_tag_list_get_type (void) { @@ -94,7 +103,11 @@ gst_tag_list_get_type (void) void _gst_tag_initialize (void) { +#if !GLIB_CHECK_VERSION (2, 31, 0) __tag_mutex = g_mutex_new (); +#else + g_mutex_init (&__tag_mutex); +#endif __tags = g_hash_table_new (g_str_hash, g_str_equal); gst_tag_register (GST_TAG_TITLE, GST_TAG_FLAG_META, G_TYPE_STRING, From ff96aeee84aedeae1efb8ce8ef1b9c7d6709b6dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 3 Dec 2011 16:02:36 +0000 Subject: [PATCH 4/9] tagsetter: update for thread API deprecations in glib master --- gst/gsttagsetter.c | 61 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/gst/gsttagsetter.c b/gst/gsttagsetter.c index d08d7e8839..72830c822a 100644 --- a/gst/gsttagsetter.c +++ b/gst/gsttagsetter.c @@ -83,9 +83,21 @@ typedef struct { GstTagMergeMode mode; GstTagList *list; +#if !GLIB_CHECK_VERSION (2, 31, 0) GStaticMutex lock; +#else + GMutex lock; +#endif } GstTagData; +#if !GLIB_CHECK_VERSION (2, 31, 0) +#define GST_TAG_DATA_LOCK(data) g_static_mutex_lock(&data->lock) +#define GST_TAG_DATA_UNLOCK(data) g_static_mutex_unlock(&data->lock) +#else +#define GST_TAG_DATA_LOCK(data) g_mutex_lock(&data->lock) +#define GST_TAG_DATA_UNLOCK(data) g_mutex_unlock(&data->lock) +#endif + GType gst_tag_setter_get_type (void) { @@ -125,7 +137,11 @@ gst_tag_data_free (gpointer p) if (data->list) gst_tag_list_free (data->list); +#if !GLIB_CHECK_VERSION (2, 31, 0) g_static_mutex_free (&data->lock); +#else + g_mutex_clear (&data->lock); +#endif g_slice_free (GstTagData, data); } @@ -137,20 +153,35 @@ gst_tag_setter_get_data (GstTagSetter * setter) data = g_object_get_qdata (G_OBJECT (setter), gst_tag_key); if (!data) { + /* make sure no other thread is creating a GstTagData at the same time */ +#if !GLIB_CHECK_VERSION (2, 31, 0) static GStaticMutex create_mutex = G_STATIC_MUTEX_INIT; - /* make sure no other thread is creating a GstTagData at the same time */ g_static_mutex_lock (&create_mutex); +#else + static GMutex create_mutex; /* no initialisation required */ + + g_mutex_lock (&create_mutex); +#endif + data = g_object_get_qdata (G_OBJECT (setter), gst_tag_key); if (!data) { data = g_slice_new (GstTagData); +#if !GLIB_CHECK_VERSION (2, 31, 0) g_static_mutex_init (&data->lock); +#else + g_mutex_init (&data->lock); +#endif data->list = NULL; data->mode = GST_TAG_MERGE_KEEP; g_object_set_qdata_full (G_OBJECT (setter), gst_tag_key, data, gst_tag_data_free); } +#if !GLIB_CHECK_VERSION (2, 31, 0) g_static_mutex_unlock (&create_mutex); +#else + g_mutex_unlock (&create_mutex); +#endif } return data; @@ -174,12 +205,12 @@ gst_tag_setter_reset_tags (GstTagSetter * setter) data = gst_tag_setter_get_data (setter); - g_static_mutex_lock (&data->lock); + GST_TAG_DATA_LOCK (data); if (data->list) { gst_tag_list_free (data->list); data->list = NULL; } - g_static_mutex_unlock (&data->lock); + GST_TAG_DATA_UNLOCK (data); } /** @@ -202,14 +233,14 @@ gst_tag_setter_merge_tags (GstTagSetter * setter, const GstTagList * list, data = gst_tag_setter_get_data (setter); - g_static_mutex_lock (&data->lock); + GST_TAG_DATA_LOCK (data); if (data->list == NULL) { if (mode != GST_TAG_MERGE_KEEP_ALL) data->list = gst_tag_list_copy (list); } else { gst_tag_list_insert (data->list, list, mode); } - g_static_mutex_unlock (&data->lock); + GST_TAG_DATA_UNLOCK (data); } /** @@ -281,13 +312,13 @@ gst_tag_setter_add_tag_valist (GstTagSetter * setter, GstTagMergeMode mode, data = gst_tag_setter_get_data (setter); - g_static_mutex_lock (&data->lock); + GST_TAG_DATA_LOCK (data); if (!data->list) data->list = gst_tag_list_new (); gst_tag_list_add_valist (data->list, mode, tag, var_args); - g_static_mutex_unlock (&data->lock); + GST_TAG_DATA_UNLOCK (data); } /** @@ -311,14 +342,14 @@ gst_tag_setter_add_tag_valist_values (GstTagSetter * setter, data = gst_tag_setter_get_data (setter); - g_static_mutex_lock (&data->lock); + GST_TAG_DATA_LOCK (data); if (!data->list) data->list = gst_tag_list_new (); gst_tag_list_add_valist_values (data->list, mode, tag, var_args); - g_static_mutex_unlock (&data->lock); + GST_TAG_DATA_UNLOCK (data); } /** @@ -343,14 +374,14 @@ gst_tag_setter_add_tag_value (GstTagSetter * setter, data = gst_tag_setter_get_data (setter); - g_static_mutex_lock (&data->lock); + GST_TAG_DATA_LOCK (data); if (!data->list) data->list = gst_tag_list_new (); gst_tag_list_add_value (data->list, mode, tag, value); - g_static_mutex_unlock (&data->lock); + GST_TAG_DATA_UNLOCK (data); } /** @@ -392,9 +423,9 @@ gst_tag_setter_set_tag_merge_mode (GstTagSetter * setter, GstTagMergeMode mode) data = gst_tag_setter_get_data (setter); - g_static_mutex_lock (&data->lock); + GST_TAG_DATA_LOCK (data); data->mode = mode; - g_static_mutex_unlock (&data->lock); + GST_TAG_DATA_UNLOCK (data); } /** @@ -416,9 +447,9 @@ gst_tag_setter_get_tag_merge_mode (GstTagSetter * setter) data = gst_tag_setter_get_data (setter); - g_static_mutex_lock (&data->lock); + GST_TAG_DATA_LOCK (data); mode = data->mode; - g_static_mutex_unlock (&data->lock); + GST_TAG_DATA_UNLOCK (data); return mode; } From fef18639dbd0436fa80c20bd87fc7c97069341c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 3 Dec 2011 17:40:53 +0000 Subject: [PATCH 5/9] g_thread_init() is deprecated in glib master It's not needed any longer. --- gst/gst.c | 8 ++++++++ libs/gst/helpers/gst-plugin-scanner.c | 2 ++ tools/gst-inspect.c | 2 ++ tools/gst-launch.c | 2 ++ tools/gst-typefind.c | 2 ++ tools/gst-xmlinspect.c | 2 ++ 6 files changed, 18 insertions(+) diff --git a/gst/gst.c b/gst/gst.c index aa187f64f3..ff7f2507ca 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -360,6 +360,9 @@ gst_init_get_option_group (void) {NULL} }; +/* Since GLib 2.31.0 threading is always enabled and g_thread_init() + * is not needed any longer and deprecated */ +#if !GLIB_CHECK_VERSION (2, 31, 0) /* Since GLib 2.23.2 calling g_thread_init() 'late' is allowed and is * automatically done as part of g_type_init() */ if (glib_check_version (2, 23, 3)) { @@ -381,6 +384,7 @@ gst_init_get_option_group (void) } else { /* GLib >= 2.23.2 */ } +#endif group = g_option_group_new ("gst", _("GStreamer Options"), _("Show GStreamer Options"), NULL, NULL); @@ -424,8 +428,10 @@ gst_init_check (int *argc, char **argv[], GError ** err) #endif gboolean res; +#if !GLIB_CHECK_VERSION (2, 31, 0) if (!g_thread_get_initialized ()) g_thread_init (NULL); +#endif if (gst_initialized) { GST_DEBUG ("already initialized gst"); @@ -574,8 +580,10 @@ init_pre (GOptionContext * context, GOptionGroup * group, gpointer data, g_type_init (); +#if !GLIB_CHECK_VERSION (2, 31, 0) /* we need threading to be enabled right here */ g_assert (g_thread_get_initialized ()); +#endif _gst_debug_init (); diff --git a/libs/gst/helpers/gst-plugin-scanner.c b/libs/gst/helpers/gst-plugin-scanner.c index 0405728101..d54c65686c 100644 --- a/libs/gst/helpers/gst-plugin-scanner.c +++ b/libs/gst/helpers/gst-plugin-scanner.c @@ -41,8 +41,10 @@ main (int argc, char *argv[]) if (argc != 2 || strcmp (argv[1], "-l")) return 1; +#if !GLIB_CHECK_VERSION (2, 31, 0) if (!g_thread_supported ()) g_thread_init (NULL); +#endif my_argc = 2; my_argv = g_malloc (my_argc * sizeof (char *)); diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c index f42b6edaf5..d3ce0c8533 100644 --- a/tools/gst-inspect.c +++ b/tools/gst-inspect.c @@ -1561,7 +1561,9 @@ main (int argc, char *argv[]) textdomain (GETTEXT_PACKAGE); #endif +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_init (NULL); +#endif gst_tools_set_prgname ("gst-inspect"); diff --git a/tools/gst-launch.c b/tools/gst-launch.c index ea99b8f6dd..b801d033d4 100644 --- a/tools/gst-launch.c +++ b/tools/gst-launch.c @@ -971,7 +971,9 @@ main (int argc, char *argv[]) textdomain (GETTEXT_PACKAGE); #endif +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_init (NULL); +#endif gst_tools_set_prgname ("gst-launch"); diff --git a/tools/gst-typefind.c b/tools/gst-typefind.c index 53635d620e..123f395dff 100644 --- a/tools/gst-typefind.c +++ b/tools/gst-typefind.c @@ -153,7 +153,9 @@ main (int argc, char *argv[]) textdomain (GETTEXT_PACKAGE); #endif +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_init (NULL); +#endif gst_tools_set_prgname ("gst-typefind"); diff --git a/tools/gst-xmlinspect.c b/tools/gst-xmlinspect.c index d1df7e1b6d..af3bb7f25f 100644 --- a/tools/gst-xmlinspect.c +++ b/tools/gst-xmlinspect.c @@ -641,7 +641,9 @@ main (int argc, char *argv[]) setlocale (LC_ALL, ""); +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_init (NULL); +#endif gst_tools_set_prgname ("gst-xmlinspect"); From 1f14a425d0e6af4c36d63a93442a75b3203fa46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 4 Dec 2011 13:04:35 +0000 Subject: [PATCH 6/9] net: initialise GError variables to NULL --- libs/gst/net/gstnetclientclock.c | 2 +- libs/gst/net/gstnettimeprovider.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/gst/net/gstnetclientclock.c b/libs/gst/net/gstnetclientclock.c index dc56b4f09d..9a0e397db2 100644 --- a/libs/gst/net/gstnetclientclock.c +++ b/libs/gst/net/gstnetclientclock.c @@ -423,7 +423,7 @@ gst_net_client_clock_start (GstNetClientClock * self) struct sockaddr_in servaddr, myaddr; socklen_t len; gint ret; - GError *error; + GError *error = NULL; g_return_val_if_fail (self->address != NULL, FALSE); g_return_val_if_fail (self->servaddr == NULL, FALSE); diff --git a/libs/gst/net/gstnettimeprovider.c b/libs/gst/net/gstnettimeprovider.c index 8e3e7f6d1e..dacdd87f25 100644 --- a/libs/gst/net/gstnettimeprovider.c +++ b/libs/gst/net/gstnettimeprovider.c @@ -355,7 +355,7 @@ gst_net_time_provider_start (GstNetTimeProvider * self) socklen_t len; int port; gint ret; - GError *error; + GError *error = NULL; if ((ret = socket (AF_INET, SOCK_DGRAM, 0)) < 0) goto no_socket; From a8b79513c14f71a5cd39e92dadfd3dbba2bb9993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 4 Dec 2011 13:09:53 +0000 Subject: [PATCH 7/9] benchmarks: g_thread_create() is deprecated in GLib master, use g_thread_try_new() instead --- tests/benchmarks/gstbufferstress.c | 6 ++++++ tests/benchmarks/gstclockstress.c | 5 +++++ tests/benchmarks/gstpollstress.c | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/tests/benchmarks/gstbufferstress.c b/tests/benchmarks/gstbufferstress.c index e3f2912a3e..e7ec274ebd 100644 --- a/tests/benchmarks/gstbufferstress.c +++ b/tests/benchmarks/gstbufferstress.c @@ -20,6 +20,7 @@ #include #include #include +#include "gst/glib-compat-private.h" #define MAX_THREADS 1000 @@ -95,7 +96,12 @@ main (gint argc, gchar * argv[]) for (t = 0; t < num_threads; t++) { GError *error = NULL; +#if !GLIB_CHECK_VERSION (2, 31, 0) threads[t] = g_thread_create (run_test, GINT_TO_POINTER (t), TRUE, &error); +#else + threads[t] = g_thread_try_new ("bufferstresstest", run_test, + GINT_TO_POINTER (t), &error); +#endif if (error) { printf ("ERROR: g_thread_create() %s\n", error->message); exit (-1); diff --git a/tests/benchmarks/gstclockstress.c b/tests/benchmarks/gstclockstress.c index b0f721b3d5..60895d92b0 100644 --- a/tests/benchmarks/gstclockstress.c +++ b/tests/benchmarks/gstclockstress.c @@ -65,7 +65,12 @@ main (gint argc, gchar * argv[]) for (t = 0; t < num_threads; t++) { GError *error = NULL; +#if !GLIB_CHECK_VERSION (2, 31, 0) threads[t] = g_thread_create (run_test, sysclock, TRUE, &error); +#else + threads[t] = g_thread_try_new ("clockstresstest", run_test, + sysclock, &error); +#endif if (error) { printf ("ERROR: g_thread_create() %s\n", error->message); exit (-1); diff --git a/tests/benchmarks/gstpollstress.c b/tests/benchmarks/gstpollstress.c index bf0d548fd3..b384f9554f 100644 --- a/tests/benchmarks/gstpollstress.c +++ b/tests/benchmarks/gstpollstress.c @@ -21,6 +21,7 @@ #include #include #include +#include "gst/glib-compat-private.h" static GstPoll *set; static GList *fds = NULL; @@ -159,7 +160,12 @@ main (gint argc, gchar * argv[]) for (t = 0; t < num_threads; t++) { GError *error = NULL; +#if !GLIB_CHECK_VERSION (2, 31, 0) threads[t] = g_thread_create (run_test, GINT_TO_POINTER (t), TRUE, &error); +#else + threads[t] = g_thread_try_new ("pollstresstest", run_test, + GINT_TO_POINTER (t), &error); +#endif if (error) { printf ("ERROR: g_thread_create() %s\n", error->message); exit (-1); From 5889260d5a68ca13b2fb8ad22c7abb8063964e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 4 Dec 2011 13:35:38 +0000 Subject: [PATCH 8/9] Work around deprecated thread API in glib master Add private replacements for deprecated functions such as g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly to avoid the deprecation warnings. We can't change most of these in 0.10 because they're part of our API and ABI. --- gst/glib-compat-private.h | 65 +++++++++++++++++++ gst/gstbus.c | 1 + gst/gstclock.c | 1 + gst/gstelement.c | 1 + gst/gstobject.h | 19 ++++++ gst/gsttask.c | 14 +++- libs/gst/base/gstbaseparse.c | 45 +++++++++---- libs/gst/base/gstbasesrc.c | 1 + libs/gst/base/gstbasetransform.c | 1 + libs/gst/base/gstcollectpads.c | 1 + libs/gst/base/gstcollectpads2.c | 2 + libs/gst/base/gstdataqueue.c | 1 + libs/gst/check/gstcheck.h | 62 ++++++++++++++++++ libs/gst/controller/gstcontroller.c | 1 + .../gstinterpolationcontrolsource.c | 1 + libs/gst/controller/gstlfocontrolsource.c | 2 + plugins/elements/gstinputselector.c | 2 + plugins/elements/gstqueue.c | 1 + plugins/elements/gstqueue2.c | 1 + plugins/elements/gsttee.c | 1 + 20 files changed, 211 insertions(+), 12 deletions(-) diff --git a/gst/glib-compat-private.h b/gst/glib-compat-private.h index 7b5d6cf860..d143d3257d 100644 --- a/gst/glib-compat-private.h +++ b/gst/glib-compat-private.h @@ -48,6 +48,71 @@ typedef struct stat GStatBuf; /* copies */ +#if GLIB_CHECK_VERSION (2, 31, 0) +#define g_mutex_new gst_g_mutex_new +static inline GMutex * +gst_g_mutex_new (void) +{ + GMutex *mutex = g_slice_new (GMutex); + g_mutex_init (mutex); + return mutex; +} +#define g_mutex_free gst_g_mutex_free +static inline void +gst_g_mutex_free (GMutex *mutex) +{ + g_mutex_clear (mutex); + g_slice_free (GMutex, mutex); +} +#define g_static_rec_mutex_init gst_g_static_rec_mutex_init +static inline void +gst_g_static_rec_mutex_init (GStaticRecMutex *mutex) +{ + static const GStaticRecMutex init_mutex = G_STATIC_REC_MUTEX_INIT; + + *mutex = init_mutex; +} +#define g_cond_new gst_g_cond_new +static inline GCond * +gst_g_cond_new (void) +{ + GCond *cond = g_slice_new (GCond); + g_cond_init (cond); + return cond; +} +#define g_cond_free gst_g_cond_free +static inline void +gst_g_cond_free (GCond *cond) +{ + g_cond_clear (cond); + g_slice_free (GCond, cond); +} +#define g_cond_timed_wait gst_g_cond_timed_wait +static inline gboolean +gst_g_cond_timed_wait (GCond *cond, GMutex *mutex, GTimeVal *abs_time) +{ + gint64 end_time; + + if (abs_time == NULL) { + g_cond_wait (cond, mutex); + return TRUE; + } + + end_time = abs_time->tv_sec; + end_time *= 1000000; + end_time += abs_time->tv_usec; + + /* would be nice if we had clock_rtoffset, but that didn't seem to + * make it into the kernel yet... + */ + /* if CLOCK_MONOTONIC is not defined then g_get_montonic_time() and + * g_get_real_time() are returning the same clock and we'd add ~0 + */ + end_time += g_get_monotonic_time () - g_get_real_time (); + return g_cond_wait_until (cond, mutex, end_time); +} +#endif /* GLIB_CHECK_VERSION (2, 31, 0) */ + /* adaptations */ G_END_DECLS diff --git a/gst/gstbus.c b/gst/gstbus.c index 42c66def54..b80420b9de 100644 --- a/gst/gstbus.c +++ b/gst/gstbus.c @@ -77,6 +77,7 @@ #include "gstinfo.h" #include "gstbus.h" +#include "glib-compat-private.h" #define GST_CAT_DEFAULT GST_CAT_BUS /* bus signals */ diff --git a/gst/gstclock.c b/gst/gstclock.c index 45f503e731..bd2eb8f23c 100644 --- a/gst/gstclock.c +++ b/gst/gstclock.c @@ -109,6 +109,7 @@ #include "gstclock.h" #include "gstinfo.h" #include "gstutils.h" +#include "glib-compat-private.h" #ifndef GST_DISABLE_TRACE /* #define GST_WITH_ALLOC_TRACE */ diff --git a/gst/gstelement.c b/gst/gstelement.c index afa25b9d37..6577428d70 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -95,6 +95,7 @@ #include "gstinfo.h" #include "gstvalue.h" #include "gst-i18n-lib.h" +#include "glib-compat-private.h" /* Element signals and args */ enum diff --git a/gst/gstobject.h b/gst/gstobject.h index b9c5206d4b..a522aeebb4 100644 --- a/gst/gstobject.h +++ b/gst/gstobject.h @@ -215,29 +215,48 @@ struct _GstObject { * * This macro will return the class lock used to protect deep_notify signal * emission on thread-unsafe glib versions (glib < 2.8). + * + * Deprecated: 0.10.36: Don't use this, it's not needed any longer. */ +#ifndef GST_DISABLE_DEPRECATED #define GST_CLASS_GET_LOCK(obj) (GST_OBJECT_CLASS_CAST(obj)->lock) +#endif + /** * GST_CLASS_LOCK: * @obj: a #GstObjectClass * * Lock the class. + * + * Deprecated: 0.10.36: Don't use this, it's not needed any longer. */ +#ifndef GST_DISABLE_DEPRECATED #define GST_CLASS_LOCK(obj) (g_static_rec_mutex_lock(GST_CLASS_GET_LOCK(obj))) +#endif + /** * GST_CLASS_TRYLOCK: * @obj: a #GstObjectClass * * Try to lock the class, returns TRUE if class could be locked. + * + * Deprecated: 0.10.36: Don't use this, it's not needed any longer. */ +#ifndef GST_DISABLE_DEPRECATED #define GST_CLASS_TRYLOCK(obj) (g_static_rec_mutex_trylock(GST_CLASS_GET_LOCK(obj))) +#endif + /** * GST_CLASS_UNLOCK: * @obj: a #GstObjectClass * * Unlock the class. + * + * Deprecated: 0.10.36: Don't use this, it's not needed any longer. */ +#ifndef GST_DISABLE_DEPRECATED #define GST_CLASS_UNLOCK(obj) (g_static_rec_mutex_unlock(GST_CLASS_GET_LOCK(obj))) +#endif /** * GstObjectClass: diff --git a/gst/gsttask.c b/gst/gsttask.c index e06e0d6917..c66c7b760c 100644 --- a/gst/gsttask.c +++ b/gst/gsttask.c @@ -72,6 +72,7 @@ #include "gstinfo.h" #include "gsttask.h" +#include "glib-compat-private.h" #include @@ -276,8 +277,13 @@ gst_task_func (GstTask * task) goto no_lock; task->abidata.ABI.thread = tself; /* only update the priority when it was changed */ - if (priv->prio_set) + if (priv->prio_set) { +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_set_priority (tself, priv->priority); +#else + GST_INFO_OBJECT (task, "Thread priorities no longer have any effect"); +#endif + } GST_OBJECT_UNLOCK (task); /* fire the enter_thread callback when we need to */ @@ -333,7 +339,9 @@ exit: } else { /* restore normal priority when releasing back into the pool, we will not * touch the priority when a custom callback has been installed. */ +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_set_priority (tself, G_THREAD_PRIORITY_NORMAL); +#endif } /* now we allow messing with the lock again by setting the running flag to * FALSE. Together with the SIGNAL this is the sign for the _join() to @@ -475,7 +483,11 @@ gst_task_set_priority (GstTask * task, GThreadPriority priority) if (thread != NULL) { /* if this task already has a thread, we can configure the priority right * away, else we do that when we assign a thread to the task. */ +#if !GLIB_CHECK_VERSION (2, 31, 0) g_thread_set_priority (thread, priority); +#else + GST_INFO_OBJECT (task, "Thread priorities no longer have any effect"); +#endif } GST_OBJECT_UNLOCK (task); } diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 308bb8a895..3cd4db5078 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -284,7 +284,11 @@ struct _GstBaseParsePrivate GstIndex *index; gint index_id; gboolean own_index; +#if !GLIB_CHECK_VERSION (2, 31, 0) GStaticMutex index_lock; +#else + GMutex index_lock; +#endif /* seek table entries only maintained if upstream is BYTE seekable */ gboolean upstream_seekable; @@ -333,6 +337,18 @@ typedef struct _GstBaseParseSeek GstClockTime start_ts; } GstBaseParseSeek; +#if !GLIB_CHECK_VERSION (2, 31, 0) +#define GST_BASE_PARSE_INDEX_LOCK(parse) \ + g_static_mutex_lock (&parse->priv->index_lock); +#define GST_BASE_PARSE_INDEX_UNLOCK(parse) \ + g_static_mutex_unlock (&parse->priv->index_lock); +#else +#define GST_BASE_PARSE_INDEX_LOCK(parse) \ + g_mutex_lock (&parse->priv->index_lock); +#define GST_BASE_PARSE_INDEX_UNLOCK(parse) \ + g_mutex_unlock (&parse->priv->index_lock); +#endif + static GstElementClass *parent_class = NULL; static void gst_base_parse_class_init (GstBaseParseClass * klass); @@ -474,8 +490,11 @@ gst_base_parse_finalize (GObject * object) gst_object_unref (parse->priv->index); parse->priv->index = NULL; } - +#if !GLIB_CHECK_VERSION (2, 31, 0) g_static_mutex_free (&parse->priv->index_lock); +#else + g_mutex_clear (&parse->priv->index_lock); +#endif gst_base_parse_clear_queues (parse); @@ -560,7 +579,11 @@ gst_base_parse_init (GstBaseParse * parse, GstBaseParseClass * bclass) parse->priv->pad_mode = GST_ACTIVATE_NONE; +#if !GLIB_CHECK_VERSION (2, 31, 0) g_static_mutex_init (&parse->priv->index_lock); +#else + g_mutex_init (&parse->priv->index_lock); +#endif /* init state */ gst_base_parse_reset (parse); @@ -1488,11 +1511,11 @@ gst_base_parse_add_index_entry (GstBaseParse * parse, guint64 offset, associations[1].value = offset; /* index might change on-the-fly, although that would be nutty app ... */ - g_static_mutex_lock (&parse->priv->index_lock); + GST_BASE_PARSE_INDEX_LOCK (parse); gst_index_add_associationv (parse->priv->index, parse->priv->index_id, (key) ? GST_ASSOCIATION_FLAG_KEY_UNIT : GST_ASSOCIATION_FLAG_DELTA_UNIT, 2, (const GstIndexAssociation *) &associations); - g_static_mutex_unlock (&parse->priv->index_lock); + GST_BASE_PARSE_INDEX_UNLOCK (parse); if (key) { parse->priv->index_last_offset = offset; @@ -3632,7 +3655,7 @@ gst_base_parse_find_offset (GstBaseParse * parse, GstClockTime time, goto exit; } - g_static_mutex_lock (&parse->priv->index_lock); + GST_BASE_PARSE_INDEX_LOCK (parse); if (parse->priv->index) { /* Let's check if we have an index entry for that time */ entry = gst_index_get_assoc_entry (parse->priv->index, @@ -3656,7 +3679,7 @@ gst_base_parse_find_offset (GstBaseParse * parse, GstClockTime time, ts = GST_CLOCK_TIME_NONE; } } - g_static_mutex_unlock (&parse->priv->index_lock); + GST_BASE_PARSE_INDEX_UNLOCK (parse); exit: if (_ts) @@ -4007,7 +4030,7 @@ gst_base_parse_set_index (GstElement * element, GstIndex * index) { GstBaseParse *parse = GST_BASE_PARSE (element); - g_static_mutex_lock (&parse->priv->index_lock); + GST_BASE_PARSE_INDEX_LOCK (parse); if (parse->priv->index) gst_object_unref (parse->priv->index); if (index) { @@ -4018,7 +4041,7 @@ gst_base_parse_set_index (GstElement * element, GstIndex * index) } else { parse->priv->index = NULL; } - g_static_mutex_unlock (&parse->priv->index_lock); + GST_BASE_PARSE_INDEX_UNLOCK (parse); } static GstIndex * @@ -4027,10 +4050,10 @@ gst_base_parse_get_index (GstElement * element) GstBaseParse *parse = GST_BASE_PARSE (element); GstIndex *result = NULL; - g_static_mutex_lock (&parse->priv->index_lock); + GST_BASE_PARSE_INDEX_LOCK (parse); if (parse->priv->index) result = gst_object_ref (parse->priv->index); - g_static_mutex_unlock (&parse->priv->index_lock); + GST_BASE_PARSE_INDEX_UNLOCK (parse); return result; } @@ -4047,7 +4070,7 @@ gst_base_parse_change_state (GstElement * element, GstStateChange transition) case GST_STATE_CHANGE_READY_TO_PAUSED: /* If this is our own index destroy it as the * old entries might be wrong for the new stream */ - g_static_mutex_lock (&parse->priv->index_lock); + GST_BASE_PARSE_INDEX_LOCK (parse); if (parse->priv->own_index) { gst_object_unref (parse->priv->index); parse->priv->index = NULL; @@ -4063,7 +4086,7 @@ gst_base_parse_change_state (GstElement * element, GstStateChange transition) &parse->priv->index_id); parse->priv->own_index = TRUE; } - g_static_mutex_unlock (&parse->priv->index_lock); + GST_BASE_PARSE_INDEX_UNLOCK (parse); break; default: break; diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index f0609a1953..cc9631ab21 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -166,6 +166,7 @@ #include #include +#include #include "gstbasesrc.h" #include "gsttypefindhelper.h" diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index fbed657884..6946ae97cb 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -207,6 +207,7 @@ #include "../../../gst/gst_private.h" #include "../../../gst/gst-i18n-lib.h" +#include "../../../gst/glib-compat-private.h" #include "gstbasetransform.h" #include diff --git a/libs/gst/base/gstcollectpads.c b/libs/gst/base/gstcollectpads.c index 004508d321..7fb0bf42bd 100644 --- a/libs/gst/base/gstcollectpads.c +++ b/libs/gst/base/gstcollectpads.c @@ -73,6 +73,7 @@ */ #include "gstcollectpads.h" +#include "gst/glib-compat-private.h" GST_DEBUG_CATEGORY_STATIC (collect_pads_debug); #define GST_CAT_DEFAULT collect_pads_debug diff --git a/libs/gst/base/gstcollectpads2.c b/libs/gst/base/gstcollectpads2.c index f549bef410..fbd6150d0e 100644 --- a/libs/gst/base/gstcollectpads2.c +++ b/libs/gst/base/gstcollectpads2.c @@ -84,6 +84,8 @@ #include "gstcollectpads2.h" +#include "../../../gst/glib-compat-private.h" + GST_DEBUG_CATEGORY_STATIC (collect_pads2_debug); #define GST_CAT_DEFAULT collect_pads2_debug diff --git a/libs/gst/base/gstdataqueue.c b/libs/gst/base/gstdataqueue.c index f6b11177cb..2d325e3e41 100644 --- a/libs/gst/base/gstdataqueue.c +++ b/libs/gst/base/gstdataqueue.c @@ -33,6 +33,7 @@ #include #include "string.h" #include "gstdataqueue.h" +#include "gst/glib-compat-private.h" GST_DEBUG_CATEGORY_STATIC (data_queue_debug); #define GST_CAT_DEFAULT (data_queue_debug) diff --git a/libs/gst/check/gstcheck.h b/libs/gst/check/gstcheck.h index e77c007bce..46bf6c5422 100644 --- a/libs/gst/check/gstcheck.h +++ b/libs/gst/check/gstcheck.h @@ -286,6 +286,68 @@ gst_g_thread_create (GThreadFunc func, gpointer data, gboolean joinable, g_assert (joinable); return g_thread_try_new ("gst-check", func, data, error); } +#define g_mutex_new gst_g_mutex_new +static inline GMutex * +gst_g_mutex_new (void) +{ + GMutex *mutex = g_slice_new (GMutex); + g_mutex_init (mutex); + return mutex; +} +#define g_mutex_free gst_g_mutex_free +static inline void +gst_g_mutex_free (GMutex *mutex) +{ + g_mutex_clear (mutex); + g_slice_free (GMutex, mutex); +} +#define g_static_rec_mutex_init gst_g_static_rec_mutex_init +static inline void +gst_g_static_rec_mutex_init (GStaticRecMutex *mutex) +{ + static const GStaticRecMutex init_mutex = G_STATIC_REC_MUTEX_INIT; + + *mutex = init_mutex; +} +#define g_cond_new gst_g_cond_new +static inline GCond * +gst_g_cond_new (void) +{ + GCond *cond = g_slice_new (GCond); + g_cond_init (cond); + return cond; +} +#define g_cond_free gst_g_cond_free +static inline void +gst_g_cond_free (GCond *cond) +{ + g_cond_clear (cond); + g_slice_free (GCond, cond); +} +#define g_cond_timed_wait gst_g_cond_timed_wait +static inline gboolean +gst_g_cond_timed_wait (GCond *cond, GMutex *mutex, GTimeVal *abs_time) +{ + gint64 end_time; + + if (abs_time == NULL) { + g_cond_wait (cond, mutex); + return TRUE; + } + + end_time = abs_time->tv_sec; + end_time *= 1000000; + end_time += abs_time->tv_usec; + + /* would be nice if we had clock_rtoffset, but that didn't seem to + * make it into the kernel yet... + */ + /* if CLOCK_MONOTONIC is not defined then g_get_montonic_time() and + * g_get_real_time() are returning the same clock and we'd add ~0 + */ + end_time += g_get_monotonic_time () - g_get_real_time (); + return g_cond_wait_until (cond, mutex, end_time); +} #endif #define MAIN_INIT() \ diff --git a/libs/gst/controller/gstcontroller.c b/libs/gst/controller/gstcontroller.c index f6e2cbf2e7..44480871ca 100644 --- a/libs/gst/controller/gstcontroller.c +++ b/libs/gst/controller/gstcontroller.c @@ -80,6 +80,7 @@ #include "gstcontrollerprivate.h" #include "gstcontrolsource.h" #include "gstinterpolationcontrolsource.h" +#include "gst/glib-compat-private.h" #define GST_CAT_DEFAULT controller_debug GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT); diff --git a/libs/gst/controller/gstinterpolationcontrolsource.c b/libs/gst/controller/gstinterpolationcontrolsource.c index f320d7d0fc..2bdefeb8c6 100644 --- a/libs/gst/controller/gstinterpolationcontrolsource.c +++ b/libs/gst/controller/gstinterpolationcontrolsource.c @@ -43,6 +43,7 @@ #include "gstcontrolsource.h" #include "gstinterpolationcontrolsource.h" #include "gstinterpolationcontrolsourceprivate.h" +#include "gst/glib-compat-private.h" #define GST_CAT_DEFAULT controller_debug GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT); diff --git a/libs/gst/controller/gstlfocontrolsource.c b/libs/gst/controller/gstlfocontrolsource.c index 06711b285f..61396875d6 100644 --- a/libs/gst/controller/gstlfocontrolsource.c +++ b/libs/gst/controller/gstlfocontrolsource.c @@ -43,6 +43,8 @@ #include "gstlfocontrolsource.h" #include "gstlfocontrolsourceprivate.h" +#include "gst/glib-compat-private.h" + #include #define EMPTY(x) (x) diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c index c143cbfdbc..19030fb37e 100644 --- a/plugins/elements/gstinputselector.c +++ b/plugins/elements/gstinputselector.c @@ -59,6 +59,8 @@ #include "gstinputselector.h" +#include "gst/glib-compat-private.h" + GST_DEBUG_CATEGORY_STATIC (input_selector_debug); #define GST_CAT_DEFAULT input_selector_debug diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index e291abd5df..25829d8013 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -61,6 +61,7 @@ #include "gstqueue.h" #include "../../gst/gst-i18n-lib.h" +#include "../../gst/glib-compat-private.h" static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 244023627f..8c4e4ccad4 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -63,6 +63,7 @@ #include #include "gst/gst-i18n-lib.h" +#include "gst/glib-compat-private.h" #include diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index 6b9e7cc800..6b875a78a0 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -48,6 +48,7 @@ #endif #include "gsttee.h" +#include "gst/glib-compat-private.h" #include From 2666450864d8301e350f4c05eae4f5d25535c377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 4 Dec 2011 14:38:26 +0000 Subject: [PATCH 9/9] Suppress deprecation warnings in selected files, for g_static_rec_mutex_* mostly GStaticRecMutex is part of our API/ABI, not much we can do here in 0.10. --- gst/gstbin.c | 3 +++ gst/gstelement.c | 3 +++ gst/gstpad.c | 3 +++ gst/gsttask.c | 3 +++ gst/gstutils.c | 3 +++ libs/gst/base/gstbaseparse.c | 3 +++ libs/gst/base/gstbasesink.c | 3 +++ libs/gst/base/gstbasesrc.c | 3 +++ libs/gst/base/gstbasetransform.c | 3 +++ libs/gst/base/gstcollectpads2.c | 9 +++++++++ plugins/elements/gstmultiqueue.c | 4 ++++ 11 files changed, 40 insertions(+) diff --git a/gst/gstbin.c b/gst/gstbin.c index 417490e5ce..f3d1b56686 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -157,6 +157,9 @@ * Last reviewed on 2006-04-28 (0.10.6) */ +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include "gst_private.h" #include "gstevent.h" diff --git a/gst/gstelement.c b/gst/gstelement.c index 6577428d70..9328dfe4df 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -79,6 +79,9 @@ * Last reviewed on 2009-05-29 (0.10.24) */ +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include "gst_private.h" #include #include diff --git a/gst/gstpad.c b/gst/gstpad.c index 206c54586f..ef28bf5e14 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -60,6 +60,9 @@ * Last reviewed on 2006-07-06 (0.10.9) */ +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include "gst_private.h" #include "gstpad.h" diff --git a/gst/gsttask.c b/gst/gsttask.c index c66c7b760c..4aae349c58 100644 --- a/gst/gsttask.c +++ b/gst/gsttask.c @@ -68,6 +68,9 @@ * Last reviewed on 2010-03-15 (0.10.29) */ +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include "gst_private.h" #include "gstinfo.h" diff --git a/gst/gstutils.c b/gst/gstutils.c index 84f3c3d9ff..9a0e807106 100644 --- a/gst/gstutils.c +++ b/gst/gstutils.c @@ -28,6 +28,9 @@ * When defining own plugins, use the GST_BOILERPLATE ease gobject creation. */ +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include "gst_private.h" #include #include diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c index 3cd4db5078..c49260c743 100644 --- a/libs/gst/base/gstbaseparse.c +++ b/libs/gst/base/gstbaseparse.c @@ -201,6 +201,9 @@ #include #include +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include #include "gstbaseparse.h" diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c index 32399e9da5..338eeb52b9 100644 --- a/libs/gst/base/gstbasesink.c +++ b/libs/gst/base/gstbasesink.c @@ -146,6 +146,9 @@ # include "config.h" #endif +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include #include "gstbasesink.h" diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index cc9631ab21..0f352d4ab4 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -165,6 +165,9 @@ #include #include +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include #include diff --git a/libs/gst/base/gstbasetransform.c b/libs/gst/base/gstbasetransform.c index 6946ae97cb..5622a9b520 100644 --- a/libs/gst/base/gstbasetransform.c +++ b/libs/gst/base/gstbasetransform.c @@ -205,6 +205,9 @@ #include #include +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include "../../../gst/gst_private.h" #include "../../../gst/gst-i18n-lib.h" #include "../../../gst/glib-compat-private.h" diff --git a/libs/gst/base/gstcollectpads2.c b/libs/gst/base/gstcollectpads2.c index fbd6150d0e..0505da6028 100644 --- a/libs/gst/base/gstcollectpads2.c +++ b/libs/gst/base/gstcollectpads2.c @@ -82,6 +82,15 @@ * Since: 0.10.36 */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS +#include + #include "gstcollectpads2.h" #include "../../../gst/glib-compat-private.h" diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 89d2289397..00547154c4 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -109,6 +109,10 @@ # include "config.h" #endif +/* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #include #include #include "gstmultiqueue.h"