gstplugin: Handle static plugins in gst_plugin_load_by_name()
authorJan Schmidt <jan@centricular.com>
Fri, 9 Dec 2022 16:54:23 +0000 (03:54 +1100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 10 Dec 2022 11:01:35 +0000 (11:01 +0000)
commit0791a73a049b6cd531686550a5101bea7835f749
treeb16918bffe984516b9a5a63bd94ccfa504289e07
parentcbab7ffefbfe005b3323da12527116eba95a6cff
gstplugin: Handle static plugins in gst_plugin_load_by_name()

gst_plugin_load_by_name() assumed a plugin has a filename,
which isn't true for static plugins, leading to criticals.

If a plugin is already loaded, just return the loaded plugin,
which makes it work for static plugins as well as saving a
moment for already-loaded dynamic plugins.

Add locking in gst_plugin_is_loaded(), as a plugin may be
still being loaded in another thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3552>
subprojects/gstreamer/gst/gstplugin.c