diff options
author | fiaxh <git@lightrise.org> | 2021-04-17 14:50:31 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2021-04-29 16:13:25 +0200 |
commit | 5d85b6cdb0165d863aadd25d9a73707b8f5cc83e (patch) | |
tree | a8e2dd368eaadd6a565a009c9e06cb3160fe16c7 /plugins/rtp/src/plugin.vala | |
parent | 3880628de4785db4c0a03a79a0c486507fe9b1a8 (diff) | |
download | dino-5d85b6cdb0165d863aadd25d9a73707b8f5cc83e.tar.gz dino-5d85b6cdb0165d863aadd25d9a73707b8f5cc83e.zip |
Handle non-existant call support
Diffstat (limited to 'plugins/rtp/src/plugin.vala')
-rw-r--r-- | plugins/rtp/src/plugin.vala | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/rtp/src/plugin.vala b/plugins/rtp/src/plugin.vala index f0ad7db2..d43588b4 100644 --- a/plugins/rtp/src/plugin.vala +++ b/plugins/rtp/src/plugin.vala @@ -278,6 +278,22 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { Gst.deinit(); } + public bool supports(string media) { + if (rtpbin == null) return false; + + if (media == "audio") { + if (get_devices("audio", false).is_empty) return false; + if (get_devices("audio", true).is_empty) return false; + } + + if (media == "video") { + if (Gst.ElementFactory.make("gtksink", null) == null) return false; + if (get_devices("video", false).is_empty) return false; + } + + return true; + } + public VideoCallWidget? create_widget(WidgetType type) { if (type == WidgetType.GTK) { return new VideoWidget(this); |