glib: map deprecated API to glib >= 2.32 equivalents.

GStaticMutex and GStaticRecMutex are now replaced with GMutex and
GRecMutex, which no longer require any prior call to g_thread_init().
This commit is contained in:
Gwenole Beauchesne 2012-02-07 11:07:15 +01:00
parent a698766a8b
commit 830efb3fbd
3 changed files with 24 additions and 0 deletions

View file

@ -33,4 +33,26 @@ g_list_free_full(GList *list, GDestroyNotify free_func)
}
#endif
#if GLIB_CHECK_VERSION(2,31,2)
#define GStaticMutex GMutex
#undef g_static_mutex_init
#define g_static_mutex_init(mutex) g_mutex_init(mutex)
#undef g_static_mutex_free
#define g_static_mutex_free(mutex) g_mutex_clear(mutex)
#undef g_static_mutex_lock
#define g_static_mutex_lock(mutex) g_mutex_lock(mutex)
#undef g_static_mutex_unlock
#define g_static_mutex_unlock(mutex) g_mutex_unlock(mutex)
#define GStaticRecMutex GRecMutex
#undef g_static_rec_mutex_init
#define g_static_rec_mutex_init(mutex) g_rec_mutex_init(mutex)
#undef g_static_rec_mutex_free
#define g_static_rec_mutex_free(mutex) g_rec_mutex_clear(mutex)
#undef g_static_rec_mutex_lock
#define g_static_rec_mutex_lock(mutex) g_rec_mutex_lock(mutex)
#undef g_static_rec_mutex_unlock
#define g_static_rec_mutex_unlock(m) g_rec_mutex_unlock(m)
#endif
#endif /* GLIB_COMPAT_H */

View file

@ -361,6 +361,7 @@ gst_vaapi_display_destroy(GstVaapiDisplay *display)
gst_vaapi_display_cache_remove(get_display_cache(), display);
free_display_cache();
}
g_static_rec_mutex_free(&priv->mutex);
}
static gboolean

View file

@ -169,6 +169,7 @@ gst_vaapi_display_cache_free(GstVaapiDisplayCache *cache)
g_list_free(cache->list);
cache->list = NULL;
}
g_static_mutex_free(&cache->mutex);
g_slice_free(GstVaapiDisplayCache, cache);
}