From 9116ffb7b759669271595ee298666c1e34b10ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Fri, 22 Sep 2017 15:12:05 +0200 Subject: [PATCH] libs: display: remove libgstvaapi_init_once() It is not required since it can be unrolled in gst_vaapi_display_class_init() https://bugzilla.gnome.org/show_bug.cgi?id=788058 --- gst-libs/gst/vaapi/gstvaapidisplay.c | 29 ++++++++-------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index 6575e4e733..2881cd9353 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -43,10 +43,11 @@ GST_DEBUG_CATEGORY (gst_debug_vaapi); GST_DEBUG_CATEGORY (gst_debug_vaapi_display); #define GST_CAT_DEFAULT gst_debug_vaapi_display -#define _do_init \ - G_ADD_PRIVATE (GstVaapiDisplay); \ - GST_DEBUG_CATEGORY_INIT (gst_debug_vaapi_display, \ - "vaapidisplay", 0, "VA-API Display"); +#define _do_init \ + G_ADD_PRIVATE (GstVaapiDisplay); \ + GST_DEBUG_CATEGORY_INIT (gst_debug_vaapi_display, \ + "vaapidisplay", 0, "VA-API Display"); \ + GST_DEBUG_CATEGORY_INIT (gst_debug_vaapi, "vaapi", 0, "VA-API helper"); G_DEFINE_TYPE_WITH_CODE (GstVaapiDisplay, gst_vaapi_display, GST_TYPE_OBJECT, _do_init); @@ -112,21 +113,6 @@ get_color_balance (GstVaapiDisplay * display, guint prop_id, gfloat * v); static gboolean set_color_balance (GstVaapiDisplay * display, guint prop_id, gfloat v); -static void -libgstvaapi_init_once (void) -{ - static gsize g_once = FALSE; - - if (!g_once_init_enter (&g_once)) - return; - - GST_DEBUG_CATEGORY_INIT (gst_debug_vaapi, "vaapi", 0, "VA-API helper"); - - gst_vaapi_display_properties_init (); - - g_once_init_leave (&g_once, TRUE); -} - /* GstVaapiDisplayType enumerations */ GType gst_vaapi_display_type_get_type (void) @@ -972,11 +958,12 @@ gst_vaapi_display_class_init (GstVaapiDisplayClass * klass) { GObjectClass *const object_class = G_OBJECT_CLASS (klass); - libgstvaapi_init_once (); - object_class->finalize = gst_vaapi_display_finalize; + klass->lock = gst_vaapi_display_lock_default; klass->unlock = gst_vaapi_display_unlock_default; + + gst_vaapi_display_properties_init (); } static void