diff options
author | Marvin W <git@larma.de> | 2022-02-12 14:35:44 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2022-02-12 14:36:26 +0100 |
commit | 369d0c79d7272b4059c39ecedb10a62121bfbe56 (patch) | |
tree | 6ae87a1fd71b68dd8eff163c2b01dc5903f58ee0 /plugins/rtp/src/plugin.vala | |
parent | 0f5f57888e2e237549b1bc7002770ec102ff0e6b (diff) | |
download | dino-369d0c79d7272b4059c39ecedb10a62121bfbe56.tar.gz dino-369d0c79d7272b4059c39ecedb10a62121bfbe56.zip |
Calls: Fix device selector for multi-party calls, allow picking device before call started
Diffstat (limited to 'plugins/rtp/src/plugin.vala')
-rw-r--r-- | plugins/rtp/src/plugin.vala | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/plugins/rtp/src/plugin.vala b/plugins/rtp/src/plugin.vala index 2469a967..3a4f6ce1 100644 --- a/plugins/rtp/src/plugin.vala +++ b/plugins/rtp/src/plugin.vala @@ -388,7 +388,7 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { return fps; } - public Device? get_preferred_device(string media, bool incoming) { + public MediaDevice? get_preferred_device(string media, bool incoming) { Gee.List<Device> devices = new ArrayList<Device>(); foreach (MediaDevice media_device in get_devices(media, incoming)) { if (media_device is Device) devices.add((Device)media_device); @@ -427,14 +427,11 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { } } - public MediaDevice? get_device(Xmpp.Xep.JingleRtp.Stream stream, bool incoming) { - Stream plugin_stream = stream as Stream; + public MediaDevice? get_device(Xmpp.Xep.JingleRtp.Stream? stream, bool incoming) { + Stream? plugin_stream = stream as Stream?; if (plugin_stream == null) return null; - if (incoming) { - return plugin_stream.output_device ?? get_preferred_device(stream.media, incoming); - } else { - return plugin_stream.input_device ?? get_preferred_device(stream.media, incoming); - } + MediaDevice? device = incoming ? plugin_stream.output_device : plugin_stream.input_device; + return device ?? get_preferred_device(stream.media, incoming); } public void dump_dot() { @@ -444,8 +441,8 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { print(@"Stored pipe details as $name\n"); } - public void set_pause(Xmpp.Xep.JingleRtp.Stream stream, bool pause) { - Stream plugin_stream = stream as Stream; + public void set_pause(Xmpp.Xep.JingleRtp.Stream? stream, bool pause) { + Stream? plugin_stream = stream as Stream?; if (plugin_stream == null) return; if (pause) { plugin_stream.pause(); @@ -454,9 +451,9 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { } } - public void set_device(Xmpp.Xep.JingleRtp.Stream stream, MediaDevice? device) { - Device real_device = device as Device; - Stream plugin_stream = stream as Stream; + public void set_device(Xmpp.Xep.JingleRtp.Stream? stream, MediaDevice? device) { + Device? real_device = device as Device?; + Stream? plugin_stream = stream as Stream?; if (real_device == null || plugin_stream == null) return; if (real_device.is_source) { plugin_stream.input_device = real_device; |