<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 20 juin 2019 08 h 40, Halley Zhao <<a href="mailto:aihua.halley.zhao@gmail.com">aihua.halley.zhao@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">translate it:<div><br></div><div>I tried to move gst_init/gst_deinit outside of the dynamic lib, it means gst_init/gst_deinit is done once in the process.</div><div>then, there is error to create GstAudioClock for the second run. I guess there are some static data for g_type/gstreamer which isn't de-inited after dlclose().</div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">GStreamer or Glib DLL/so cannot be loaded twice (didn't I say that already?). Just load and leak it to avoid these errors.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div>(cowplayer_test:5466): GLib-GObject-WARNING **: cannot register existing type 'GstAudioClock'<br>(cowplayer_test:5466): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed<br>(cowplayer_test:5466): GLib-GObject-CRITICAL **: g_object_new: assertion 'G_TYPE_IS_OBJECT (object_type)' failed<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Halley Zhao <<a href="mailto:aihua.halley.zhao@gmail.com" target="_blank" rel="noreferrer">aihua.halley.zhao@gmail.com</a>> 于2019年6月20日周四 下午6:29写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">我把gst_init/gst_deinit移到了动态库的外部,也就是进程仅做一次gst_init/gst_deinit.<div>然后出现创想GstAudioClock的时候失败:</div><div>(cowplayer_test:5466): GLib-GObject-WARNING **: cannot register existing type 'GstAudioClock'<br>(cowplayer_test:5466): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed<br>(cowplayer_test:5466): GLib-GObject-CRITICAL **: g_object_new: assertion 'G_TYPE_IS_OBJECT (object_type)' failed<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Halley Zhao <<a href="mailto:aihua.halley.zhao@gmail.com" target="_blank" rel="noreferrer">aihua.halley.zhao@gmail.com</a>> 于2019年6月20日周四 下午6:05写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi experts:<div>I created a dynamic lib to use gst, and the lib is loaded by dlopen.</div><div>then there is exception to load the lib for a second playback.</div><div><br></div><div>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.</div><div><br></div><div>0:00:08.140795000  5131 0xffff98003e90 DEBUG               GST_INIT gst.c:417:gst_init_check: already initialized gst<br>0:00:08.140939875  5131 0xffff98003e90 WARN     GST_ELEMENT_FACTORY gstelementfactory.c:456:gst_element_factory_make: no such element factory "appsrc"!<br></div><div><br></div><div>2. if I skip call gst_deinit() before dlclose the lib, some exception comes for g_type_check</div><div>(gdb) bt<br>#0  0x0000ffffbeb67dd8 in strcmp () from /usr/lib64/libc.so.6<br>#1  0x0000ffffbf16ba5c in g_str_equal () from /usr/lib64/<a href="http://libglib-2.0.so" target="_blank" rel="noreferrer">libglib-2.0.so</a><br>#2  0x0000ffffbf16af08 in g_hash_table_lookup ()<br>   from /usr/lib64/<a href="http://libglib-2.0.so" target="_blank" rel="noreferrer">libglib-2.0.so</a><br>#3  0x0000ffffbf18d648 in g_intern_static_string ()<br>   from /usr/lib64/<a href="http://libglib-2.0.so" target="_blank" rel="noreferrer">libglib-2.0.so</a><br>#4  0x0000ffffb70548dc in gst_audio_clock_get_type ()<br>   from /usr/lib64/libgstaudio-1.0.so.0<br>#5  0x0000ffffb705494c in gst_audio_clock_new ()<br>   from /usr/lib64/libgstaudio-1.0.so.0<br></div></div>
</blockquote></div>
</blockquote></div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div></div></div>