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: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2519>
This commit is contained in:
Florian Müllner 2022-10-24 14:01:03 +02:00
parent f266c2ca15
commit 3cdcd075ef

View File

@ -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() {