From 863d783beb28b32735e803c9d0d67efd3e8c0b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 7 Oct 2010 18:46:26 +0100 Subject: [PATCH] elements: minor performance improvement when doing g_object_notify() for the "last-message" property Make sure property names passed to g_object_notify() are in the canonical form (ie. "last-message" not "last_message"), so that g_param_spec_pool_lookup() doesn't have to do strdup/canonicalize/free for every single notify call. This only applies when building against older GLib versions (< 2.26). --- plugins/elements/gstfakesink.c | 2 +- plugins/elements/gstfakesrc.c | 4 ++-- plugins/elements/gstidentity.c | 2 +- plugins/elements/gsttee.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/elements/gstfakesink.c b/plugins/elements/gstfakesink.c index fa97e2c2d7..d480f92ef9 100644 --- a/plugins/elements/gstfakesink.c +++ b/plugins/elements/gstfakesink.c @@ -383,7 +383,7 @@ gst_fake_sink_notify_last_message (GstFakeSink * sink) * for an in-band buffer or event. This is fixed in GLib >= 2.26 */ #if !GLIB_CHECK_VERSION(2,26,0) g_static_rec_mutex_lock (&sink->notify_lock); - g_object_notify ((GObject *) sink, "last_message"); + g_object_notify ((GObject *) sink, "last-message"); g_static_rec_mutex_unlock (&sink->notify_lock); #else g_object_notify_by_pspec ((GObject *) sink, pspec_last_message); diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c index 712c2c269a..997b41a7d3 100644 --- a/plugins/elements/gstfakesrc.c +++ b/plugins/elements/gstfakesrc.c @@ -451,7 +451,7 @@ gst_fake_src_event_handler (GstBaseSrc * basesrc, GstEvent * event) GST_OBJECT_UNLOCK (src); #if !GLIB_CHECK_VERSION(2,26,0) - g_object_notify ((GObject *) src, "last_message"); + g_object_notify ((GObject *) src, "last-message"); #else g_object_notify_by_pspec ((GObject *) src, pspec_last_message); #endif @@ -854,7 +854,7 @@ gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length, GST_OBJECT_UNLOCK (src); #if !GLIB_CHECK_VERSION(2,26,0) - g_object_notify ((GObject *) src, "last_message"); + g_object_notify ((GObject *) src, "last-message"); #else g_object_notify_by_pspec ((GObject *) src, pspec_last_message); #endif diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index f49054a4eb..8dc0643f4b 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -315,7 +315,7 @@ gst_identity_notify_last_message (GstIdentity * identity) * for an in-band buffer or event. This is fixed in GLib >= 2.26 */ #if !GLIB_CHECK_VERSION(2,26,0) g_static_rec_mutex_lock (&identity->notify_lock); - g_object_notify ((GObject *) identity, "last_message"); + g_object_notify ((GObject *) identity, "last-message"); g_static_rec_mutex_unlock (&identity->notify_lock); #else g_object_notify_by_pspec ((GObject *) identity, pspec_last_message); diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index cf5360cc74..54700774e1 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -648,7 +648,7 @@ gst_tee_do_message (GstTee * tee, GstPad * pad, gpointer data, gboolean is_list) GST_OBJECT_UNLOCK (tee); #if !GLIB_CHECK_VERSION(2,26,0) - g_object_notify ((GObject *) tee, "last_message"); + g_object_notify ((GObject *) tee, "last-message"); #else g_object_notify_by_pspec ((GObject *) tee, pspec_last_message); #endif