Clarification about GST_PLUGIN_DEFINE

The GstPlugin documentation (gstreamer.freedesktop.org) seems to be suggesting that the version arg is different than the major and minor version args at the start of the macro – that those two are related to the gstreamer version the plugin is compiled against so therefore the last version is the plugin’s version itself. However if I treat the version argument in that way, I get a behavior of gst-inspect-1.0 --exists <element> being different than the output of gst-inspect-1.0 <element> (the former is a non-zero exit whereas the latter clearly finds the element and can read its information). I ran the command with GST_DEBUG=*:DEBUG enabled, and the log ended with this: Checking whether 0.2.1 >= 1.22.0? no. (The log line is from gst_plugin_feature_check_version.) The code is comparing the plugin’s version to the GStreamer core library version and reporting back that the plugin is incompatible because its own independent version differs from GStreamer’s own version.

Is the version arg supposed to be the full GStreamer core version? If so, why is the major and minor version also required as the first two args to the macro – it seems redundant/unnecessary.

If the version arg is not supposed to be the plugin’s own independent version, where is such a version supposed to be set when declaring a plugin?

The plugin version string can be any version and should not have to match the GStreamer library versions so e.g. 0.0.1 should work just fine as well.

I think the gst_plugin_feature_check_version() check in gst-inspect-1.0 is just flat out wrong and should be removed.

Let me know if you would like to make a Merge Request for that, otherwise I can do it as well.

I briefly poked around to see if there was some other API that should have been called, because it makes some sense why one would want to check the compiled-against gstreamer version of the plugin, but I could not find one related to getting the GST major/minor values that were set from that macro. (I only spent a few minutes poking around before changing the plugin definition to work like the plugins in the GStreamer repo.)

Are you suggesting the version check should not be performed at all?

(PR for removing the check: Updated gst-inspect.c to not compare plugin version to gstreamer version. (!6191) · Merge requests · GStreamer / gstreamer · GitLab)

That’s right, it doesn’t really make sense. I have no idea what I was thinking, I probably just considered or tested it with plugins that are part of the GStreamer modules back then.