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).
This commit is contained in:
Tim-Philipp Müller 2010-10-07 18:46:26 +01:00
parent fe9bb36ac7
commit 863d783beb
4 changed files with 5 additions and 5 deletions

View file

@ -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 */ * for an in-band buffer or event. This is fixed in GLib >= 2.26 */
#if !GLIB_CHECK_VERSION(2,26,0) #if !GLIB_CHECK_VERSION(2,26,0)
g_static_rec_mutex_lock (&sink->notify_lock); 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); g_static_rec_mutex_unlock (&sink->notify_lock);
#else #else
g_object_notify_by_pspec ((GObject *) sink, pspec_last_message); g_object_notify_by_pspec ((GObject *) sink, pspec_last_message);

View file

@ -451,7 +451,7 @@ gst_fake_src_event_handler (GstBaseSrc * basesrc, GstEvent * event)
GST_OBJECT_UNLOCK (src); GST_OBJECT_UNLOCK (src);
#if !GLIB_CHECK_VERSION(2,26,0) #if !GLIB_CHECK_VERSION(2,26,0)
g_object_notify ((GObject *) src, "last_message"); g_object_notify ((GObject *) src, "last-message");
#else #else
g_object_notify_by_pspec ((GObject *) src, pspec_last_message); g_object_notify_by_pspec ((GObject *) src, pspec_last_message);
#endif #endif
@ -854,7 +854,7 @@ gst_fake_src_create (GstBaseSrc * basesrc, guint64 offset, guint length,
GST_OBJECT_UNLOCK (src); GST_OBJECT_UNLOCK (src);
#if !GLIB_CHECK_VERSION(2,26,0) #if !GLIB_CHECK_VERSION(2,26,0)
g_object_notify ((GObject *) src, "last_message"); g_object_notify ((GObject *) src, "last-message");
#else #else
g_object_notify_by_pspec ((GObject *) src, pspec_last_message); g_object_notify_by_pspec ((GObject *) src, pspec_last_message);
#endif #endif

View file

@ -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 */ * for an in-band buffer or event. This is fixed in GLib >= 2.26 */
#if !GLIB_CHECK_VERSION(2,26,0) #if !GLIB_CHECK_VERSION(2,26,0)
g_static_rec_mutex_lock (&identity->notify_lock); 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); g_static_rec_mutex_unlock (&identity->notify_lock);
#else #else
g_object_notify_by_pspec ((GObject *) identity, pspec_last_message); g_object_notify_by_pspec ((GObject *) identity, pspec_last_message);

View file

@ -648,7 +648,7 @@ gst_tee_do_message (GstTee * tee, GstPad * pad, gpointer data, gboolean is_list)
GST_OBJECT_UNLOCK (tee); GST_OBJECT_UNLOCK (tee);
#if !GLIB_CHECK_VERSION(2,26,0) #if !GLIB_CHECK_VERSION(2,26,0)
g_object_notify ((GObject *) tee, "last_message"); g_object_notify ((GObject *) tee, "last-message");
#else #else
g_object_notify_by_pspec ((GObject *) tee, pspec_last_message); g_object_notify_by_pspec ((GObject *) tee, pspec_last_message);
#endif #endif