gst_init exceptions when it is used in a dynamic lib which is loaded by dlopen

Nicolas Dufresne nicolas at ndufresne.ca
Thu Jun 20 12:18:11 UTC 2019


Le jeu. 20 juin 2019 06 h 10, Halley Zhao <aihua.halley.zhao at gmail.com> a
écrit :

> Hi experts:
> I created a dynamic lib to use gst, and the lib is loaded by dlopen.
> then there is exception to load the lib for a second playback.
>

GStreamer (and glib) cannot be loaded twice.


> 1. if I call gst_deinit() before dlclose the lib. I fail to create any gst
> element next time after calling gst_init() again.  gst_init_check() said
> gst has already been inited.
>

gst_deinit() is only there for debugging.


> 0:00:08.140795000  5131 0xffff98003e90 DEBUG               GST_INIT
> gst.c:417:gst_init_check: already initialized gst
> 0:00:08.140939875  5131 0xffff98003e90 WARN     GST_ELEMENT_FACTORY
> gstelementfactory.c:456:gst_element_factory_make: no such element factory
> "appsrc"!
>
> 2. if I skip call gst_deinit() before dlclose the lib, some exception
> comes for g_type_check
> (gdb) bt
> #0  0x0000ffffbeb67dd8 in strcmp () from /usr/lib64/libc.so.6
> #1  0x0000ffffbf16ba5c in g_str_equal () from /usr/lib64/libglib-2.0.so
> #2  0x0000ffffbf16af08 in g_hash_table_lookup ()
>    from /usr/lib64/libglib-2.0.so
> #3  0x0000ffffbf18d648 in g_intern_static_string ()
>    from /usr/lib64/libglib-2.0.so
> #4  0x0000ffffb70548dc in gst_audio_clock_get_type ()
>    from /usr/lib64/libgstaudio-1.0.so.0
> #5  0x0000ffffb705494c in gst_audio_clock_new ()
>    from /usr/lib64/libgstaudio-1.0.so.0
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190620/51c12dd1/attachment.html>


More information about the gstreamer-devel mailing list