gstplugin: Better warnings on plugin load failure on Windows
authorNirbheek Chauhan <nirbheek@centricular.com>
Wed, 19 Jan 2022 15:28:36 +0000 (20:58 +0530)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 19 Jan 2022 18:02:59 +0000 (18:02 +0000)
commit614a213e6ae8d62e3bb64c3a3da2cb2e1951b83e
tree09eb9d70074a283d8dbaf876feeabf897026abee
parent5fb769e95d6c4448a3331e74807615ba7fceacad
gstplugin: Better warnings on plugin load failure on Windows

It is an extremely common mistake on Windows to have incorrect PATH
values when loading a plugin, and the error from g_module_error()
(which just calls FormatMessageW()) is very confusing in this case:

 The specified module could not be found.

 https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-#ERROR_MOD_NOT_FOUND

It implies the plugin itself could not be found. The actual issue is
that a DLL dependency could not be found. We need to detect this case
and print a more useful error message.

We should still print the error fetched from FormatMessage() so that
people are able to google for it.

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