From 3cdcd075ef5320cf3946251470a71cc2ff4e09de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 24 Oct 2022 14:01:03 +0200 Subject: [PATCH] dbusServices/screencast: Check for all require elements Instead of assuming that gst-plugins-good has been compiled with all the plugins we need enabled, explicitly check for the ones we use. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5710 Part-of: --- js/dbusServices/screencast/screencastService.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/dbusServices/screencast/screencastService.js b/js/dbusServices/screencast/screencastService.js index 7b47da27c..f7f36da88 100644 --- a/js/dbusServices/screencast/screencastService.js +++ b/js/dbusServices/screencast/screencastService.js @@ -259,9 +259,13 @@ var Recorder = class { var ScreencastService = class extends ServiceImplementation { static canScreencast() { + const elements = [ + 'pipewiresrc', + 'filesink', + ...DEFAULT_PIPELINE.split('!').map(e => e.trim().split(' ').at(0)), + ]; return Gst.init_check(null) && - Gst.ElementFactory.find('pipewiresrc') && - Gst.ElementFactory.find('filesink'); + elements.every(e => Gst.ElementFactory.find(e) != null); } constructor() {