From dbc6d87cb9c26a5858ccf7400a43cdd4f6f26971 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Thu, 10 Feb 2022 15:41:24 +0100 Subject: Various call fixes - Don't create incoming CIM calls twice - Fix is_color check for video devices w/ multiple formats - Tolerate mismatching content creator on jingle responses - Change MUJI namespace to urn:xmpp:jingle:muji:0 --- plugins/rtp/src/plugin.vala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'plugins/rtp') diff --git a/plugins/rtp/src/plugin.vala b/plugins/rtp/src/plugin.vala index e7ee7117..2469a967 100644 --- a/plugins/rtp/src/plugin.vala +++ b/plugins/rtp/src/plugin.vala @@ -350,10 +350,16 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { if (device.media != "video") continue; if (device.is_sink) continue; + // Skip monitors + if (device.is_monitor) continue; + bool is_color = false; for (int i = 0; i < device.device.caps.get_size(); i++) { unowned Gst.Structure structure = device.device.caps.get_structure(i); - if (structure.has_field("format") && !structure.get_string("format").has_prefix("GRAY")) { + if (!structure.has_field("format")) continue; + // "format" might be an array and get_string() will then return null. We just assume arrays to be fine. + string? format = structure.get_string("format"); + if (format == null || !format.has_prefix("GRAY")) { is_color = true; } } @@ -361,9 +367,6 @@ public class Dino.Plugins.Rtp.Plugin : RootInterface, VideoCallPlugin, Object { // Don't allow grey-scale devices if (!is_color) continue; - // Skip monitors - if (device.is_monitor) continue; - if (device.protocol == DeviceProtocol.PIPEWIRE) { pipewire_devices.add(device); } else { -- cgit v1.2.3-70-g09d2