GNOME Bugzilla – Bug 793611
pbutils: Lazily initialize global state and don't require calling gst_pbutils_init() separately
Last modified: 2018-02-26 09:50:54 UTC
It is aligned with what we do for gst_init and the PTP clock initialization. This is useful for doing assert checks before functions that need those inits to be made.
Created attachment 368582 [details] [review] pbutils: add gst_pb_utils_is_initialized To be able to tell if it has been initialized. Useful for writing assert statements.
Mmmh, sure, why not. But perhaps we should just get rid of / deprecate gst_pb_utils_init() and do a lazy init? It's only used to set up gettext stuff and that's only used in non-performance critical functions in description.c and missing_plugins.c, so could just as well be done at the beginning of the functions.
I'd rather add some g_once() thing here and call it from the few places where it's required, and then deprecate the function.
Agreed. Should we do it before 1.14 or after it?
Can implement lazy-init now, but I'd say let's only deprecate the function after 1.14?
Created attachment 368919 [details] [review] pbutils: move locale dir initialization to a separate function It is the only thing pb_utils_init does and it could be automatically called from the places in pbutils it is needed.
commit 006c7181ed3f146a36c25139c06982ccda8c5306 (HEAD -> master) Author: Thiago Santos <thiagossantos@gmail.com> Date: Sun Feb 25 10:52:46 2018 -0800 pbutils: Move locale dir initialization to a separate function and do lazy initialization It is the only thing gst_pb_utils_init() does and it could be automatically called from the places in pbutils it is needed. After 1.14 we should deprecate gst_pb_utils_init(). https://bugzilla.gnome.org/show_bug.cgi?id=793611