After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 793611 - pbutils: Lazily initialize global state and don't require calling gst_pbutils_init() separately
pbutils: Lazily initialize global state and don't require calling gst_pbutils...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal enhancement
: 1.13.90
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-02-19 20:03 UTC by Thiago Sousa Santos
Modified: 2018-02-26 09:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
pbutils: add gst_pb_utils_is_initialized (2.16 KB, patch)
2018-02-19 20:03 UTC, Thiago Sousa Santos
rejected Details | Review
pbutils: move locale dir initialization to a separate function (4.31 KB, patch)
2018-02-26 06:18 UTC, Thiago Sousa Santos
committed Details | Review

Description Thiago Sousa Santos 2018-02-19 20:03:38 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.
Comment 1 Thiago Sousa Santos 2018-02-19 20:03:43 UTC
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.
Comment 2 Tim-Philipp Müller 2018-02-20 11:45:56 UTC
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.
Comment 3 Sebastian Dröge (slomo) 2018-02-21 12:04:57 UTC
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.
Comment 4 Thiago Sousa Santos 2018-02-21 17:34:58 UTC
Agreed. Should we do it before 1.14 or after it?
Comment 5 Tim-Philipp Müller 2018-02-21 17:39:46 UTC
Can implement lazy-init now, but I'd say let's only deprecate the function after 1.14?
Comment 6 Thiago Sousa Santos 2018-02-26 06:18:08 UTC
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.
Comment 7 Sebastian Dröge (slomo) 2018-02-26 09:50:09 UTC
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