From 288b82913907cc661b0255a4b3534f8bbed0dc3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Wed, 11 May 2022 11:45:07 +0200 Subject: [PATCH] Further alter default plugin feature ranks on startup Too many problems with VAAPI decodebin, meanwhile VA works fine and there is already a pending MR on GStreamer to enable it by default, so we do that a little early. We also do promise working HW accel out of box, so enable all common NVDEC elements too. They can always be disabled back in player preferences window if any problems do happen. We can now remove the alternations of v4l2codecs as those are PRIMARY+1 by default and we now require GStreamer 1.20+ so no need for version checking there too. Fixes #236 --- lib/gst/clapper/gstclapper.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/gst/clapper/gstclapper.c b/lib/gst/clapper/gstclapper.c index 71d0d9f7..ca40a0d6 100644 --- a/lib/gst/clapper/gstclapper.c +++ b/lib/gst/clapper/gstclapper.c @@ -3550,19 +3550,23 @@ gst_clapper_prepare_gstreamer (void) GST_DEBUG ("Preparing GStreamer plugins"); + /* Too many problems with VAAPI decodebin, meanwhile VA works + * fine and there is already a pending MR on GStreamer to enable + * it by default, so we do that a little early */ if (gst_clapper_has_plugin_with_features ("va")) { - gst_clapper_set_feature_rank_versioned ("vah264dec", rank, 1, 19, 1); - gst_clapper_set_feature_rank_versioned ("vampeg2dec", rank, 1, 19, 1); + gst_clapper_set_feature_rank ("vampeg2dec", rank); + gst_clapper_set_feature_rank ("vah264dec", rank); + gst_clapper_set_feature_rank ("vah265dec", rank); + gst_clapper_set_feature_rank ("vavp8dec", rank); + gst_clapper_set_feature_rank ("vavp9dec", rank); + gst_clapper_set_feature_rank ("vaav1dec", rank); } + /* We do promise working HW accel out of box, so enable NVDEC too */ if (gst_clapper_has_plugin_with_features ("nvcodec")) { gst_clapper_set_feature_rank ("nvh264dec", rank + 4); gst_clapper_set_feature_rank ("nvh265dec", rank + 4); - } - if (gst_clapper_has_plugin_with_features ("v4l2codecs")) { - if (!gst_clapper_set_feature_rank_versioned ("v4l2slh264dec", rank + 10, 1, 19, 1)) - gst_clapper_set_feature_rank ("v4l2slh264dec", GST_RANK_NONE); - if (!gst_clapper_set_feature_rank_versioned ("v4l2slvp8dec", rank + 10, 1, 19, 2)) - gst_clapper_set_feature_rank ("v4l2slvp8dec", GST_RANK_NONE); + gst_clapper_set_feature_rank ("nvvp8dec", rank + 4); + gst_clapper_set_feature_rank ("nvvp9dec", rank + 4); } /* After setting defaults, update them from ENV */