meson: Enable crate features based on available gstreamer version

We shouldn't only enable the gstreamer features based on the available
gstreamer version (such as gst-base/v1_26), but also the plugin
features (such as v1_26).

This should help with situations like
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/634

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1943>
This commit is contained in:
Nirbheek Chauhan 2024-11-28 18:55:54 +05:30 committed by GStreamer Marge Bot
parent 8886cceaf0
commit 5e4d5a3dc6

View file

@ -63,6 +63,7 @@ class CargoAnalyzer:
def extract_features(self, cargo_data):
features = cargo_data['features']
print(f'Available features: {features!r}', file=sys.stderr)
wanted_features = set()
gst_version_major = int(self.gst_version.split('.')[0])
gst_version_minor = int(self.gst_version.split('.')[1])
@ -77,11 +78,13 @@ class CargoAnalyzer:
if gst_version_major < majver or gst_version_minor < minver:
continue
wanted_features |= set([name])
wanted_features |= set(value)
if name.startswith("gst"):
# Required for some reason for rswebrtc which has a specific feature
wanted_features |= {f"{cargo_data['package']['name']}/{name}"}
print(f'Enabling features: {wanted_features!r}', file=sys.stderr)
return wanted_features
def run(self):